|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.lambdaworks.redis.RedisConnection<K,V>
public class RedisConnection<K,V>
A synchronous thread-safe connection to a redis server. Multiple threads may
share one RedisConnection 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.
| Field Summary | |
|---|---|
protected RedisAsyncConnection<K,V> |
c
|
protected long |
timeout
|
protected TimeUnit |
unit
|
| Constructor Summary | |
|---|---|
RedisConnection(RedisAsyncConnection<K,V> c)
Initialize a new connection. |
|
| Method Summary | ||
|---|---|---|
Long |
append(K key,
V value)
|
|
String |
auth(String password)
|
|
String |
bgrewriteaof()
|
|
String |
bgsave()
|
|
Long |
bitcount(K key)
|
|
Long |
bitcount(K key,
long start,
long end)
|
|
Long |
bitopAnd(K destination,
K... keys)
|
|
Long |
bitopNot(K destination,
K source)
|
|
Long |
bitopOr(K destination,
K... keys)
|
|
Long |
bitopXor(K destination,
K... keys)
|
|
KeyValue<K,V> |
blpop(long timeout,
K... keys)
|
|
KeyValue<K,V> |
brpop(long timeout,
K... keys)
|
|
V |
brpoplpush(long timeout,
K source,
K destination)
|
|
K |
clientGetname()
|
|
String |
clientKill(String addr)
|
|
String |
clientList()
|
|
String |
clientSetname(K name)
|
|
void |
close()
Close the connection. |
|
List<String> |
configGet(String parameter)
|
|
String |
configResetstat()
|
|
String |
configSet(String parameter,
String value)
|
|
Long |
dbsize()
|
|
String |
debugObject(K key)
|
|
Long |
decr(K key)
|
|
Long |
decrby(K key,
long amount)
|
|
Long |
del(K... keys)
|
|
String |
digest(V script)
Generate SHA-1 digest for the supplied script. |
|
String |
discard()
|
|
byte[] |
dump(K key)
|
|
V |
echo(V msg)
|
|
|
eval(V script,
ScriptOutputType type,
K... keys)
Eval the supplied script, which must result in the requested type. |
|
|
eval(V script,
ScriptOutputType type,
K[] keys,
V... values)
|
|
|
evalsha(String digest,
ScriptOutputType type,
K... keys)
Eval a pre-loaded script identified by its SHA-1 digest, which must result in the requested type. |
|
|
evalsha(String digest,
ScriptOutputType type,
K[] keys,
V... values)
|
|
List<Object> |
exec()
|
|
Boolean |
exists(K key)
|
|
Boolean |
expire(K key,
long seconds)
|
|
Boolean |
expireat(K key,
Date timestamp)
|
|
Boolean |
expireat(K key,
long timestamp)
|
|
String |
flushall()
|
|
String |
flushdb()
|
|
V |
get(K key)
|
|
Long |
getbit(K key,
long offset)
|
|
V |
getrange(K key,
long start,
long end)
|
|
V |
getset(K key,
V value)
|
|
Long |
hdel(K key,
K... fields)
|
|
Boolean |
hexists(K key,
K field)
|
|
V |
hget(K key,
K field)
|
|
Map<K,V> |
hgetall(K key)
|
|
Long |
hincrby(K key,
K field,
long amount)
|
|
Double |
hincrbyfloat(K key,
K field,
double amount)
|
|
List<K> |
hkeys(K key)
|
|
Long |
hlen(K key)
|
|
List<V> |
hmget(K key,
K... fields)
|
|
String |
hmset(K key,
Map<K,V> map)
|
|
Boolean |
hset(K key,
K field,
V value)
|
|
Boolean |
hsetnx(K key,
K field,
V value)
|
|
List<V> |
hvals(K key)
|
|
Long |
incr(K key)
|
|
Long |
incrby(K key,
long amount)
|
|
Double |
incrbyfloat(K key,
double amount)
|
|
String |
info()
|
|
String |
info(String section)
|
|
List<K> |
keys(K pattern)
|
|
Date |
lastsave()
|
|
V |
lindex(K key,
long index)
|
|
Long |
linsert(K key,
boolean before,
V pivot,
V value)
|
|
Long |
llen(K key)
|
|
V |
lpop(K key)
|
|
Long |
lpush(K key,
V... values)
|
|
Long |
lpushx(K key,
V value)
|
|
List<V> |
lrange(K key,
long start,
long stop)
|
|
Long |
lrem(K key,
long count,
V value)
|
|
String |
lset(K key,
long index,
V value)
|
|
String |
ltrim(K key,
long start,
long stop)
|
|
List<V> |
mget(K... keys)
|
|
String |
migrate(String host,
int port,
K key,
int db,
long timeout)
|
|
Boolean |
move(K key,
int db)
|
|
String |
mset(Map<K,V> map)
|
|
Boolean |
msetnx(Map<K,V> map)
|
|
String |
multi()
|
|
String |
objectEncoding(K key)
|
|
Long |
objectIdletime(K key)
|
|
Long |
objectRefcount(K key)
|
|
Boolean |
persist(K key)
|
|
Boolean |
pexpire(K key,
long milliseconds)
|
|
Boolean |
pexpireat(K key,
Date timestamp)
|
|
Boolean |
pexpireat(K key,
long timestamp)
|
|
String |
ping()
|
|
Long |
pttl(K key)
|
|
Long |
publish(K channel,
V message)
|
|
String |
quit()
|
|
V |
randomkey()
|
|
String |
rename(K key,
K newKey)
|
|
Boolean |
renamenx(K key,
K newKey)
|
|
String |
restore(K key,
long ttl,
byte[] value)
|
|
V |
rpop(K key)
|
|
V |
rpoplpush(K source,
K destination)
|
|
Long |
rpush(K key,
V... values)
|
|
Long |
rpushx(K key,
V value)
|
|
Long |
sadd(K key,
V... members)
|
|
String |
save()
|
|
Long |
scard(K key)
|
|
List<Boolean> |
scriptExists(String... digests)
|
|
String |
scriptFlush()
|
|
String |
scriptKill()
|
|
String |
scriptLoad(V script)
|
|
Set<V> |
sdiff(K... keys)
|
|
Long |
sdiffstore(K destination,
K... keys)
|
|
String |
select(int db)
|
|
String |
set(K key,
V value)
|
|
Long |
setbit(K key,
long offset,
int value)
|
|
String |
setex(K key,
long seconds,
V value)
|
|
Boolean |
setnx(K key,
V value)
|
|
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)
|
|
Set<V> |
sinter(K... keys)
|
|
Long |
sinterstore(K destination,
K... keys)
|
|
Boolean |
sismember(K key,
V member)
|
|
String |
slaveof(String host,
int port)
|
|
String |
slaveofNoOne()
|
|
List<Object> |
slowlogGet()
|
|
List<Object> |
slowlogGet(int count)
|
|
Long |
slowlogLen()
|
|
String |
slowlogReset()
|
|
Set<V> |
smembers(K key)
|
|
Boolean |
smove(K source,
K destination,
V member)
|
|
List<V> |
sort(K key)
|
|
List<V> |
sort(K key,
SortArgs sortArgs)
|
|
Long |
sortStore(K key,
SortArgs sortArgs,
K destination)
|
|
V |
spop(K key)
|
|
V |
srandmember(K key)
|
|
Set<V> |
srandmember(K key,
long count)
|
|
Long |
srem(K key,
V... members)
|
|
Long |
strlen(K key)
|
|
Set<V> |
sunion(K... keys)
|
|
Long |
sunionstore(K destination,
K... keys)
|
|
String |
sync()
|
|
Long |
ttl(K key)
|
|
String |
type(K key)
|
|
String |
unwatch()
|
|
String |
watch(K... keys)
|
|
Long |
zadd(K key,
double score,
V member)
|
|
Long |
zadd(K key,
Object... scoresAndValues)
|
|
Long |
zcard(K key)
|
|
Long |
zcount(K key,
double min,
double max)
|
|
Long |
zcount(K key,
String min,
String max)
|
|
Double |
zincrby(K key,
double amount,
K member)
|
|
Long |
zinterstore(K destination,
K... keys)
|
|
Long |
zinterstore(K destination,
ZStoreArgs storeArgs,
K... keys)
|
|
List<V> |
zrange(K key,
long start,
long stop)
|
|
List<V> |
zrangebyscore(K key,
double min,
double max)
|
|
List<V> |
zrangebyscore(K key,
double min,
double max,
long offset,
long count)
|
|
List<V> |
zrangebyscore(K key,
String min,
String max)
|
|
List<V> |
zrangebyscore(K key,
String min,
String max,
long offset,
long count)
|
|
List<ScoredValue<V>> |
zrangebyscoreWithScores(K key,
double min,
double max)
|
|
List<ScoredValue<V>> |
zrangebyscoreWithScores(K key,
double min,
double max,
long offset,
long count)
|
|
List<ScoredValue<V>> |
zrangebyscoreWithScores(K key,
String min,
String max)
|
|
List<ScoredValue<V>> |
zrangebyscoreWithScores(K key,
String min,
String max,
long offset,
long count)
|
|
List<ScoredValue<V>> |
zrangeWithScores(K key,
long start,
long stop)
|
|
Long |
zrank(K key,
V member)
|
|
Long |
zrem(K key,
V... members)
|
|
Long |
zremrangebyrank(K key,
long start,
long stop)
|
|
Long |
zremrangebyscore(K key,
double min,
double max)
|
|
Long |
zremrangebyscore(K key,
String min,
String max)
|
|
List<V> |
zrevrange(K key,
long start,
long stop)
|
|
List<V> |
zrevrangebyscore(K key,
double max,
double min)
|
|
List<V> |
zrevrangebyscore(K key,
double max,
double min,
long offset,
long count)
|
|
List<V> |
zrevrangebyscore(K key,
String max,
String min)
|
|
List<V> |
zrevrangebyscore(K key,
String max,
String min,
long offset,
long count)
|
|
List<ScoredValue<V>> |
zrevrangebyscoreWithScores(K key,
double max,
double min)
|
|
List<ScoredValue<V>> |
zrevrangebyscoreWithScores(K key,
double max,
double min,
long offset,
long count)
|
|
List<ScoredValue<V>> |
zrevrangebyscoreWithScores(K key,
String max,
String min)
|
|
List<ScoredValue<V>> |
zrevrangebyscoreWithScores(K key,
String max,
String min,
long offset,
long count)
|
|
List<ScoredValue<V>> |
zrevrangeWithScores(K key,
long start,
long stop)
|
|
Long |
zrevrank(K key,
V member)
|
|
Double |
zscore(K key,
V member)
|
|
Long |
zunionstore(K destination,
K... keys)
|
|
Long |
zunionstore(K destination,
ZStoreArgs storeArgs,
K... keys)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected RedisAsyncConnection<K,V> c
protected long timeout
protected TimeUnit unit
| Constructor Detail |
|---|
public RedisConnection(RedisAsyncConnection<K,V> c)
c - Underlying async connection.| Method Detail |
|---|
public void setTimeout(long timeout,
TimeUnit unit)
timeout - Command timeout.unit - Unit of time for the timeout.
public Long append(K key,
V value)
public String auth(String password)
public String bgrewriteaof()
public String bgsave()
public Long bitcount(K key)
public Long bitcount(K key,
long start,
long end)
public Long bitopAnd(K destination,
K... keys)
public Long bitopNot(K destination,
K source)
public Long bitopOr(K destination,
K... keys)
public Long bitopXor(K destination,
K... keys)
public KeyValue<K,V> blpop(long timeout,
K... keys)
public KeyValue<K,V> brpop(long timeout,
K... keys)
public V brpoplpush(long timeout,
K source,
K destination)
public K clientGetname()
public String clientSetname(K name)
public String clientKill(String addr)
public String clientList()
public List<String> configGet(String parameter)
public String configResetstat()
public String configSet(String parameter,
String value)
public Long dbsize()
public String debugObject(K key)
public Long decr(K key)
public Long decrby(K key,
long amount)
public Long del(K... keys)
public String discard()
public byte[] dump(K key)
public V echo(V msg)
public <T> T eval(V script,
ScriptOutputType type,
K... keys)
type.
T - Expected return type.script - Lua script to evaluate.type - Script output type.keys - Redis keys to pass to script.
public <T> T eval(V script,
ScriptOutputType type,
K[] keys,
V... values)
public <T> T evalsha(String digest,
ScriptOutputType type,
K... keys)
type.
T - Expected return type.digest - Lowercase hex string of script's SHA-1 digest.type - Script output type.keys - Redis keys to pass to script.
public <T> T evalsha(String digest,
ScriptOutputType type,
K[] keys,
V... values)
public Boolean exists(K key)
public Boolean expire(K key,
long seconds)
public Boolean expireat(K key,
Date timestamp)
public Boolean expireat(K key,
long timestamp)
public List<Object> exec()
public String flushall()
throws Exception
Exception
public String flushdb()
throws Exception
Exceptionpublic V get(K key)
public Long getbit(K key,
long offset)
public V getrange(K key,
long start,
long end)
public V getset(K key,
V value)
public Long hdel(K key,
K... fields)
public Boolean hexists(K key,
K field)
public V hget(K key,
K field)
public Long hincrby(K key,
K field,
long amount)
public Double hincrbyfloat(K key,
K field,
double amount)
public Map<K,V> hgetall(K key)
public List<K> hkeys(K key)
public Long hlen(K key)
public List<V> hmget(K key,
K... fields)
public String hmset(K key,
Map<K,V> map)
public Boolean hset(K key,
K field,
V value)
public Boolean hsetnx(K key,
K field,
V value)
public List<V> hvals(K key)
public Long incr(K key)
public Long incrby(K key,
long amount)
public Double incrbyfloat(K key,
double amount)
public String info()
public String info(String section)
public List<K> keys(K pattern)
public Date lastsave()
public V lindex(K key,
long index)
public Long linsert(K key,
boolean before,
V pivot,
V value)
public Long llen(K key)
public V lpop(K key)
public Long lpush(K key,
V... values)
public Long lpushx(K key,
V value)
public List<V> lrange(K key,
long start,
long stop)
public Long lrem(K key,
long count,
V value)
public String lset(K key,
long index,
V value)
public String ltrim(K key,
long start,
long stop)
public String migrate(String host,
int port,
K key,
int db,
long timeout)
public List<V> mget(K... keys)
public Boolean move(K key,
int db)
public String multi()
public String mset(Map<K,V> map)
public Boolean msetnx(Map<K,V> map)
public String objectEncoding(K key)
public Long objectIdletime(K key)
public Long objectRefcount(K key)
public Boolean persist(K key)
public Boolean pexpire(K key,
long milliseconds)
public Boolean pexpireat(K key,
Date timestamp)
public Boolean pexpireat(K key,
long timestamp)
public String ping()
public Long pttl(K key)
public Long publish(K channel,
V message)
public String quit()
public V randomkey()
public String rename(K key,
K newKey)
public Boolean renamenx(K key,
K newKey)
public String restore(K key,
long ttl,
byte[] value)
public V rpop(K key)
public V rpoplpush(K source,
K destination)
public Long rpush(K key,
V... values)
public Long rpushx(K key,
V value)
public Long sadd(K key,
V... members)
public String save()
public Long scard(K key)
public List<Boolean> scriptExists(String... digests)
public String scriptFlush()
public String scriptKill()
public String scriptLoad(V script)
public Set<V> sdiff(K... keys)
public Long sdiffstore(K destination,
K... keys)
public String select(int db)
public String set(K key,
V value)
public Long setbit(K key,
long offset,
int value)
public String setex(K key,
long seconds,
V value)
public Boolean setnx(K key,
V value)
public Long setrange(K key,
long offset,
V value)
@Deprecated public void shutdown()
public void shutdown(boolean save)
public Set<V> sinter(K... keys)
public Long sinterstore(K destination,
K... keys)
public Boolean sismember(K key,
V member)
public Boolean smove(K source,
K destination,
V member)
public String slaveof(String host,
int port)
public String slaveofNoOne()
public List<Object> slowlogGet()
public List<Object> slowlogGet(int count)
public Long slowlogLen()
public String slowlogReset()
public Set<V> smembers(K key)
public List<V> sort(K key)
public List<V> sort(K key,
SortArgs sortArgs)
public Long sortStore(K key,
SortArgs sortArgs,
K destination)
public V spop(K key)
public V srandmember(K key)
public Set<V> srandmember(K key,
long count)
public Long srem(K key,
V... members)
public Set<V> sunion(K... keys)
public Long sunionstore(K destination,
K... keys)
public String sync()
public Long strlen(K key)
public Long ttl(K key)
public String type(K key)
public String watch(K... keys)
public String unwatch()
public Long zadd(K key,
double score,
V member)
public Long zadd(K key,
Object... scoresAndValues)
public Long zcard(K key)
public Long zcount(K key,
double min,
double max)
public Long zcount(K key,
String min,
String max)
public Double zincrby(K key,
double amount,
K member)
public Long zinterstore(K destination,
K... keys)
public Long zinterstore(K destination,
ZStoreArgs storeArgs,
K... keys)
public List<V> zrange(K key,
long start,
long stop)
public List<ScoredValue<V>> zrangeWithScores(K key,
long start,
long stop)
public List<V> zrangebyscore(K key,
double min,
double max)
public List<V> zrangebyscore(K key,
String min,
String max)
public List<V> zrangebyscore(K key,
double min,
double max,
long offset,
long count)
public List<V> zrangebyscore(K key,
String min,
String max,
long offset,
long count)
public List<ScoredValue<V>> zrangebyscoreWithScores(K key,
double min,
double max)
public List<ScoredValue<V>> zrangebyscoreWithScores(K key,
String min,
String max)
public List<ScoredValue<V>> zrangebyscoreWithScores(K key,
double min,
double max,
long offset,
long count)
public List<ScoredValue<V>> zrangebyscoreWithScores(K key,
String min,
String max,
long offset,
long count)
public Long zrank(K key,
V member)
public Long zrem(K key,
V... members)
public Long zremrangebyrank(K key,
long start,
long stop)
public Long zremrangebyscore(K key,
double min,
double max)
public Long zremrangebyscore(K key,
String min,
String max)
public List<V> zrevrange(K key,
long start,
long stop)
public List<ScoredValue<V>> zrevrangeWithScores(K key,
long start,
long stop)
public List<V> zrevrangebyscore(K key,
double max,
double min)
public List<V> zrevrangebyscore(K key,
String max,
String min)
public List<V> zrevrangebyscore(K key,
double max,
double min,
long offset,
long count)
public List<V> zrevrangebyscore(K key,
String max,
String min,
long offset,
long count)
public List<ScoredValue<V>> zrevrangebyscoreWithScores(K key,
double max,
double min)
public List<ScoredValue<V>> zrevrangebyscoreWithScores(K key,
String max,
String min)
public List<ScoredValue<V>> zrevrangebyscoreWithScores(K key,
double max,
double min,
long offset,
long count)
public List<ScoredValue<V>> zrevrangebyscoreWithScores(K key,
String max,
String min,
long offset,
long count)
public Long zrevrank(K key,
V member)
public Double zscore(K key,
V member)
public Long zunionstore(K destination,
K... keys)
public Long zunionstore(K destination,
ZStoreArgs storeArgs,
K... keys)
public void close()
public String digest(V script)
script - Lua script.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||