Package net.spy.memcached.protocol.ascii
Class ConcatenationOperationImpl
java.lang.Object
net.spy.memcached.compat.SpyObject
net.spy.memcached.protocol.BaseOperationImpl
net.spy.memcached.protocol.ascii.ConcatenationOperationImpl
- All Implemented Interfaces:
ConcatenationOperation,KeyedOperation,Operation
Operation for ascii concatenations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final byte[]protected final byte[]protected final intprotected final intprotected final Stringprotected final StringFields inherited from class net.spy.memcached.protocol.BaseOperationImpl
callback, CANCELLED, notMyVbucketNodes, TIMED_OUT -
Constructor Summary
ConstructorsConstructorDescriptionConcatenationOperationImpl(ConcatenationType t, String k, byte[] d, OperationCallback cb) -
Method Summary
Modifier and TypeMethodDescriptionlongGet the CAS value sent with this operation.byte[]getData()byte[]Returns the raw bytes of the error message content.intintgetFlags()getKeys()protected final net.spy.memcached.protocol.ascii.OperationReadTypeGet the concatenation type for this operation.voidhandleLine(String line) voidInitialize this operation.protected final OperationStatusmatchStatus(String line, OperationStatus... statii) Match the status line provided against one of the given OperationStatus objects.voidreadFromBuffer(ByteBuffer data) Read data from the given byte buffer and dispatch to the appropriate read mechanism.protected final voidsetArguments(ByteBuffer bb, Object... args) Set some arguments for an operation into the given byte buffer.protected final voidsetReadType(net.spy.memcached.protocol.ascii.OperationReadType to) Set the read type of this operation.toString()protected voidThis is called on each subclass whenever an operation was cancelled.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, writeComplete, writingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.spy.memcached.ops.ConcatenationOperation
getDataMethods inherited from interface net.spy.memcached.ops.KeyedOperation
getKeysMethods inherited from interface net.spy.memcached.ops.Operation
addClone, cancel, getBuffer, getCallback, getCloneCount, getErrorMsg, getException, getHandlingNode, getState, getWriteCompleteTimestamp, handleRead, hasErrored, initialize, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, readFromBuffer, setCloneCount, setHandlingNode, timeOut, writeComplete, writing
-
Field Details
-
type
-
key
-
flags
protected final int flags -
exp
protected final int exp -
data
protected final byte[] data -
CRLF
protected static final byte[] CRLF
-
-
Constructor Details
-
ConcatenationOperationImpl
-
-
Method Details
-
getCasValue
public long getCasValue()Description copied from interface:ConcatenationOperationGet the CAS value sent with this operation.- Specified by:
getCasValuein interfaceConcatenationOperation
-
getStoreType
Description copied from interface:ConcatenationOperationGet the concatenation type for this operation.- Specified by:
getStoreTypein interfaceConcatenationOperation
-
handleLine
-
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
-
wasCancelled
protected void wasCancelled()Description copied from class:BaseOperationImplThis is called on each subclass whenever an operation was cancelled.- Overrides:
wasCancelledin classBaseOperationImpl
-
getKeys
-
getFlags
public int getFlags() -
getExpiration
public int getExpiration() -
getData
public byte[] getData() -
toString
-
matchStatus
Match the status line provided against one of the given OperationStatus objects. If none match, return a failure status with the given line.- Parameters:
line- the current linestatii- several status objects- Returns:
- the appropriate status object
-
getReadType
protected final net.spy.memcached.protocol.ascii.OperationReadType getReadType() -
setReadType
protected final void setReadType(net.spy.memcached.protocol.ascii.OperationReadType to) Set the read type of this operation. -
setArguments
Set some arguments for an operation into the given byte buffer. -
readFromBuffer
Description copied from interface:OperationRead data from the given byte buffer and dispatch to the appropriate read mechanism.- Specified by:
readFromBufferin interfaceOperation- Specified by:
readFromBufferin classBaseOperationImpl- Throws:
IOException
-
getErrorMsg
public byte[] getErrorMsg()Description copied from interface:OperationReturns the raw bytes of the error message content.- Specified by:
getErrorMsgin interfaceOperation- Returns:
- the raw error message content.
-