Package net.rubyeye.xmemcached.command
Class KestrelCommandFactory
- java.lang.Object
-
- net.rubyeye.xmemcached.command.KestrelCommandFactory
-
- All Implemented Interfaces:
CommandFactory
public class KestrelCommandFactory extends java.lang.Object implements CommandFactory
Kestrel is a message queue written in scala by robey(http://github.com/robey/kestrel).It's protocol use memcached text protocol,so you can use any memcached clients to talk with it.But it's protocol implementation is not all compatible with memcached standard protocol,So xmemcached supply this command factory for it.
-
-
Constructor Summary
Constructors Constructor Description KestrelCommandFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Command
createAddCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, boolean noreply, Transcoder transcoder)
create a add commandCommand
createAppendCommand(java.lang.String key, byte[] keyBytes, java.lang.Object value, boolean noreply, Transcoder transcoder)
create a append commandCommand
createAuthListMechanismsCommand(java.util.concurrent.CountDownLatch latch)
Create a command for listing authentication mechanismsCommand
createAuthStartCommand(java.lang.String mechanism, java.util.concurrent.CountDownLatch latch, byte[] authData)
Create command for starting authenticationCommand
createAuthStepCommand(java.lang.String mechanism, java.util.concurrent.CountDownLatch latch, byte[] authData)
Create a command for stepping authenticationCommand
createAWSElasticCacheConfigCommand(java.lang.String subCommand, java.lang.String key)
Create a AWS ElasticCache config command, only supports Cache Engine Version 1.4.14 or Higher.Command
createCASCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, long cas, boolean noreply, Transcoder transcoder)
Create a cas commandCommand
createDeleteCommand(java.lang.String key, byte[] keyBytes, int time, long cas, boolean noreply)
create a delete commandCommand
createFlushAllCommand(java.util.concurrent.CountDownLatch latch, int delay, boolean noreply)
create a flush_all commandCommand
createGetAndTouchCommand(java.lang.String key, byte[] keyBytes, java.util.concurrent.CountDownLatch latch, int exp, boolean noreply)
Create a get-and-touch commandCommand
createGetCommand(java.lang.String key, byte[] keyBytes, CommandType cmdType, Transcoder transcoder)
create a get/gets command<T> Command
createGetMultiCommand(java.util.Collection<java.lang.String> keys, java.util.concurrent.CountDownLatch latch, CommandType cmdType, Transcoder<T> transcoder)
Create a multi-get commandCommand
createIncrDecrCommand(java.lang.String key, byte[] keyBytes, long amount, long initial, int expTime, CommandType cmdType, boolean noreply)
create a incr/decr commandCommand
createPrependCommand(java.lang.String key, byte[] keyBytes, java.lang.Object value, boolean noreply, Transcoder transcoder)
Create a prepend commandCommand
createQuitCommand()
create a quit commandCommand
createReplaceCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, boolean noreply, Transcoder transcoder)
create a replace commandCommand
createSetCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, boolean noreply, Transcoder transcoder)
Create a set commandCommand
createStatsCommand(java.net.InetSocketAddress server, java.util.concurrent.CountDownLatch latch, java.lang.String itemName)
create a stats commandCommand
createTouchCommand(java.lang.String key, byte[] keyBytes, java.util.concurrent.CountDownLatch latch, int exp, boolean noreply)
Create a touch commandCommand
createVerbosityCommand(java.util.concurrent.CountDownLatch latch, int level, boolean noreply)
Create a verbosity commandCommand
createVersionCommand(java.util.concurrent.CountDownLatch latch, java.net.InetSocketAddress server)
create a version commandProtocol
getProtocol()
Get this client's protocol versionvoid
setBufferAllocator(BufferAllocator bufferAllocator)
set command factory's buffer allocator
-
-
-
Method Detail
-
createAWSElasticCacheConfigCommand
public Command createAWSElasticCacheConfigCommand(java.lang.String subCommand, java.lang.String key)
Description copied from interface:CommandFactory
Create a AWS ElasticCache config command, only supports Cache Engine Version 1.4.14 or Higher.- Specified by:
createAWSElasticCacheConfigCommand
in interfaceCommandFactory
- Returns:
- See Also:
- Adding Auto Discovery To Your Client Library
-
createAddCommand
public Command createAddCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, boolean noreply, Transcoder transcoder)
Description copied from interface:CommandFactory
create a add command- Specified by:
createAddCommand
in interfaceCommandFactory
- Returns:
-
createAppendCommand
public Command createAppendCommand(java.lang.String key, byte[] keyBytes, java.lang.Object value, boolean noreply, Transcoder transcoder)
Description copied from interface:CommandFactory
create a append command- Specified by:
createAppendCommand
in interfaceCommandFactory
- Returns:
-
createCASCommand
public Command createCASCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, long cas, boolean noreply, Transcoder transcoder)
Description copied from interface:CommandFactory
Create a cas command- Specified by:
createCASCommand
in interfaceCommandFactory
- Returns:
-
createDeleteCommand
public Command createDeleteCommand(java.lang.String key, byte[] keyBytes, int time, long cas, boolean noreply)
Description copied from interface:CommandFactory
create a delete command- Specified by:
createDeleteCommand
in interfaceCommandFactory
- Returns:
-
createFlushAllCommand
public Command createFlushAllCommand(java.util.concurrent.CountDownLatch latch, int delay, boolean noreply)
Description copied from interface:CommandFactory
create a flush_all command- Specified by:
createFlushAllCommand
in interfaceCommandFactory
- Returns:
-
createGetCommand
public Command createGetCommand(java.lang.String key, byte[] keyBytes, CommandType cmdType, Transcoder transcoder)
Description copied from interface:CommandFactory
create a get/gets command- Specified by:
createGetCommand
in interfaceCommandFactory
cmdType
- 命令类型transcoder
- TODO- Returns:
-
createGetMultiCommand
public <T> Command createGetMultiCommand(java.util.Collection<java.lang.String> keys, java.util.concurrent.CountDownLatch latch, CommandType cmdType, Transcoder<T> transcoder)
Description copied from interface:CommandFactory
Create a multi-get command- Specified by:
createGetMultiCommand
in interfaceCommandFactory
- Returns:
-
createIncrDecrCommand
public Command createIncrDecrCommand(java.lang.String key, byte[] keyBytes, long amount, long initial, int expTime, CommandType cmdType, boolean noreply)
Description copied from interface:CommandFactory
create a incr/decr command- Specified by:
createIncrDecrCommand
in interfaceCommandFactory
- Returns:
-
createPrependCommand
public Command createPrependCommand(java.lang.String key, byte[] keyBytes, java.lang.Object value, boolean noreply, Transcoder transcoder)
Description copied from interface:CommandFactory
Create a prepend command- Specified by:
createPrependCommand
in interfaceCommandFactory
- Returns:
-
createReplaceCommand
public Command createReplaceCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, boolean noreply, Transcoder transcoder)
Description copied from interface:CommandFactory
create a replace command- Specified by:
createReplaceCommand
in interfaceCommandFactory
- Returns:
-
createSetCommand
public Command createSetCommand(java.lang.String key, byte[] keyBytes, int exp, java.lang.Object value, boolean noreply, Transcoder transcoder)
Description copied from interface:CommandFactory
Create a set command- Specified by:
createSetCommand
in interfaceCommandFactory
- Returns:
-
createStatsCommand
public Command createStatsCommand(java.net.InetSocketAddress server, java.util.concurrent.CountDownLatch latch, java.lang.String itemName)
Description copied from interface:CommandFactory
create a stats command- Specified by:
createStatsCommand
in interfaceCommandFactory
- Returns:
-
createVerbosityCommand
public Command createVerbosityCommand(java.util.concurrent.CountDownLatch latch, int level, boolean noreply)
Description copied from interface:CommandFactory
Create a verbosity command- Specified by:
createVerbosityCommand
in interfaceCommandFactory
- Returns:
-
createVersionCommand
public Command createVersionCommand(java.util.concurrent.CountDownLatch latch, java.net.InetSocketAddress server)
Description copied from interface:CommandFactory
create a version command- Specified by:
createVersionCommand
in interfaceCommandFactory
- Returns:
-
createQuitCommand
public Command createQuitCommand()
Description copied from interface:CommandFactory
create a quit command- Specified by:
createQuitCommand
in interfaceCommandFactory
- Returns:
-
getProtocol
public Protocol getProtocol()
Description copied from interface:CommandFactory
Get this client's protocol version- Specified by:
getProtocol
in interfaceCommandFactory
- Returns:
-
createAuthListMechanismsCommand
public Command createAuthListMechanismsCommand(java.util.concurrent.CountDownLatch latch)
Description copied from interface:CommandFactory
Create a command for listing authentication mechanisms- Specified by:
createAuthListMechanismsCommand
in interfaceCommandFactory
- Returns:
-
createAuthStartCommand
public Command createAuthStartCommand(java.lang.String mechanism, java.util.concurrent.CountDownLatch latch, byte[] authData)
Description copied from interface:CommandFactory
Create command for starting authentication- Specified by:
createAuthStartCommand
in interfaceCommandFactory
- Returns:
-
createAuthStepCommand
public Command createAuthStepCommand(java.lang.String mechanism, java.util.concurrent.CountDownLatch latch, byte[] authData)
Description copied from interface:CommandFactory
Create a command for stepping authentication- Specified by:
createAuthStepCommand
in interfaceCommandFactory
- Returns:
-
createGetAndTouchCommand
public Command createGetAndTouchCommand(java.lang.String key, byte[] keyBytes, java.util.concurrent.CountDownLatch latch, int exp, boolean noreply)
Description copied from interface:CommandFactory
Create a get-and-touch command- Specified by:
createGetAndTouchCommand
in interfaceCommandFactory
latch
- TODO- Returns:
-
createTouchCommand
public Command createTouchCommand(java.lang.String key, byte[] keyBytes, java.util.concurrent.CountDownLatch latch, int exp, boolean noreply)
Description copied from interface:CommandFactory
Create a touch command- Specified by:
createTouchCommand
in interfaceCommandFactory
latch
- TODO- Returns:
-
setBufferAllocator
public void setBufferAllocator(BufferAllocator bufferAllocator)
Description copied from interface:CommandFactory
set command factory's buffer allocator- Specified by:
setBufferAllocator
in interfaceCommandFactory
-
-