org.springframework.data.redis.connection.jedis
Class JedisConnection

java.lang.Object
  extended by org.springframework.data.redis.connection.jedis.JedisConnection
All Implemented Interfaces:
RedisCommands, RedisConnection, RedisConnectionCommands, RedisHashCommands, RedisKeyCommands, RedisListCommands, RedisPubSubCommands, RedisScriptingCommands, RedisServerCommands, RedisSetCommands, RedisStringCommands, RedisTxCommands, RedisZSetCommands

public class JedisConnection
extends Object
implements RedisConnection

RedisConnection implementation on top of Jedis library.


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
 
Constructor Summary
JedisConnection(redis.clients.jedis.Jedis jedis)
          Constructs a new JedisConnection instance.
JedisConnection(redis.clients.jedis.Jedis jedis, redis.clients.util.Pool<redis.clients.jedis.Jedis> pool, int dbIndex)
          Constructs a new JedisConnection instance backed by a jedis pool.
 
Method Summary
 Long append(byte[] key, byte[] value)
           
 void bgSave()
           
 void bgWriteAof()
           
 Long bitCount(byte[] key)
           
 Long bitCount(byte[] key, long begin, long end)
           
 Long bitOp(RedisStringCommands.BitOperation op, byte[] destination, byte[]... keys)
           
 List<byte[]> bLPop(int timeout, byte[]... keys)
           
 List<byte[]> bRPop(int timeout, byte[]... keys)
           
 byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey)
           
 void close()
          Closes (or quits) the connection.
 List<Object> closePipeline()
          Executes the commands in the pipeline and returns their result.
protected  DataAccessException convertJedisAccessException(Exception ex)
           
 Long dbSize()
           
 Long decr(byte[] key)
           
 Long decrBy(byte[] key, long value)
           
 Long del(byte[]... keys)
           
 void discard()
           
 byte[] dump(byte[] key)
           
 byte[] echo(byte[] message)
           
<T> T
eval(byte[] script, ReturnType returnType, int numKeys, byte[]... keysAndArgs)
           
<T> T
evalSha(String scriptSha1, ReturnType returnType, int numKeys, byte[]... keysAndArgs)
           
 List<Object> exec()
           
 Object execute(String command, byte[]... args)
          'Native' or 'raw' execution of the given command along-side the given arguments.
 Boolean exists(byte[] key)
           
 Boolean expire(byte[] key, long seconds)
           
 Boolean expireAt(byte[] key, long unixTime)
           
 void flushAll()
           
 void flushDb()
           
 byte[] get(byte[] key)
           
 Boolean getBit(byte[] key, long offset)
           
 List<String> getConfig(String param)
           
 redis.clients.jedis.Jedis getNativeConnection()
          Returns the native connection (the underlying library/driver object).
 byte[] getRange(byte[] key, long start, long end)
           
 byte[] getSet(byte[] key, byte[] value)
           
 Subscription getSubscription()
          Returns the current subscription for this connection or null if the connection is not subscribed.
 Long hDel(byte[] key, byte[]... fields)
           
 Boolean hExists(byte[] key, byte[] field)
           
 byte[] hGet(byte[] key, byte[] field)
           
 Map<byte[],byte[]> hGetAll(byte[] key)
           
 Double hIncrBy(byte[] key, byte[] field, double delta)
           
 Long hIncrBy(byte[] key, byte[] field, long delta)
           
 Set<byte[]> hKeys(byte[] key)
           
 Long hLen(byte[] key)
           
 List<byte[]> hMGet(byte[] key, byte[]... fields)
           
 void hMSet(byte[] key, Map<byte[],byte[]> tuple)
           
 Boolean hSet(byte[] key, byte[] field, byte[] value)
           
 Boolean hSetNX(byte[] key, byte[] field, byte[] value)
           
 List<byte[]> hVals(byte[] key)
           
 Long incr(byte[] key)
           
 Double incrBy(byte[] key, double value)
           
 Long incrBy(byte[] key, long value)
           
 Properties info()
           
 Properties info(String section)
           
 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)
           
 Long lastSave()
           
 byte[] lIndex(byte[] key, long index)
           
 Long lInsert(byte[] key, RedisListCommands.Position where, byte[] pivot, byte[] value)
           
 Long lLen(byte[] key)
           
 byte[] lPop(byte[] key)
           
 Long lPush(byte[] key, byte[]... values)
           
 Long lPushX(byte[] key, byte[] value)
           
 List<byte[]> lRange(byte[] key, long start, long end)
           
 Long lRem(byte[] key, long count, byte[] value)
           
 void lSet(byte[] key, long index, byte[] value)
           
 void lTrim(byte[] key, long start, long end)
           
 List<byte[]> mGet(byte[]... keys)
           
 Boolean move(byte[] key, int dbIndex)
           
 void mSet(Map<byte[],byte[]> tuples)
           
 Boolean mSetNX(Map<byte[],byte[]> tuples)
           
 void multi()
           
 void openPipeline()
          Activates the pipeline mode for this connection.
 Boolean persist(byte[] key)
           
 Boolean pExpire(byte[] key, long millis)
           
 Boolean pExpireAt(byte[] key, long unixTimeInMillis)
           
 String ping()
           
 void pSubscribe(MessageListener listener, byte[]... patterns)
          Subscribes the connection to all channels matching the given patterns.
 Long pTtl(byte[] key)
           
 Long publish(byte[] channel, byte[] message)
          Publishes the given message to the given channel.
 byte[] randomKey()
           
 void rename(byte[] oldName, byte[] newName)
           
 Boolean renameNX(byte[] oldName, byte[] newName)
           
 void resetConfigStats()
           
 void restore(byte[] key, long ttlInMillis, byte[] serializedValue)
           
 byte[] rPop(byte[] key)
           
 byte[] rPopLPush(byte[] srcKey, byte[] dstKey)
           
 Long rPush(byte[] key, byte[]... values)
           
 Long rPushX(byte[] key, byte[] value)
           
 Long sAdd(byte[] key, byte[]... values)
           
 void save()
           
 Long sCard(byte[] key)
           
 List<Boolean> scriptExists(String... scriptSha1)
           
 void scriptFlush()
           
 void scriptKill()
           
 String scriptLoad(byte[] script)
           
 Set<byte[]> sDiff(byte[]... keys)
           
 Long sDiffStore(byte[] destKey, byte[]... keys)
           
 void select(int dbIndex)
           
 void set(byte[] key, byte[] value)
           
 void setBit(byte[] key, long offset, boolean value)
           
 void setConfig(String param, String value)
           
 void setConvertPipelineAndTxResults(boolean convertPipelineAndTxResults)
          Specifies if pipelined results should be converted to the expected data type.
 void setEx(byte[] key, long time, byte[] value)
           
 Boolean setNX(byte[] key, byte[] value)
           
 void setRange(byte[] key, byte[] value, long start)
           
 void shutdown()
           
 Set<byte[]> sInter(byte[]... keys)
           
 Long sInterStore(byte[] destKey, byte[]... keys)
           
 Boolean sIsMember(byte[] key, byte[] value)
           
 Set<byte[]> sMembers(byte[] key)
           
 Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value)
           
 List<byte[]> sort(byte[] key, SortParameters params)
           
 Long sort(byte[] key, SortParameters params, byte[] storeKey)
           
 byte[] sPop(byte[] key)
           
 byte[] sRandMember(byte[] key)
           
 List<byte[]> sRandMember(byte[] key, long count)
           
 Long sRem(byte[] key, byte[]... values)
           
 Long strLen(byte[] key)
           
 void subscribe(MessageListener listener, byte[]... channels)
          Subscribes the connection to the given channels.
 Set<byte[]> sUnion(byte[]... keys)
           
 Long sUnionStore(byte[] destKey, byte[]... keys)
           
 Long ttl(byte[] key)
           
 DataType type(byte[] key)
           
 void unwatch()
           
 void watch(byte[]... keys)
           
 Boolean zAdd(byte[] key, double score, byte[] value)
           
 Long zAdd(byte[] key, Set<RedisZSetCommands.Tuple> tuples)
           
 Long zCard(byte[] key)
           
 Long zCount(byte[] key, double min, double max)
           
 Double zIncrBy(byte[] key, double increment, byte[] value)
           
 Long zInterStore(byte[] destKey, byte[]... sets)
           
 Long zInterStore(byte[] destKey, RedisZSetCommands.Aggregate aggregate, int[] weights, byte[]... sets)
           
 Set<byte[]> zRange(byte[] key, long start, long end)
           
 Set<byte[]> zRangeByScore(byte[] key, double min, double max)
           
 Set<byte[]> zRangeByScore(byte[] key, double min, double max, long offset, long count)
           
 Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key, double min, double max)
           
 Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count)
           
 Set<RedisZSetCommands.Tuple> zRangeWithScores(byte[] key, long start, long end)
           
 Long zRank(byte[] key, byte[] value)
           
 Long zRem(byte[] key, byte[]... values)
           
 Long zRemRange(byte[] key, long start, long end)
           
 Long zRemRangeByScore(byte[] key, double min, double max)
           
 Set<byte[]> zRevRange(byte[] key, long start, long end)
           
 Set<byte[]> zRevRangeByScore(byte[] key, double min, double max)
           
 Set<byte[]> zRevRangeByScore(byte[] key, double min, double max, long offset, long count)
           
 Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key, double min, double max)
           
 Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count)
           
 Set<RedisZSetCommands.Tuple> zRevRangeWithScores(byte[] key, long start, long end)
           
 Long zRevRank(byte[] key, byte[] value)
           
 Double zScore(byte[] key, byte[] value)
           
 Long zUnionStore(byte[] destKey, byte[]... sets)
           
 Long zUnionStore(byte[] destKey, RedisZSetCommands.Aggregate aggregate, int[] weights, byte[]... sets)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JedisConnection

public JedisConnection(redis.clients.jedis.Jedis jedis)
Constructs a new JedisConnection instance.

Parameters:
jedis - Jedis entity

JedisConnection

public JedisConnection(redis.clients.jedis.Jedis jedis,
                       redis.clients.util.Pool<redis.clients.jedis.Jedis> pool,
                       int dbIndex)
Constructs a new JedisConnection instance backed by a jedis pool.

Parameters:
jedis -
pool - can be null, if no pool is used
Method Detail

convertJedisAccessException

protected DataAccessException convertJedisAccessException(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.

close

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

Specified by:
close in interface RedisConnection
Throws:
DataAccessException

getNativeConnection

public redis.clients.jedis.Jedis 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

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.

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)
Specified by:
sort in interface RedisKeyCommands

sort

public Long sort(byte[] key,
                 SortParameters params,
                 byte[] storeKey)
Specified by:
sort in interface RedisKeyCommands

dbSize

public Long dbSize()
Specified by:
dbSize in interface RedisServerCommands

flushDb

public void flushDb()
Specified by:
flushDb in interface RedisServerCommands

flushAll

public void flushAll()
Specified by:
flushAll in interface RedisServerCommands

bgSave

public void bgSave()
Specified by:
bgSave in interface RedisServerCommands

bgWriteAof

public void bgWriteAof()
Specified by:
bgWriteAof in interface RedisServerCommands

save

public void save()
Specified by:
save in interface RedisServerCommands

getConfig

public List<String> getConfig(String param)
Specified by:
getConfig in interface RedisServerCommands

info

public Properties info()
Specified by:
info in interface RedisServerCommands

info

public Properties info(String section)
Specified by:
info in interface RedisServerCommands

lastSave

public Long lastSave()
Specified by:
lastSave in interface RedisServerCommands

setConfig

public void setConfig(String param,
                      String value)
Specified by:
setConfig in interface RedisServerCommands

resetConfigStats

public void resetConfigStats()
Specified by:
resetConfigStats in interface RedisServerCommands

shutdown

public void shutdown()
Specified by:
shutdown in interface RedisServerCommands

echo

public byte[] echo(byte[] message)
Specified by:
echo in interface RedisConnectionCommands

ping

public String ping()
Specified by:
ping in interface RedisConnectionCommands

del

public Long del(byte[]... keys)
Specified by:
del in interface RedisKeyCommands

discard

public void discard()
Specified by:
discard in interface RedisTxCommands

exec

public List<Object> exec()
Specified by:
exec in interface RedisTxCommands

exists

public Boolean exists(byte[] key)
Specified by:
exists in interface RedisKeyCommands

expire

public Boolean expire(byte[] key,
                      long seconds)
Specified by:
expire in interface RedisKeyCommands

expireAt

public Boolean expireAt(byte[] key,
                        long unixTime)
Specified by:
expireAt in interface RedisKeyCommands

keys

public Set<byte[]> keys(byte[] pattern)
Specified by:
keys in interface RedisKeyCommands

multi

public void multi()
Specified by:
multi in interface RedisTxCommands

persist

public Boolean persist(byte[] key)
Specified by:
persist in interface RedisKeyCommands

move

public Boolean move(byte[] key,
                    int dbIndex)
Specified by:
move in interface RedisKeyCommands

randomKey

public byte[] randomKey()
Specified by:
randomKey in interface RedisKeyCommands

rename

public void rename(byte[] oldName,
                   byte[] newName)
Specified by:
rename in interface RedisKeyCommands

renameNX

public Boolean renameNX(byte[] oldName,
                        byte[] newName)
Specified by:
renameNX in interface RedisKeyCommands

select

public void select(int dbIndex)
Specified by:
select in interface RedisConnectionCommands

ttl

public Long ttl(byte[] key)
Specified by:
ttl in interface RedisKeyCommands

pExpire

public Boolean pExpire(byte[] key,
                       long millis)
Specified by:
pExpire in interface RedisKeyCommands

pExpireAt

public Boolean pExpireAt(byte[] key,
                         long unixTimeInMillis)
Specified by:
pExpireAt in interface RedisKeyCommands

pTtl

public Long pTtl(byte[] key)
Specified by:
pTtl in interface RedisKeyCommands

dump

public byte[] dump(byte[] key)
Specified by:
dump in interface RedisKeyCommands

restore

public void restore(byte[] key,
                    long ttlInMillis,
                    byte[] serializedValue)
Specified by:
restore in interface RedisKeyCommands

type

public DataType type(byte[] key)
Specified by:
type in interface RedisKeyCommands

unwatch

public void unwatch()
Specified by:
unwatch in interface RedisTxCommands

watch

public void watch(byte[]... keys)
Specified by:
watch in interface RedisTxCommands

get

public byte[] get(byte[] key)
Specified by:
get in interface RedisStringCommands

set

public void set(byte[] key,
                byte[] value)
Specified by:
set in interface RedisStringCommands

getSet

public byte[] getSet(byte[] key,
                     byte[] value)
Specified by:
getSet in interface RedisStringCommands

append

public Long append(byte[] key,
                   byte[] value)
Specified by:
append in interface RedisStringCommands

mGet

public List<byte[]> mGet(byte[]... keys)
Specified by:
mGet in interface RedisStringCommands

mSet

public void mSet(Map<byte[],byte[]> tuples)
Specified by:
mSet in interface RedisStringCommands

mSetNX

public Boolean mSetNX(Map<byte[],byte[]> tuples)
Specified by:
mSetNX in interface RedisStringCommands

setEx

public void setEx(byte[] key,
                  long time,
                  byte[] value)
Specified by:
setEx in interface RedisStringCommands

setNX

public Boolean setNX(byte[] key,
                     byte[] value)
Specified by:
setNX in interface RedisStringCommands

getRange

public byte[] getRange(byte[] key,
                       long start,
                       long end)
Specified by:
getRange in interface RedisStringCommands

decr

public Long decr(byte[] key)
Specified by:
decr in interface RedisStringCommands

decrBy

public Long decrBy(byte[] key,
                   long value)
Specified by:
decrBy in interface RedisStringCommands

incr

public Long incr(byte[] key)
Specified by:
incr in interface RedisStringCommands

incrBy

public Long incrBy(byte[] key,
                   long value)
Specified by:
incrBy in interface RedisStringCommands

incrBy

public Double incrBy(byte[] key,
                     double value)
Specified by:
incrBy in interface RedisStringCommands

getBit

public Boolean getBit(byte[] key,
                      long offset)
Specified by:
getBit in interface RedisStringCommands

setBit

public void setBit(byte[] key,
                   long offset,
                   boolean value)
Specified by:
setBit in interface RedisStringCommands

setRange

public void setRange(byte[] key,
                     byte[] value,
                     long start)
Specified by:
setRange in interface RedisStringCommands

strLen

public Long strLen(byte[] key)
Specified by:
strLen in interface RedisStringCommands

bitCount

public Long bitCount(byte[] key)
Specified by:
bitCount in interface RedisStringCommands

bitCount

public Long bitCount(byte[] key,
                     long begin,
                     long end)
Specified by:
bitCount in interface RedisStringCommands

bitOp

public Long bitOp(RedisStringCommands.BitOperation op,
                  byte[] destination,
                  byte[]... keys)
Specified by:
bitOp in interface RedisStringCommands

lPush

public Long lPush(byte[] key,
                  byte[]... values)
Specified by:
lPush in interface RedisListCommands

rPush

public Long rPush(byte[] key,
                  byte[]... values)
Specified by:
rPush in interface RedisListCommands

bLPop

public List<byte[]> bLPop(int timeout,
                          byte[]... keys)
Specified by:
bLPop in interface RedisListCommands

bRPop

public List<byte[]> bRPop(int timeout,
                          byte[]... keys)
Specified by:
bRPop in interface RedisListCommands

lIndex

public byte[] lIndex(byte[] key,
                     long index)
Specified by:
lIndex in interface RedisListCommands

lInsert

public Long lInsert(byte[] key,
                    RedisListCommands.Position where,
                    byte[] pivot,
                    byte[] value)
Specified by:
lInsert in interface RedisListCommands

lLen

public Long lLen(byte[] key)
Specified by:
lLen in interface RedisListCommands

lPop

public byte[] lPop(byte[] key)
Specified by:
lPop in interface RedisListCommands

lRange

public List<byte[]> lRange(byte[] key,
                           long start,
                           long end)
Specified by:
lRange in interface RedisListCommands

lRem

public Long lRem(byte[] key,
                 long count,
                 byte[] value)
Specified by:
lRem in interface RedisListCommands

lSet

public void lSet(byte[] key,
                 long index,
                 byte[] value)
Specified by:
lSet in interface RedisListCommands

lTrim

public void lTrim(byte[] key,
                  long start,
                  long end)
Specified by:
lTrim in interface RedisListCommands

rPop

public byte[] rPop(byte[] key)
Specified by:
rPop in interface RedisListCommands

rPopLPush

public byte[] rPopLPush(byte[] srcKey,
                        byte[] dstKey)
Specified by:
rPopLPush in interface RedisListCommands

bRPopLPush

public byte[] bRPopLPush(int timeout,
                         byte[] srcKey,
                         byte[] dstKey)
Specified by:
bRPopLPush in interface RedisListCommands

lPushX

public Long lPushX(byte[] key,
                   byte[] value)
Specified by:
lPushX in interface RedisListCommands

rPushX

public Long rPushX(byte[] key,
                   byte[] value)
Specified by:
rPushX in interface RedisListCommands

sAdd

public Long sAdd(byte[] key,
                 byte[]... values)
Specified by:
sAdd in interface RedisSetCommands

sCard

public Long sCard(byte[] key)
Specified by:
sCard in interface RedisSetCommands

sDiff

public Set<byte[]> sDiff(byte[]... keys)
Specified by:
sDiff in interface RedisSetCommands

sDiffStore

public Long sDiffStore(byte[] destKey,
                       byte[]... keys)
Specified by:
sDiffStore in interface RedisSetCommands

sInter

public Set<byte[]> sInter(byte[]... keys)
Specified by:
sInter in interface RedisSetCommands

sInterStore

public Long sInterStore(byte[] destKey,
                        byte[]... keys)
Specified by:
sInterStore in interface RedisSetCommands

sIsMember

public Boolean sIsMember(byte[] key,
                         byte[] value)
Specified by:
sIsMember in interface RedisSetCommands

sMembers

public Set<byte[]> sMembers(byte[] key)
Specified by:
sMembers in interface RedisSetCommands

sMove

public Boolean sMove(byte[] srcKey,
                     byte[] destKey,
                     byte[] value)
Specified by:
sMove in interface RedisSetCommands

sPop

public byte[] sPop(byte[] key)
Specified by:
sPop in interface RedisSetCommands

sRandMember

public byte[] sRandMember(byte[] key)
Specified by:
sRandMember in interface RedisSetCommands

sRandMember

public List<byte[]> sRandMember(byte[] key,
                                long count)
Specified by:
sRandMember in interface RedisSetCommands

sRem

public Long sRem(byte[] key,
                 byte[]... values)
Specified by:
sRem in interface RedisSetCommands

sUnion

public Set<byte[]> sUnion(byte[]... keys)
Specified by:
sUnion in interface RedisSetCommands

sUnionStore

public Long sUnionStore(byte[] destKey,
                        byte[]... keys)
Specified by:
sUnionStore in interface RedisSetCommands

zAdd

public Boolean zAdd(byte[] key,
                    double score,
                    byte[] value)
Specified by:
zAdd in interface RedisZSetCommands

zAdd

public Long zAdd(byte[] key,
                 Set<RedisZSetCommands.Tuple> tuples)
Specified by:
zAdd in interface RedisZSetCommands

zCard

public Long zCard(byte[] key)
Specified by:
zCard in interface RedisZSetCommands

zCount

public Long zCount(byte[] key,
                   double min,
                   double max)
Specified by:
zCount in interface RedisZSetCommands

zIncrBy

public Double zIncrBy(byte[] key,
                      double increment,
                      byte[] value)
Specified by:
zIncrBy in interface RedisZSetCommands

zInterStore

public Long zInterStore(byte[] destKey,
                        RedisZSetCommands.Aggregate aggregate,
                        int[] weights,
                        byte[]... sets)
Specified by:
zInterStore in interface RedisZSetCommands

zInterStore

public Long zInterStore(byte[] destKey,
                        byte[]... sets)
Specified by:
zInterStore in interface RedisZSetCommands

zRange

public Set<byte[]> zRange(byte[] key,
                          long start,
                          long end)
Specified by:
zRange in interface RedisZSetCommands

zRangeWithScores

public Set<RedisZSetCommands.Tuple> zRangeWithScores(byte[] key,
                                                     long start,
                                                     long end)
Specified by:
zRangeWithScores in interface RedisZSetCommands

zRangeByScore

public Set<byte[]> zRangeByScore(byte[] key,
                                 double min,
                                 double max)
Specified by:
zRangeByScore in interface RedisZSetCommands

zRangeByScoreWithScores

public Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key,
                                                            double min,
                                                            double max)
Specified by:
zRangeByScoreWithScores in interface RedisZSetCommands

zRevRangeWithScores

public Set<RedisZSetCommands.Tuple> zRevRangeWithScores(byte[] key,
                                                        long start,
                                                        long end)
Specified by:
zRevRangeWithScores in interface RedisZSetCommands

zRangeByScore

public Set<byte[]> zRangeByScore(byte[] key,
                                 double min,
                                 double max,
                                 long offset,
                                 long count)
Specified by:
zRangeByScore in interface RedisZSetCommands

zRangeByScoreWithScores

public Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key,
                                                            double min,
                                                            double max,
                                                            long offset,
                                                            long count)
Specified by:
zRangeByScoreWithScores in interface RedisZSetCommands

zRevRangeByScore

public Set<byte[]> zRevRangeByScore(byte[] key,
                                    double min,
                                    double max,
                                    long offset,
                                    long count)
Specified by:
zRevRangeByScore in interface RedisZSetCommands

zRevRangeByScore

public Set<byte[]> zRevRangeByScore(byte[] key,
                                    double min,
                                    double max)
Specified by:
zRevRangeByScore in interface RedisZSetCommands

zRevRangeByScoreWithScores

public Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key,
                                                               double min,
                                                               double max,
                                                               long offset,
                                                               long count)
Specified by:
zRevRangeByScoreWithScores in interface RedisZSetCommands

zRevRangeByScoreWithScores

public Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key,
                                                               double min,
                                                               double max)
Specified by:
zRevRangeByScoreWithScores in interface RedisZSetCommands

zRank

public Long zRank(byte[] key,
                  byte[] value)
Specified by:
zRank in interface RedisZSetCommands

zRem

public Long zRem(byte[] key,
                 byte[]... values)
Specified by:
zRem in interface RedisZSetCommands

zRemRange

public Long zRemRange(byte[] key,
                      long start,
                      long end)
Specified by:
zRemRange in interface RedisZSetCommands

zRemRangeByScore

public Long zRemRangeByScore(byte[] key,
                             double min,
                             double max)
Specified by:
zRemRangeByScore in interface RedisZSetCommands

zRevRange

public Set<byte[]> zRevRange(byte[] key,
                             long start,
                             long end)
Specified by:
zRevRange in interface RedisZSetCommands

zRevRank

public Long zRevRank(byte[] key,
                     byte[] value)
Specified by:
zRevRank in interface RedisZSetCommands

zScore

public Double zScore(byte[] key,
                     byte[] value)
Specified by:
zScore in interface RedisZSetCommands

zUnionStore

public Long zUnionStore(byte[] destKey,
                        RedisZSetCommands.Aggregate aggregate,
                        int[] weights,
                        byte[]... sets)
Specified by:
zUnionStore in interface RedisZSetCommands

zUnionStore

public Long zUnionStore(byte[] destKey,
                        byte[]... sets)
Specified by:
zUnionStore in interface RedisZSetCommands

hSet

public Boolean hSet(byte[] key,
                    byte[] field,
                    byte[] value)
Specified by:
hSet in interface RedisHashCommands

hSetNX

public Boolean hSetNX(byte[] key,
                      byte[] field,
                      byte[] value)
Specified by:
hSetNX in interface RedisHashCommands

hDel

public Long hDel(byte[] key,
                 byte[]... fields)
Specified by:
hDel in interface RedisHashCommands

hExists

public Boolean hExists(byte[] key,
                       byte[] field)
Specified by:
hExists in interface RedisHashCommands

hGet

public byte[] hGet(byte[] key,
                   byte[] field)
Specified by:
hGet in interface RedisHashCommands

hGetAll

public Map<byte[],byte[]> hGetAll(byte[] key)
Specified by:
hGetAll in interface RedisHashCommands

hIncrBy

public Long hIncrBy(byte[] key,
                    byte[] field,
                    long delta)
Specified by:
hIncrBy in interface RedisHashCommands

hIncrBy

public Double hIncrBy(byte[] key,
                      byte[] field,
                      double delta)
Specified by:
hIncrBy in interface RedisHashCommands

hKeys

public Set<byte[]> hKeys(byte[] key)
Specified by:
hKeys in interface RedisHashCommands

hLen

public Long hLen(byte[] key)
Specified by:
hLen in interface RedisHashCommands

hMGet

public List<byte[]> hMGet(byte[] key,
                          byte[]... fields)
Specified by:
hMGet in interface RedisHashCommands

hMSet

public void hMSet(byte[] key,
                  Map<byte[],byte[]> tuple)
Specified by:
hMSet in interface RedisHashCommands

hVals

public List<byte[]> hVals(byte[] key)
Specified by:
hVals in interface RedisHashCommands

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

scriptFlush

public void scriptFlush()
Specified by:
scriptFlush in interface RedisScriptingCommands

scriptKill

public void scriptKill()
Specified by:
scriptKill in interface RedisScriptingCommands

scriptLoad

public String scriptLoad(byte[] script)
Specified by:
scriptLoad in interface RedisScriptingCommands

scriptExists

public List<Boolean> scriptExists(String... scriptSha1)
Specified by:
scriptExists in interface RedisScriptingCommands

eval

public <T> T eval(byte[] script,
                  ReturnType returnType,
                  int numKeys,
                  byte[]... keysAndArgs)
Specified by:
eval in interface RedisScriptingCommands

evalSha

public <T> T evalSha(String scriptSha1,
                     ReturnType returnType,
                     int numKeys,
                     byte[]... keysAndArgs)
Specified by:
evalSha in interface RedisScriptingCommands

setConvertPipelineAndTxResults

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

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