/** * Construct an optimized get starting with the given get operation. */ public OptimizedSetImpl(CASOperation firstStore) { super(DUMMY_OPCODE, -1, NOOP_CALLBACK); addOperation(firstStore); }
private void optimizeSets() { // make sure there are at least two get operations in a row before // attempting to optimize them. optimizedOp = writeQ.remove(); if (writeQ.peek() instanceof CASOperation) { OptimizedSetImpl og = new OptimizedSetImpl((CASOperation) optimizedOp); optimizedOp = og; while (writeQ.peek() instanceof StoreOperation && og.size() < MAX_SET_OPTIMIZATION_COUNT && og.bytes() < MAX_SET_OPTIMIZATION_BYTES) { CASOperation o = (CASOperation) writeQ.remove(); if (!o.isCancelled()) { og.addOperation(o); } } // Initialize the new mega set optimizedOp.initialize(); assert optimizedOp.getState() == OperationState.WRITE_QUEUED; } } }
assert !is.hasNext(); int myOpaque = generateOpaque(); callbacks.put(myOpaque, so.getCallback()); byte[] data = so.getData(); bb.put(cmdMap(so.getStoreType())); bb.putShort((short) keyBytes.length); bb.put((byte) StoreOperationImpl.EXTRA_LEN); // extralen setBuffer(bb);
@Override protected void finishedPayload(byte[] pl) throws IOException { if(responseOpaque == terminalOpaque) { for(OperationCallback cb : callbacks.values()) { cb.receivedStatus(STATUS_OK); cb.complete(); } transitionState(OperationState.COMPLETE); } else { OperationCallback cb = callbacks.remove(responseOpaque); assert cb != null : "No callback for " + responseOpaque; assert errorCode != 0 : "Got no error on a quiet mutation."; OperationStatus status=getStatusForErrorCode(errorCode, pl); assert status != null : "Got no status for a quiet mutation error"; cb.receivedStatus(status); cb.complete(); } resetInput(); }
@Override protected void finishedPayload(byte[] pl) throws IOException { if (responseOpaque == terminalOpaque) { for (OperationCallback cb : callbacks.values()) { cb.receivedStatus(STATUS_OK); cb.complete(); } transitionState(OperationState.COMPLETE); } else { OperationCallback cb = callbacks.remove(responseOpaque); assert cb != null : "No callback for " + responseOpaque; assert errorCode != 0 : "Got no error on a quiet mutation."; super.finishedPayload(pl); } resetInput(); }
private void optimizeSets() { // make sure there are at least two get operations in a row before // attempting to optimize them. optimizedOp = writeQ.remove(); if (writeQ.peek() instanceof CASOperation) { OptimizedSetImpl og = new OptimizedSetImpl((CASOperation) optimizedOp); optimizedOp = og; while (writeQ.peek() instanceof StoreOperation && og.size() < MAX_SET_OPTIMIZATION_COUNT && og.bytes() < MAX_SET_OPTIMIZATION_BYTES) { CASOperation o = (CASOperation) writeQ.remove(); if (!o.isCancelled()) { og.addOperation(o); } } // Initialize the new mega set optimizedOp.initialize(); assert optimizedOp.getState() == OperationState.WRITE_QUEUED; } } }
assert !is.hasNext(); int myOpaque = generateOpaque(); callbacks.put(myOpaque, so.getCallback()); byte[] data = so.getBytes(); bb.put((byte)cmdMap(so.getStoreType())); bb.putShort((short)keyBytes.length); bb.put((byte)StoreOperationImpl.EXTRA_LEN); // extralen setBuffer(bb);
@Override protected void finishedPayload(byte[] pl) throws IOException { if(responseOpaque == terminalOpaque) { for(OperationCallback cb : callbacks.values()) { cb.receivedStatus(STATUS_OK); cb.complete(); } transitionState(OperationState.COMPLETE); } else { OperationCallback cb = callbacks.remove(responseOpaque); assert cb != null : "No callback for " + responseOpaque; assert errorCode != 0 : "Got no error on a quiet mutation."; OperationStatus status=getStatusForErrorCode(errorCode, pl); assert status != null : "Got no status for a quiet mutation error"; cb.receivedStatus(status); cb.complete(); } resetInput(); }
@Override protected void finishedPayload(byte[] pl) throws IOException { if (responseOpaque == terminalOpaque) { for (OperationCallback cb : callbacks.values()) { cb.receivedStatus(STATUS_OK); cb.complete(); } transitionState(OperationState.COMPLETE); } else { OperationCallback cb = callbacks.remove(responseOpaque); assert cb != null : "No callback for " + responseOpaque; assert errorCode != 0 : "Got no error on a quiet mutation."; super.finishedPayload(pl); } resetInput(); }
private void optimizeSets() { // make sure there are at least two get operations in a row before // attempting to optimize them. optimizedOp = writeQ.remove(); if (writeQ.peek() instanceof CASOperation) { OptimizedSetImpl og = new OptimizedSetImpl((CASOperation) optimizedOp); optimizedOp = og; while (writeQ.peek() instanceof StoreOperation && og.size() < MAX_SET_OPTIMIZATION_COUNT && og.bytes() < MAX_SET_OPTIMIZATION_BYTES) { CASOperation o = (CASOperation) writeQ.remove(); if (!o.isCancelled()) { og.addOperation(o); } } // Initialize the new mega set optimizedOp.initialize(); assert optimizedOp.getState() == OperationState.WRITE_QUEUED; } } }
assert !is.hasNext(); int myOpaque = generateOpaque(); callbacks.put(myOpaque, so.getCallback()); byte[] data = so.getData(); bb.put(cmdMap(so.getStoreType())); bb.putShort((short) keyBytes.length); bb.put((byte) StoreOperationImpl.EXTRA_LEN); // extralen setBuffer(bb);
@Override protected void finishedPayload(byte[] pl) throws IOException { if (responseOpaque == terminalOpaque) { for (OperationCallback cb : callbacks.values()) { cb.receivedStatus(STATUS_OK); cb.complete(); } transitionState(OperationState.COMPLETE); } else { OperationCallback cb = callbacks.remove(responseOpaque); assert cb != null : "No callback for " + responseOpaque; assert errorCode != 0 : "Got no error on a quiet mutation."; OperationStatus status = getStatusForErrorCode(errorCode, pl); assert status != null : "Got no status for a quiet mutation error"; cb.receivedStatus(status); cb.complete(); } resetInput(); }
@Override protected void finishedPayload(byte[] pl) throws IOException { if (responseOpaque == terminalOpaque) { for (OperationCallback cb : callbacks.values()) { cb.receivedStatus(STATUS_OK); cb.complete(); } transitionState(OperationState.COMPLETE); } else { OperationCallback cb = callbacks.remove(responseOpaque); assert cb != null : "No callback for " + responseOpaque; assert errorCode != 0 : "Got no error on a quiet mutation."; super.finishedPayload(pl); } resetInput(); }
/** * Construct an optimized get starting with the given get operation. */ public OptimizedSetImpl(CASOperation firstStore) { super(-1, -1, NOOP_CALLBACK); addOperation(firstStore); }
private void optimizeSets() { // make sure there are at least two get operations in a row before // attempting to optimize them. optimizedOp=writeQ.remove(); if(writeQ.peek() instanceof CASOperation) { OptimizedSetImpl og=new OptimizedSetImpl( (CASOperation)optimizedOp); optimizedOp=og; while(writeQ.peek() instanceof StoreOperation && og.size() < MAX_SET_OPTIMIZATION_COUNT && og.bytes() < MAX_SET_OPTIMIZATION_BYTES) { CASOperation o=(CASOperation) writeQ.remove(); if(!o.isCancelled()) { og.addOperation(o); } } // Initialize the new mega set optimizedOp.initialize(); assert optimizedOp.getState() == OperationState.WRITING; } } }
assert !is.hasNext(); int myOpaque = generateOpaque(); callbacks.put(myOpaque, so.getCallback()); byte[] data = so.getBytes(); bb.put((byte)cmdMap(so.getStoreType())); bb.putShort((short)keyBytes.length); bb.put((byte)StoreOperationImpl.EXTRA_LEN); // extralen setBuffer(bb);
/** * Construct an optimized get starting with the given get operation. */ public OptimizedSetImpl(CASOperation firstStore) { super(-1, -1, NOOP_CALLBACK); addOperation(firstStore); }
private void optimizeSets() { // make sure there are at least two get operations in a row before // attempting to optimize them. optimizedOp=writeQ.remove(); if(writeQ.peek() instanceof CASOperation) { OptimizedSetImpl og=new OptimizedSetImpl( (CASOperation)optimizedOp); optimizedOp=og; while(writeQ.peek() instanceof StoreOperation && og.size() < MAX_SET_OPTIMIZATION_COUNT && og.bytes() < MAX_SET_OPTIMIZATION_BYTES) { CASOperation o=(CASOperation) writeQ.remove(); if(!o.isCancelled()) { og.addOperation(o); } } // Initialize the new mega set optimizedOp.initialize(); assert optimizedOp.getState() == OperationState.WRITING; } } }
assert !is.hasNext(); int myOpaque = generateOpaque(); callbacks.put(myOpaque, so.getCallback()); byte[] data = so.getBytes(); bb.put((byte) cmdMap(so.getStoreType())); bb.putShort((short) keyBytes.length); bb.put((byte) StoreOperationImpl.EXTRA_LEN); // extralen setBuffer(bb);
/** * Construct an optimized get starting with the given get operation. */ public OptimizedSetImpl(CASOperation firstStore) { super(DUMMY_OPCODE, -1, NOOP_CALLBACK); addOperation(firstStore); }