Package net.spy.memcached.protocol.ascii
Class CASOperationImpl
- java.lang.Object
-
- net.spy.memcached.compat.SpyObject
-
- net.spy.memcached.protocol.BaseOperationImpl
-
- net.spy.memcached.protocol.ascii.OperationImpl
-
- net.spy.memcached.protocol.ascii.CASOperationImpl
-
- All Implemented Interfaces:
CASOperation
,KeyedOperation
,Operation
class CASOperationImpl extends OperationImpl implements CASOperation
-
-
Field Summary
Fields Modifier and Type Field Description private long
casValue
private byte[]
data
private static OperationStatus
EXISTS
private int
exp
private int
flags
private java.lang.String
key
private static OperationStatus
NOT_FOUND
private static int
OVERHEAD
private static OperationStatus
STORED
-
Fields inherited from class net.spy.memcached.protocol.ascii.OperationImpl
CRLF
-
Fields inherited from class net.spy.memcached.protocol.BaseOperationImpl
callback, CANCELLED, notMyVbucketNodes, TIMED_OUT
-
-
Constructor Summary
Constructors Constructor Description CASOperationImpl(java.lang.String k, long c, int f, int e, byte[] d, OperationCallback cb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getCasValue()
Get the CAS value advised for this operation.byte[]
getData()
Get the bytes to be set during this operation.int
getExpiration()
Get the expiration to be set for this operation.int
getFlags()
Get the flags to be set for this operation.java.util.Collection<java.lang.String>
getKeys()
Get the keys requested in this GetOperation.StoreType
getStoreType()
Get the type of storage used by this CASOperation.void
handleLine(java.lang.String line)
void
initialize()
Initialize this operation.java.lang.String
toString()
-
Methods inherited from class net.spy.memcached.protocol.ascii.OperationImpl
classifyError, getErrorMsg, getReadType, matchStatus, readFromBuffer, setArguments, setReadType
-
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
-
OVERHEAD
private static final int OVERHEAD
- See Also:
- Constant Field Values
-
STORED
private static final OperationStatus STORED
-
NOT_FOUND
private static final OperationStatus NOT_FOUND
-
EXISTS
private static final OperationStatus EXISTS
-
key
private final java.lang.String key
-
casValue
private final long casValue
-
flags
private final int flags
-
exp
private final int exp
-
data
private final byte[] data
-
-
Constructor Detail
-
CASOperationImpl
public CASOperationImpl(java.lang.String k, long c, int f, int e, byte[] d, OperationCallback cb)
-
-
Method Detail
-
handleLine
public void handleLine(java.lang.String line)
- Specified by:
handleLine
in classOperationImpl
-
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
-
getKeys
public java.util.Collection<java.lang.String> getKeys()
Description copied from interface:KeyedOperation
Get the keys requested in this GetOperation.- Specified by:
getKeys
in interfaceKeyedOperation
-
getData
public byte[] getData()
Description copied from interface:CASOperation
Get 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:
getData
in interfaceCASOperation
-
getCasValue
public long getCasValue()
Description copied from interface:CASOperation
Get the CAS value advised for this operation.- Specified by:
getCasValue
in interfaceCASOperation
-
getExpiration
public int getExpiration()
Description copied from interface:CASOperation
Get the expiration to be set for this operation.- Specified by:
getExpiration
in interfaceCASOperation
-
getFlags
public int getFlags()
Description copied from interface:CASOperation
Get the flags to be set for this operation.- Specified by:
getFlags
in interfaceCASOperation
-
getStoreType
public StoreType getStoreType()
Description copied from interface:CASOperation
Get the type of storage used by this CASOperation.- Specified by:
getStoreType
in interfaceCASOperation
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-