Class OptimizedSetImpl
- java.lang.Object
-
- net.spy.memcached.compat.SpyObject
-
- net.spy.memcached.protocol.BaseOperationImpl
-
- net.spy.memcached.protocol.binary.OperationImpl
-
- net.spy.memcached.protocol.binary.MultiKeyOperationImpl
-
- net.spy.memcached.protocol.binary.OptimizedSetImpl
-
- All Implemented Interfaces:
KeyedOperation
,Operation
,VBucketAware
public class OptimizedSetImpl extends MultiKeyOperationImpl
Optimized Set operation for folding a bunch of sets together.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
OptimizedSetImpl.NoopCallback
-
Field Summary
Fields Modifier and Type Field Description private int
byteCount
private java.util.Map<java.lang.Integer,OperationCallback>
callbacks
private static OperationCallback
NOOP_CALLBACK
private java.util.List<CASOperation>
ops
private int
terminalOpaque
-
Fields inherited from class net.spy.memcached.protocol.binary.MultiKeyOperationImpl
vbmap
-
Fields inherited from class net.spy.memcached.protocol.binary.OperationImpl
DUMMY_OPCODE, EMPTY_BYTES, ERR_2BIG, ERR_BUSY, ERR_DELTA_BADVAL, ERR_EXISTS, ERR_INTERNAL, ERR_INVAL, ERR_NO_MEM, ERR_NOT_FOUND, ERR_NOT_MY_VBUCKET, ERR_NOT_STORED, ERR_NOT_SUPPORTED, ERR_TEMP_FAIL, ERR_UNKNOWN_COMMAND, errorCode, keyLen, MIN_RECV_PACKET, opaque, REQ_MAGIC, RES_MAGIC, responseCas, responseCmd, responseOpaque, STATUS_OK, SUCCESS, vbucket
-
Fields inherited from class net.spy.memcached.protocol.BaseOperationImpl
callback, CANCELLED, notMyVbucketNodes, TIMED_OUT
-
-
Constructor Summary
Constructors Constructor Description OptimizedSetImpl(CASOperation firstStore)
Construct an optimized get starting with the given get operation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOperation(CASOperation op)
int
bytes()
private static byte
cmdMap(StoreType t)
protected void
finishedPayload(byte[] pl)
void
initialize()
Initialize this operation.protected boolean
opaqueIsValid()
Validate an opaque value from the header.int
size()
-
Methods inherited from class net.spy.memcached.protocol.binary.MultiKeyOperationImpl
addNotMyVbucketNode, getKeys, getNotMyVbucketNodes, getVBucket, setNotMyVbucketNodes, setVBucket, toString
-
Methods inherited from class net.spy.memcached.protocol.binary.OperationImpl
decodeByte, decodeInt, decodeLong, decodePayload, decodeShort, decodeUnsignedInt, generateOpaque, getErrorMsg, getStatusForErrorCode, prepareBuffer, readFromBuffer, resetInput
-
Methods inherited from class net.spy.memcached.protocol.BaseOperationImpl
addClone, cancel, getBuffer, getCallback, getCloneCount, getException, getHandlingNode, getState, getWriteCompleteTimestamp, handleError, handleRead, hasErrored, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, setBuffer, setCallback, setCloneCount, setHandlingNode, timeOut, transitionState, wasCancelled, writeComplete, writing
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.spy.memcached.ops.Operation
addClone, cancel, getBuffer, getCallback, getCloneCount, getErrorMsg, getException, getHandlingNode, getState, getWriteCompleteTimestamp, handleRead, hasErrored, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, readFromBuffer, setCloneCount, setHandlingNode, timeOut, writeComplete, writing
-
-
-
-
Field Detail
-
NOOP_CALLBACK
private static final OperationCallback NOOP_CALLBACK
-
terminalOpaque
private final int terminalOpaque
-
callbacks
private final java.util.Map<java.lang.Integer,OperationCallback> callbacks
-
ops
private final java.util.List<CASOperation> ops
-
byteCount
private int byteCount
-
-
Constructor Detail
-
OptimizedSetImpl
public OptimizedSetImpl(CASOperation firstStore)
Construct an optimized get starting with the given get operation.
-
-
Method Detail
-
addOperation
public void addOperation(CASOperation op)
-
size
public int size()
-
bytes
public int bytes()
-
initialize
public void initialize()
Description copied from interface:Operation
Initialize this operation. This is used to prepare output byte buffers and stuff.- Specified by:
initialize
in interfaceOperation
- Specified by:
initialize
in classBaseOperationImpl
-
cmdMap
private static byte cmdMap(StoreType t)
-
finishedPayload
protected void finishedPayload(byte[] pl) throws java.io.IOException
- Overrides:
finishedPayload
in classOperationImpl
- Throws:
java.io.IOException
-
opaqueIsValid
protected boolean opaqueIsValid()
Description copied from class:OperationImpl
Validate an opaque value from the header. This may be overridden from a subclass where the opaque isn't expected to always be the same as the request opaque.- Overrides:
opaqueIsValid
in classOperationImpl
-
-