Package net.spy.memcached.protocol.ascii
Class BaseGetOpImpl
java.lang.Object
net.spy.memcached.compat.SpyObject
net.spy.memcached.protocol.BaseOperationImpl
net.spy.memcached.protocol.ascii.BaseGetOpImpl
- All Implemented Interfaces:
Operation
- Direct Known Subclasses:
GetAndTouchOperationImpl
Base class for get and gets handlers.
-
Field Summary
FieldsFields inherited from class net.spy.memcached.protocol.BaseOperationImpl
callback, CANCELLED, notMyVbucketNodes, TIMED_OUT -
Constructor Summary
ConstructorsConstructorDescriptionBaseGetOpImpl(String c, OperationCallback cb, String k) BaseGetOpImpl(String c, OperationCallback cb, Collection<String> k) -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]protected byte[]byte[]Returns the raw bytes of the error message content.final Collection<String> getKeys()Get the keys this GetOperation is looking for.protected final net.spy.memcached.protocol.ascii.OperationReadTypefinal voidhandleLine(String line) final voidHandle a raw data read.final 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 final 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, 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.Operation
addClone, cancel, getBuffer, getCallback, getCloneCount, getException, getHandlingNode, getState, getWriteCompleteTimestamp, hasErrored, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, setCloneCount, setHandlingNode, timeOut, writeComplete, writing
-
Field Details
-
CRLF
protected static final byte[] CRLF
-
-
Constructor Details
-
BaseGetOpImpl
-
BaseGetOpImpl
-
-
Method Details
-
getKeys
Get the keys this GetOperation is looking for. -
handleLine
-
handleRead
Description copied from interface:OperationHandle a raw data read.- Specified by:
handleReadin interfaceOperation- Overrides:
handleReadin classBaseOperationImpl
-
initialize
public final 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
-
extraBytesBefore
protected byte[] extraBytesBefore() -
extraBytesAfter
protected byte[] extraBytesAfter() -
wasCancelled
protected final void wasCancelled()Description copied from class:BaseOperationImplThis is called on each subclass whenever an operation was cancelled.- Overrides:
wasCancelledin classBaseOperationImpl
-
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.
-