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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final char[]
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.private String
private static final char[]
private int
private TextGetCommand.ParseStatus
protected Map
<String, CachedData> protected boolean
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
ConstructorsConstructorDescriptionTextGetCommand
(String key, byte[] keyBytes, CommandType cmdType, CountDownLatch latch) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
decode
(MemcachedTCPSession session, ByteBuffer buffer) abstract void
dispatch()
void
encode()
private String
getItem
(ByteBuffer buffer, char token, char[] others) final Map
<String, CachedData> private String
getString
(byte[] keyBytes) private boolean
isIn
(byte b, char[] others) final void
setAssocCommands
(List<Command> assocCommands) final void
setMergeCommands
(Map<Object, Command> mergeCommands) void
setParseStatus
(TextGetCommand.ParseStatus parseStatus) final void
setReturnValues
(Map<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 Details
-
A_SPACE
private static final char[] A_SPACE -
EMPTY_CHARS
private static final char[] EMPTY_CHARS -
returnValues
-
currentReturnKey
-
offset
private int offset -
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
-
parseStatus
-
wasFirst
protected boolean wasFirst
-
-
Constructor Details
-
TextGetCommand
-
-
Method Details
-
getMergeCommands
- Specified by:
getMergeCommands
in interfaceMergeCommandsAware
-
setMergeCommands
- Specified by:
setMergeCommands
in interfaceMergeCommandsAware
-
getAssocCommands
- Specified by:
getAssocCommands
in interfaceAssocCommandAware
-
setAssocCommands
- Specified by:
setAssocCommands
in interfaceAssocCommandAware
-
getParseStatus
-
setParseStatus
-
decode
-
getItem
-
isIn
private boolean isIn(byte b, char[] others) -
getString
-
getReturnValues
- Specified by:
getReturnValues
in interfaceMapReturnValueAware
-
setReturnValues
-
dispatch
public abstract void dispatch() -
encode
public void encode()
-