Class StoreOperationImpl
- java.lang.Object
-
- net.spy.memcached.compat.SpyObject
-
- net.spy.memcached.protocol.BaseOperationImpl
-
- net.spy.memcached.protocol.binary.OperationImpl
-
- net.spy.memcached.protocol.binary.SingleKeyOperationImpl
-
- net.spy.memcached.protocol.binary.StoreOperationImpl
-
- All Implemented Interfaces:
CASOperation,KeyedOperation,Operation,StoreOperation,VBucketAware
class StoreOperationImpl extends SingleKeyOperationImpl implements StoreOperation, CASOperation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.spy.memcached.ops.StoreOperation
StoreOperation.Callback
-
-
Field Summary
Fields Modifier and Type Field Description private static byteADD(package private) static byteADDQprivate longcasprivate byte[]dataprivate intexp(package private) static intEXTRA_LENprivate intflagsprivate static byteREPLACE(package private) static byteREPLACEQprivate static byteSET(package private) static byteSETQprivate StoreTypestoreType-
Fields inherited from class net.spy.memcached.protocol.binary.SingleKeyOperationImpl
key
-
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 StoreOperationImpl(StoreType t, java.lang.String k, int f, int e, byte[] d, long c, StoreOperation.Callback cb)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static bytecmdMap(StoreType t)protected voiddecodePayload(byte[] pl)Decode the given payload for this command.longgetCasValue()Get the CAS value advised for this operation.byte[]getData()Get the bytes to be set during this operation.intgetExpiration()Get the expiration value to be set.intgetFlags()Get the flags to be set.StoreTypegetStoreType()Get the store type used by this operation.voidinitialize()Initialize this operation.java.lang.StringtoString()-
Methods inherited from class net.spy.memcached.protocol.binary.SingleKeyOperationImpl
addNotMyVbucketNode, getKeys, getNotMyVbucketNodes, getVBucket, setNotMyVbucketNodes, setVBucket
-
Methods inherited from class net.spy.memcached.protocol.binary.OperationImpl
decodeByte, decodeInt, decodeLong, decodeShort, decodeUnsignedInt, finishedPayload, generateOpaque, getErrorMsg, getStatusForErrorCode, opaqueIsValid, 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.KeyedOperation
getKeys
-
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
-
SET
private static final byte SET
- See Also:
- Constant Field Values
-
ADD
private static final byte ADD
- See Also:
- Constant Field Values
-
REPLACE
private static final byte REPLACE
- See Also:
- Constant Field Values
-
SETQ
static final byte SETQ
- See Also:
- Constant Field Values
-
ADDQ
static final byte ADDQ
- See Also:
- Constant Field Values
-
REPLACEQ
static final byte REPLACEQ
- See Also:
- Constant Field Values
-
EXTRA_LEN
static final int EXTRA_LEN
- See Also:
- Constant Field Values
-
storeType
private final StoreType storeType
-
flags
private final int flags
-
exp
private final int exp
-
cas
private final long cas
-
data
private final byte[] data
-
-
Constructor Detail
-
StoreOperationImpl
public StoreOperationImpl(StoreType t, java.lang.String k, int f, int e, byte[] d, long c, StoreOperation.Callback cb)
-
-
Method Detail
-
cmdMap
private static byte cmdMap(StoreType t)
-
initialize
public void initialize()
Description copied from interface:OperationInitialize this operation. This is used to prepare output byte buffers and stuff.- Specified by:
initializein interfaceOperation- Specified by:
initializein classBaseOperationImpl
-
getCasValue
public long getCasValue()
Description copied from interface:CASOperationGet the CAS value advised for this operation.- Specified by:
getCasValuein interfaceCASOperation
-
getExpiration
public int getExpiration()
Description copied from interface:StoreOperationGet the expiration value to be set.- Specified by:
getExpirationin interfaceCASOperation- Specified by:
getExpirationin interfaceStoreOperation
-
getFlags
public int getFlags()
Description copied from interface:StoreOperationGet the flags to be set.- Specified by:
getFlagsin interfaceCASOperation- Specified by:
getFlagsin interfaceStoreOperation
-
getData
public byte[] getData()
Description copied from interface:StoreOperationGet the bytes to be set during this operation.Note, this returns an exact reference to the bytes and the data must not be modified.
- Specified by:
getDatain interfaceCASOperation- Specified by:
getDatain interfaceStoreOperation
-
getStoreType
public StoreType getStoreType()
Description copied from interface:StoreOperationGet the store type used by this operation.- Specified by:
getStoreTypein interfaceCASOperation- Specified by:
getStoreTypein interfaceStoreOperation
-
decodePayload
protected void decodePayload(byte[] pl)
Description copied from class:OperationImplDecode the given payload for this command.- Overrides:
decodePayloadin classOperationImpl- Parameters:
pl- the payload.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classSingleKeyOperationImpl
-
-