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.OperationImpl
-
- net.spy.memcached.protocol.ascii.BaseGetOpImpl
-
- All Implemented Interfaces:
Operation
- Direct Known Subclasses:
GetAndTouchOperationImpl,GetlOperationImpl,GetOperationImpl,GetsOperationImpl
public abstract class BaseGetOpImpl extends OperationImpl
Base class for get and gets handlers.
-
-
Field Summary
Fields Modifier and Type Field Description private longcasValueprivate java.lang.Stringcmdprivate intcurrentFlagsprivate java.lang.StringcurrentKeyprivate byte[]dataprivate static OperationStatusENDprotected intexpprivate byte[]expBytesprivate booleanhasValueprivate java.util.Collection<java.lang.String>keysprivate static OperationStatusLOCK_ERRORprivate bytelookingForprivate static OperationStatusNOT_FOUNDprivate intreadOffsetprivate static byte[]RN_BYTES-
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 BaseGetOpImpl(java.lang.String c, int e, OperationCallback cb, java.lang.String k)BaseGetOpImpl(java.lang.String c, OperationCallback cb, java.util.Collection<java.lang.String> k)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterKeyBytes(java.nio.ByteBuffer b)protected intafterKeyBytesSize()java.util.Collection<java.lang.String>getKeys()Get the keys this GetOperation is looking for.voidhandleLine(java.lang.String line)voidhandleRead(java.nio.ByteBuffer b)Handle a raw data read.voidinitialize()Initialize this operation.java.lang.StringtoString()protected voidwasCancelled()This is called on each subclass whenever an operation was cancelled.-
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, hasErrored, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, setBuffer, setCallback, setCloneCount, setHandlingNode, timeOut, transitionState, 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, getException, getHandlingNode, getState, getWriteCompleteTimestamp, hasErrored, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, setCloneCount, setHandlingNode, timeOut, writeComplete, writing
-
-
-
-
Field Detail
-
END
private static final OperationStatus END
-
NOT_FOUND
private static final OperationStatus NOT_FOUND
-
LOCK_ERROR
private static final OperationStatus LOCK_ERROR
-
RN_BYTES
private static final byte[] RN_BYTES
-
cmd
private final java.lang.String cmd
-
keys
private final java.util.Collection<java.lang.String> keys
-
currentKey
private java.lang.String currentKey
-
exp
protected final int exp
-
expBytes
private final byte[] expBytes
-
casValue
private long casValue
-
currentFlags
private int currentFlags
-
data
private byte[] data
-
readOffset
private int readOffset
-
lookingFor
private byte lookingFor
-
hasValue
private boolean hasValue
-
-
Constructor Detail
-
BaseGetOpImpl
public BaseGetOpImpl(java.lang.String c, OperationCallback cb, java.util.Collection<java.lang.String> k)
-
BaseGetOpImpl
public BaseGetOpImpl(java.lang.String c, int e, OperationCallback cb, java.lang.String k)
-
-
Method Detail
-
getKeys
public final java.util.Collection<java.lang.String> getKeys()
Get the keys this GetOperation is looking for.
-
handleLine
public final void handleLine(java.lang.String line)
- Specified by:
handleLinein classOperationImpl
-
handleRead
public final void handleRead(java.nio.ByteBuffer b)
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
-
afterKeyBytesSize
protected int afterKeyBytesSize()
-
afterKeyBytes
protected void afterKeyBytes(java.nio.ByteBuffer b)
-
wasCancelled
protected final void wasCancelled()
Description copied from class:BaseOperationImplThis is called on each subclass whenever an operation was cancelled.- Overrides:
wasCancelledin classBaseOperationImpl
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-