Class TextGetCommand
- java.lang.Object
-
- net.rubyeye.xmemcached.command.Command
-
- net.rubyeye.xmemcached.command.text.TextGetCommand
-
- All Implemented Interfaces:
WriteMessage,AssocCommandAware,MapReturnValueAware,MergeCommandsAware
- Direct Known Subclasses:
KestrelGetCommand,TextGetMultiCommand,TextGetOneCommand
public abstract class TextGetCommand extends Command implements MergeCommandsAware, AssocCommandAware, MapReturnValueAware
Abstract get command for text protocol
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTextGetCommand.ParseStatus
-
Field Summary
Fields Modifier and Type Field Description private static char[]A_SPACEprotected java.util.List<Command>assocCommandsWhen MemcachedClient merge get commands,those commans which have the same key will be merged into one get command.The result command's assocCommands contains all these commands with the same key.private java.lang.StringcurrentReturnKeyprivate static char[]EMPTY_CHARSprotected java.util.Map<java.lang.Object,Command>mergeCommandsprivate intoffsetprivate TextGetCommand.ParseStatusparseStatusprotected java.util.Map<java.lang.String,CachedData>returnValuesprotected booleanwasFirst-
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 TextGetCommand(java.lang.String key, byte[] keyBytes, CommandType cmdType, java.util.concurrent.CountDownLatch latch)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleandecode(MemcachedTCPSession session, java.nio.ByteBuffer buffer)abstract voiddispatch()voidencode()java.util.List<Command>getAssocCommands()private java.lang.StringgetItem(java.nio.ByteBuffer buffer, char token, char[] others)java.util.Map<java.lang.Object,Command>getMergeCommands()TextGetCommand.ParseStatusgetParseStatus()java.util.Map<java.lang.String,CachedData>getReturnValues()private java.lang.StringgetString(byte[] keyBytes)private booleanisIn(byte b, char[] others)voidsetAssocCommands(java.util.List<Command> assocCommands)voidsetMergeCommands(java.util.Map<java.lang.Object,Command> mergeCommands)voidsetParseStatus(TextGetCommand.ParseStatus parseStatus)voidsetReturnValues(java.util.Map<java.lang.String,CachedData> returnValues)-
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, getTranscoder, getWriteBuffer, getWriteFuture, isAdded, isCancel, isNoreply, isWriting, setAdded, setCommandType, setException, setIoBuffer, setKey, setKeyBytes, setLatch, setMergeCount, setNoreply, setResult, setStatus, setTranscoder, setWriteBuffer, setWriteFuture, toString, writing
-
-
-
-
Field Detail
-
A_SPACE
private static final char[] A_SPACE
-
EMPTY_CHARS
private static final char[] EMPTY_CHARS
-
returnValues
protected java.util.Map<java.lang.String,CachedData> returnValues
-
currentReturnKey
private java.lang.String currentReturnKey
-
offset
private int offset
-
assocCommands
protected java.util.List<Command> assocCommands
When MemcachedClient merge get commands,those commans which have the same key will be merged into one get command.The result command's assocCommands contains all these commands with the same key.
-
mergeCommands
protected java.util.Map<java.lang.Object,Command> mergeCommands
-
parseStatus
private TextGetCommand.ParseStatus parseStatus
-
wasFirst
protected boolean wasFirst
-
-
Constructor Detail
-
TextGetCommand
public TextGetCommand(java.lang.String key, byte[] keyBytes, CommandType cmdType, java.util.concurrent.CountDownLatch latch)
-
-
Method Detail
-
getMergeCommands
public final java.util.Map<java.lang.Object,Command> getMergeCommands()
- Specified by:
getMergeCommandsin interfaceMergeCommandsAware
-
setMergeCommands
public final void setMergeCommands(java.util.Map<java.lang.Object,Command> mergeCommands)
- Specified by:
setMergeCommandsin interfaceMergeCommandsAware
-
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
-
getParseStatus
public TextGetCommand.ParseStatus getParseStatus()
-
setParseStatus
public void setParseStatus(TextGetCommand.ParseStatus parseStatus)
-
decode
public final boolean decode(MemcachedTCPSession session, java.nio.ByteBuffer buffer)
-
getItem
private java.lang.String getItem(java.nio.ByteBuffer buffer, char token, char[] others)
-
isIn
private boolean isIn(byte b, char[] others)
-
getString
private java.lang.String getString(byte[] keyBytes)
-
getReturnValues
public final java.util.Map<java.lang.String,CachedData> getReturnValues()
- Specified by:
getReturnValuesin interfaceMapReturnValueAware
-
setReturnValues
public final void setReturnValues(java.util.Map<java.lang.String,CachedData> returnValues)
-
dispatch
public abstract void dispatch()
-
-