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 longprotected BinaryDecodeStatus(package private) static final shortprotected int(package private) static final byteSet,add,replace protocol's extras lengthprotected intprotected OpCodeprotected intprotected intprotected ResponseStatusprotected intprotected Objectprotected shortFields inherited from class 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 TypeMethodDescriptionbooleandecode(MemcachedTCPSession session, ByteBuffer buffer) voidencode()protected voidfillExtras(CachedData data) private voidfillHeader(CachedData data) protected voidfillKey()protected voidfillValue(CachedData data) protected booleanfinish()final longgetCas()protected longfinal intprotected byteprotected shortintfinal OpCodefinal ResponseStatusfinal Transcoderfinal ObjectgetValue()protected intgetValueLength(CachedData data) private voidmarkBuffer(ByteBuffer buffer) private intreadBodyLength(ByteBuffer buffer) protected longreadCAS(ByteBuffer buffer) private bytereadDataType(ByteBuffer buffer) protected booleanreadExtras(ByteBuffer buffer, int extrasLength) private intreadExtrasLength(ByteBuffer buffer) protected voidreadHeader(ByteBuffer buffer) protected booleanreadKey(ByteBuffer buffer, int keyLength) private intreadKeyLength(ByteBuffer buffer) private voidreadMagicNumber(ByteBuffer buffer) protected booleanreadOpaque(ByteBuffer buffer) protected booleanreadOpCode(ByteBuffer buffer) protected voidreadStatus(ByteBuffer buffer) protected booleanreadValue(ByteBuffer buffer, int bodyLength, int keyLength, int extrasLength) final voidsetCas(long cas) final voidsetExpTime(int exp) voidsetOpaque(int opaque) final voidfinal voidsetResponseStatus(ResponseStatus responseStatus) final voidsetTranscoder(Transcoder transcoder) final voidMethods inherited from class 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:
getValuein interfaceStoreCommand
-
setValue
- Specified by:
setValuein interfaceStoreCommand
-
getTranscoder
- Overrides:
getTranscoderin classCommand
-
setTranscoder
- Overrides:
setTranscoderin 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
-
fillValue
-
fillKey
protected void fillKey() -
fillExtras
-
fillHeader
-
getCasValue
protected long getCasValue() -
getValueLength
-
getKeyLength
protected short getKeyLength() -
getExtrasLength
protected byte getExtrasLength()
-