Class TapOperationImpl
- java.lang.Object
-
- net.spy.memcached.compat.SpyObject
-
- net.spy.memcached.protocol.BaseOperationImpl
-
- net.spy.memcached.protocol.binary.OperationImpl
-
- net.spy.memcached.protocol.binary.TapOperationImpl
-
- All Implemented Interfaces:
Operation,TapOperation
- Direct Known Subclasses:
TapAckOperationImpl,TapBackfillOperationImpl,TapCustomOperationImpl,TapDumpOperationImpl
public abstract class TapOperationImpl extends OperationImpl implements TapOperation
Abstract implementation of a tap operation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.spy.memcached.ops.TapOperation
TapOperation.Callback
-
-
Field Summary
Fields Modifier and Type Field Description private intbodylenprivate intbytesProcessed(package private) static byteCMDprivate byte[]headerprivate byte[]message-
Fields inherited from class net.spy.memcached.protocol.binary.OperationImpl
DUMMY_OPCODE, EMPTY_BYTES, ERR_2BIG, ERR_BUSY, ERR_DELTA_BADVAL, ERR_EXISTS, ERR_INTERNAL, ERR_INVAL, ERR_NO_MEM, ERR_NOT_FOUND, ERR_NOT_MY_VBUCKET, ERR_NOT_STORED, ERR_NOT_SUPPORTED, ERR_TEMP_FAIL, ERR_UNKNOWN_COMMAND, errorCode, keyLen, MIN_RECV_PACKET, opaque, REQ_MAGIC, RES_MAGIC, responseCas, responseCmd, responseOpaque, STATUS_OK, SUCCESS, vbucket
-
Fields inherited from class net.spy.memcached.protocol.BaseOperationImpl
callback, CANCELLED, notMyVbucketNodes, TIMED_OUT
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTapOperationImpl(OperationCallback cb)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidinitialize()Initialize this operation.voidreadFromBuffer(java.nio.ByteBuffer data)Read from the incomingByteBuffer.-
Methods inherited from class net.spy.memcached.protocol.binary.OperationImpl
decodeByte, decodeInt, decodeLong, decodePayload, decodeShort, decodeUnsignedInt, finishedPayload, generateOpaque, getErrorMsg, getStatusForErrorCode, opaqueIsValid, prepareBuffer, resetInput, toString
-
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, setCloneCount, setHandlingNode, timeOut, writeComplete, writing
-
Methods inherited from interface net.spy.memcached.ops.TapOperation
streamClosed
-
-
-
-
Field Detail
-
bytesProcessed
private int bytesProcessed
-
bodylen
private int bodylen
-
header
private byte[] header
-
message
private byte[] message
-
CMD
static final byte CMD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TapOperationImpl
protected TapOperationImpl(OperationCallback cb)
-
-
Method Detail
-
initialize
public abstract 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
-
readFromBuffer
public void readFromBuffer(java.nio.ByteBuffer data) throws java.io.IOExceptionDescription copied from class:OperationImplRead from the incomingByteBuffer. Reading from the buffer is done in stages, depending on how much data can be read at once. First, the header is read and then parsed (24 bytes, indicated byOperationImpl.MIN_RECV_PACKET). Then, the payload is read (if one is available for this operation and can be loaded fully).- Specified by:
readFromBufferin interfaceOperation- Overrides:
readFromBufferin classOperationImpl- Parameters:
data- the buffer to read from.- Throws:
java.io.IOException- if an error happened during parsing/reading.
-
-