Class BinaryGetCommand
- java.lang.Object
-
- net.rubyeye.xmemcached.command.Command
-
- net.rubyeye.xmemcached.command.binary.BaseBinaryCommand
-
- net.rubyeye.xmemcached.command.binary.BinaryGetCommand
-
- All Implemented Interfaces:
WriteMessage,AssocCommandAware,StoreCommand
- Direct Known Subclasses:
BinaryGetAndTouchCommand
public class BinaryGetCommand extends BaseBinaryCommand implements AssocCommandAware
Implements get/getq,getk/getkq protocol
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Command>assocCommandsprivate java.lang.StringresponseKeyprivate CachedDataresponseValue-
Fields inherited from class net.rubyeye.xmemcached.command.binary.BaseBinaryCommand
cas, decodeStatus, DEFAULT_VBUCKET_ID, expTime, EXTRAS_LENGTH, opaque, opCode, responseExtrasLength, responseKeyLength, responseStatus, responseTotalBodyLength, value, vbucketId
-
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
Constructors Constructor Description BinaryGetCommand(java.lang.String key, byte[] keyBytes, CommandType cmdType, java.util.concurrent.CountDownLatch latch, OpCode opCode, boolean noreply)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfillExtras(CachedData data)protected voidfillValue(CachedData data)protected booleanfinish()java.util.List<Command>getAssocCommands()protected bytegetExtrasLength()java.lang.StringgetResponseKey()protected intgetValueLength(CachedData data)protected longreadCAS(java.nio.ByteBuffer buffer)protected booleanreadExtras(java.nio.ByteBuffer buffer, int extrasLength)protected voidreadHeader(java.nio.ByteBuffer buffer)Optimistic,if the value length is 0,then skip remaining buffer,set result as nullprotected booleanreadKey(java.nio.ByteBuffer buffer, int keyLength)protected booleanreadValue(java.nio.ByteBuffer buffer, int bodyLength, int keyLength, int extrasLength)voidsetAssocCommands(java.util.List<Command> assocCommands)voidsetResponseKey(java.lang.String responseKey)-
Methods inherited from class net.rubyeye.xmemcached.command.binary.BaseBinaryCommand
decode, encode, fillKey, getCas, getCasValue, getExpTime, getKeyLength, getOpaque, getOpCode, getResponseStatus, getTranscoder, getValue, readOpaque, readOpCode, readStatus, setCas, setExpTime, setOpaque, setOpCode, setResponseStatus, setTranscoder, setValue
-
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 Detail
-
responseKey
private java.lang.String responseKey
-
responseValue
private CachedData responseValue
-
assocCommands
private java.util.List<Command> assocCommands
-
-
Constructor Detail
-
BinaryGetCommand
public BinaryGetCommand(java.lang.String key, byte[] keyBytes, CommandType cmdType, java.util.concurrent.CountDownLatch latch, OpCode opCode, boolean noreply)
-
-
Method Detail
-
getResponseKey
public final java.lang.String getResponseKey()
-
setResponseKey
public final void setResponseKey(java.lang.String responseKey)
-
getAssocCommands
public final java.util.List<Command> getAssocCommands()
- Specified by:
getAssocCommandsin interfaceAssocCommandAware
-
setAssocCommands
public final void setAssocCommands(java.util.List<Command> assocCommands)
- Specified by:
setAssocCommandsin interfaceAssocCommandAware
-
readHeader
protected void readHeader(java.nio.ByteBuffer buffer)
Optimistic,if the value length is 0,then skip remaining buffer,set result as null- Overrides:
readHeaderin classBaseBinaryCommand
-
finish
protected boolean finish()
- Overrides:
finishin classBaseBinaryCommand
-
readKey
protected boolean readKey(java.nio.ByteBuffer buffer, int keyLength)- Overrides:
readKeyin classBaseBinaryCommand
-
readValue
protected boolean readValue(java.nio.ByteBuffer buffer, int bodyLength, int keyLength, int extrasLength)- Overrides:
readValuein classBaseBinaryCommand
-
readExtras
protected boolean readExtras(java.nio.ByteBuffer buffer, int extrasLength)- Overrides:
readExtrasin classBaseBinaryCommand
-
fillExtras
protected void fillExtras(CachedData data)
- Overrides:
fillExtrasin classBaseBinaryCommand
-
fillValue
protected void fillValue(CachedData data)
- Overrides:
fillValuein classBaseBinaryCommand
-
getExtrasLength
protected byte getExtrasLength()
- Overrides:
getExtrasLengthin classBaseBinaryCommand
-
getValueLength
protected int getValueLength(CachedData data)
- Overrides:
getValueLengthin classBaseBinaryCommand
-
readCAS
protected long readCAS(java.nio.ByteBuffer buffer)
- Overrides:
readCASin classBaseBinaryCommand
-
-