org.springframework.data.redis.connection.lettuce
Class LettuceConnection

java.lang.Object
  

extended by org.springframework.data.redis.connection.lettuce.LettuceConnection
All Implemented Interfaces:
RedisCommands, RedisConnection, RedisConnectionCommands, RedisHashCommands, RedisKeyCommands, RedisListCommands, RedisPubSubCommands, RedisScriptingCommands, RedisServerCommands, RedisSetCommands, RedisStringCommands, RedisTxCommands, RedisZSetCommands

public class LettuceConnection
extends Object
implements RedisConnection

RedisConnection implementation on top of Lettuce Redis client.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisStringCommands
RedisStringCommands.BitOperation
 
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisListCommands
RedisListCommands.Position
 
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisZSetCommands
RedisZSetCommands.Aggregate, RedisZSetCommands.Tuple
 
Nested classes/interfaces inherited from interface org.springframework.data.redis.connection.RedisServerCommands
RedisServerCommands.ShutdownOption
 
Constructor Summary
LettuceConnection(long timeout, com.lambdaworks.redis.RedisClient client)
          Instantiates a new lettuce connection.
LettuceConnection(long timeout, com.lambdaworks.redis.RedisClient client, LettucePool pool)
          Instantiates a new lettuce connection.
LettuceConnection(com.lambdaworks.redis.RedisAsyncConnection<byte[],byte[]> sharedConnection, long timeout, com.lambdaworks.redis.RedisClient client)
          Instantiates a new lettuce connection.
LettuceConnection(com.lambdaworks.redis.RedisAsyncConnection<byte[],byte[]> sharedConnection, long timeout, com.lambdaworks.redis.RedisClient client, LettucePool pool)
          Instantiates a new lettuce connection.
 
Method Summary
 Long append(byte[] key, byte[] value)
          Append a value to key.
 void bgReWriteAof()
          Start an Append Only File rewrite process on server.
 void bgSave()
          Start background saving of db on server.
 void bgWriteAof()
          Deprecated. As of 1.3, use bgReWriteAof().
 Long bitCount(byte[] key)
          Count the number of set bits (population counting) in value stored at key.
 Long bitCount(byte[] key, long begin, long end)
          Count the number of set bits (population counting) of value stored at key between begin and end.
 Long bitOp(RedisStringCommands.BitOperation op, byte[] destination, byte[]... keys)
          Perform bitwise operations between strings.
 List<byte[]> bLPop(int timeout, byte[]... keys)
          Removes and returns first element from lists stored at keys (see: RedisListCommands.lPop(byte[])).
 List<byte[]> bRPop(int timeout, byte[]... keys)
          Removes and returns last element from lists stored at keys (see: RedisListCommands.rPop(byte[])).
 byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey)
          Remove the last element from list at srcKey, append it to dstKey and return its value (see RedisListCommands.rPopLPush(byte[], byte[])).
 void close()
          Closes (or quits) the connection.
 List<Object> closePipeline()
          Executes the commands in the pipeline and returns their result.
protected  DataAccessException convertLettuceAccessException(Exception ex)
           
 Long dbSize()
          Get the total number of available keys in currently selected database.
 Long decr(byte[] key)
          Decrement value of key by 1.
 Long decrBy(byte[] key, long value)
          Increment value of key by value.
 Long del(byte[]... keys)
          Delete given keys.
 void discard()
          Discard all commands issued after RedisTxCommands.multi().
 byte[] dump(byte[] key)
          Retrieve serialized version of the value stored at key.
 byte[] echo(byte[] message)
          Returns message via server roundtrip.
<T> T
eval(byte[] script, ReturnType returnType, int numKeys, byte[]... keysAndArgs)
          Evaluate given script.
<T> T
evalSha(String scriptSha1, ReturnType returnType, int numKeys, byte[]... keysAndArgs)
          Evaluate given scriptSha.
 List<Object> exec()
          Executes all queued commands in a transaction started with RedisTxCommands.multi().
 Object execute(String command, byte[]... args)
          'Native' or 'raw' execution of the given command along-side the given arguments.
 Object execute(String command, com.lambdaworks.redis.protocol.CommandOutput commandOutputTypeHint, byte[]... args)
          'Native' or 'raw' execution of the given command along-side the given arguments.
 Boolean exists(byte[] key)
          Determine if given key exists.
 Boolean expire(byte[] key, long seconds)
          Set time to live for given key in seconds.
 Boolean expireAt(byte[] key, long unixTime)
          Set the expiration for given key as a UNIX timestamp.
 void flushAll()
          Delete all all keys from all databases.
 void flushDb()
          Delete all keys of the currently selected database.
 byte[] get(byte[] key)
          Get the value of key.
 Boolean getBit(byte[] key, long offset)
          Get the bit value at offset of value at key.
 List<RedisClientInfo> getClientList()
          Request information and statistics about connected clients.
 String getClientName()
          Returns the name of the current connection.
 List<String> getConfig(String param)
          Load configuration parameters for given pattern from server.
 com.lambdaworks.redis.RedisAsyncConnection<byte[],byte[]> getNativeConnection()
          Returns the native connection (the underlying library/driver object).
 byte[] getRange(byte[] key, long start, long end)
          Get a substring of value of key between begin and end.
 byte[] getSet(byte[] key, byte[] value)
          Set value of key and return its old value.
 Subscription getSubscription()
          Returns the current subscription for this connection or null if the connection is not subscribed.
 Long hDel(byte[] key, byte[]... fields)
          Delete given hash fields.
 Boolean hExists(byte[] key, byte[] field)
          Determine if given hash field exists.
 byte[] hGet(byte[] key, byte[] field)
          Get value for given field from hash at key.
 Map<byte[],byte[]> hGetAll(byte[] key)
          Get entire hash stored at key.
 Double hIncrBy(byte[] key, byte[] field, double delta)
          Increment value of a hash field by the given delta.
 Long hIncrBy(byte[] key, byte[] field, long delta)
          Increment value of a hash field by the given delta.
 Set<byte[]> hKeys(byte[] key)
          Get key set (fields) of hash at key.
 Long hLen(byte[] key)
          Get size of hash at key.
 List<byte[]> hMGet(byte[] key, byte[]... fields)
          Get values for given fields from hash at key.
 void hMSet(byte[] key, Map<byte[],byte[]> tuple)
          Set multiple hash fields to multiple values using data provided in hashes
 Boolean hSet(byte[] key, byte[] field, byte[] value)
          Set the value of a hash field.
 Boolean hSetNX(byte[] key, byte[] field, byte[] value)
          Set the value of a hash field only if field does not exist.
 List<byte[]> hVals(byte[] key)
          Get entry set (values) of hash at field.
 Long incr(byte[] key)
          Increment value of key by 1.
 Double incrBy(byte[] key, double value)
          Increment value of key by value.
 Long incrBy(byte[] key, long value)
          Increment value of key by value.
 Properties info()
          Load default server information like mempory cpu utilization replication
 Properties info(String section)
          Load server information for given selection.
 boolean isClosed()
          Indicates whether the underlying connection is closed or not.
 boolean isPipelined()
          Indicates whether the connection is currently pipelined or not.
 boolean isQueueing()
          Indicates whether the connection is in "queue"(or "MULTI") mode or not.
 boolean isSubscribed()
          Indicates whether the current connection is subscribed (to at least one channel) or not.
 Set<byte[]> keys(byte[] pattern)
          Find all keys matching the given pattern.
 void killClient(String host, int port)
          <<<<<<< HEAD Closes a given client connection identified by ip:port.
 Long lastSave()
          Get time of last RedisServerCommands.bgSave() operation in seconds.
 byte[] lIndex(byte[] key, long index)
          Get element at index form list at key.
 Long lInsert(byte[] key, RedisListCommands.Position where, byte[] pivot, byte[] value)
          Insert value RedisListCommands.Position.BEFORE or RedisListCommands.Position.AFTER existing pivot for key.
 Long lLen(byte[] key)
          Get the size of list stored at key.
 byte[] lPop(byte[] key)
          Removes and returns first element in list stored at key.
 Long lPush(byte[] key, byte[]... values)
          Prepend values to key.
 Long lPushX(byte[] key, byte[] value)
          Prepend values to key only if the list exits.
 List<byte[]> lRange(byte[] key, long start, long end)
          Get elements between begin and end from list at key.
 Long lRem(byte[] key, long count, byte[] value)
          Removes the first count occurrences of value from the list stored at key.
 void lSet(byte[] key, long index, byte[] value)
          Set the value list element at index.
 void lTrim(byte[] key, long start, long end)
          Trim list at key to elements between begin and end.
 List<byte[]> mGet(byte[]... keys)
          Get the values of all given keys.
 Boolean move(byte[] key, int dbIndex)
          Move given key to database with index.
 void mSet(Map<byte[],byte[]> tuples)
          Set multiple keys to multiple values using key-value pairs provided in tuple.
 Boolean mSetNX(Map<byte[],byte[]> tuples)
          Set multiple keys to multiple values using key-value pairs provided in tuple only if the provided key does not exist.
 void multi()
          Mark the start of a transaction block.
 void openPipeline()
          Activates the pipeline mode for this connection.
 Boolean persist(byte[] key)
          Remove the expiration from given key.
 Boolean pExpire(byte[] key, long millis)
          Set time to live for given key in milliseconds.
 Boolean pExpireAt(byte[] key, long unixTimeInMillis)
          Set the expiration for given key as a UNIX timestamp in milliseconds.
 String ping()
          Test connection.
 void pSetEx(byte[] key, long milliseconds, byte[] value)
          pSetEx is not directly supported and therefore emulated via lua script.
 void pSubscribe(MessageListener listener, byte[]... patterns)
          Subscribes the connection to all channels matching the given patterns.
 Long pTtl(byte[] key)
          Get the time to live for key in milliseconds.
 Long publish(byte[] channel, byte[] message)
          Publishes the given message to the given channel.
 byte[] randomKey()
          Return a random key from the keyspace.
 void rename(byte[] oldName, byte[] newName)
          Rename key oleName to newName.
 Boolean renameNX(byte[] oldName, byte[] newName)
          Rename key oleName to newName only if newName does not exist.
 void resetConfigStats()
          Reset statistic counters on server.
 void restore(byte[] key, long ttlInMillis, byte[] serializedValue)
          Create key using the serializedValue, previously obtained using RedisKeyCommands.dump(byte[]).
 byte[] rPop(byte[] key)
          Removes and returns last element in list stored at key.
 byte[] rPopLPush(byte[] srcKey, byte[] dstKey)
          Remove the last element from list at srcKey, append it to dstKey and return its value.
 Long rPush(byte[] key, byte[]... values)
          Append values to key.
 Long rPushX(byte[] key, byte[] value)
          Append values to key only if the list exists.
 Long sAdd(byte[] key, byte[]... values)
          Add given values to set at key.
 void save()
          Synchronous save current db snapshot on server.
 Long sCard(byte[] key)
          Get size of set at key.
 List<Boolean> scriptExists(String... scriptSha1)
          Check if given scriptShas exist in script cache.
 void scriptFlush()
          Flush lua script cache.
 void scriptKill()
          Kill current lua script execution.
 String scriptLoad(byte[] script)
          Load lua script into scripts cache, without executing it.
 Set<byte[]> sDiff(byte[]... keys)
          Diff all sets for given keys.
 Long sDiffStore(byte[] destKey, byte[]... keys)
          Diff all sets for given keys and store result in destKey
 void select(int dbIndex)
          Select the DB with given positive dbIndex.
 void set(byte[] key, byte[] value)
          Set value for key.
 Boolean setBit(byte[] key, long offset, boolean value)
          Sets the bit at offset in value stored at key.
 void setClientName(byte[] name)
          Assign given name to current connection.
 void setConfig(String param, String value)
          Set server configuration for key to value.
 void setConvertPipelineAndTxResults(boolean convertPipelineAndTxResults)
          Specifies if pipelined and transaction results should be converted to the expected data type.
 void setEx(byte[] key, long time, byte[] value)
          Set the value and expiration in seconds for key.
 Boolean setNX(byte[] key, byte[] value)
          Set value for key, only if key does not exist.
 void setRange(byte[] key, byte[] value, long start)
          Overwrite parts of key starting at the specified offset with given value.
 void shutdown()
          Shutdown server.
 void shutdown(RedisServerCommands.ShutdownOption option)
          Shutdown server.
 Set<byte[]> sInter(byte[]... keys)
          Returns the members intersecting all given sets at keys.
 Long sInterStore(byte[] destKey, byte[]... keys)
          Intersect all given sets at keys and store result in destKey.
 Boolean sIsMember(byte[] key, byte[] value)
          Check if set at key contains value.
 void slaveOf(String host, int port)
          Change redis replication setting to new master.
 void slaveOfNoOne()
          Change server into master.
 Set<byte[]> sMembers(byte[] key)
          Get all elements of set at key.
 Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value)
          Move value from srcKey to
 List<byte[]> sort(byte[] key, SortParameters params)
          Sort the elements for key.
 Long sort(byte[] key, SortParameters params, byte[] sortKey)
          Sort the elements for key and store result in storeKey.
 byte[] sPop(byte[] key)
          Remove and return a random member from set at key.
 byte[] sRandMember(byte[] key)
          Get random element from set at key.
 List<byte[]> sRandMember(byte[] key, long count)
          Get count random elements from set at key.
 Long sRem(byte[] key, byte[]... values)
          Remove given values from set at key and return the number of removed elements.
 Long strLen(byte[] key)
          Get the length of the value stored at key.
 void subscribe(MessageListener listener, byte[]... channels)
          Subscribes the connection to the given channels.
 Set<byte[]> sUnion(byte[]... keys)
          Union all sets at given keys.
 Long sUnionStore(byte[] destKey, byte[]... keys)
          Union all sets at given keys and store result in destKey.
 Long time()
          Request server timestamp using TIME command.
 Long ttl(byte[] key)
          Get the time to live for key in seconds.
 DataType type(byte[] key)
          Determine the type stored at key.
 void unwatch()
          Flushes all the previously #watch(byte[]) keys.
 void watch(byte[]... keys)
          Watch given keys for modifications during transaction started with RedisTxCommands.multi().
 Boolean zAdd(byte[] key, double score, byte[] value)
          Add value to a sorted set at key, or update its score if it already exists.
 Long zAdd(byte[] key, Set<RedisZSetCommands.Tuple> tuples)
          Add tuples to a sorted set at key, or update its score if it already exists.
 Long zCard(byte[] key)
          Get the size of sorted set with key.
 Long zCount(byte[] key, double min, double max)
          Count number of elements within sorted set with scores between min and max.
 Double zIncrBy(byte[] key, double increment, byte[] value)
          Increment the score of element with value in sorted set by increment.
 Long zInterStore(byte[] destKey, byte[]... sets)
          Intersect sorted sets and store result in destination key.
 Long zInterStore(byte[] destKey, RedisZSetCommands.Aggregate aggregate, int[] weights, byte[]... sets)
          Intersect sorted sets and store result in destination key.
 Set<byte[]> zRange(byte[] key, long start, long end)
          Get elements between begin and end from sorted set.
 Set<byte[]> zRangeByScore(byte[] key, double min, double max)
          Get elements where score is between min and max from sorted set.
 Set<byte[]> zRangeByScore(byte[] key, double min, double max, long offset, long count)
          Get elements in range from begin to end where score is between min and max from sorted set.
 Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key, double min, double max)
          Get set of RedisZSetCommands.Tuples where score is between min and max from sorted set.
 Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count)
          Get set of RedisZSetCommands.Tuples in range from begin to end where score is between min and max from sorted set.
 Set<RedisZSetCommands.Tuple> zRangeWithScores(byte[] key, long start, long end)
          Get set of RedisZSetCommands.Tuples between begin and end from sorted set.
 Long zRank(byte[] key, byte[] value)
          Determine the index of element with value in a sorted set.
 Long zRem(byte[] key, byte[]... values)
          Remove values from sorted set.
 Long zRemRange(byte[] key, long start, long end)
          Remove elements in range between begin and end from sorted set with key.
 Long zRemRangeByScore(byte[] key, double min, double max)
          Remove elements with scores between min and max from sorted set with key.
 Set<byte[]> zRevRange(byte[] key, long start, long end)
          Get elements in range from begin to end from sorted set ordered high -> low.
 Set<byte[]> zRevRangeByScore(byte[] key, double min, double max)
          Get elements where score is between min and max from sorted set ordered high -> low.
 Set<byte[]> zRevRangeByScore(byte[] key, double min, double max, long offset, long count)
          Get elements in range from begin to end where score is between min and max from sorted set ordered high -> low.
 Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key, double min, double max)
          Get set of RedisZSetCommands.Tuple where score is between min and max from sorted set ordered high -> low.
 Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count)
          Get set of RedisZSetCommands.Tuple in range from begin to end where score is between min and max from sorted set ordered high -> low.
 Set<RedisZSetCommands.Tuple> zRevRangeWithScores(byte[] key, long start, long end)
          Get set of RedisZSetCommands.Tuples in range from begin to end from sorted set ordered high -> low.
 Long zRevRank(byte[] key, byte[] value)
          Determine the index of element with value in a sorted set when scored high to low.
 Double zScore(byte[] key, byte[] value)
          Get the score of element with value from sorted set with key key.
 Long zUnionStore(byte[] destKey, byte[]... sets)
          Union sorted sets and store result in destination key.
 Long zUnionStore(byte[] destKey, RedisZSetCommands.Aggregate aggregate, int[] weights, byte[]... sets)
          Union sorted sets and store result in destination key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LettuceConnection

public LettuceConnection(long timeout,
                         com.lambdaworks.redis.RedisClient client)
Instantiates a new lettuce connection.

Parameters:
timeout - The connection timeout (in milliseconds)
client - The RedisClient to use when instantiating a native connection

LettuceConnection

public LettuceConnection(long timeout,
                         com.lambdaworks.redis.RedisClient client,
                         LettucePool pool)
Instantiates a new lettuce connection.

Parameters:
timeout - The connection timeout (in milliseconds) * @param client The RedisClient to use when instantiating a pub/sub connection
pool - The connection pool to use for all other native connections

LettuceConnection

public LettuceConnection(com.lambdaworks.redis.RedisAsyncConnection<byte[],byte[]> sharedConnection,
                         long timeout,
                         com.lambdaworks.redis.RedisClient client)
Instantiates a new lettuce connection.

Parameters:
sharedConnection - A native connection that is shared with other LettuceConnections. Will not be used for transactions or blocking operations
timeout - The connection timeout (in milliseconds)
client - The RedisClient to use when making pub/sub, blocking, and tx connections

LettuceConnection

public LettuceConnection(com.lambdaworks.redis.RedisAsyncConnection<byte[],byte[]> sharedConnection,
                         long timeout,
                         com.lambdaworks.redis.RedisClient client,
                         LettucePool pool)
Instantiates a new lettuce connection.

Parameters:
sharedConnection - A native connection that is shared with other LettuceConnections. Should not be used for transactions or blocking operations
timeout - The connection timeout (in milliseconds)
client - The RedisClient to use when making pub/sub connections
pool - The connection pool to use for blocking and tx operations
Method Detail

convertLettuceAccessException

protected DataAccessException convertLettuceAccessException(Exception ex)

execute

public Object execute(String command,
                      byte[]... args)
Description copied from interface: RedisCommands
'Native' or 'raw' execution of the given command along-side the given arguments. The command is executed as is, with as little 'interpretation' as possible - it is up to the caller to take care of any processing of arguments or the result.

Specified by:
execute in interface RedisCommands
Parameters:
command - Command to execute
args - Possible command arguments (may be null)
Returns:
execution result.

execute

public Object execute(String command,
                      com.lambdaworks.redis.protocol.CommandOutput commandOutputTypeHint,
                      byte[]... args)
'Native' or 'raw' execution of the given command along-side the given arguments.

Parameters:
command - Command to execute
commandOutputTypeHint - Type of Output to use, may be (may be null).
args - Possible command arguments (may be null)
Returns:
execution result.
See Also:
RedisCommands#execute(String, byte[]...)

close

public void close()
           throws DataAccessException
Description copied from interface: RedisConnection
Closes (or quits) the connection.

Specified by:
close in interface RedisConnection
Throws:
DataAccessException

isClosed

public boolean isClosed()
Description copied from interface: RedisConnection
Indicates whether the underlying connection is closed or not.

Specified by:
isClosed in interface RedisConnection
Returns:
true if the connection is closed, false otherwise.

getNativeConnection

public com.lambdaworks.redis.RedisAsyncConnection<byte[],byte[]> getNativeConnection()
Description copied from interface: RedisConnection
Returns the native connection (the underlying library/driver object).

Specified by:
getNativeConnection in interface RedisConnection
Returns:
underlying, native object

isQueueing

public boolean isQueueing()
Description copied from interface: RedisConnection
Indicates whether the connection is in "queue"(or "MULTI") mode or not. When queueing, all commands are postponed until EXEC or DISCARD commands are issued. Since in queueing no results are returned, the connection will return NULL on all operations that interact with the data.

Specified by:
isQueueing in interface RedisConnection
Returns:
true if the connection is in queue/MULTI mode, false otherwise

isPipelined

public boolean isPipelined()
Description copied from interface: RedisConnection
Indicates whether the connection is currently pipelined or not.

Specified by:
isPipelined in interface RedisConnection
Returns:
true if the connection is pipelined, false otherwise
See Also:
RedisConnection.openPipeline(), RedisConnection.isQueueing()

openPipeline

public void openPipeline()
Description copied from interface: RedisConnection
Activates the pipeline mode for this connection. When pipelined, all commands return null (the reply is read at the end through RedisConnection.closePipeline(). Calling this method when the connection is already pipelined has no effect. Pipelining is used for issuing commands without requesting the response right away but rather at the end of the batch. While somewhat similar to MULTI, pipelining does not guarantee atomicity - it only tries to improve performance when issuing a lot of commands (such as in batching scenarios).

Note:

Consider doing some performance testing before using this feature since in many cases the performance benefits are minimal yet the impact on usage are not.

Specified by:
openPipeline in interface RedisConnection
See Also:
RedisTxCommands.multi()

closePipeline

public List<Object> closePipeline()
Description copied from interface: RedisConnection
Executes the commands in the pipeline and returns their result. If the connection is not pipelined, an empty collection is returned.

Specified by:
closePipeline in interface RedisConnection
Returns:
the result of the executed commands.

sort

public List<byte[]> sort(byte[] key,
                         SortParameters params)
Description copied from interface: RedisKeyCommands
Sort the elements for key.

Specified by:
sort in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/sort

sort

public Long sort(byte[] key,
                 SortParameters params,
                 byte[] sortKey)
Description copied from interface: RedisKeyCommands
Sort the elements for key and store result in storeKey.

Specified by:
sort in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/sort

dbSize

public Long dbSize()
Description copied from interface: RedisServerCommands
Get the total number of available keys in currently selected database.

Specified by:
dbSize in interface RedisServerCommands
Returns:
See Also:
http://redis.io/commands/dbsize

flushDb

public void flushDb()
Description copied from interface: RedisServerCommands
Delete all keys of the currently selected database.

Specified by:
flushDb in interface RedisServerCommands
See Also:
http://redis.io/commands/flushdb

flushAll

public void flushAll()
Description copied from interface: RedisServerCommands
Delete all all keys from all databases.

Specified by:
flushAll in interface RedisServerCommands
See Also:
http://redis.io/commands/flushall

bgSave

public void bgSave()
Description copied from interface: RedisServerCommands
Start background saving of db on server.

Specified by:
bgSave in interface RedisServerCommands
See Also:
http://redis.io/commands/bgsave

bgReWriteAof

public void bgReWriteAof()
Description copied from interface: RedisServerCommands
Start an Append Only File rewrite process on server.

Specified by:
bgReWriteAof in interface RedisServerCommands
See Also:
http://redis.io/commands/bgrewriteaof

bgWriteAof

@Deprecated
public void bgWriteAof()
Deprecated. As of 1.3, use bgReWriteAof().

Description copied from interface: RedisServerCommands
Start an Append Only File rewrite process on server.

Specified by:
bgWriteAof in interface RedisServerCommands
See Also:
http://redis.io/commands/bgrewriteaof

save

public void save()
Description copied from interface: RedisServerCommands
Synchronous save current db snapshot on server.

Specified by:
save in interface RedisServerCommands
See Also:
http://redis.io/commands/save

getConfig

public List<String> getConfig(String param)
Description copied from interface: RedisServerCommands
Load configuration parameters for given pattern from server.

Specified by:
getConfig in interface RedisServerCommands
Returns:
See Also:
http://redis.io/commands/config-get

info

public Properties info()
Description copied from interface: RedisServerCommands
Load default server information like

Specified by:
info in interface RedisServerCommands
Returns:
See Also:
http://redis.io/commands/info

info

public Properties info(String section)
Description copied from interface: RedisServerCommands
Load server information for given selection.

Specified by:
info in interface RedisServerCommands
Returns:
See Also:
http://redis.io/commands/info

lastSave

public Long lastSave()
Description copied from interface: RedisServerCommands
Get time of last RedisServerCommands.bgSave() operation in seconds.

Specified by:
lastSave in interface RedisServerCommands
Returns:
See Also:
http://redis.io/commands/lastsave

setConfig

public void setConfig(String param,
                      String value)
Description copied from interface: RedisServerCommands
Set server configuration for key to value.

Specified by:
setConfig in interface RedisServerCommands
See Also:
http://redis.io/commands/config-set

resetConfigStats

public void resetConfigStats()
Description copied from interface: RedisServerCommands
Reset statistic counters on server.
Counters can be retrieved using RedisServerCommands.info().

Specified by:
resetConfigStats in interface RedisServerCommands
See Also:
http://redis.io/commands/config-resetstat

shutdown

public void shutdown()
Description copied from interface: RedisServerCommands
Shutdown server.

Specified by:
shutdown in interface RedisServerCommands
See Also:
http://redis.io/commands/shutdown

shutdown

public void shutdown(RedisServerCommands.ShutdownOption option)
Description copied from interface: RedisServerCommands
Shutdown server.

Specified by:
shutdown in interface RedisServerCommands
See Also:
http://redis.io/commands/shutdown

echo

public byte[] echo(byte[] message)
Description copied from interface: RedisConnectionCommands
Returns message via server roundtrip.

Specified by:
echo in interface RedisConnectionCommands
Returns:
See Also:
http://redis.io/commands/echo

ping

public String ping()
Description copied from interface: RedisConnectionCommands
Test connection.

Specified by:
ping in interface RedisConnectionCommands
Returns:
Server response message - usually PONG.
See Also:
http://redis.io/commands/ping

del

public Long del(byte[]... keys)
Description copied from interface: RedisKeyCommands
Delete given keys.

Specified by:
del in interface RedisKeyCommands
Returns:
The number of keys that were removed.
See Also:
http://redis.io/commands/del

discard

public void discard()
Description copied from interface: RedisTxCommands
Discard all commands issued after RedisTxCommands.multi().

Specified by:
discard in interface RedisTxCommands
See Also:
http://redis.io/commands/discard

exec

public List<Object> exec()
Description copied from interface: RedisTxCommands
Executes all queued commands in a transaction started with RedisTxCommands.multi().
If used along with #watch(byte[]) the operation will fail if any of watched keys has been modified.

Specified by:
exec in interface RedisTxCommands
Returns:
List of replies for each executed command.
See Also:
http://redis.io/commands/exec

exists

public Boolean exists(byte[] key)
Description copied from interface: RedisKeyCommands
Determine if given key exists.

Specified by:
exists in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/exists

expire

public Boolean expire(byte[] key,
                      long seconds)
Description copied from interface: RedisKeyCommands
Set time to live for given key in seconds.

Specified by:
expire in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/expire

expireAt

public Boolean expireAt(byte[] key,
                        long unixTime)
Description copied from interface: RedisKeyCommands
Set the expiration for given key as a UNIX timestamp.

Specified by:
expireAt in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/expireat

pExpire

public Boolean pExpire(byte[] key,
                       long millis)
Description copied from interface: RedisKeyCommands
Set time to live for given key in milliseconds.

Specified by:
pExpire in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/pexpire

pExpireAt

public Boolean pExpireAt(byte[] key,
                         long unixTimeInMillis)
Description copied from interface: RedisKeyCommands
Set the expiration for given key as a UNIX timestamp in milliseconds.

Specified by:
pExpireAt in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/pexpireat

pTtl

public Long pTtl(byte[] key)
Description copied from interface: RedisKeyCommands
Get the time to live for key in milliseconds.

Specified by:
pTtl in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/pttl

dump

public byte[] dump(byte[] key)
Description copied from interface: RedisKeyCommands
Retrieve serialized version of the value stored at key.

Specified by:
dump in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/dump

restore

public void restore(byte[] key,
                    long ttlInMillis,
                    byte[] serializedValue)
Description copied from interface: RedisKeyCommands
Create key using the serializedValue, previously obtained using RedisKeyCommands.dump(byte[]).

Specified by:
restore in interface RedisKeyCommands
See Also:
http://redis.io/commands/restore

keys

public Set<byte[]> keys(byte[] pattern)
Description copied from interface: RedisKeyCommands
Find all keys matching the given pattern.

Specified by:
keys in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/keys

multi

public void multi()
Description copied from interface: RedisTxCommands
Mark the start of a transaction block.
Commands will be queued and can then be executed by calling RedisTxCommands.exec() or rolled back using RedisTxCommands.discard() .

Specified by:
multi in interface RedisTxCommands
See Also:
http://redis.io/commands/multi

persist

public Boolean persist(byte[] key)
Description copied from interface: RedisKeyCommands
Remove the expiration from given key.

Specified by:
persist in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/persist

move

public Boolean move(byte[] key,
                    int dbIndex)
Description copied from interface: RedisKeyCommands
Move given key to database with index.

Specified by:
move in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/move

randomKey

public byte[] randomKey()
Description copied from interface: RedisKeyCommands
Return a random key from the keyspace.

Specified by:
randomKey in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/randomkey

rename

public void rename(byte[] oldName,
                   byte[] newName)
Description copied from interface: RedisKeyCommands
Rename key oleName to newName.

Specified by:
rename in interface RedisKeyCommands
See Also:
http://redis.io/commands/rename

renameNX

public Boolean renameNX(byte[] oldName,
                        byte[] newName)
Description copied from interface: RedisKeyCommands
Rename key oleName to newName only if newName does not exist.

Specified by:
renameNX in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/renamenx

select

public void select(int dbIndex)
Description copied from interface: RedisConnectionCommands
Select the DB with given positive dbIndex.

Specified by:
select in interface RedisConnectionCommands
See Also:
http://redis.io/commands/select

ttl

public Long ttl(byte[] key)
Description copied from interface: RedisKeyCommands
Get the time to live for key in seconds.

Specified by:
ttl in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/ttl

type

public DataType type(byte[] key)
Description copied from interface: RedisKeyCommands
Determine the type stored at key.

Specified by:
type in interface RedisKeyCommands
Returns:
See Also:
http://redis.io/commands/type

unwatch

public void unwatch()
Description copied from interface: RedisTxCommands
Flushes all the previously #watch(byte[]) keys.

Specified by:
unwatch in interface RedisTxCommands
See Also:
http://redis.io/commands/unwatch

watch

public void watch(byte[]... keys)
Description copied from interface: RedisTxCommands
Watch given keys for modifications during transaction started with RedisTxCommands.multi().

Specified by:
watch in interface RedisTxCommands
See Also:
http://redis.io/commands/watch

get

public byte[] get(byte[] key)
Description copied from interface: RedisStringCommands
Get the value of key.

Specified by:
get in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/get

set

public void set(byte[] key,
                byte[] value)
Description copied from interface: RedisStringCommands
Set value for key.

Specified by:
set in interface RedisStringCommands
See Also:
http://redis.io/commands/set

getSet

public byte[] getSet(byte[] key,
                     byte[] value)
Description copied from interface: RedisStringCommands
Set value of key and return its old value.

Specified by:
getSet in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/getset

append

public Long append(byte[] key,
                   byte[] value)
Description copied from interface: RedisStringCommands
Append a value to key.

Specified by:
append in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/append

mGet

public List<byte[]> mGet(byte[]... keys)
Description copied from interface: RedisStringCommands
Get the values of all given keys.

Specified by:
mGet in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/mget

mSet

public void mSet(Map<byte[],byte[]> tuples)
Description copied from interface: RedisStringCommands
Set multiple keys to multiple values using key-value pairs provided in tuple.

Specified by:
mSet in interface RedisStringCommands
See Also:
http://redis.io/commands/mset

mSetNX

public Boolean mSetNX(Map<byte[],byte[]> tuples)
Description copied from interface: RedisStringCommands
Set multiple keys to multiple values using key-value pairs provided in tuple only if the provided key does not exist.

Specified by:
mSetNX in interface RedisStringCommands
See Also:
http://redis.io/commands/msetnx

setEx

public void setEx(byte[] key,
                  long time,
                  byte[] value)
Description copied from interface: RedisStringCommands
Set the value and expiration in seconds for key.

Specified by:
setEx in interface RedisStringCommands
See Also:
http://redis.io/commands/setex

pSetEx

public void pSetEx(byte[] key,
                   long milliseconds,
                   byte[] value)
pSetEx is not directly supported and therefore emulated via lua script.

Specified by:
pSetEx in interface RedisStringCommands
Since:
1.3
See Also:
RedisStringCommands.pSetEx(byte[], long, byte[])

setNX

public Boolean setNX(byte[] key,
                     byte[] value)
Description copied from interface: RedisStringCommands
Set value for key, only if key does not exist.

Specified by:
setNX in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/setnx

getRange

public byte[] getRange(byte[] key,
                       long start,
                       long end)
Description copied from interface: RedisStringCommands
Get a substring of value of key between begin and end.

Specified by:
getRange in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/getrange

decr

public Long decr(byte[] key)
Description copied from interface: RedisStringCommands
Decrement value of key by 1.

Specified by:
decr in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/decr

decrBy

public Long decrBy(byte[] key,
                   long value)
Description copied from interface: RedisStringCommands
Increment value of key by value.

Specified by:
decrBy in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/decrby

incr

public Long incr(byte[] key)
Description copied from interface: RedisStringCommands
Increment value of key by 1.

Specified by:
incr in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/incr

incrBy

public Long incrBy(byte[] key,
                   long value)
Description copied from interface: RedisStringCommands
Increment value of key by value.

Specified by:
incrBy in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/incrby

incrBy

public Double incrBy(byte[] key,
                     double value)
Description copied from interface: RedisStringCommands
Increment value of key by value.

Specified by:
incrBy in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/incrbyfloat

getBit

public Boolean getBit(byte[] key,
                      long offset)
Description copied from interface: RedisStringCommands
Get the bit value at offset of value at key.

Specified by:
getBit in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/getbit

setBit

public Boolean setBit(byte[] key,
                      long offset,
                      boolean value)
Description copied from interface: RedisStringCommands
Sets the bit at offset in value stored at key.

Specified by:
setBit in interface RedisStringCommands
Returns:
the original bit value stored at offset.
See Also:
http://redis.io/commands/setbit

setRange

public void setRange(byte[] key,
                     byte[] value,
                     long start)
Description copied from interface: RedisStringCommands
Overwrite parts of key starting at the specified offset with given value.

Specified by:
setRange in interface RedisStringCommands
See Also:
http://redis.io/commands/setrange

strLen

public Long strLen(byte[] key)
Description copied from interface: RedisStringCommands
Get the length of the value stored at key.

Specified by:
strLen in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/strlen

bitCount

public Long bitCount(byte[] key)
Description copied from interface: RedisStringCommands
Count the number of set bits (population counting) in value stored at key.

Specified by:
bitCount in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/bitcount

bitCount

public Long bitCount(byte[] key,
                     long begin,
                     long end)
Description copied from interface: RedisStringCommands
Count the number of set bits (population counting) of value stored at key between begin and end.

Specified by:
bitCount in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/bitcount

bitOp

public Long bitOp(RedisStringCommands.BitOperation op,
                  byte[] destination,
                  byte[]... keys)
Description copied from interface: RedisStringCommands
Perform bitwise operations between strings.

Specified by:
bitOp in interface RedisStringCommands
Returns:
See Also:
http://redis.io/commands/bitop

lPush

public Long lPush(byte[] key,
                  byte[]... values)
Description copied from interface: RedisListCommands
Prepend values to key.

Specified by:
lPush in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/lpush

rPush

public Long rPush(byte[] key,
                  byte[]... values)
Description copied from interface: RedisListCommands
Append values to key.

Specified by:
rPush in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/rpush

bLPop

public List<byte[]> bLPop(int timeout,
                          byte[]... keys)
Description copied from interface: RedisListCommands
Removes and returns first element from lists stored at keys (see: RedisListCommands.lPop(byte[])).
Blocks connection until element available or timeout reached.

Specified by:
bLPop in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/blpop

bRPop

public List<byte[]> bRPop(int timeout,
                          byte[]... keys)
Description copied from interface: RedisListCommands
Removes and returns last element from lists stored at keys (see: RedisListCommands.rPop(byte[])).
Blocks connection until element available or timeout reached.

Specified by:
bRPop in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/brpop

lIndex

public byte[] lIndex(byte[] key,
                     long index)
Description copied from interface: RedisListCommands
Get element at index form list at key.

Specified by:
lIndex in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/lindex

lInsert

public Long lInsert(byte[] key,
                    RedisListCommands.Position where,
                    byte[] pivot,
                    byte[] value)
Description copied from interface: RedisListCommands
Insert value RedisListCommands.Position.BEFORE or RedisListCommands.Position.AFTER existing pivot for key.

Specified by:
lInsert in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/linsert

lLen

public Long lLen(byte[] key)
Description copied from interface: RedisListCommands
Get the size of list stored at key.

Specified by:
lLen in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/llen

lPop

public byte[] lPop(byte[] key)
Description copied from interface: RedisListCommands
Removes and returns first element in list stored at key.

Specified by:
lPop in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/lpop

lRange

public List<byte[]> lRange(byte[] key,
                           long start,
                           long end)
Description copied from interface: RedisListCommands
Get elements between begin and end from list at key.

Specified by:
lRange in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/lrange

lRem

public Long lRem(byte[] key,
                 long count,
                 byte[] value)
Description copied from interface: RedisListCommands
Removes the first count occurrences of value from the list stored at key.

Specified by:
lRem in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/lrem

lSet

public void lSet(byte[] key,
                 long index,
                 byte[] value)
Description copied from interface: RedisListCommands
Set the value list element at index.

Specified by:
lSet in interface RedisListCommands
See Also:
http://redis.io/commands/lset

lTrim

public void lTrim(byte[] key,
                  long start,
                  long end)
Description copied from interface: RedisListCommands
Trim list at key to elements between begin and end.

Specified by:
lTrim in interface RedisListCommands
See Also:
http://redis.io/commands/ltrim

rPop

public byte[] rPop(byte[] key)
Description copied from interface: RedisListCommands
Removes and returns last element in list stored at key.

Specified by:
rPop in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/rpop

rPopLPush

public byte[] rPopLPush(byte[] srcKey,
                        byte[] dstKey)
Description copied from interface: RedisListCommands
Remove the last element from list at srcKey, append it to dstKey and return its value.

Specified by:
rPopLPush in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/rpoplpush

bRPopLPush

public byte[] bRPopLPush(int timeout,
                         byte[] srcKey,
                         byte[] dstKey)
Description copied from interface: RedisListCommands
Remove the last element from list at srcKey, append it to dstKey and return its value (see RedisListCommands.rPopLPush(byte[], byte[])).
Blocks connection until element available or timeout reached.

Specified by:
bRPopLPush in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/brpoplpush

lPushX

public Long lPushX(byte[] key,
                   byte[] value)
Description copied from interface: RedisListCommands
Prepend values to key only if the list exits.

Specified by:
lPushX in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/lpushx

rPushX

public Long rPushX(byte[] key,
                   byte[] value)
Description copied from interface: RedisListCommands
Append values to key only if the list exists.

Specified by:
rPushX in interface RedisListCommands
Returns:
See Also:
http://redis.io/commands/rpushx

sAdd

public Long sAdd(byte[] key,
                 byte[]... values)
Description copied from interface: RedisSetCommands
Add given values to set at key.

Specified by:
sAdd in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/sadd

sCard

public Long sCard(byte[] key)
Description copied from interface: RedisSetCommands
Get size of set at key.

Specified by:
sCard in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/scard

sDiff

public Set<byte[]> sDiff(byte[]... keys)
Description copied from interface: RedisSetCommands
Diff all sets for given keys.

Specified by:
sDiff in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/sdiff

sDiffStore

public Long sDiffStore(byte[] destKey,
                       byte[]... keys)
Description copied from interface: RedisSetCommands
Diff all sets for given keys and store result in destKey

Specified by:
sDiffStore in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/sdiffstore

sInter

public Set<byte[]> sInter(byte[]... keys)
Description copied from interface: RedisSetCommands
Returns the members intersecting all given sets at keys.

Specified by:
sInter in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/sinter

sInterStore

public Long sInterStore(byte[] destKey,
                        byte[]... keys)
Description copied from interface: RedisSetCommands
Intersect all given sets at keys and store result in destKey.

Specified by:
sInterStore in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/sinterstore

sIsMember

public Boolean sIsMember(byte[] key,
                         byte[] value)
Description copied from interface: RedisSetCommands
Check if set at key contains value.

Specified by:
sIsMember in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/sismember

sMembers

public Set<byte[]> sMembers(byte[] key)
Description copied from interface: RedisSetCommands
Get all elements of set at key.

Specified by:
sMembers in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/smembers

sMove

public Boolean sMove(byte[] srcKey,
                     byte[] destKey,
                     byte[] value)
Description copied from interface: RedisSetCommands
Move value from srcKey to

Specified by:
sMove in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/smove

sPop

public byte[] sPop(byte[] key)
Description copied from interface: RedisSetCommands
Remove and return a random member from set at key.

Specified by:
sPop in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/spop

sRandMember

public byte[] sRandMember(byte[] key)
Description copied from interface: RedisSetCommands
Get random element from set at key.

Specified by:
sRandMember in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/srandmember

sRandMember

public List<byte[]> sRandMember(byte[] key,
                                long count)
Description copied from interface: RedisSetCommands
Get count random elements from set at key.

Specified by:
sRandMember in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/srandmember

sRem

public Long sRem(byte[] key,
                 byte[]... values)
Description copied from interface: RedisSetCommands
Remove given values from set at key and return the number of removed elements.

Specified by:
sRem in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/srem

sUnion

public Set<byte[]> sUnion(byte[]... keys)
Description copied from interface: RedisSetCommands
Union all sets at given keys.

Specified by:
sUnion in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/sunion

sUnionStore

public Long sUnionStore(byte[] destKey,
                        byte[]... keys)
Description copied from interface: RedisSetCommands
Union all sets at given keys and store result in destKey.

Specified by:
sUnionStore in interface RedisSetCommands
Returns:
See Also:
http://redis.io/commands/sunionstore

zAdd

public Boolean zAdd(byte[] key,
                    double score,
                    byte[] value)
Description copied from interface: RedisZSetCommands
Add value to a sorted set at key, or update its score if it already exists.

Specified by:
zAdd in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zadd

zAdd

public Long zAdd(byte[] key,
                 Set<RedisZSetCommands.Tuple> tuples)
Description copied from interface: RedisZSetCommands
Add tuples to a sorted set at key, or update its score if it already exists.

Specified by:
zAdd in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zadd

zCard

public Long zCard(byte[] key)
Description copied from interface: RedisZSetCommands
Get the size of sorted set with key.

Specified by:
zCard in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zcard

zCount

public Long zCount(byte[] key,
                   double min,
                   double max)
Description copied from interface: RedisZSetCommands
Count number of elements within sorted set with scores between min and max.

Specified by:
zCount in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zcount

zIncrBy

public Double zIncrBy(byte[] key,
                      double increment,
                      byte[] value)
Description copied from interface: RedisZSetCommands
Increment the score of element with value in sorted set by increment.

Specified by:
zIncrBy in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zincrby

zInterStore

public Long zInterStore(byte[] destKey,
                        RedisZSetCommands.Aggregate aggregate,
                        int[] weights,
                        byte[]... sets)
Description copied from interface: RedisZSetCommands
Intersect sorted sets and store result in destination key.

Specified by:
zInterStore in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zinterstore

zInterStore

public Long zInterStore(byte[] destKey,
                        byte[]... sets)
Description copied from interface: RedisZSetCommands
Intersect sorted sets and store result in destination key.

Specified by:
zInterStore in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zinterstore

zRange

public Set<byte[]> zRange(byte[] key,
                          long start,
                          long end)
Description copied from interface: RedisZSetCommands
Get elements between begin and end from sorted set.

Specified by:
zRange in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrange

zRangeWithScores

public Set<RedisZSetCommands.Tuple> zRangeWithScores(byte[] key,
                                                     long start,
                                                     long end)
Description copied from interface: RedisZSetCommands
Get set of RedisZSetCommands.Tuples between begin and end from sorted set.

Specified by:
zRangeWithScores in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrange

zRangeByScore

public Set<byte[]> zRangeByScore(byte[] key,
                                 double min,
                                 double max)
Description copied from interface: RedisZSetCommands
Get elements where score is between min and max from sorted set.

Specified by:
zRangeByScore in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrangebyscore

zRangeByScoreWithScores

public Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key,
                                                            double min,
                                                            double max)
Description copied from interface: RedisZSetCommands
Get set of RedisZSetCommands.Tuples where score is between min and max from sorted set.

Specified by:
zRangeByScoreWithScores in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrangebyscore

zRevRangeWithScores

public Set<RedisZSetCommands.Tuple> zRevRangeWithScores(byte[] key,
                                                        long start,
                                                        long end)
Description copied from interface: RedisZSetCommands
Get set of RedisZSetCommands.Tuples in range from begin to end from sorted set ordered high -> low.

Specified by:
zRevRangeWithScores in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrevrange

zRangeByScore

public Set<byte[]> zRangeByScore(byte[] key,
                                 double min,
                                 double max,
                                 long offset,
                                 long count)
Description copied from interface: RedisZSetCommands
Get elements in range from begin to end where score is between min and max from sorted set.

Specified by:
zRangeByScore in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrangebyscore

zRangeByScoreWithScores

public Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key,
                                                            double min,
                                                            double max,
                                                            long offset,
                                                            long count)
Description copied from interface: RedisZSetCommands
Get set of RedisZSetCommands.Tuples in range from begin to end where score is between min and max from sorted set.

Specified by:
zRangeByScoreWithScores in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrangebyscore

zRevRangeByScore

public Set<byte[]> zRevRangeByScore(byte[] key,
                                    double min,
                                    double max,
                                    long offset,
                                    long count)
Description copied from interface: RedisZSetCommands
Get elements in range from begin to end where score is between min and max from sorted set ordered high -> low.

Specified by:
zRevRangeByScore in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrevrangebyscore

zRevRangeByScore

public Set<byte[]> zRevRangeByScore(byte[] key,
                                    double min,
                                    double max)
Description copied from interface: RedisZSetCommands
Get elements where score is between min and max from sorted set ordered high -> low.

Specified by:
zRevRangeByScore in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrevrange

zRevRangeByScoreWithScores

public Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key,
                                                               double min,
                                                               double max,
                                                               long offset,
                                                               long count)
Description copied from interface: RedisZSetCommands
Get set of RedisZSetCommands.Tuple in range from begin to end where score is between min and max from sorted set ordered high -> low.

Specified by:
zRevRangeByScoreWithScores in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrevrangebyscore

zRevRangeByScoreWithScores

public Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key,
                                                               double min,
                                                               double max)
Description copied from interface: RedisZSetCommands
Get set of RedisZSetCommands.Tuple where score is between min and max from sorted set ordered high -> low.

Specified by:
zRevRangeByScoreWithScores in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrevrange

zRank

public Long zRank(byte[] key,
                  byte[] value)
Description copied from interface: RedisZSetCommands
Determine the index of element with value in a sorted set.

Specified by:
zRank in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrank

zRem

public Long zRem(byte[] key,
                 byte[]... values)
Description copied from interface: RedisZSetCommands
Remove values from sorted set. Return number of removed elements.

Specified by:
zRem in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrem

zRemRange

public Long zRemRange(byte[] key,
                      long start,
                      long end)
Description copied from interface: RedisZSetCommands
Remove elements in range between begin and end from sorted set with key.

Specified by:
zRemRange in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zremrange

zRemRangeByScore

public Long zRemRangeByScore(byte[] key,
                             double min,
                             double max)
Description copied from interface: RedisZSetCommands
Remove elements with scores between min and max from sorted set with key.

Specified by:
zRemRangeByScore in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zremrangebyscore

zRevRange

public Set<byte[]> zRevRange(byte[] key,
                             long start,
                             long end)
Description copied from interface: RedisZSetCommands
Get elements in range from begin to end from sorted set ordered high -> low.

Specified by:
zRevRange in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrevrange

zRevRank

public Long zRevRank(byte[] key,
                     byte[] value)
Description copied from interface: RedisZSetCommands
Determine the index of element with value in a sorted set when scored high to low.

Specified by:
zRevRank in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrevrank

zScore

public Double zScore(byte[] key,
                     byte[] value)
Description copied from interface: RedisZSetCommands
Get the score of element with value from sorted set with key key.

Specified by:
zScore in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zrem

zUnionStore

public Long zUnionStore(byte[] destKey,
                        RedisZSetCommands.Aggregate aggregate,
                        int[] weights,
                        byte[]... sets)
Description copied from interface: RedisZSetCommands
Union sorted sets and store result in destination key.

Specified by:
zUnionStore in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zunionstore

zUnionStore

public Long zUnionStore(byte[] destKey,
                        byte[]... sets)
Description copied from interface: RedisZSetCommands
Union sorted sets and store result in destination key.

Specified by:
zUnionStore in interface RedisZSetCommands
Returns:
See Also:
http://redis.io/commands/zunionstore

hSet

public Boolean hSet(byte[] key,
                    byte[] field,
                    byte[] value)
Description copied from interface: RedisHashCommands
Set the value of a hash field.

Specified by:
hSet in interface RedisHashCommands
Returns:
See Also:
http://redis.io/commands/hset

hSetNX

public Boolean hSetNX(byte[] key,
                      byte[] field,
                      byte[] value)
Description copied from interface: RedisHashCommands
Set the value of a hash field only if field does not exist.

Specified by:
hSetNX in interface RedisHashCommands
Returns:
See Also:
http://redis.io/commands/hsetnx

hDel

public Long hDel(byte[] key,
                 byte[]... fields)
Description copied from interface: RedisHashCommands
Delete given hash fields.

Specified by:
hDel in interface RedisHashCommands
Returns:
See Also:
http://redis.io/commands/hdel

hExists

public Boolean hExists(byte[] key,
                       byte[] field)
Description copied from interface: RedisHashCommands
Determine if given hash field exists.

Specified by:
hExists in interface RedisHashCommands
Returns:
See Also:
http://redis.io/commands/hexits

hGet

public byte[] hGet(byte[] key,
                   byte[] field)
Description copied from interface: RedisHashCommands
Get value for given field from hash at key.

Specified by:
hGet in interface RedisHashCommands
Returns:
See Also:
http://redis.io/commands/hget

hGetAll

public Map<byte[],byte[]> hGetAll(byte[] key)
Description copied from interface: RedisHashCommands
Get entire hash stored at key.

Specified by:
hGetAll in interface RedisHashCommands
Returns:
See Also:
http://redis.io/commands/hgetall

hIncrBy

public Long hIncrBy(byte[] key,
                    byte[] field,
                    long delta)
Description copied from interface: RedisHashCommands
Increment value of a hash field by the given delta.

Specified by:
hIncrBy in interface RedisHashCommands
Returns:
See Also:
http://redis.io/commands/hincrby

hIncrBy

public Double hIncrBy(byte[] key,
                      byte[] field,
                      double delta)
Description copied from interface: RedisHashCommands
Increment value of a hash field by the given delta.

Specified by:
hIncrBy in interface RedisHashCommands
Returns:
See Also:
http://redis.io/commands/hincrbyfloat

hKeys

public Set<byte[]> hKeys(byte[] key)
Description copied from interface: RedisHashCommands
Get key set (fields) of hash at key.

Specified by:
hKeys in interface RedisHashCommands
Returns:
See Also:
http://redis.io/commands/h?

hLen

public Long hLen(byte[] key)
Description copied from interface: RedisHashCommands
Get size of hash at key.

Specified by:
hLen in interface RedisHashCommands
Returns:
See Also:
http://redis.io/commands/hlen

hMGet

public List<byte[]> hMGet(byte[] key,
                          byte[]... fields)
Description copied from interface: RedisHashCommands
Get values for given fields from hash at key.

Specified by:
hMGet in interface RedisHashCommands
Returns:
See Also:
http://redis.io/commands/hmget

hMSet

public void hMSet(byte[] key,
                  Map<byte[],byte[]> tuple)
Description copied from interface: RedisHashCommands
Set multiple hash fields to multiple values using data provided in hashes

Specified by:
hMSet in interface RedisHashCommands
See Also:
http://redis.io/commands/hmset

hVals

public List<byte[]> hVals(byte[] key)
Description copied from interface: RedisHashCommands
Get entry set (values) of hash at field.

Specified by:
hVals in interface RedisHashCommands
Returns:
See Also:
http://redis.io/commands/hvals

scriptFlush

public void scriptFlush()
Description copied from interface: RedisScriptingCommands
Flush lua script cache.

Specified by:
scriptFlush in interface RedisScriptingCommands
See Also:
http://redis.io/commands/script-flush

scriptKill

public void scriptKill()
Description copied from interface: RedisScriptingCommands
Kill current lua script execution.

Specified by:
scriptKill in interface RedisScriptingCommands
See Also:
http://redis.io/commands/script-kill

scriptLoad

public String scriptLoad(byte[] script)
Description copied from interface: RedisScriptingCommands
Load lua script into scripts cache, without executing it.
Execute the script by calling #evalSha(String, ReturnType, int, byte[]).

Specified by:
scriptLoad in interface RedisScriptingCommands
Returns:
See Also:
http://redis.io/commands/script-load

scriptExists

public List<Boolean> scriptExists(String... scriptSha1)
Description copied from interface: RedisScriptingCommands
Check if given scriptShas exist in script cache.

Specified by:
scriptExists in interface RedisScriptingCommands
Returns:
one entry per given scriptSha in returned list.
See Also:
http://redis.io/commands/script-exits

eval

public <T> T eval(byte[] script,
                  ReturnType returnType,
                  int numKeys,
                  byte[]... keysAndArgs)
Description copied from interface: RedisScriptingCommands
Evaluate given script.

Specified by:
eval in interface RedisScriptingCommands
Returns:
See Also:
http://redis.io/commands/eval

evalSha

public <T> T evalSha(String scriptSha1,
                     ReturnType returnType,
                     int numKeys,
                     byte[]... keysAndArgs)
Description copied from interface: RedisScriptingCommands
Evaluate given scriptSha.

Specified by:
evalSha in interface RedisScriptingCommands
Returns:
See Also:
http://redis.io/commands/evalsha

publish

public Long publish(byte[] channel,
                    byte[] message)
Description copied from interface: RedisPubSubCommands
Publishes the given message to the given channel.

Specified by:
publish in interface RedisPubSubCommands
Parameters:
channel - the channel to publish to
message - message to publish
Returns:
the number of clients that received the message

getSubscription

public Subscription getSubscription()
Description copied from interface: RedisPubSubCommands
Returns the current subscription for this connection or null if the connection is not subscribed.

Specified by:
getSubscription in interface RedisPubSubCommands
Returns:
the current subscription, null if none is available

isSubscribed

public boolean isSubscribed()
Description copied from interface: RedisPubSubCommands
Indicates whether the current connection is subscribed (to at least one channel) or not.

Specified by:
isSubscribed in interface RedisPubSubCommands
Returns:
true if the connection is subscribed, false otherwise

pSubscribe

public void pSubscribe(MessageListener listener,
                       byte[]... patterns)
Description copied from interface: RedisPubSubCommands
Subscribes the connection to all channels matching the given patterns. Once subscribed, a connection enters listening mode and can only subscribe to other channels or unsubscribe. No other commands are accepted until the connection is unsubscribed.

Note that this operation is blocking and the current thread starts waiting for new messages immediately.

Specified by:
pSubscribe in interface RedisPubSubCommands
Parameters:
listener - message listener
patterns - channel name patterns

subscribe

public void subscribe(MessageListener listener,
                      byte[]... channels)
Description copied from interface: RedisPubSubCommands
Subscribes the connection to the given channels. Once subscribed, a connection enters listening mode and can only subscribe to other channels or unsubscribe. No other commands are accepted until the connection is unsubscribed.

Note that this operation is blocking and the current thread starts waiting for new messages immediately.

Specified by:
subscribe in interface RedisPubSubCommands
Parameters:
listener - message listener
channels - channel names

time

public Long time()
Description copied from interface: RedisServerCommands
Request server timestamp using TIME command.

Specified by:
time in interface RedisServerCommands
Returns:
current server time in milliseconds.

killClient

public void killClient(String host,
                       int port)
Description copied from interface: RedisServerCommands
<<<<<<< HEAD Closes a given client connection identified by ip:port.

Specified by:
killClient in interface RedisServerCommands
Parameters:
host - of connection to close.
port - of connection to close

setClientName

public void setClientName(byte[] name)
Description copied from interface: RedisServerCommands
Assign given name to current connection.

Specified by:
setClientName in interface RedisServerCommands

slaveOf

public void slaveOf(String host,
                    int port)
Description copied from interface: RedisServerCommands
Change redis replication setting to new master.

Specified by:
slaveOf in interface RedisServerCommands
See Also:
http://redis.io/commands/slaveof

getClientName

public String getClientName()
Description copied from interface: RedisServerCommands
Returns the name of the current connection.

Specified by:
getClientName in interface RedisServerCommands
Returns:
See Also:
http://redis.io/commands/client-getname

getClientList

public List<RedisClientInfo> getClientList()
Description copied from interface: RedisServerCommands
Request information and statistics about connected clients.

Specified by:
getClientList in interface RedisServerCommands
Returns:
List of RedisClientInfo objects.
See Also:
http://redis.io/commands/client-list

slaveOfNoOne

public void slaveOfNoOne()
Description copied from interface: RedisServerCommands
Change server into master.

Specified by:
slaveOfNoOne in interface RedisServerCommands
See Also:
http://redis.io/commands/slaveof

setConvertPipelineAndTxResults

public void setConvertPipelineAndTxResults(boolean convertPipelineAndTxResults)
Specifies if pipelined and transaction results should be converted to the expected data type. If false, results of closePipeline() and exec() will be of the type returned by the Lettuce driver

Parameters:
convertPipelineAndTxResults - Whether or not to convert pipeline and tx results