Class BaseBinaryCommand
java.lang.Object
net.rubyeye.xmemcached.command.Command
net.rubyeye.xmemcached.command.binary.BaseBinaryCommand
- All Implemented Interfaces:
WriteMessage
,StoreCommand
- Direct Known Subclasses:
BinaryAppendPrependCommand
,BinaryAuthListMechanismsCommand
,BinaryAuthStartCommand
,BinaryAuthStepCommand
,BinaryAWSElasticCacheConfigCommand
,BinaryCASCommand
,BinaryDeleteCommand
,BinaryFlushAllCommand
,BinaryGetCommand
,BinaryGetMultiCommand
,BinaryIncrDecrCommand
,BinaryNoopCommand
,BinaryQuitCommand
,BinarySetMultiCommand
,BinaryStatsCommand
,BinaryStoreCommand
,BinaryTouchCommand
,BinaryVerbosityCommand
,BinaryVersionCommand
Base Binary command.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected long
protected BinaryDecodeStatus
(package private) static final short
protected int
(package private) static final byte
Set,add,replace protocol's extras lengthprotected int
protected OpCode
protected int
protected int
protected ResponseStatus
protected int
protected Object
protected short
Fields inherited from class net.rubyeye.xmemcached.command.Command
cancel, commandType, exception, ioBuffer, key, keyBytes, latch, mergeCount, noreply, REQUEST_MAGIC_NUMBER, RESPONSE_MAGIC_NUMBER, result, status, transcoder, writeFuture
-
Constructor Summary
ConstructorsConstructorDescriptionBaseBinaryCommand
(String key, byte[] keyBytes, CommandType cmdType, CountDownLatch latch, int exp, long cas, Object value, boolean noreply, Transcoder transcoder) -
Method Summary
Modifier and TypeMethodDescriptionboolean
decode
(MemcachedTCPSession session, ByteBuffer buffer) void
encode()
protected void
fillExtras
(CachedData data) private void
fillHeader
(CachedData data) protected void
fillKey()
protected void
fillValue
(CachedData data) protected boolean
finish()
final long
getCas()
protected long
final int
protected byte
protected short
int
final OpCode
final ResponseStatus
final Transcoder
final Object
getValue()
protected int
getValueLength
(CachedData data) private void
markBuffer
(ByteBuffer buffer) private int
readBodyLength
(ByteBuffer buffer) protected long
readCAS
(ByteBuffer buffer) private byte
readDataType
(ByteBuffer buffer) protected boolean
readExtras
(ByteBuffer buffer, int extrasLength) private int
readExtrasLength
(ByteBuffer buffer) protected void
readHeader
(ByteBuffer buffer) protected boolean
readKey
(ByteBuffer buffer, int keyLength) private int
readKeyLength
(ByteBuffer buffer) private void
readMagicNumber
(ByteBuffer buffer) protected boolean
readOpaque
(ByteBuffer buffer) protected boolean
readOpCode
(ByteBuffer buffer) protected void
readStatus
(ByteBuffer buffer) protected boolean
readValue
(ByteBuffer buffer, int bodyLength, int keyLength, int extrasLength) final void
setCas
(long cas) final void
setExpTime
(int exp) void
setOpaque
(int opaque) final void
final void
setResponseStatus
(ResponseStatus responseStatus) final void
setTranscoder
(Transcoder transcoder) final void
Methods inherited from class net.rubyeye.xmemcached.command.Command
cancel, countDownLatch, decodeError, decodeError, decodeError, decodeError, getCommandType, getCopiedMergeCount, getException, getIoBuffer, getKey, getKeyBytes, getLatch, getMergeCount, getMessage, getResult, getStatus, getWriteBuffer, getWriteFuture, isAdded, isCancel, isNoreply, isWriting, setAdded, setCommandType, setException, setIoBuffer, setKey, setKeyBytes, setLatch, setMergeCount, setNoreply, setResult, setStatus, setWriteBuffer, setWriteFuture, toString, writing
-
Field Details
-
DEFAULT_VBUCKET_ID
static final short DEFAULT_VBUCKET_ID- See Also:
-
expTime
protected int expTime -
cas
protected long cas -
value
-
opCode
-
decodeStatus
-
responseKeyLength
protected int responseKeyLength -
responseExtrasLength
protected int responseExtrasLength -
responseTotalBodyLength
protected int responseTotalBodyLength -
responseStatus
-
opaque
protected int opaque -
vbucketId
protected short vbucketId -
EXTRAS_LENGTH
static final byte EXTRAS_LENGTHSet,add,replace protocol's extras length- See Also:
-
-
Constructor Details
-
BaseBinaryCommand
public BaseBinaryCommand(String key, byte[] keyBytes, CommandType cmdType, CountDownLatch latch, int exp, long cas, Object value, boolean noreply, Transcoder transcoder)
-
-
Method Details
-
getExpTime
public final int getExpTime() -
setExpTime
public final void setExpTime(int exp) -
getCas
public final long getCas() -
getOpaque
public int getOpaque() -
setOpaque
public void setOpaque(int opaque) -
setCas
public final void setCas(long cas) -
getValue
- Specified by:
getValue
in interfaceStoreCommand
-
setValue
- Specified by:
setValue
in interfaceStoreCommand
-
getTranscoder
- Overrides:
getTranscoder
in classCommand
-
setTranscoder
- Overrides:
setTranscoder
in classCommand
-
decode
-
finish
protected boolean finish() -
readHeader
-
markBuffer
-
readOpaque
-
readCAS
-
readKey
-
readValue
-
readExtras
-
readBodyLength
-
readStatus
-
getOpCode
-
setOpCode
-
getResponseStatus
-
setResponseStatus
-
readKeyLength
-
readExtrasLength
-
readDataType
-
readOpCode
-
readMagicNumber
-
encode
public void encode() -
fillValue
-
fillKey
protected void fillKey() -
fillExtras
-
fillHeader
-
getCasValue
protected long getCasValue() -
getValueLength
-
getKeyLength
protected short getKeyLength() -
getExtrasLength
protected byte getExtrasLength()
-