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 long
casValue
private java.lang.String
cmd
private int
currentFlags
private java.lang.String
currentKey
private byte[]
data
private static OperationStatus
END
protected int
exp
private byte[]
expBytes
private boolean
hasValue
private java.util.Collection<java.lang.String>
keys
private static OperationStatus
LOCK_ERROR
private byte
lookingFor
private static OperationStatus
NOT_FOUND
private int
readOffset
private 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 void
afterKeyBytes(java.nio.ByteBuffer b)
protected int
afterKeyBytesSize()
java.util.Collection<java.lang.String>
getKeys()
Get the keys this GetOperation is looking for.void
handleLine(java.lang.String line)
void
handleRead(java.nio.ByteBuffer b)
Handle a raw data read.void
initialize()
Initialize this operation.java.lang.String
toString()
protected void
wasCancelled()
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:
handleLine
in classOperationImpl
-
handleRead
public final void handleRead(java.nio.ByteBuffer b)
Description copied from interface:Operation
Handle a raw data read.- Specified by:
handleRead
in interfaceOperation
- Overrides:
handleRead
in classBaseOperationImpl
-
initialize
public final 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
-
afterKeyBytesSize
protected int afterKeyBytesSize()
-
afterKeyBytes
protected void afterKeyBytes(java.nio.ByteBuffer b)
-
wasCancelled
protected final void wasCancelled()
Description copied from class:BaseOperationImpl
This is called on each subclass whenever an operation was cancelled.- Overrides:
wasCancelled
in classBaseOperationImpl
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-