com.lambdaworks.redis
Class RedisAsyncConnection<K,V>

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelUpstreamHandler
      extended by com.lambdaworks.redis.RedisAsyncConnection<K,V>
All Implemented Interfaces:
ChannelHandler, ChannelUpstreamHandler
Direct Known Subclasses:
RedisPubSubConnection

public class RedisAsyncConnection<K,V>
extends SimpleChannelUpstreamHandler

An asynchronous thread-safe connection to a redis server. Multiple threads may share one RedisAsyncConnection provided they avoid blocking and transactional operations such as blpop(long, K...) and multi()/exec(). A ConnectionWatchdog monitors each connection and reconnects automatically until close() is called. All pending commands will be (re)sent after successful reconnection.

Author:
Will Glozer

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
 
Field Summary
protected  Channel channel
           
protected  RedisCodec<K,V> codec
           
protected  MultiOutput<K,V> multi
           
protected  BlockingQueue<Command<K,V,?>> queue
           
protected  long timeout
           
protected  TimeUnit unit
           
 
Constructor Summary
RedisAsyncConnection(BlockingQueue<Command<K,V,?>> queue, RedisCodec<K,V> codec, long timeout, TimeUnit unit)
          Initialize a new connection.
 
Method Summary
 Future<Long> append(K key, V value)
           
 String auth(String password)
           
<T> T
await(Command<K,V,T> cmd, long timeout, TimeUnit unit)
           
 boolean awaitAll(Future<?>... futures)
          Wait until commands are complete or the connection timeout is reached.
 boolean awaitAll(long timeout, TimeUnit unit, Future<?>... futures)
          Wait until futures are complete or the supplied timeout is reached.
 Future<String> bgrewriteaof()
           
 Future<String> bgsave()
           
 Future<Long> bitcount(K key)
           
 Future<Long> bitcount(K key, long start, long end)
           
 Future<Long> bitopAnd(K destination, K... keys)
           
 Future<Long> bitopNot(K destination, K source)
           
 Future<Long> bitopOr(K destination, K... keys)
           
 Future<Long> bitopXor(K destination, K... keys)
           
 Future<KeyValue<K,V>> blpop(long timeout, K... keys)
           
 Future<KeyValue<K,V>> brpop(long timeout, K... keys)
           
 Future<V> brpoplpush(long timeout, K source, K destination)
           
 void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
           
 void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e)
           
 Future<K> clientGetname()
           
 Future<String> clientKill(String addr)
           
 Future<String> clientList()
           
 Future<String> clientSetname(K name)
           
 void close()
          Close the connection.
 Future<List<String>> configGet(String parameter)
           
 Future<String> configResetstat()
           
 Future<String> configSet(String parameter, String value)
           
 Future<Long> dbsize()
           
 Future<String> debugObject(K key)
           
 Future<Long> decr(K key)
           
 Future<Long> decrby(K key, long amount)
           
 Future<Long> del(K... keys)
           
 String digest(V script)
           
 Future<String> discard()
           
<T> Command<K,V,T>
dispatch(CommandType type, CommandOutput<K,V,T> output)
           
<T> Command<K,V,T>
dispatch(CommandType type, CommandOutput<K,V,T> output, CommandArgs<K,V> args)
           
<T> Command<K,V,T>
dispatch(CommandType type, CommandOutput<K,V,T> output, K key)
           
<T> Command<K,V,T>
dispatch(CommandType type, CommandOutput<K,V,T> output, K key, V value)
           
<T> Command<K,V,T>
dispatch(CommandType type, CommandOutput<K,V,T> output, K key, V[] values)
           
 Future<byte[]> dump(K key)
           
 Future<V> echo(V msg)
           
<T> Future<T>
eval(V script, ScriptOutputType type, K[] keys, V... values)
           
<T> Future<T>
evalsha(String digest, ScriptOutputType type, K[] keys, V... values)
           
 Future<List<Object>> exec()
           
 Future<Boolean> exists(K key)
           
 Future<Boolean> expire(K key, long seconds)
           
 Future<Boolean> expireat(K key, Date timestamp)
           
 Future<Boolean> expireat(K key, long timestamp)
           
 Future<String> flushall()
           
 Future<String> flushdb()
           
 Future<V> get(K key)
           
 Future<Long> getbit(K key, long offset)
           
 Future<V> getrange(K key, long start, long end)
           
 Future<V> getset(K key, V value)
           
 Future<Long> hdel(K key, K... fields)
           
 Future<Boolean> hexists(K key, K field)
           
 Future<V> hget(K key, K field)
           
 Future<Map<K,V>> hgetall(K key)
           
 Future<Long> hincrby(K key, K field, long amount)
           
 Future<Double> hincrbyfloat(K key, K field, double amount)
           
 Future<List<K>> hkeys(K key)
           
 Future<Long> hlen(K key)
           
 Future<List<V>> hmget(K key, K... fields)
           
 Future<String> hmset(K key, Map<K,V> map)
           
 Future<Boolean> hset(K key, K field, V value)
           
 Future<Boolean> hsetnx(K key, K field, V value)
           
 Future<List<V>> hvals(K key)
           
 Future<Long> incr(K key)
           
 Future<Long> incrby(K key, long amount)
           
 Future<Double> incrbyfloat(K key, double amount)
           
 Future<String> info()
           
 Future<String> info(String section)
           
 Future<List<K>> keys(K pattern)
           
 Future<Date> lastsave()
           
 Future<V> lindex(K key, long index)
           
 Future<Long> linsert(K key, boolean before, V pivot, V value)
           
 Future<Long> llen(K key)
           
 Future<V> lpop(K key)
           
 Future<Long> lpush(K key, V... values)
           
 Future<Long> lpushx(K key, V value)
           
 Future<List<V>> lrange(K key, long start, long stop)
           
 Future<Long> lrem(K key, long count, V value)
           
 Future<String> lset(K key, long index, V value)
           
 Future<String> ltrim(K key, long start, long stop)
           
 Future<List<V>> mget(K... keys)
           
 Future<String> migrate(String host, int port, K key, int db, long timeout)
           
 Future<Boolean> move(K key, int db)
           
 Future<String> mset(Map<K,V> map)
           
 Future<Boolean> msetnx(Map<K,V> map)
           
 Future<String> multi()
           
protected
<K,V,T> CommandOutput<K,V,T>
newScriptOutput(RedisCodec<K,V> codec, ScriptOutputType type)
           
 Future<String> objectEncoding(K key)
           
 Future<Long> objectIdletime(K key)
           
 Future<Long> objectRefcount(K key)
           
 Future<Boolean> persist(K key)
           
 Future<Boolean> pexpire(K key, long milliseconds)
           
 Future<Boolean> pexpireat(K key, Date timestamp)
           
 Future<Boolean> pexpireat(K key, long timestamp)
           
 Future<String> ping()
           
 Future<Long> pttl(K key)
           
 Future<Long> publish(K channel, V message)
           
 Future<String> quit()
           
 Future<V> randomkey()
           
 Future<String> rename(K key, K newKey)
           
 Future<Boolean> renamenx(K key, K newKey)
           
 Future<String> restore(K key, long ttl, byte[] value)
           
 Future<V> rpop(K key)
           
 Future<V> rpoplpush(K source, K destination)
           
 Future<Long> rpush(K key, V... values)
           
 Future<Long> rpushx(K key, V value)
           
 Future<Long> sadd(K key, V... members)
           
 Future<String> save()
           
 Future<Long> scard(K key)
           
 Future<List<Boolean>> scriptExists(String... digests)
           
 Future<String> scriptFlush()
           
 Future<String> scriptKill()
           
 Future<String> scriptLoad(V script)
           
 Future<Set<V>> sdiff(K... keys)
           
 Future<Long> sdiffstore(K destination, K... keys)
           
 String select(int db)
           
 Future<String> set(K key, V value)
           
 Future<Long> setbit(K key, long offset, int value)
           
 Future<String> setex(K key, long seconds, V value)
           
 Future<Boolean> setnx(K key, V value)
           
 Future<Long> setrange(K key, long offset, V value)
           
 void setTimeout(long timeout, TimeUnit unit)
          Set the command timeout for this connection.
 void shutdown()
          Deprecated. 
 void shutdown(boolean save)
           
 Future<Set<V>> sinter(K... keys)
           
 Future<Long> sinterstore(K destination, K... keys)
           
 Future<Boolean> sismember(K key, V member)
           
 Future<String> slaveof(String host, int port)
           
 Future<String> slaveofNoOne()
           
 Future<List<Object>> slowlogGet()
           
 Future<List<Object>> slowlogGet(int count)
           
 Future<Long> slowlogLen()
           
 Future<String> slowlogReset()
           
 Future<Set<V>> smembers(K key)
           
 Future<Boolean> smove(K source, K destination, V member)
           
 Future<List<V>> sort(K key)
           
 Future<List<V>> sort(K key, SortArgs sortArgs)
           
 Future<Long> sortStore(K key, SortArgs sortArgs, K destination)
           
 Future<V> spop(K key)
           
 Future<V> srandmember(K key)
           
 Future<Set<V>> srandmember(K key, long count)
           
 Future<Long> srem(K key, V... members)
           
 String string(double n)
           
 Future<Long> strlen(K key)
           
 Future<Set<V>> sunion(K... keys)
           
 Future<Long> sunionstore(K destination, K... keys)
           
 Future<String> sync()
           
 Future<Long> ttl(K key)
           
 Future<String> type(K key)
           
 Future<String> unwatch()
           
 Future<String> watch(K... keys)
           
 Future<Long> zadd(K key, double score, V member)
           
 Future<Long> zadd(K key, Object... scoresAndValues)
           
 Future<Long> zcard(K key)
           
 Future<Long> zcount(K key, double min, double max)
           
 Future<Long> zcount(K key, String min, String max)
           
 Future<Double> zincrby(K key, double amount, K member)
           
 Future<Long> zinterstore(K destination, K... keys)
           
 Future<Long> zinterstore(K destination, ZStoreArgs storeArgs, K... keys)
           
 Future<List<V>> zrange(K key, long start, long stop)
           
 Future<List<V>> zrangebyscore(K key, double min, double max)
           
 Future<List<V>> zrangebyscore(K key, double min, double max, long offset, long count)
           
 Future<List<V>> zrangebyscore(K key, String min, String max)
           
 Future<List<V>> zrangebyscore(K key, String min, String max, long offset, long count)
           
 Future<List<ScoredValue<V>>> zrangebyscoreWithScores(K key, double min, double max)
           
 Future<List<ScoredValue<V>>> zrangebyscoreWithScores(K key, double min, double max, long offset, long count)
           
 Future<List<ScoredValue<V>>> zrangebyscoreWithScores(K key, String min, String max)
           
 Future<List<ScoredValue<V>>> zrangebyscoreWithScores(K key, String min, String max, long offset, long count)
           
 Future<List<ScoredValue<V>>> zrangeWithScores(K key, long start, long stop)
           
 Future<Long> zrank(K key, V member)
           
 Future<Long> zrem(K key, V... members)
           
 Future<Long> zremrangebyrank(K key, long start, long stop)
           
 Future<Long> zremrangebyscore(K key, double min, double max)
           
 Future<Long> zremrangebyscore(K key, String min, String max)
           
 Future<List<V>> zrevrange(K key, long start, long stop)
           
 Future<List<V>> zrevrangebyscore(K key, double max, double min)
           
 Future<List<V>> zrevrangebyscore(K key, double max, double min, long offset, long count)
           
 Future<List<V>> zrevrangebyscore(K key, String max, String min)
           
 Future<List<V>> zrevrangebyscore(K key, String max, String min, long offset, long count)
           
 Future<List<ScoredValue<V>>> zrevrangebyscoreWithScores(K key, double max, double min)
           
 Future<List<ScoredValue<V>>> zrevrangebyscoreWithScores(K key, double max, double min, long offset, long count)
           
 Future<List<ScoredValue<V>>> zrevrangebyscoreWithScores(K key, String max, String min)
           
 Future<List<ScoredValue<V>>> zrevrangebyscoreWithScores(K key, String max, String min, long offset, long count)
           
 Future<List<ScoredValue<V>>> zrevrangeWithScores(K key, long start, long stop)
           
 Future<Long> zrevrank(K key, V member)
           
 Future<Double> zscore(K key, V member)
           
 Future<Long> zunionstore(K destination, K... keys)
           
 Future<Long> zunionstore(K destination, ZStoreArgs storeArgs, K... keys)
           
 
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelBound, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, exceptionCaught, handleUpstream, messageReceived, writeComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queue

protected BlockingQueue<Command<K,V,?>> queue

codec

protected RedisCodec<K,V> codec

channel

protected Channel channel

timeout

protected long timeout

unit

protected TimeUnit unit

multi

protected MultiOutput<K,V> multi
Constructor Detail

RedisAsyncConnection

public RedisAsyncConnection(BlockingQueue<Command<K,V,?>> queue,
                            RedisCodec<K,V> codec,
                            long timeout,
                            TimeUnit unit)
Initialize a new connection.

Parameters:
queue - Command queue.
codec - Codec used to encode/decode keys and values.
timeout - Maximum time to wait for a response.
unit - Unit of time for the timeout.
Method Detail

setTimeout

public void setTimeout(long timeout,
                       TimeUnit unit)
Set the command timeout for this connection.

Parameters:
timeout - Command timeout.
unit - Unit of time for the timeout.

append

public Future<Long> append(K key,
                           V value)

auth

public String auth(String password)

bgrewriteaof

public Future<String> bgrewriteaof()

bgsave

public Future<String> bgsave()

bitcount

public Future<Long> bitcount(K key)

bitcount

public Future<Long> bitcount(K key,
                             long start,
                             long end)

bitopAnd

public Future<Long> bitopAnd(K destination,
                             K... keys)

bitopNot

public Future<Long> bitopNot(K destination,
                             K source)

bitopOr

public Future<Long> bitopOr(K destination,
                            K... keys)

bitopXor

public Future<Long> bitopXor(K destination,
                             K... keys)

blpop

public Future<KeyValue<K,V>> blpop(long timeout,
                                   K... keys)

brpop

public Future<KeyValue<K,V>> brpop(long timeout,
                                   K... keys)

brpoplpush

public Future<V> brpoplpush(long timeout,
                            K source,
                            K destination)

clientGetname

public Future<K> clientGetname()

clientSetname

public Future<String> clientSetname(K name)

clientKill

public Future<String> clientKill(String addr)

clientList

public Future<String> clientList()

configGet

public Future<List<String>> configGet(String parameter)

configResetstat

public Future<String> configResetstat()

configSet

public Future<String> configSet(String parameter,
                                String value)

dbsize

public Future<Long> dbsize()

debugObject

public Future<String> debugObject(K key)

decr

public Future<Long> decr(K key)

decrby

public Future<Long> decrby(K key,
                           long amount)

del

public Future<Long> del(K... keys)

discard

public Future<String> discard()

dump

public Future<byte[]> dump(K key)

echo

public Future<V> echo(V msg)

eval

public <T> Future<T> eval(V script,
                          ScriptOutputType type,
                          K[] keys,
                          V... values)

evalsha

public <T> Future<T> evalsha(String digest,
                             ScriptOutputType type,
                             K[] keys,
                             V... values)

exists

public Future<Boolean> exists(K key)

expire

public Future<Boolean> expire(K key,
                              long seconds)

expireat

public Future<Boolean> expireat(K key,
                                Date timestamp)

expireat

public Future<Boolean> expireat(K key,
                                long timestamp)

exec

public Future<List<Object>> exec()

flushall

public Future<String> flushall()
                        throws Exception
Throws:
Exception

flushdb

public Future<String> flushdb()
                       throws Exception
Throws:
Exception

get

public Future<V> get(K key)

getbit

public Future<Long> getbit(K key,
                           long offset)

getrange

public Future<V> getrange(K key,
                          long start,
                          long end)

getset

public Future<V> getset(K key,
                        V value)

hdel

public Future<Long> hdel(K key,
                         K... fields)

hexists

public Future<Boolean> hexists(K key,
                               K field)

hget

public Future<V> hget(K key,
                      K field)

hincrby

public Future<Long> hincrby(K key,
                            K field,
                            long amount)

hincrbyfloat

public Future<Double> hincrbyfloat(K key,
                                   K field,
                                   double amount)

hgetall

public Future<Map<K,V>> hgetall(K key)

hkeys

public Future<List<K>> hkeys(K key)

hlen

public Future<Long> hlen(K key)

hmget

public Future<List<V>> hmget(K key,
                             K... fields)

hmset

public Future<String> hmset(K key,
                            Map<K,V> map)

hset

public Future<Boolean> hset(K key,
                            K field,
                            V value)

hsetnx

public Future<Boolean> hsetnx(K key,
                              K field,
                              V value)

hvals

public Future<List<V>> hvals(K key)

incr

public Future<Long> incr(K key)

incrby

public Future<Long> incrby(K key,
                           long amount)

incrbyfloat

public Future<Double> incrbyfloat(K key,
                                  double amount)

info

public Future<String> info()

info

public Future<String> info(String section)

keys

public Future<List<K>> keys(K pattern)

lastsave

public Future<Date> lastsave()

lindex

public Future<V> lindex(K key,
                        long index)

linsert

public Future<Long> linsert(K key,
                            boolean before,
                            V pivot,
                            V value)

llen

public Future<Long> llen(K key)

lpop

public Future<V> lpop(K key)

lpush

public Future<Long> lpush(K key,
                          V... values)

lpushx

public Future<Long> lpushx(K key,
                           V value)

lrange

public Future<List<V>> lrange(K key,
                              long start,
                              long stop)

lrem

public Future<Long> lrem(K key,
                         long count,
                         V value)

lset

public Future<String> lset(K key,
                           long index,
                           V value)

ltrim

public Future<String> ltrim(K key,
                            long start,
                            long stop)

migrate

public Future<String> migrate(String host,
                              int port,
                              K key,
                              int db,
                              long timeout)

mget

public Future<List<V>> mget(K... keys)

move

public Future<Boolean> move(K key,
                            int db)

multi

public Future<String> multi()

mset

public Future<String> mset(Map<K,V> map)

msetnx

public Future<Boolean> msetnx(Map<K,V> map)

objectEncoding

public Future<String> objectEncoding(K key)

objectIdletime

public Future<Long> objectIdletime(K key)

objectRefcount

public Future<Long> objectRefcount(K key)

persist

public Future<Boolean> persist(K key)

pexpire

public Future<Boolean> pexpire(K key,
                               long milliseconds)

pexpireat

public Future<Boolean> pexpireat(K key,
                                 Date timestamp)

pexpireat

public Future<Boolean> pexpireat(K key,
                                 long timestamp)

ping

public Future<String> ping()

pttl

public Future<Long> pttl(K key)

publish

public Future<Long> publish(K channel,
                            V message)

quit

public Future<String> quit()

randomkey

public Future<V> randomkey()

rename

public Future<String> rename(K key,
                             K newKey)

renamenx

public Future<Boolean> renamenx(K key,
                                K newKey)

restore

public Future<String> restore(K key,
                              long ttl,
                              byte[] value)

rpop

public Future<V> rpop(K key)

rpoplpush

public Future<V> rpoplpush(K source,
                           K destination)

rpush

public Future<Long> rpush(K key,
                          V... values)

rpushx

public Future<Long> rpushx(K key,
                           V value)

sadd

public Future<Long> sadd(K key,
                         V... members)

save

public Future<String> save()

scard

public Future<Long> scard(K key)

scriptExists

public Future<List<Boolean>> scriptExists(String... digests)

scriptFlush

public Future<String> scriptFlush()

scriptKill

public Future<String> scriptKill()

scriptLoad

public Future<String> scriptLoad(V script)

sdiff

public Future<Set<V>> sdiff(K... keys)

sdiffstore

public Future<Long> sdiffstore(K destination,
                               K... keys)

select

public String select(int db)

set

public Future<String> set(K key,
                          V value)

setbit

public Future<Long> setbit(K key,
                           long offset,
                           int value)

setex

public Future<String> setex(K key,
                            long seconds,
                            V value)

setnx

public Future<Boolean> setnx(K key,
                             V value)

setrange

public Future<Long> setrange(K key,
                             long offset,
                             V value)

shutdown

@Deprecated
public void shutdown()
Deprecated. 


shutdown

public void shutdown(boolean save)

sinter

public Future<Set<V>> sinter(K... keys)

sinterstore

public Future<Long> sinterstore(K destination,
                                K... keys)

sismember

public Future<Boolean> sismember(K key,
                                 V member)

smove

public Future<Boolean> smove(K source,
                             K destination,
                             V member)

slaveof

public Future<String> slaveof(String host,
                              int port)

slaveofNoOne

public Future<String> slaveofNoOne()

slowlogGet

public Future<List<Object>> slowlogGet()

slowlogGet

public Future<List<Object>> slowlogGet(int count)

slowlogLen

public Future<Long> slowlogLen()

slowlogReset

public Future<String> slowlogReset()

smembers

public Future<Set<V>> smembers(K key)

sort

public Future<List<V>> sort(K key)

sort

public Future<List<V>> sort(K key,
                            SortArgs sortArgs)

sortStore

public Future<Long> sortStore(K key,
                              SortArgs sortArgs,
                              K destination)

spop

public Future<V> spop(K key)

srandmember

public Future<V> srandmember(K key)

srandmember

public Future<Set<V>> srandmember(K key,
                                  long count)

srem

public Future<Long> srem(K key,
                         V... members)

sunion

public Future<Set<V>> sunion(K... keys)

sunionstore

public Future<Long> sunionstore(K destination,
                                K... keys)

sync

public Future<String> sync()

strlen

public Future<Long> strlen(K key)

ttl

public Future<Long> ttl(K key)

type

public Future<String> type(K key)

watch

public Future<String> watch(K... keys)

unwatch

public Future<String> unwatch()

zadd

public Future<Long> zadd(K key,
                         double score,
                         V member)

zadd

public Future<Long> zadd(K key,
                         Object... scoresAndValues)

zcard

public Future<Long> zcard(K key)

zcount

public Future<Long> zcount(K key,
                           double min,
                           double max)

zcount

public Future<Long> zcount(K key,
                           String min,
                           String max)

zincrby

public Future<Double> zincrby(K key,
                              double amount,
                              K member)

zinterstore

public Future<Long> zinterstore(K destination,
                                K... keys)

zinterstore

public Future<Long> zinterstore(K destination,
                                ZStoreArgs storeArgs,
                                K... keys)

zrange

public Future<List<V>> zrange(K key,
                              long start,
                              long stop)

zrangeWithScores

public Future<List<ScoredValue<V>>> zrangeWithScores(K key,
                                                     long start,
                                                     long stop)

zrangebyscore

public Future<List<V>> zrangebyscore(K key,
                                     double min,
                                     double max)

zrangebyscore

public Future<List<V>> zrangebyscore(K key,
                                     String min,
                                     String max)

zrangebyscore

public Future<List<V>> zrangebyscore(K key,
                                     double min,
                                     double max,
                                     long offset,
                                     long count)

zrangebyscore

public Future<List<V>> zrangebyscore(K key,
                                     String min,
                                     String max,
                                     long offset,
                                     long count)

zrangebyscoreWithScores

public Future<List<ScoredValue<V>>> zrangebyscoreWithScores(K key,
                                                            double min,
                                                            double max)

zrangebyscoreWithScores

public Future<List<ScoredValue<V>>> zrangebyscoreWithScores(K key,
                                                            String min,
                                                            String max)

zrangebyscoreWithScores

public Future<List<ScoredValue<V>>> zrangebyscoreWithScores(K key,
                                                            double min,
                                                            double max,
                                                            long offset,
                                                            long count)

zrangebyscoreWithScores

public Future<List<ScoredValue<V>>> zrangebyscoreWithScores(K key,
                                                            String min,
                                                            String max,
                                                            long offset,
                                                            long count)

zrank

public Future<Long> zrank(K key,
                          V member)

zrem

public Future<Long> zrem(K key,
                         V... members)

zremrangebyrank

public Future<Long> zremrangebyrank(K key,
                                    long start,
                                    long stop)

zremrangebyscore

public Future<Long> zremrangebyscore(K key,
                                     double min,
                                     double max)

zremrangebyscore

public Future<Long> zremrangebyscore(K key,
                                     String min,
                                     String max)

zrevrange

public Future<List<V>> zrevrange(K key,
                                 long start,
                                 long stop)

zrevrangeWithScores

public Future<List<ScoredValue<V>>> zrevrangeWithScores(K key,
                                                        long start,
                                                        long stop)

zrevrangebyscore

public Future<List<V>> zrevrangebyscore(K key,
                                        double max,
                                        double min)

zrevrangebyscore

public Future<List<V>> zrevrangebyscore(K key,
                                        String max,
                                        String min)

zrevrangebyscore

public Future<List<V>> zrevrangebyscore(K key,
                                        double max,
                                        double min,
                                        long offset,
                                        long count)

zrevrangebyscore

public Future<List<V>> zrevrangebyscore(K key,
                                        String max,
                                        String min,
                                        long offset,
                                        long count)

zrevrangebyscoreWithScores

public Future<List<ScoredValue<V>>> zrevrangebyscoreWithScores(K key,
                                                               double max,
                                                               double min)

zrevrangebyscoreWithScores

public Future<List<ScoredValue<V>>> zrevrangebyscoreWithScores(K key,
                                                               String max,
                                                               String min)

zrevrangebyscoreWithScores

public Future<List<ScoredValue<V>>> zrevrangebyscoreWithScores(K key,
                                                               double max,
                                                               double min,
                                                               long offset,
                                                               long count)

zrevrangebyscoreWithScores

public Future<List<ScoredValue<V>>> zrevrangebyscoreWithScores(K key,
                                                               String max,
                                                               String min,
                                                               long offset,
                                                               long count)

zrevrank

public Future<Long> zrevrank(K key,
                             V member)

zscore

public Future<Double> zscore(K key,
                             V member)

zunionstore

public Future<Long> zunionstore(K destination,
                                K... keys)

zunionstore

public Future<Long> zunionstore(K destination,
                                ZStoreArgs storeArgs,
                                K... keys)

awaitAll

public boolean awaitAll(Future<?>... futures)
Wait until commands are complete or the connection timeout is reached.

Parameters:
futures - Futures to wait for.
Returns:
True if all futures complete in time.

awaitAll

public boolean awaitAll(long timeout,
                        TimeUnit unit,
                        Future<?>... futures)
Wait until futures are complete or the supplied timeout is reached.

Parameters:
timeout - Maximum time to wait for futures to complete.
unit - Unit of time for the timeout.
futures - Futures to wait for.
Returns:
True if all futures complete in time.

close

public void close()
Close the connection.


digest

public String digest(V script)

channelConnected

public void channelConnected(ChannelHandlerContext ctx,
                             ChannelStateEvent e)
                      throws Exception
Overrides:
channelConnected in class SimpleChannelUpstreamHandler
Throws:
Exception

channelClosed

public void channelClosed(ChannelHandlerContext ctx,
                          ChannelStateEvent e)
                   throws Exception
Overrides:
channelClosed in class SimpleChannelUpstreamHandler
Throws:
Exception

dispatch

public <T> Command<K,V,T> dispatch(CommandType type,
                                   CommandOutput<K,V,T> output)

dispatch

public <T> Command<K,V,T> dispatch(CommandType type,
                                   CommandOutput<K,V,T> output,
                                   K key)

dispatch

public <T> Command<K,V,T> dispatch(CommandType type,
                                   CommandOutput<K,V,T> output,
                                   K key,
                                   V value)

dispatch

public <T> Command<K,V,T> dispatch(CommandType type,
                                   CommandOutput<K,V,T> output,
                                   K key,
                                   V[] values)

dispatch

public <T> Command<K,V,T> dispatch(CommandType type,
                                   CommandOutput<K,V,T> output,
                                   CommandArgs<K,V> args)

await

public <T> T await(Command<K,V,T> cmd,
                   long timeout,
                   TimeUnit unit)

newScriptOutput

protected <K,V,T> CommandOutput<K,V,T> newScriptOutput(RedisCodec<K,V> codec,
                                                       ScriptOutputType type)

string

public String string(double n)


Copyright © 2013. All Rights Reserved.