public class DefaultStringRedisConnection extends Object implements StringRedisConnection, DecoratedRedisConnection
StringRedisConnection
.StringRedisConnection.StringTuple
RedisStringCommands.BitOperation, RedisStringCommands.SetOption
RedisListCommands.Position
RedisZSetCommands.Aggregate, RedisZSetCommands.Limit, RedisZSetCommands.Range, RedisZSetCommands.Tuple
RedisServerCommands.MigrateOption, RedisServerCommands.ShutdownOption
RedisGeoCommands.DistanceUnit, RedisGeoCommands.GeoLocation<T>, RedisGeoCommands.GeoRadiusCommandArgs
Constructor and Description |
---|
DefaultStringRedisConnection(RedisConnection connection)
Constructs a new
DefaultStringRedisConnection instance. |
DefaultStringRedisConnection(RedisConnection connection,
RedisSerializer<String> serializer)
Constructs a new
DefaultStringRedisConnection instance. |
Modifier and Type | Method and Description |
---|---|
Long |
append(byte[] key,
byte[] value)
Append a
value to key . |
Long |
append(String key,
String 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 |
bitCount(String key)
Count the number of set bits (population counting) in value stored at
key . |
Long |
bitCount(String 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.
|
Long |
bitOp(RedisStringCommands.BitOperation op,
String destination,
String... 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<String> |
bLPop(int timeout,
String... keys) |
List<byte[]> |
bRPop(int timeout,
byte[]... keys)
Removes and returns last element from lists stored at
keys (see: RedisListCommands.rPop(byte[]) ). |
List<String> |
bRPop(int timeout,
String... keys) |
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[]) ). |
String |
bRPopLPush(int timeout,
String srcKey,
String dstKey) |
void |
close()
Closes (or quits) the connection.
|
List<Object> |
closePipeline()
Executes the commands in the pipeline and returns their result.
|
Long |
dbSize()
Get the total number of available keys in currently selected database.
|
Long |
decr(byte[] key)
Decrement value of
key by 1. |
Long |
decr(String key)
Decrement value of
key by 1. |
Long |
decrBy(byte[] key,
long value)
Increment value of
key by value . |
Long |
decrBy(String key,
long value)
Increment value of
key by value . |
Long |
del(byte[]... keys)
Delete given
keys . |
Long |
del(String... 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. |
String |
echo(String message) |
<T> T |
eval(byte[] script,
ReturnType returnType,
int numKeys,
byte[]... keysAndArgs)
Evaluate given
script . |
<T> T |
eval(String script,
ReturnType returnType,
int numKeys,
String... keysAndArgs)
NOTE: This method will not deserialize Strings returned by Lua scripts, as they may not be encoded with the same
serializer used here.
|
<T> T |
evalSha(byte[] scriptSha1,
ReturnType returnType,
int numKeys,
byte[]... keysAndArgs)
Evaluate given
scriptSha . |
<T> T |
evalSha(String scriptSha1,
ReturnType returnType,
int numKeys,
byte[]... keysAndArgs)
Evaluate given
scriptSha . |
<T> T |
evalSha(String scriptSha1,
ReturnType returnType,
int numKeys,
String... keysAndArgs)
NOTE: This method will not deserialize Strings returned by Lua scripts, as they may not be encoded with the same
serializer used here.
|
List<Object> |
exec()
Executes all queued commands in a transaction started with
RedisTxCommands.multi() . |
Object |
execute(String command) |
Object |
execute(String command,
byte[]... args)
'Native' or 'raw' execution of the given command along-side the given arguments.
|
Object |
execute(String command,
String... args) |
Boolean |
exists(byte[] key)
Determine if given
key exists. |
Boolean |
exists(String key)
Determine if given
key exists. |
Boolean |
expire(byte[] key,
long seconds)
Set time to live for given
key in seconds. |
Boolean |
expire(String 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. |
Boolean |
expireAt(String 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.
|
Long |
geoAdd(byte[] key,
Iterable<RedisGeoCommands.GeoLocation<byte[]>> locations)
Add
RedisGeoCommands.GeoLocation s to key |
Long |
geoAdd(byte[] key,
Map<byte[],Point> memberCoordinateMap)
|
Long |
geoAdd(byte[] key,
Point point,
byte[] member)
Add
Point with given member name to key. |
Long |
geoAdd(byte[] key,
RedisGeoCommands.GeoLocation<byte[]> location)
Add
RedisGeoCommands.GeoLocation to key. |
Long |
geoAdd(String key,
Iterable<RedisGeoCommands.GeoLocation<String>> locations)
Add
GeoLocation s to key |
Long |
geoAdd(String key,
Map<String,Point> memberCoordinateMap)
|
Long |
geoAdd(String key,
Point point,
String member)
Add
Point with given member name to key. |
Long |
geoAdd(String key,
RedisGeoCommands.GeoLocation<String> location)
Add
GeoLocation to key. |
Distance |
geoDist(byte[] key,
byte[] member1,
byte[] member2)
Get the
Distance between member1 and member2. |
Distance |
geoDist(byte[] key,
byte[] member1,
byte[] member2,
Metric metric)
|
Distance |
geoDist(String key,
String member1,
String member2)
Get the
Distance between member1 and member2. |
Distance |
geoDist(String key,
String member1,
String member2,
Metric metric)
|
List<String> |
geoHash(byte[] key,
byte[]... members)
Get Geohash representation of the position for one or more members.
|
List<String> |
geoHash(String key,
String... members)
Get geohash representation of the position for one or more members.
|
List<Point> |
geoPos(byte[] key,
byte[]... members)
Get the
Point representation of positions for one or more members. |
List<Point> |
geoPos(String key,
String... members)
Get the
Point representation of positions for one or more members. |
GeoResults<RedisGeoCommands.GeoLocation<byte[]>> |
geoRadius(byte[] key,
Circle within)
Get the members within the boundaries of a given
Circle . |
GeoResults<RedisGeoCommands.GeoLocation<byte[]>> |
geoRadius(byte[] key,
Circle within,
RedisGeoCommands.GeoRadiusCommandArgs args)
Get the members within the boundaries of a given
Circle applying RedisGeoCommands.GeoRadiusCommandArgs . |
GeoResults<RedisGeoCommands.GeoLocation<String>> |
geoRadius(String key,
Circle within)
Get the members within the boundaries of a given
Circle . |
GeoResults<RedisGeoCommands.GeoLocation<String>> |
geoRadius(String key,
Circle within,
RedisGeoCommands.GeoRadiusCommandArgs args)
Get the members within the boundaries of a given
Circle applying GeoRadiusCommandArgs . |
GeoResults<RedisGeoCommands.GeoLocation<byte[]>> |
geoRadiusByMember(byte[] key,
byte[] member,
Distance radius)
Get the members within the circle defined by the members coordinates and given
Distance . |
GeoResults<RedisGeoCommands.GeoLocation<byte[]>> |
geoRadiusByMember(byte[] key,
byte[] member,
Distance radius,
RedisGeoCommands.GeoRadiusCommandArgs args)
Get the members within the circle defined by the members coordinates, given
Distance
and RedisGeoCommands.GeoRadiusCommandArgs . |
GeoResults<RedisGeoCommands.GeoLocation<byte[]>> |
geoRadiusByMember(byte[] key,
byte[] member,
double radius)
Get the members within the circle defined by the members coordinates and given
radius.
|
GeoResults<RedisGeoCommands.GeoLocation<String>> |
geoRadiusByMember(String key,
String member,
Distance radius)
Get the members within the circle defined by the members coordinates and given
Distance . |
GeoResults<RedisGeoCommands.GeoLocation<String>> |
geoRadiusByMember(String key,
String member,
Distance radius,
RedisGeoCommands.GeoRadiusCommandArgs args)
Get the members within the circle defined by the members coordinates and given
Distance and GeoRadiusCommandArgs . |
GeoResults<RedisGeoCommands.GeoLocation<String>> |
geoRadiusByMember(String key,
String member,
double radius)
Get the members within the circle defined by the members coordinates and given
radius.
|
Long |
geoRemove(byte[] key,
byte[]... members)
Remove the members.
|
Long |
geoRemove(String key,
String... members)
Remove the members.
|
byte[] |
get(byte[] key)
Get the value of
key . |
String |
get(String key)
Get the value of
key . |
Boolean |
getBit(byte[] key,
long offset)
Get the bit value at
offset of value at key . |
Boolean |
getBit(String 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 pattern)
Load configuration parameters for given
pattern from server. |
RedisConnection |
getDelegate()
Gets the underlying
RedisConnection . |
Object |
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 . |
String |
getRange(String key,
long start,
long end)
Get a substring of value of
key between begin and end . |
RedisSentinelConnection |
getSentinelConnection() |
byte[] |
getSet(byte[] key,
byte[] value)
Set value of
key and return its old value. |
String |
getSet(String key,
String 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 . |
Long |
hDel(String key,
String... fields) |
Boolean |
hExists(byte[] key,
byte[] field)
Determine if given hash
field exists. |
Boolean |
hExists(String key,
String field) |
byte[] |
hGet(byte[] key,
byte[] field)
Get value for given
field from hash at key . |
String |
hGet(String key,
String field) |
Map<byte[],byte[]> |
hGetAll(byte[] key)
Get entire hash stored at
key . |
Map<String,String> |
hGetAll(String 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 . |
Double |
hIncrBy(String key,
String field,
double delta) |
Long |
hIncrBy(String key,
String field,
long delta) |
Set<byte[]> |
hKeys(byte[] key)
Get key set (fields) of hash at
key . |
Set<String> |
hKeys(String key) |
Long |
hLen(byte[] key)
Get size of hash at
key . |
Long |
hLen(String key) |
List<byte[]> |
hMGet(byte[] key,
byte[]... fields)
Get values for given
fields from hash at key . |
List<String> |
hMGet(String key,
String... fields) |
void |
hMSet(byte[] key,
Map<byte[],byte[]> hashes)
Set multiple hash fields to multiple values using data provided in
hashes |
void |
hMSet(String key,
Map<String,String> hashes) |
Cursor<Map.Entry<byte[],byte[]>> |
hScan(byte[] key,
ScanOptions options)
Use a
Cursor to iterate over entries in hash at key . |
Cursor<Map.Entry<String,String>> |
hScan(String key,
ScanOptions options) |
Boolean |
hSet(byte[] key,
byte[] field,
byte[] value)
Set the
value of a hash field . |
Boolean |
hSet(String key,
String field,
String value) |
Boolean |
hSetNX(byte[] key,
byte[] field,
byte[] value)
Set the
value of a hash field only if field does not exist. |
Boolean |
hSetNX(String key,
String field,
String value) |
List<byte[]> |
hVals(byte[] key)
Get entry set (values) of hash at
field . |
List<String> |
hVals(String key) |
Long |
incr(byte[] key)
Increment value of
key by 1. |
Long |
incr(String 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 . |
Double |
incrBy(String key,
double value)
Increment value of
key by value . |
Long |
incrBy(String key,
long value)
Increment value of
key by value . |
Properties |
info()
Load default server information like
mempory
cpu utilization
replication
See http://redis.io/commands/info
|
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 . |
Collection<String> |
keys(String pattern)
Find all keys matching the given
pattern . |
void |
killClient(String host,
int port)
Closes a given client connection identified by host: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 . |
String |
lIndex(String key,
long index) |
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 |
lInsert(String key,
RedisListCommands.Position where,
String pivot,
String value) |
Long |
lLen(byte[] key)
Get the size of list stored at
key . |
Long |
lLen(String key) |
byte[] |
lPop(byte[] key)
Removes and returns first element in list stored at
key . |
String |
lPop(String key) |
Long |
lPush(byte[] key,
byte[]... values)
Prepend
values to key . |
Long |
lPush(String key,
String... values) |
Long |
lPushX(byte[] key,
byte[] value)
Prepend
values to key only if the list exists. |
Long |
lPushX(String key,
String value) |
List<byte[]> |
lRange(byte[] key,
long start,
long end)
Get elements between
begin and end from list at key . |
List<String> |
lRange(String key,
long start,
long end) |
Long |
lRem(byte[] key,
long count,
byte[] value)
Removes the first
count occurrences of value from the list stored at key . |
Long |
lRem(String key,
long count,
String value) |
void |
lSet(byte[] key,
long index,
byte[] value)
Set the
value list element at index . |
void |
lSet(String key,
long index,
String value) |
void |
lTrim(byte[] key,
long start,
long end)
Trim list at
key to elements between begin and end . |
void |
lTrim(String key,
long start,
long end) |
List<byte[]> |
mGet(byte[]... keys)
Get the values of all given
keys . |
List<String> |
mGet(String... keys)
Get the values of all given
keys . |
void |
migrate(byte[] key,
RedisNode target,
int dbIndex,
RedisServerCommands.MigrateOption option) |
void |
migrate(byte[] key,
RedisNode target,
int dbIndex,
RedisServerCommands.MigrateOption option,
long timeout) |
Boolean |
move(byte[] key,
int dbIndex)
Move given
key to database with index . |
Boolean |
move(String key,
int dbIndex)
Move given
key to database with index . |
void |
mSet(Map<byte[],byte[]> tuple)
Set multiple keys to multiple values using key-value pairs provided in
tuple . |
Boolean |
mSetNX(Map<byte[],byte[]> tuple)
Set multiple keys to multiple values using key-value pairs provided in
tuple only if the provided key does
not exist. |
Boolean |
mSetNXString(Map<String,String> tuple)
Set multiple keys to multiple values using key-value pairs provided in
tuple only if the provided key does
not exist. |
void |
mSetString(Map<String,String> tuple)
Set multiple keys to multiple values using key-value pairs provided in
tuple . |
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 |
persist(String key)
Remove the expiration from given
key . |
Boolean |
pExpire(byte[] key,
long millis)
Set time to live for given
key in milliseconds. |
Boolean |
pExpire(String 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. |
Boolean |
pExpireAt(String key,
long unixTimeInMillis)
Set the expiration for given
key as a UNIX timestamp in milliseconds. |
Long |
pfAdd(byte[] key,
byte[]... values)
Adds given values to the HyperLogLog stored at given key.
|
Long |
pfAdd(String key,
String... values)
Adds given values to the HyperLogLog stored at given key.
|
Long |
pfCount(byte[]... keys)
Return the approximated cardinality of the structures observed by the HyperLogLog at key(s).
|
Long |
pfCount(String... keys) |
void |
pfMerge(byte[] destinationKey,
byte[]... sourceKeys)
Merge N different HyperLogLogs at sourceKeys into a single destinationKey.
|
void |
pfMerge(String destinationKey,
String... sourceKeys) |
String |
ping()
Test connection.
|
void |
pSetEx(byte[] key,
long milliseconds,
byte[] value)
Set the
value and expiration in milliseconds for key . |
void |
pSetEx(String key,
long seconds,
String value)
Set the
value and expiration in milliseconds for key . |
void |
pSubscribe(MessageListener listener,
byte[]... patterns)
Subscribes the connection to all channels matching the given patterns.
|
void |
pSubscribe(MessageListener listener,
String... patterns) |
Long |
pTtl(byte[] key)
Get the precise time to live for
key in milliseconds. |
Long |
pTtl(byte[] key,
TimeUnit timeUnit)
Get the precise time to live for
key in and convert it to the given TimeUnit . |
Long |
pTtl(String key)
Get the precise time to live for
key in milliseconds. |
Long |
pTtl(String key,
TimeUnit timeUnit)
Get the precise time to live for
key in and convert it to the given TimeUnit . |
Long |
publish(byte[] channel,
byte[] message)
Publishes the given message to the given channel.
|
Long |
publish(String channel,
String message) |
byte[] |
randomKey()
Return a random key from the keyspace.
|
void |
rename(byte[] oldName,
byte[] newName)
Rename key
oleName to newName . |
void |
rename(String oldName,
String newName)
Rename key
oleName to newName . |
Boolean |
renameNX(byte[] oldName,
byte[] newName)
Rename key
oleName to newName only if newName does not exist. |
Boolean |
renameNX(String oldName,
String 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)
|
byte[] |
rPop(byte[] key)
Removes and returns last element in list stored at
key . |
String |
rPop(String key) |
byte[] |
rPopLPush(byte[] srcKey,
byte[] dstKey)
Remove the last element from list at
srcKey , append it to dstKey and return its value. |
String |
rPopLPush(String srcKey,
String dstKey) |
Long |
rPush(byte[] key,
byte[]... values)
Append
values to key . |
Long |
rPush(String key,
String... values) |
Long |
rPushX(byte[] key,
byte[] value)
Append values to
key only if the list exists. |
Long |
rPushX(String key,
String value) |
Long |
sAdd(byte[] key,
byte[]... values)
Add given
values to set at key . |
Long |
sAdd(String key,
String... values) |
void |
save()
Synchronous save current db snapshot on server.
|
Cursor<byte[]> |
scan(ScanOptions options)
Use a
Cursor to iterate over keys. |
Long |
sCard(byte[] key)
Get size of set at
key . |
Long |
sCard(String 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.
|
String |
scriptLoad(String script) |
Set<byte[]> |
sDiff(byte[]... keys)
Diff all sets for given
keys . |
Set<String> |
sDiff(String... keys) |
Long |
sDiffStore(byte[] destKey,
byte[]... keys)
Diff all sets for given
keys and store result in destKey
See http://redis.io/commands/sdiffstore |
Long |
sDiffStore(String destKey,
String... keys) |
void |
select(int dbIndex)
Select the DB with given positive
dbIndex . |
void |
set(byte[] key,
byte[] value)
Set
value for key . |
void |
set(byte[] key,
byte[] value,
Expiration expiration,
RedisStringCommands.SetOption option)
Set
value for key applying timeouts from expiration if set and inserting/updating values
depending on option . |
void |
set(String key,
String value)
Set
value for key . |
void |
set(String key,
String value,
Expiration expiration,
RedisStringCommands.SetOption option)
Set
value for key applying timeouts from expiration if set and inserting/updating values
depending on option . |
Boolean |
setBit(byte[] key,
long offset,
boolean value)
Sets the bit at
offset in value stored at key . |
Boolean |
setBit(String 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 |
setClientName(String name)
Assign given
name to connection using registered RedisSerializer for name conversion. |
void |
setConfig(String param,
String value)
Set server configuration for
param to value . |
void |
setDeserializePipelineAndTxResults(boolean deserializePipelineAndTxResults)
Specifies if pipelined and tx results should be deserialized to Strings.
|
void |
setEx(byte[] key,
long seconds,
byte[] value)
Set the
value and expiration in seconds for key . |
void |
setEx(String key,
long seconds,
String 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. |
Boolean |
setNX(String key,
String 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 |
setRange(String key,
String 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 . |
Set<String> |
sInter(String... keys) |
Long |
sInterStore(byte[] destKey,
byte[]... keys)
Intersect all given sets at
keys and store result in destKey . |
Long |
sInterStore(String destKey,
String... keys) |
Boolean |
sIsMember(byte[] key,
byte[] value)
Check if set at
key contains value . |
Boolean |
sIsMember(String key,
String 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 . |
Set<String> |
sMembers(String key) |
Boolean |
sMove(byte[] srcKey,
byte[] destKey,
byte[] value)
Move
value from srcKey to destKey
See http://redis.io/commands/smove |
Boolean |
sMove(String srcKey,
String destKey,
String value) |
List<byte[]> |
sort(byte[] key,
SortParameters params)
Sort the elements for
key . |
Long |
sort(byte[] key,
SortParameters params,
byte[] storeKey)
Sort the elements for
key and store result in storeKey . |
List<String> |
sort(String key,
SortParameters params) |
Long |
sort(String key,
SortParameters params,
String storeKey) |
byte[] |
sPop(byte[] key)
Remove and return a random member from set at
key . |
String |
sPop(String 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 . |
String |
sRandMember(String key) |
List<String> |
sRandMember(String key,
long count) |
Long |
sRem(byte[] key,
byte[]... values)
Remove given
values from set at key and return the number of removed elements. |
Long |
sRem(String key,
String... values) |
Cursor<byte[]> |
sScan(byte[] key,
ScanOptions options)
Use a
Cursor to iterate over elements in set at key . |
Cursor<String> |
sScan(String key,
ScanOptions options) |
Long |
strLen(byte[] key)
Get the length of the value stored at
key . |
Long |
strLen(String key)
Get the length of the value stored at
key . |
void |
subscribe(MessageListener listener,
byte[]... channels)
Subscribes the connection to the given channels.
|
void |
subscribe(MessageListener listener,
String... channels) |
Set<byte[]> |
sUnion(byte[]... keys)
Union all sets at given
keys . |
Set<String> |
sUnion(String... keys) |
Long |
sUnionStore(byte[] destKey,
byte[]... keys)
Union all sets at given
keys and store result in destKey . |
Long |
sUnionStore(String destKey,
String... keys) |
Long |
time()
Request server timestamp using
TIME command. |
Long |
ttl(byte[] key)
Get the time to live for
key in seconds. |
Long |
ttl(byte[] key,
TimeUnit timeUnit)
Get the time to live for
key in and convert it to the given TimeUnit . |
Long |
ttl(String key)
Get the time to live for
key in seconds. |
Long |
ttl(String key,
TimeUnit timeUnit)
Get the time to live for
key in and convert it to the given TimeUnit . |
DataType |
type(byte[] key)
Determine the type stored at
key . |
DataType |
type(String 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. |
Boolean |
zAdd(String key,
double score,
String value) |
Long |
zAdd(String key,
Set<StringRedisConnection.StringTuple> tuples) |
Long |
zCard(byte[] key)
Get the size of sorted set with
key . |
Long |
zCard(String key) |
Long |
zCount(byte[] key,
double min,
double max)
Count number of elements within sorted set with scores between
min and max . |
Long |
zCount(byte[] key,
RedisZSetCommands.Range range)
Count number of elements within sorted set with scores between
Range#min and Range#max . |
Long |
zCount(String key,
double min,
double max) |
Double |
zIncrBy(byte[] key,
double increment,
byte[] value)
Increment the score of element with
value in sorted set by increment . |
Double |
zIncrBy(String key,
double increment,
String value) |
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 . |
Long |
zInterStore(String destKey,
RedisZSetCommands.Aggregate aggregate,
int[] weights,
String... sets) |
Long |
zInterStore(String destKey,
String... sets) |
Set<byte[]> |
zRange(byte[] key,
long start,
long end)
Get elements between
begin and end from sorted set. |
Set<String> |
zRange(String key,
long start,
long end) |
Set<byte[]> |
zRangeByLex(byte[] key)
Get all the elements in the sorted set at key in lexicographical ordering.
|
Set<byte[]> |
zRangeByLex(byte[] key,
RedisZSetCommands.Range range)
Get all the elements in
RedisZSetCommands.Range from the sorted set at key in lexicographical ordering. |
Set<byte[]> |
zRangeByLex(byte[] key,
RedisZSetCommands.Range range,
RedisZSetCommands.Limit limit)
Get all the elements in
RedisZSetCommands.Range from the sorted set at key in lexicographical ordering. |
Set<String> |
zRangeByLex(String key)
Get all elements in the sorted set at key in lexicographical ordering.
|
Set<String> |
zRangeByLex(String key,
RedisZSetCommands.Range range)
Get the elements in
Range from the sorted set at key in lexicographical ordering |
Set<String> |
zRangeByLex(String key,
RedisZSetCommands.Range range,
RedisZSetCommands.Limit limit)
Get the elements in
Range from the sorted set at key in lexicographical ordering. |
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<byte[]> |
zRangeByScore(byte[] key,
RedisZSetCommands.Range range)
Get elements where score is between
Range#min and Range#max from sorted set. |
Set<byte[]> |
zRangeByScore(byte[] key,
RedisZSetCommands.Range range,
RedisZSetCommands.Limit limit)
Get elements in range from
Limit#count to Limit#offset where score is between Range#min and
Range#max from sorted set. |
Set<byte[]> |
zRangeByScore(byte[] key,
String min,
String max)
Get elements where score is between
min and max from sorted set. |
Set<byte[]> |
zRangeByScore(byte[] key,
String min,
String max,
long offset,
long count)
Get elements in range from
begin to end where score is between min and max from
sorted set. |
Set<String> |
zRangeByScore(String key,
double min,
double max) |
Set<String> |
zRangeByScore(String key,
double min,
double max,
long offset,
long count) |
Set<byte[]> |
zRangeByScore(String key,
String min,
String max) |
Set<byte[]> |
zRangeByScore(String key,
String min,
String 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)
Get set of
RedisZSetCommands.Tuple s in range from begin to end where score is between min and
max from sorted set. |
Set<RedisZSetCommands.Tuple> |
zRangeByScoreWithScores(byte[] key,
RedisZSetCommands.Range range)
|
Set<RedisZSetCommands.Tuple> |
zRangeByScoreWithScores(byte[] key,
RedisZSetCommands.Range range,
RedisZSetCommands.Limit limit)
Get set of
RedisZSetCommands.Tuple s in range from Limit#offset to Limit#offset + Limit#count where score is
between Range#min and Range#max from sorted set. |
Set<StringRedisConnection.StringTuple> |
zRangeByScoreWithScores(String key,
double min,
double max) |
Set<StringRedisConnection.StringTuple> |
zRangeByScoreWithScores(String key,
double min,
double max,
long offset,
long count) |
Set<RedisZSetCommands.Tuple> |
zRangeWithScores(byte[] key,
long start,
long end)
|
Set<StringRedisConnection.StringTuple> |
zRangeWithScores(String key,
long start,
long end) |
Long |
zRank(byte[] key,
byte[] value)
Determine the index of element with
value in a sorted set. |
Long |
zRank(String key,
String value) |
Long |
zRem(byte[] key,
byte[]... values)
Remove
values from sorted set. |
Long |
zRem(String key,
String... values) |
Long |
zRemRange(byte[] key,
long start,
long end)
Remove elements in range between
begin and end from sorted set with key . |
Long |
zRemRange(String key,
long start,
long end) |
Long |
zRemRangeByScore(byte[] key,
double min,
double max)
Remove elements with scores between
min and max from sorted set with key . |
Long |
zRemRangeByScore(byte[] key,
RedisZSetCommands.Range range)
Remove elements with scores between
Range#min and Range#max from sorted set with key . |
Long |
zRemRangeByScore(String key,
double min,
double max) |
Set<byte[]> |
zRevRange(byte[] key,
long start,
long end)
Get elements in range from
begin to end from sorted set ordered from high to low. |
Set<String> |
zRevRange(String key,
long start,
long end) |
Set<byte[]> |
zRevRangeByScore(byte[] key,
double min,
double max)
Get elements where score is between
min and max from sorted set ordered from high to 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<byte[]> |
zRevRangeByScore(byte[] key,
RedisZSetCommands.Range range)
Get elements where score is between
Range#min and Range#max from sorted set ordered from high to
low. |
Set<byte[]> |
zRevRangeByScore(byte[] key,
RedisZSetCommands.Range range,
RedisZSetCommands.Limit limit)
Get elements in range from
Limit#offset to Limit#offset + Limit#count where score is between
Range#min and Range#max from sorted set ordered high -> low. |
Set<String> |
zRevRangeByScore(String key,
double min,
double max) |
Set<String> |
zRevRangeByScore(String key,
double min,
double max,
long offset,
long count) |
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 from high to
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> |
zRevRangeByScoreWithScores(byte[] key,
RedisZSetCommands.Range range)
Get set of
RedisZSetCommands.Tuple where score is between Range#min and Range#max from sorted set ordered
from high to low. |
Set<RedisZSetCommands.Tuple> |
zRevRangeByScoreWithScores(byte[] key,
RedisZSetCommands.Range range,
RedisZSetCommands.Limit limit)
Get set of
RedisZSetCommands.Tuple in range from Limit#offset to Limit#count where score is between
Range#min and Range#max from sorted set ordered high -> low. |
Set<StringRedisConnection.StringTuple> |
zRevRangeByScoreWithScores(String key,
double min,
double max) |
Set<StringRedisConnection.StringTuple> |
zRevRangeByScoreWithScores(String key,
double min,
double max,
long offset,
long count) |
Set<RedisZSetCommands.Tuple> |
zRevRangeWithScores(byte[] key,
long start,
long end)
Get set of
RedisZSetCommands.Tuple s in range from begin to end from sorted set ordered from high to low. |
Set<StringRedisConnection.StringTuple> |
zRevRangeWithScores(String key,
long start,
long end) |
Long |
zRevRank(byte[] key,
byte[] value)
Determine the index of element with
value in a sorted set when scored high to low. |
Long |
zRevRank(String key,
String value) |
Cursor<RedisZSetCommands.Tuple> |
zScan(byte[] key,
ScanOptions options)
Use a
Cursor to iterate over elements in sorted set at key . |
Cursor<StringRedisConnection.StringTuple> |
zScan(String key,
ScanOptions options) |
Double |
zScore(byte[] key,
byte[] value)
Get the score of element with
value from sorted set with key key . |
Double |
zScore(String key,
String value) |
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 . |
Long |
zUnionStore(String destKey,
RedisZSetCommands.Aggregate aggregate,
int[] weights,
String... sets) |
Long |
zUnionStore(String destKey,
String... sets) |
public DefaultStringRedisConnection(RedisConnection connection)
DefaultStringRedisConnection
instance. Uses StringRedisSerializer
as
underlying serializer.connection
- Redis connectionpublic DefaultStringRedisConnection(RedisConnection connection, RedisSerializer<String> serializer)
DefaultStringRedisConnection
instance.connection
- Redis connectionserializer
- String serializerpublic Long append(byte[] key, byte[] value)
RedisStringCommands
value
to key
.
See http://redis.io/commands/append
append
in interface RedisStringCommands
key
- must not be null.public void bgSave()
RedisServerCommands
See http://redis.io/commands/bgsave
bgSave
in interface RedisServerCommands
public void bgReWriteAof()
RedisServerCommands
See http://redis.io/commands/bgrewriteaof
bgReWriteAof
in interface RedisServerCommands
@Deprecated public void bgWriteAof()
bgReWriteAof()
.RedisServerCommands
See http://redis.io/commands/bgrewriteaof
bgWriteAof
in interface RedisServerCommands
public List<byte[]> bLPop(int timeout, byte[]... keys)
RedisListCommands
keys
(see: RedisListCommands.lPop(byte[])
). timeout
reached.
See http://redis.io/commands/blpop
bLPop
in interface RedisListCommands
public List<byte[]> bRPop(int timeout, byte[]... keys)
RedisListCommands
keys
(see: RedisListCommands.rPop(byte[])
). timeout
reached.
See http://redis.io/commands/brpop
bRPop
in interface RedisListCommands
public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey)
RedisListCommands
srcKey
, append it to dstKey
and return its value (see
RedisListCommands.rPopLPush(byte[], byte[])
). timeout
reached.
See http://redis.io/commands/brpoplpush
bRPopLPush
in interface RedisListCommands
public void close() throws RedisSystemException
RedisConnection
close
in interface RedisConnection
RedisSystemException
public Long dbSize()
RedisServerCommands
See http://redis.io/commands/dbsize
dbSize
in interface RedisServerCommands
public Long decr(byte[] key)
RedisStringCommands
key
by 1.
See http://redis.io/commands/decr
decr
in interface RedisStringCommands
key
- must not be null.public Long decrBy(byte[] key, long value)
RedisStringCommands
key
by value
.
See http://redis.io/commands/decrby
decrBy
in interface RedisStringCommands
key
- must not be null.public Long del(byte[]... keys)
RedisKeyCommands
keys
.
See http://redis.io/commands/del
del
in interface RedisKeyCommands
public void discard()
RedisTxCommands
RedisTxCommands.multi()
.
See http://redis.io/commands/discard
discard
in interface RedisTxCommands
public byte[] echo(byte[] message)
RedisConnectionCommands
message
via server roundtrip.
See http://redis.io/commands/echo
echo
in interface RedisConnectionCommands
public List<Object> exec()
RedisTxCommands
RedisTxCommands.multi()
. #watch(byte[])
the operation will fail if any of watched keys has been modified.
See http://redis.io/commands/exec
exec
in interface RedisTxCommands
public Boolean exists(byte[] key)
RedisKeyCommands
key
exists.
See http://redis.io/commands/exists
exists
in interface RedisKeyCommands
public Boolean expire(byte[] key, long seconds)
RedisKeyCommands
key
in seconds.
See http://redis.io/commands/expire
expire
in interface RedisKeyCommands
public Boolean expireAt(byte[] key, long unixTime)
RedisKeyCommands
key
as a UNIX timestamp.
See http://redis.io/commands/expireat
expireAt
in interface RedisKeyCommands
public void flushAll()
RedisServerCommands
See http://redis.io/commands/flushall
flushAll
in interface RedisServerCommands
public void flushDb()
RedisServerCommands
See http://redis.io/commands/flushdb
flushDb
in interface RedisServerCommands
public byte[] get(byte[] key)
RedisStringCommands
key
.
See http://redis.io/commands/get
get
in interface RedisStringCommands
key
- must not be null.public Boolean getBit(byte[] key, long offset)
RedisStringCommands
offset
of value at key
.
See http://redis.io/commands/getbit
getBit
in interface RedisStringCommands
key
- must not be null.public List<String> getConfig(String pattern)
RedisServerCommands
pattern
from server.
See http://redis.io/commands/config-get
getConfig
in interface RedisServerCommands
public Object getNativeConnection()
RedisConnection
getNativeConnection
in interface RedisConnection
public byte[] getRange(byte[] key, long start, long end)
RedisStringCommands
key
between begin
and end
.
See http://redis.io/commands/getrange
getRange
in interface RedisStringCommands
key
- must not be null.public byte[] getSet(byte[] key, byte[] value)
RedisStringCommands
key
and return its old value.
See http://redis.io/commands/getset
getSet
in interface RedisStringCommands
key
- must not be null.public Subscription getSubscription()
RedisPubSubCommands
getSubscription
in interface RedisPubSubCommands
public Long hDel(byte[] key, byte[]... fields)
RedisHashCommands
fields
.hDel
in interface RedisHashCommands
http://redis.io/commands/hdel
public Boolean hExists(byte[] key, byte[] field)
RedisHashCommands
field
exists.hExists
in interface RedisHashCommands
http://redis.io/commands/hexits
public byte[] hGet(byte[] key, byte[] field)
RedisHashCommands
field
from hash at key
.hGet
in interface RedisHashCommands
http://redis.io/commands/hget
public Map<byte[],byte[]> hGetAll(byte[] key)
RedisHashCommands
key
.hGetAll
in interface RedisHashCommands
http://redis.io/commands/hgetall
public Long hIncrBy(byte[] key, byte[] field, long delta)
RedisHashCommands
value
of a hash field
by the given delta
.hIncrBy
in interface RedisHashCommands
http://redis.io/commands/hincrby
public Double hIncrBy(byte[] key, byte[] field, double delta)
RedisHashCommands
value
of a hash field
by the given delta
.hIncrBy
in interface RedisHashCommands
http://redis.io/commands/hincrbyfloat
public Set<byte[]> hKeys(byte[] key)
RedisHashCommands
key
.hKeys
in interface RedisHashCommands
http://redis.io/commands/h?
public Long hLen(byte[] key)
RedisHashCommands
key
.hLen
in interface RedisHashCommands
http://redis.io/commands/hlen
public List<byte[]> hMGet(byte[] key, byte[]... fields)
RedisHashCommands
fields
from hash at key
.hMGet
in interface RedisHashCommands
http://redis.io/commands/hmget
public void hMSet(byte[] key, Map<byte[],byte[]> hashes)
RedisHashCommands
hashes
hMSet
in interface RedisHashCommands
http://redis.io/commands/hmset
public Boolean hSet(byte[] key, byte[] field, byte[] value)
RedisHashCommands
value
of a hash field
.hSet
in interface RedisHashCommands
http://redis.io/commands/hset
public Boolean hSetNX(byte[] key, byte[] field, byte[] value)
RedisHashCommands
value
of a hash field
only if field
does not exist.hSetNX
in interface RedisHashCommands
http://redis.io/commands/hsetnx
public List<byte[]> hVals(byte[] key)
RedisHashCommands
field
.hVals
in interface RedisHashCommands
http://redis.io/commands/hvals
public Long incr(byte[] key)
RedisStringCommands
key
by 1.
See http://redis.io/commands/incr
incr
in interface RedisStringCommands
key
- must not be null.public Long incrBy(byte[] key, long value)
RedisStringCommands
key
by value
.
See http://redis.io/commands/incrby
incrBy
in interface RedisStringCommands
key
- must not be null.public Double incrBy(byte[] key, double value)
RedisStringCommands
key
by value
.
See http://redis.io/commands/incrbyfloat
incrBy
in interface RedisStringCommands
key
- must not be null.public Properties info()
RedisServerCommands
See http://redis.io/commands/info
info
in interface RedisServerCommands
public Properties info(String section)
RedisServerCommands
selection
.
See http://redis.io/commands/info
info
in interface RedisServerCommands
public boolean isClosed()
RedisConnection
isClosed
in interface RedisConnection
public boolean isQueueing()
RedisConnection
isQueueing
in interface RedisConnection
public boolean isSubscribed()
RedisPubSubCommands
isSubscribed
in interface RedisPubSubCommands
public Set<byte[]> keys(byte[] pattern)
RedisKeyCommands
pattern
.
See http://redis.io/commands/keys
keys
in interface RedisKeyCommands
public Long lastSave()
RedisServerCommands
RedisServerCommands.bgSave()
operation in seconds.
See http://redis.io/commands/lastsave
lastSave
in interface RedisServerCommands
public byte[] lIndex(byte[] key, long index)
RedisListCommands
index
form list at key
.
See http://redis.io/commands/lindex
lIndex
in interface RedisListCommands
public Long lInsert(byte[] key, RedisListCommands.Position where, byte[] pivot, byte[] value)
RedisListCommands
value
RedisListCommands.Position.BEFORE
or RedisListCommands.Position.AFTER
existing pivot
for key
.
See http://redis.io/commands/linsert
lInsert
in interface RedisListCommands
public Long lLen(byte[] key)
RedisListCommands
key
.
See http://redis.io/commands/llen
lLen
in interface RedisListCommands
public byte[] lPop(byte[] key)
RedisListCommands
key
.
See http://redis.io/commands/lpop
lPop
in interface RedisListCommands
public Long lPush(byte[] key, byte[]... values)
RedisListCommands
values
to key
.
See http://redis.io/commands/lpush
lPush
in interface RedisListCommands
public Long lPushX(byte[] key, byte[] value)
RedisListCommands
values
to key
only if the list exists.
See http://redis.io/commands/lpushx
lPushX
in interface RedisListCommands
public List<byte[]> lRange(byte[] key, long start, long end)
RedisListCommands
begin
and end
from list at key
.
See http://redis.io/commands/lrange
lRange
in interface RedisListCommands
public Long lRem(byte[] key, long count, byte[] value)
RedisListCommands
count
occurrences of value
from the list stored at key
.
See http://redis.io/commands/lrem
lRem
in interface RedisListCommands
public void lSet(byte[] key, long index, byte[] value)
RedisListCommands
value
list element at index
.
See http://redis.io/commands/lset
lSet
in interface RedisListCommands
public void lTrim(byte[] key, long start, long end)
RedisListCommands
key
to elements between begin
and end
.
See http://redis.io/commands/ltrim
lTrim
in interface RedisListCommands
public List<byte[]> mGet(byte[]... keys)
RedisStringCommands
keys
.
See http://redis.io/commands/mget
mGet
in interface RedisStringCommands
public void mSet(Map<byte[],byte[]> tuple)
RedisStringCommands
tuple
.
See http://redis.io/commands/mset
mSet
in interface RedisStringCommands
public Boolean mSetNX(Map<byte[],byte[]> tuple)
RedisStringCommands
tuple
only if the provided key does
not exist.
See http://redis.io/commands/msetnx
mSetNX
in interface RedisStringCommands
public void multi()
RedisTxCommands
RedisTxCommands.exec()
or rolled back using RedisTxCommands.discard()
See http://redis.io/commands/multi
multi
in interface RedisTxCommands
public Boolean persist(byte[] key)
RedisKeyCommands
key
.
See http://redis.io/commands/persist
persist
in interface RedisKeyCommands
public Boolean move(byte[] key, int dbIndex)
RedisKeyCommands
key
to database with index
.
See http://redis.io/commands/move
move
in interface RedisKeyCommands
public String ping()
RedisConnectionCommands
See http://redis.io/commands/ping
ping
in interface RedisConnectionCommands
public void pSubscribe(MessageListener listener, byte[]... patterns)
RedisPubSubCommands
Note that this operation is blocking and the current thread starts waiting for new messages immediately.
pSubscribe
in interface RedisPubSubCommands
listener
- message listenerpatterns
- channel name patternspublic Long publish(byte[] channel, byte[] message)
RedisPubSubCommands
publish
in interface RedisPubSubCommands
channel
- the channel to publish tomessage
- message to publishpublic byte[] randomKey()
RedisKeyCommands
See http://redis.io/commands/randomkey
randomKey
in interface RedisKeyCommands
public void rename(byte[] oldName, byte[] newName)
RedisKeyCommands
oleName
to newName
.
See http://redis.io/commands/rename
rename
in interface RedisKeyCommands
public Boolean renameNX(byte[] oldName, byte[] newName)
RedisKeyCommands
oleName
to newName
only if newName
does not exist.
See http://redis.io/commands/renamenx
renameNX
in interface RedisKeyCommands
public void resetConfigStats()
RedisServerCommands
RedisServerCommands.info()
.
See http://redis.io/commands/config-resetstat
resetConfigStats
in interface RedisServerCommands
public byte[] rPop(byte[] key)
RedisListCommands
key
.
See http://redis.io/commands/rpop
rPop
in interface RedisListCommands
public byte[] rPopLPush(byte[] srcKey, byte[] dstKey)
RedisListCommands
srcKey
, append it to dstKey
and return its value.
See http://redis.io/commands/rpoplpush
rPopLPush
in interface RedisListCommands
public Long rPush(byte[] key, byte[]... values)
RedisListCommands
values
to key
.
See http://redis.io/commands/rpush
rPush
in interface RedisListCommands
public Long rPushX(byte[] key, byte[] value)
RedisListCommands
key
only if the list exists.
See http://redis.io/commands/rpushx
rPushX
in interface RedisListCommands
public Long sAdd(byte[] key, byte[]... values)
RedisSetCommands
values
to set at key
.
See http://redis.io/commands/sadd
sAdd
in interface RedisSetCommands
public void save()
RedisServerCommands
See http://redis.io/commands/save
save
in interface RedisServerCommands
public Long sCard(byte[] key)
RedisSetCommands
key
.
See http://redis.io/commands/scard
sCard
in interface RedisSetCommands
public Set<byte[]> sDiff(byte[]... keys)
RedisSetCommands
keys
.
See http://redis.io/commands/sdiff
sDiff
in interface RedisSetCommands
public Long sDiffStore(byte[] destKey, byte[]... keys)
RedisSetCommands
keys
and store result in destKey
See http://redis.io/commands/sdiffstore
sDiffStore
in interface RedisSetCommands
public void select(int dbIndex)
RedisConnectionCommands
dbIndex
.
See http://redis.io/commands/select
select
in interface RedisConnectionCommands
public void set(byte[] key, byte[] value)
RedisStringCommands
value
for key
.
See http://redis.io/commands/set
set
in interface RedisStringCommands
key
- must not be null.value
- must not be null.public void set(byte[] key, byte[] value, Expiration expiration, RedisStringCommands.SetOption option)
RedisStringCommands
value
for key
applying timeouts from expiration
if set and inserting/updating values
depending on option
.
See http://redis.io/commands/set
set
in interface RedisStringCommands
key
- must not be null.value
- must not be null.expiration
- can be null. Defaulted to Expiration.persistent()
.option
- can be null. Defaulted to RedisStringCommands.SetOption.UPSERT
.public Boolean setBit(byte[] key, long offset, boolean value)
RedisStringCommands
offset
in value stored at key
.
See http://redis.io/commands/setbit
setBit
in interface RedisStringCommands
key
- must not be null.offset
.public void setConfig(String param, String value)
RedisServerCommands
param
to value
.
See http://redis.io/commands/config-set
setConfig
in interface RedisServerCommands
public void setEx(byte[] key, long seconds, byte[] value)
RedisStringCommands
value
and expiration in seconds
for key
.
See http://redis.io/commands/setex
setEx
in interface RedisStringCommands
key
- must not be null.value
- must not be null.public void pSetEx(byte[] key, long milliseconds, byte[] value)
RedisStringCommands
value
and expiration in milliseconds
for key
.
See http://redis.io/commands/psetex
pSetEx
in interface RedisStringCommands
key
- must not be null.value
- must not be null.public Boolean setNX(byte[] key, byte[] value)
RedisStringCommands
value
for key
, only if key
does not exist.
See http://redis.io/commands/setnx
setNX
in interface RedisStringCommands
key
- must not be null.value
- must not be null.public void setRange(byte[] key, byte[] value, long start)
RedisStringCommands
key
starting at the specified offset
with given value
.
See http://redis.io/commands/setrange
setRange
in interface RedisStringCommands
key
- must not be null.public void shutdown()
RedisServerCommands
See http://redis.io/commands/shutdown
shutdown
in interface RedisServerCommands
public void shutdown(RedisServerCommands.ShutdownOption option)
RedisServerCommands
See http://redis.io/commands/shutdown
shutdown
in interface RedisServerCommands
public Set<byte[]> sInter(byte[]... keys)
RedisSetCommands
keys
.
See http://redis.io/commands/sinter
sInter
in interface RedisSetCommands
public Long sInterStore(byte[] destKey, byte[]... keys)
RedisSetCommands
keys
and store result in destKey
.
See http://redis.io/commands/sinterstore
sInterStore
in interface RedisSetCommands
public Boolean sIsMember(byte[] key, byte[] value)
RedisSetCommands
key
contains value
.
See http://redis.io/commands/sismember
sIsMember
in interface RedisSetCommands
public Set<byte[]> sMembers(byte[] key)
RedisSetCommands
key
.
See http://redis.io/commands/smembers
sMembers
in interface RedisSetCommands
public Boolean sMove(byte[] srcKey, byte[] destKey, byte[] value)
RedisSetCommands
value
from srcKey
to destKey
See http://redis.io/commands/smove
sMove
in interface RedisSetCommands
public Long sort(byte[] key, SortParameters params, byte[] storeKey)
RedisKeyCommands
key
and store result in storeKey
.
See http://redis.io/commands/sort
sort
in interface RedisKeyCommands
public List<byte[]> sort(byte[] key, SortParameters params)
RedisKeyCommands
key
.
See http://redis.io/commands/sort
sort
in interface RedisKeyCommands
public byte[] sPop(byte[] key)
RedisSetCommands
key
.
See http://redis.io/commands/spop
sPop
in interface RedisSetCommands
public byte[] sRandMember(byte[] key)
RedisSetCommands
key
.
See http://redis.io/commands/srandmember
sRandMember
in interface RedisSetCommands
public List<byte[]> sRandMember(byte[] key, long count)
RedisSetCommands
count
random elements from set at key
.
See http://redis.io/commands/srandmember
sRandMember
in interface RedisSetCommands
public Long sRem(byte[] key, byte[]... values)
RedisSetCommands
values
from set at key
and return the number of removed elements.
See http://redis.io/commands/srem
sRem
in interface RedisSetCommands
public Long strLen(byte[] key)
RedisStringCommands
key
.
See http://redis.io/commands/strlen
strLen
in interface RedisStringCommands
key
- must not be null.public Long bitCount(byte[] key)
RedisStringCommands
key
.
See http://redis.io/commands/bitcount
bitCount
in interface RedisStringCommands
key
- must not be null.public Long bitCount(byte[] key, long begin, long end)
RedisStringCommands
key
between begin
and
end
.
See http://redis.io/commands/bitcount
bitCount
in interface RedisStringCommands
key
- must not be null.public Long bitOp(RedisStringCommands.BitOperation op, byte[] destination, byte[]... keys)
RedisStringCommands
See http://redis.io/commands/bitop
bitOp
in interface RedisStringCommands
public void subscribe(MessageListener listener, byte[]... channels)
RedisPubSubCommands
Note that this operation is blocking and the current thread starts waiting for new messages immediately.
subscribe
in interface RedisPubSubCommands
listener
- message listenerchannels
- channel namespublic Set<byte[]> sUnion(byte[]... keys)
RedisSetCommands
keys
.
See http://redis.io/commands/sunion
sUnion
in interface RedisSetCommands
public Long sUnionStore(byte[] destKey, byte[]... keys)
RedisSetCommands
keys
and store result in destKey
.
See http://redis.io/commands/sunionstore
sUnionStore
in interface RedisSetCommands
public Long ttl(byte[] key)
RedisKeyCommands
key
in seconds.
See http://redis.io/commands/ttl
ttl
in interface RedisKeyCommands
public Long ttl(byte[] key, TimeUnit timeUnit)
RedisKeyCommands
key
in and convert it to the given TimeUnit
.
See http://redis.io/commands/ttl
ttl
in interface RedisKeyCommands
public DataType type(byte[] key)
RedisKeyCommands
key
.
See http://redis.io/commands/type
type
in interface RedisKeyCommands
public void unwatch()
RedisTxCommands
#watch(byte[])
keys.
See http://redis.io/commands/unwatch
unwatch
in interface RedisTxCommands
public void watch(byte[]... keys)
RedisTxCommands
keys
for modifications during transaction started with RedisTxCommands.multi()
.
See http://redis.io/commands/watch
watch
in interface RedisTxCommands
public Boolean zAdd(byte[] key, double score, byte[] value)
RedisZSetCommands
value
to a sorted set at key
, or update its score
if it already exists.
See http://redis.io/commands/zadd
zAdd
in interface RedisZSetCommands
public Long zAdd(byte[] key, Set<RedisZSetCommands.Tuple> tuples)
RedisZSetCommands
tuples
to a sorted set at key
, or update its score
if it already exists.
See http://redis.io/commands/zadd
zAdd
in interface RedisZSetCommands
public Long zCard(byte[] key)
RedisZSetCommands
key
.
See http://redis.io/commands/zcard
zCard
in interface RedisZSetCommands
public Long zCount(byte[] key, double min, double max)
RedisZSetCommands
min
and max
.
See http://redis.io/commands/zcount
zCount
in interface RedisZSetCommands
public Long zCount(byte[] key, RedisZSetCommands.Range range)
RedisZSetCommands
Range#min
and Range#max
.zCount
in interface RedisZSetCommands
public Double zIncrBy(byte[] key, double increment, byte[] value)
RedisZSetCommands
value
in sorted set by increment
.
See http://redis.io/commands/zincrby
zIncrBy
in interface RedisZSetCommands
public Long zInterStore(byte[] destKey, RedisZSetCommands.Aggregate aggregate, int[] weights, byte[]... sets)
RedisZSetCommands
sets
and store result in destination key
.
See http://redis.io/commands/zinterstore
zInterStore
in interface RedisZSetCommands
public Long zInterStore(byte[] destKey, byte[]... sets)
RedisZSetCommands
sets
and store result in destination key
.
See http://redis.io/commands/zinterstore
zInterStore
in interface RedisZSetCommands
public Set<byte[]> zRange(byte[] key, long start, long end)
RedisZSetCommands
begin
and end
from sorted set.
See http://redis.io/commands/zrange
zRange
in interface RedisZSetCommands
public Set<byte[]> zRangeByScore(byte[] key, double min, double max, long offset, long count)
RedisZSetCommands
begin
to end
where score is between min
and max
from
sorted set.
See http://redis.io/commands/zrangebyscore
zRangeByScore
in interface RedisZSetCommands
public Set<byte[]> zRangeByScore(byte[] key, RedisZSetCommands.Range range)
RedisZSetCommands
Range#min
and Range#max
from sorted set.zRangeByScore
in interface RedisZSetCommands
public Set<byte[]> zRangeByScore(byte[] key, RedisZSetCommands.Range range, RedisZSetCommands.Limit limit)
RedisZSetCommands
Limit#count
to Limit#offset
where score is between Range#min
and
Range#max
from sorted set.zRangeByScore
in interface RedisZSetCommands
public Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key, RedisZSetCommands.Range range)
RedisZSetCommands
zRangeByScoreWithScores
in interface RedisZSetCommands
public Set<byte[]> zRangeByScore(byte[] key, double min, double max)
RedisZSetCommands
min
and max
from sorted set.
See http://redis.io/commands/zrangebyscore
zRangeByScore
in interface RedisZSetCommands
public Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count)
RedisZSetCommands
RedisZSetCommands.Tuple
s in range from begin
to end
where score is between min
and
max
from sorted set.
See http://redis.io/commands/zrangebyscore
zRangeByScoreWithScores
in interface RedisZSetCommands
public Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key, RedisZSetCommands.Range range, RedisZSetCommands.Limit limit)
RedisZSetCommands
RedisZSetCommands.Tuple
s in range from Limit#offset
to Limit#offset + Limit#count
where score is
between Range#min
and Range#max
from sorted set.zRangeByScoreWithScores
in interface RedisZSetCommands
public Set<RedisZSetCommands.Tuple> zRangeByScoreWithScores(byte[] key, double min, double max)
RedisZSetCommands
RedisZSetCommands.Tuple
s where score is between min
and max
from sorted set.
See http://redis.io/commands/zrangebyscore
zRangeByScoreWithScores
in interface RedisZSetCommands
public Set<RedisZSetCommands.Tuple> zRangeWithScores(byte[] key, long start, long end)
RedisZSetCommands
RedisZSetCommands.Tuple
s between begin
and end
from sorted set.
See http://redis.io/commands/zrange
zRangeWithScores
in interface RedisZSetCommands
public Set<byte[]> zRevRangeByScore(byte[] key, double min, double max, long offset, long count)
RedisZSetCommands
begin
to end
where score is between min
and max
from
sorted set ordered high -> low.
See http://redis.io/commands/zrevrangebyscore
zRevRangeByScore
in interface RedisZSetCommands
public Set<byte[]> zRevRangeByScore(byte[] key, RedisZSetCommands.Range range)
RedisZSetCommands
Range#min
and Range#max
from sorted set ordered from high to
low.zRevRangeByScore
in interface RedisZSetCommands
public Set<byte[]> zRevRangeByScore(byte[] key, double min, double max)
RedisZSetCommands
min
and max
from sorted set ordered from high to low.
See http://redis.io/commands/zrevrange
zRevRangeByScore
in interface RedisZSetCommands
public Set<byte[]> zRevRangeByScore(byte[] key, RedisZSetCommands.Range range, RedisZSetCommands.Limit limit)
RedisZSetCommands
Limit#offset
to Limit#offset + Limit#count
where score is between
Range#min
and Range#max
from sorted set ordered high -> low.zRevRangeByScore
in interface RedisZSetCommands
public Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key, double min, double max, long offset, long count)
RedisZSetCommands
RedisZSetCommands.Tuple
in range from begin
to end
where score is between min
and
max
from sorted set ordered high -> low.
See http://redis.io/commands/zrevrangebyscore
zRevRangeByScoreWithScores
in interface RedisZSetCommands
public Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key, RedisZSetCommands.Range range)
RedisZSetCommands
RedisZSetCommands.Tuple
where score is between Range#min
and Range#max
from sorted set ordered
from high to low.zRevRangeByScoreWithScores
in interface RedisZSetCommands
public Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key, RedisZSetCommands.Range range, RedisZSetCommands.Limit limit)
RedisZSetCommands
RedisZSetCommands.Tuple
in range from Limit#offset
to Limit#count
where score is between
Range#min
and Range#max
from sorted set ordered high -> low.zRevRangeByScoreWithScores
in interface RedisZSetCommands
public Set<RedisZSetCommands.Tuple> zRevRangeByScoreWithScores(byte[] key, double min, double max)
RedisZSetCommands
RedisZSetCommands.Tuple
where score is between min
and max
from sorted set ordered from high to
low.
See http://redis.io/commands/zrevrange
zRevRangeByScoreWithScores
in interface RedisZSetCommands
public Long zRank(byte[] key, byte[] value)
RedisZSetCommands
value
in a sorted set.
See http://redis.io/commands/zrank
zRank
in interface RedisZSetCommands
public Long zRem(byte[] key, byte[]... values)
RedisZSetCommands
values
from sorted set. Return number of removed elements.
See http://redis.io/commands/zrem
zRem
in interface RedisZSetCommands
public Long zRemRange(byte[] key, long start, long end)
RedisZSetCommands
begin
and end
from sorted set with key
.
See http://redis.io/commands/zremrange
zRemRange
in interface RedisZSetCommands
public Long zRemRangeByScore(byte[] key, double min, double max)
RedisZSetCommands
min
and max
from sorted set with key
.
See http://redis.io/commands/zremrangebyscore
zRemRangeByScore
in interface RedisZSetCommands
public Long zRemRangeByScore(byte[] key, RedisZSetCommands.Range range)
RedisZSetCommands
Range#min
and Range#max
from sorted set with key
.zRemRangeByScore
in interface RedisZSetCommands
public Set<byte[]> zRevRange(byte[] key, long start, long end)
RedisZSetCommands
begin
to end
from sorted set ordered from high to low.
See http://redis.io/commands/zrevrange
zRevRange
in interface RedisZSetCommands
public Set<RedisZSetCommands.Tuple> zRevRangeWithScores(byte[] key, long start, long end)
RedisZSetCommands
RedisZSetCommands.Tuple
s in range from begin
to end
from sorted set ordered from high to low.
See http://redis.io/commands/zrevrange
zRevRangeWithScores
in interface RedisZSetCommands
public Long zRevRank(byte[] key, byte[] value)
RedisZSetCommands
value
in a sorted set when scored high to low.
See http://redis.io/commands/zrevrank
zRevRank
in interface RedisZSetCommands
public Double zScore(byte[] key, byte[] value)
RedisZSetCommands
value
from sorted set with key key
.
See http://redis.io/commands/zrem
zScore
in interface RedisZSetCommands
public Long zUnionStore(byte[] destKey, RedisZSetCommands.Aggregate aggregate, int[] weights, byte[]... sets)
RedisZSetCommands
sets
and store result in destination key
.
See http://redis.io/commands/zunionstore
zUnionStore
in interface RedisZSetCommands
public Long zUnionStore(byte[] destKey, byte[]... sets)
RedisZSetCommands
sets
and store result in destination key
.
See http://redis.io/commands/zunionstore
zUnionStore
in interface RedisZSetCommands
public Boolean pExpire(byte[] key, long millis)
RedisKeyCommands
key
in milliseconds.
See http://redis.io/commands/pexpire
pExpire
in interface RedisKeyCommands
public Boolean pExpireAt(byte[] key, long unixTimeInMillis)
RedisKeyCommands
key
as a UNIX timestamp in milliseconds.
See http://redis.io/commands/pexpireat
pExpireAt
in interface RedisKeyCommands
public Long pTtl(byte[] key)
RedisKeyCommands
key
in milliseconds.
See http://redis.io/commands/pttl
pTtl
in interface RedisKeyCommands
public Long pTtl(byte[] key, TimeUnit timeUnit)
RedisKeyCommands
key
in and convert it to the given TimeUnit
.
See http://redis.io/commands/pttl
pTtl
in interface RedisKeyCommands
public byte[] dump(byte[] key)
RedisKeyCommands
key
.
See http://redis.io/commands/dump
dump
in interface RedisKeyCommands
public void restore(byte[] key, long ttlInMillis, byte[] serializedValue)
RedisKeyCommands
key
using the serializedValue
, previously obtained using RedisKeyCommands.dump(byte[])
.
See http://redis.io/commands/restore
restore
in interface RedisKeyCommands
public void scriptFlush()
RedisScriptingCommands
See http://redis.io/commands/script-flush
scriptFlush
in interface RedisScriptingCommands
public void scriptKill()
RedisScriptingCommands
See http://redis.io/commands/script-kill
scriptKill
in interface RedisScriptingCommands
public String scriptLoad(byte[] script)
RedisScriptingCommands
#evalSha(String, ReturnType, int, byte[])
.
See http://redis.io/commands/script-load
scriptLoad
in interface RedisScriptingCommands
public List<Boolean> scriptExists(String... scriptSha1)
RedisScriptingCommands
scriptShas
exist in script cache.
See http://redis.io/commands/script-exits
scriptExists
in interface RedisScriptingCommands
public <T> T eval(byte[] script, ReturnType returnType, int numKeys, byte[]... keysAndArgs)
RedisScriptingCommands
script
.
See http://redis.io/commands/eval
eval
in interface RedisScriptingCommands
public <T> T evalSha(String scriptSha1, ReturnType returnType, int numKeys, byte[]... keysAndArgs)
RedisScriptingCommands
scriptSha
.
See http://redis.io/commands/evalsha
evalSha
in interface RedisScriptingCommands
public <T> T evalSha(byte[] scriptSha1, ReturnType returnType, int numKeys, byte[]... keysAndArgs)
RedisScriptingCommands
scriptSha
.
See http://redis.io/commands/evalsha
evalSha
in interface RedisScriptingCommands
public Long append(String key, String value)
StringRedisConnection
value
to key
.
See http://redis.io/commands/append
append
in interface StringRedisConnection
key
- must not be null.public List<String> bLPop(int timeout, String... keys)
bLPop
in interface StringRedisConnection
public List<String> bRPop(int timeout, String... keys)
bRPop
in interface StringRedisConnection
public String bRPopLPush(int timeout, String srcKey, String dstKey)
bRPopLPush
in interface StringRedisConnection
public Long decr(String key)
StringRedisConnection
key
by 1.
See http://redis.io/commands/decr
decr
in interface StringRedisConnection
key
- must not be null.public Long decrBy(String key, long value)
StringRedisConnection
key
by value
.
See http://redis.io/commands/decrby
decrBy
in interface StringRedisConnection
key
- must not be null.public Long del(String... keys)
StringRedisConnection
keys
.
See http://redis.io/commands/del
del
in interface StringRedisConnection
public String echo(String message)
echo
in interface StringRedisConnection
public Boolean exists(String key)
StringRedisConnection
key
exists.
See http://redis.io/commands/exists
exists
in interface StringRedisConnection
public Boolean expire(String key, long seconds)
StringRedisConnection
key
in seconds.
See http://redis.io/commands/expire
expire
in interface StringRedisConnection
public Boolean expireAt(String key, long unixTime)
StringRedisConnection
key
as a UNIX timestamp.
See http://redis.io/commands/expireat
expireAt
in interface StringRedisConnection
public String get(String key)
StringRedisConnection
key
.
See http://redis.io/commands/get
get
in interface StringRedisConnection
key
- must not be null.public Boolean getBit(String key, long offset)
StringRedisConnection
offset
of value at key
.
See http://redis.io/commands/getbit
getBit
in interface StringRedisConnection
key
- must not be null.public String getRange(String key, long start, long end)
StringRedisConnection
key
between begin
and end
.
See http://redis.io/commands/getrange
getRange
in interface StringRedisConnection
key
- must not be null.public String getSet(String key, String value)
StringRedisConnection
key
and return its old value.
See http://redis.io/commands/getset
getSet
in interface StringRedisConnection
key
- must not be null.public Long hDel(String key, String... fields)
hDel
in interface StringRedisConnection
public Boolean hExists(String key, String field)
hExists
in interface StringRedisConnection
public String hGet(String key, String field)
hGet
in interface StringRedisConnection
public Map<String,String> hGetAll(String key)
hGetAll
in interface StringRedisConnection
public Long hIncrBy(String key, String field, long delta)
hIncrBy
in interface StringRedisConnection
public Double hIncrBy(String key, String field, double delta)
hIncrBy
in interface StringRedisConnection
public Set<String> hKeys(String key)
hKeys
in interface StringRedisConnection
public Long hLen(String key)
hLen
in interface StringRedisConnection
public List<String> hMGet(String key, String... fields)
hMGet
in interface StringRedisConnection
public void hMSet(String key, Map<String,String> hashes)
hMSet
in interface StringRedisConnection
public Boolean hSet(String key, String field, String value)
hSet
in interface StringRedisConnection
public Boolean hSetNX(String key, String field, String value)
hSetNX
in interface StringRedisConnection
public List<String> hVals(String key)
hVals
in interface StringRedisConnection
public Long incr(String key)
StringRedisConnection
key
by 1.
See http://redis.io/commands/incr
incr
in interface StringRedisConnection
key
- must not be null.public Long incrBy(String key, long value)
StringRedisConnection
key
by value
.
See http://redis.io/commands/incrby
incrBy
in interface StringRedisConnection
key
- must not be null.public Double incrBy(String key, double value)
StringRedisConnection
key
by value
.
See http://redis.io/commands/incrbyfloat
incrBy
in interface StringRedisConnection
key
- must not be null.public Collection<String> keys(String pattern)
StringRedisConnection
pattern
.
See http://redis.io/commands/keys
keys
in interface StringRedisConnection
public String lIndex(String key, long index)
lIndex
in interface StringRedisConnection
public Long lInsert(String key, RedisListCommands.Position where, String pivot, String value)
lInsert
in interface StringRedisConnection
public Long lLen(String key)
lLen
in interface StringRedisConnection
public String lPop(String key)
lPop
in interface StringRedisConnection
public Long lPush(String key, String... values)
lPush
in interface StringRedisConnection
public Long lPushX(String key, String value)
lPushX
in interface StringRedisConnection
public List<String> lRange(String key, long start, long end)
lRange
in interface StringRedisConnection
public Long lRem(String key, long count, String value)
lRem
in interface StringRedisConnection
public void lSet(String key, long index, String value)
lSet
in interface StringRedisConnection
public void lTrim(String key, long start, long end)
lTrim
in interface StringRedisConnection
public List<String> mGet(String... keys)
StringRedisConnection
keys
.
See http://redis.io/commands/mget
mGet
in interface StringRedisConnection
public Boolean mSetNXString(Map<String,String> tuple)
StringRedisConnection
tuple
only if the provided key does
not exist.
See http://redis.io/commands/msetnx
mSetNXString
in interface StringRedisConnection
public void mSetString(Map<String,String> tuple)
StringRedisConnection
tuple
.
See http://redis.io/commands/mset
mSetString
in interface StringRedisConnection
public Boolean persist(String key)
StringRedisConnection
key
.
See http://redis.io/commands/persist
persist
in interface StringRedisConnection
public Boolean move(String key, int dbIndex)
StringRedisConnection
key
to database with index
.
See http://redis.io/commands/move
move
in interface StringRedisConnection
public void pSubscribe(MessageListener listener, String... patterns)
pSubscribe
in interface StringRedisConnection
public Long publish(String channel, String message)
publish
in interface StringRedisConnection
public void rename(String oldName, String newName)
StringRedisConnection
oleName
to newName
.
See http://redis.io/commands/rename
rename
in interface StringRedisConnection
public Boolean renameNX(String oldName, String newName)
StringRedisConnection
oleName
to newName
only if newName
does not exist.
See http://redis.io/commands/renamenx
renameNX
in interface StringRedisConnection
public String rPop(String key)
rPop
in interface StringRedisConnection
public String rPopLPush(String srcKey, String dstKey)
rPopLPush
in interface StringRedisConnection
public Long rPush(String key, String... values)
rPush
in interface StringRedisConnection
public Long rPushX(String key, String value)
rPushX
in interface StringRedisConnection
public Long sAdd(String key, String... values)
sAdd
in interface StringRedisConnection
public Long sCard(String key)
sCard
in interface StringRedisConnection
public Set<String> sDiff(String... keys)
sDiff
in interface StringRedisConnection
public Long sDiffStore(String destKey, String... keys)
sDiffStore
in interface StringRedisConnection
public void set(String key, String value)
StringRedisConnection
value
for key
.
See http://redis.io/commands/set
set
in interface StringRedisConnection
key
- must not be null.value
- must not be null.public void set(String key, String value, Expiration expiration, RedisStringCommands.SetOption option)
StringRedisConnection
value
for key
applying timeouts from expiration
if set and inserting/updating values
depending on option
.
See http://redis.io/commands/set
set
in interface StringRedisConnection
key
- must not be null.value
- must not be null.expiration
- can be null. Defaulted to Expiration.persistent()
.option
- can be null. Defaulted to SetOption#UPSERT
.public Boolean setBit(String key, long offset, boolean value)
StringRedisConnection
offset
in value stored at key
.
See http://redis.io/commands/setbit
setBit
in interface StringRedisConnection
key
- must not be null.offset
.public void setEx(String key, long seconds, String value)
StringRedisConnection
value
and expiration in seconds
for key
.
See http://redis.io/commands/setex
setEx
in interface StringRedisConnection
key
- must not be null.value
- must not be null.public void pSetEx(String key, long seconds, String value)
StringRedisConnection
value
and expiration in milliseconds
for key
.
See http://redis.io/commands/psetex
pSetEx
in interface StringRedisConnection
key
- must not be null.value
- must not be null.public Boolean setNX(String key, String value)
StringRedisConnection
value
for key
, only if key
does not exist.
See http://redis.io/commands/setnx
setNX
in interface StringRedisConnection
key
- must not be null.value
- must not be null.public void setRange(String key, String value, long start)
StringRedisConnection
key
starting at the specified offset
with given value
.
See http://redis.io/commands/setrange
setRange
in interface StringRedisConnection
key
- must not be null.public Set<String> sInter(String... keys)
sInter
in interface StringRedisConnection
public Long sInterStore(String destKey, String... keys)
sInterStore
in interface StringRedisConnection
public Boolean sIsMember(String key, String value)
sIsMember
in interface StringRedisConnection
public Set<String> sMembers(String key)
sMembers
in interface StringRedisConnection
public Boolean sMove(String srcKey, String destKey, String value)
sMove
in interface StringRedisConnection
public Long sort(String key, SortParameters params, String storeKey)
sort
in interface StringRedisConnection
public List<String> sort(String key, SortParameters params)
sort
in interface StringRedisConnection
public String sPop(String key)
sPop
in interface StringRedisConnection
public String sRandMember(String key)
sRandMember
in interface StringRedisConnection
public List<String> sRandMember(String key, long count)
sRandMember
in interface StringRedisConnection
public Long sRem(String key, String... values)
sRem
in interface StringRedisConnection
public Long strLen(String key)
StringRedisConnection
key
.
See http://redis.io/commands/strlen
strLen
in interface StringRedisConnection
key
- must not be null.public Long bitCount(String key)
StringRedisConnection
key
.
See http://redis.io/commands/bitcount
bitCount
in interface StringRedisConnection
key
- must not be null.public Long bitCount(String key, long begin, long end)
StringRedisConnection
key
between begin
and
end
.
See http://redis.io/commands/bitcount
bitCount
in interface StringRedisConnection
key
- must not be null.public Long bitOp(RedisStringCommands.BitOperation op, String destination, String... keys)
StringRedisConnection
See http://redis.io/commands/bitop
bitOp
in interface StringRedisConnection
public void subscribe(MessageListener listener, String... channels)
subscribe
in interface StringRedisConnection
public Set<String> sUnion(String... keys)
sUnion
in interface StringRedisConnection
public Long sUnionStore(String destKey, String... keys)
sUnionStore
in interface StringRedisConnection
public Long ttl(String key)
StringRedisConnection
key
in seconds.
See http://redis.io/commands/ttl
ttl
in interface StringRedisConnection
public Long ttl(String key, TimeUnit timeUnit)
StringRedisConnection
key
in and convert it to the given TimeUnit
.
See http://redis.io/commands/ttl
ttl
in interface StringRedisConnection
public DataType type(String key)
StringRedisConnection
key
.
See http://redis.io/commands/type
type
in interface StringRedisConnection
public Boolean zAdd(String key, double score, String value)
zAdd
in interface StringRedisConnection
public Long zAdd(String key, Set<StringRedisConnection.StringTuple> tuples)
zAdd
in interface StringRedisConnection
public Long zCard(String key)
zCard
in interface StringRedisConnection
public Long zCount(String key, double min, double max)
zCount
in interface StringRedisConnection
public Double zIncrBy(String key, double increment, String value)
zIncrBy
in interface StringRedisConnection
public Long zInterStore(String destKey, RedisZSetCommands.Aggregate aggregate, int[] weights, String... sets)
zInterStore
in interface StringRedisConnection
public Long zInterStore(String destKey, String... sets)
zInterStore
in interface StringRedisConnection
public Set<String> zRange(String key, long start, long end)
zRange
in interface StringRedisConnection
public Set<String> zRangeByScore(String key, double min, double max, long offset, long count)
zRangeByScore
in interface StringRedisConnection
public Set<String> zRangeByScore(String key, double min, double max)
zRangeByScore
in interface StringRedisConnection
public Set<StringRedisConnection.StringTuple> zRangeByScoreWithScores(String key, double min, double max, long offset, long count)
zRangeByScoreWithScores
in interface StringRedisConnection
public Set<StringRedisConnection.StringTuple> zRangeByScoreWithScores(String key, double min, double max)
zRangeByScoreWithScores
in interface StringRedisConnection
public Set<StringRedisConnection.StringTuple> zRangeWithScores(String key, long start, long end)
zRangeWithScores
in interface StringRedisConnection
public Long zRank(String key, String value)
zRank
in interface StringRedisConnection
public Long zRem(String key, String... values)
zRem
in interface StringRedisConnection
public Long zRemRange(String key, long start, long end)
zRemRange
in interface StringRedisConnection
public Long zRemRangeByScore(String key, double min, double max)
zRemRangeByScore
in interface StringRedisConnection
public Set<String> zRevRange(String key, long start, long end)
zRevRange
in interface StringRedisConnection
public Set<StringRedisConnection.StringTuple> zRevRangeWithScores(String key, long start, long end)
zRevRangeWithScores
in interface StringRedisConnection
public Set<String> zRevRangeByScore(String key, double min, double max)
zRevRangeByScore
in interface StringRedisConnection
public Set<StringRedisConnection.StringTuple> zRevRangeByScoreWithScores(String key, double min, double max)
zRevRangeByScoreWithScores
in interface StringRedisConnection
public Set<String> zRevRangeByScore(String key, double min, double max, long offset, long count)
zRevRangeByScore
in interface StringRedisConnection
public Set<StringRedisConnection.StringTuple> zRevRangeByScoreWithScores(String key, double min, double max, long offset, long count)
zRevRangeByScoreWithScores
in interface StringRedisConnection
public Long zRevRank(String key, String value)
zRevRank
in interface StringRedisConnection
public Double zScore(String key, String value)
zScore
in interface StringRedisConnection
public Long zUnionStore(String destKey, RedisZSetCommands.Aggregate aggregate, int[] weights, String... sets)
zUnionStore
in interface StringRedisConnection
public Long zUnionStore(String destKey, String... sets)
zUnionStore
in interface StringRedisConnection
public Long geoAdd(byte[] key, Point point, byte[] member)
RedisGeoCommands
Point
with given member name to key.geoAdd
in interface RedisGeoCommands
key
- must not be null.point
- must not be null.member
- must not be null.public Long geoAdd(byte[] key, RedisGeoCommands.GeoLocation<byte[]> location)
RedisGeoCommands
RedisGeoCommands.GeoLocation
to key.geoAdd
in interface RedisGeoCommands
key
- must not be null.location
- must not be null.public Long geoAdd(String key, Point point, String member)
StringRedisConnection
Point
with given member name to key.geoAdd
in interface StringRedisConnection
key
- must not be null.point
- must not be null.member
- must not be null.public Long geoAdd(String key, RedisGeoCommands.GeoLocation<String> location)
StringRedisConnection
GeoLocation
to key.geoAdd
in interface StringRedisConnection
key
- must not be null.location
- must not be null.public Long geoAdd(byte[] key, Map<byte[],Point> memberCoordinateMap)
RedisGeoCommands
geoAdd
in interface RedisGeoCommands
key
- must not be null.memberCoordinateMap
- must not be null.public Long geoAdd(byte[] key, Iterable<RedisGeoCommands.GeoLocation<byte[]>> locations)
RedisGeoCommands
RedisGeoCommands.GeoLocation
s to keygeoAdd
in interface RedisGeoCommands
key
- must not be null.locations
- must not be null.public Long geoAdd(String key, Map<String,Point> memberCoordinateMap)
StringRedisConnection
geoAdd
in interface StringRedisConnection
key
- must not be null.memberCoordinateMap
- must not be null.public Long geoAdd(String key, Iterable<RedisGeoCommands.GeoLocation<String>> locations)
StringRedisConnection
GeoLocation
s to keygeoAdd
in interface StringRedisConnection
key
- must not be null.locations
- must not be null.public Distance geoDist(byte[] key, byte[] member1, byte[] member2)
RedisGeoCommands
Distance
between member1 and member2.geoDist
in interface RedisGeoCommands
key
- must not be null.member1
- must not be null.member2
- must not be null.public Distance geoDist(String key, String member1, String member2)
StringRedisConnection
Distance
between member1 and member2.geoDist
in interface StringRedisConnection
key
- must not be null.member1
- must not be null.member2
- must not be null.public Distance geoDist(byte[] key, byte[] member1, byte[] member2, Metric metric)
RedisGeoCommands
geoDist
in interface RedisGeoCommands
key
- must not be null.member1
- must not be null.member2
- must not be null.metric
- must not be null.public Distance geoDist(String key, String member1, String member2, Metric metric)
StringRedisConnection
geoDist
in interface StringRedisConnection
key
- must not be null.member1
- must not be null.member2
- must not be null.metric
- must not be null.public List<String> geoHash(byte[] key, byte[]... members)
RedisGeoCommands
geoHash
in interface RedisGeoCommands
key
- must not be null.members
- must not be null.public List<String> geoHash(String key, String... members)
StringRedisConnection
geoHash
in interface StringRedisConnection
key
- must not be null.members
- must not be null.public List<Point> geoPos(byte[] key, byte[]... members)
RedisGeoCommands
Point
representation of positions for one or more members.geoPos
in interface RedisGeoCommands
key
- must not be null.members
- must not be null.public List<Point> geoPos(String key, String... members)
StringRedisConnection
Point
representation of positions for one or more members.geoPos
in interface StringRedisConnection
key
- must not be null.members
- must not be null.public GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadius(String key, Circle within)
StringRedisConnection
Circle
.geoRadius
in interface StringRedisConnection
key
- must not be null.within
- must not be null.public GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadius(String key, Circle within, RedisGeoCommands.GeoRadiusCommandArgs args)
StringRedisConnection
Circle
applying GeoRadiusCommandArgs
.geoRadius
in interface StringRedisConnection
key
- must not be null.within
- must not be null.args
- must not be null.public GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadiusByMember(String key, String member, double radius)
StringRedisConnection
geoRadiusByMember
in interface StringRedisConnection
key
- must not be null.member
- must not be null.public GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadiusByMember(String key, String member, Distance radius)
StringRedisConnection
Distance
.geoRadiusByMember
in interface StringRedisConnection
key
- must not be null.member
- must not be null.radius
- must not be null.public GeoResults<RedisGeoCommands.GeoLocation<String>> geoRadiusByMember(String key, String member, Distance radius, RedisGeoCommands.GeoRadiusCommandArgs args)
StringRedisConnection
Distance
and GeoRadiusCommandArgs
.geoRadiusByMember
in interface StringRedisConnection
key
- must not be null.member
- must not be null.radius
- must not be null.args
- must not be null.public GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadius(byte[] key, Circle within)
RedisGeoCommands
Circle
.geoRadius
in interface RedisGeoCommands
key
- must not be null.within
- must not be null.public GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadius(byte[] key, Circle within, RedisGeoCommands.GeoRadiusCommandArgs args)
RedisGeoCommands
Circle
applying RedisGeoCommands.GeoRadiusCommandArgs
.geoRadius
in interface RedisGeoCommands
key
- must not be null.within
- must not be null.args
- must not be null.public GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, double radius)
RedisGeoCommands
geoRadiusByMember
in interface RedisGeoCommands
key
- must not be null.member
- must not be null.public GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, Distance radius)
RedisGeoCommands
Distance
.geoRadiusByMember
in interface RedisGeoCommands
key
- must not be null.member
- must not be null.radius
- must not be null.public GeoResults<RedisGeoCommands.GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, Distance radius, RedisGeoCommands.GeoRadiusCommandArgs args)
RedisGeoCommands
Distance
and RedisGeoCommands.GeoRadiusCommandArgs
.geoRadiusByMember
in interface RedisGeoCommands
key
- must not be null.member
- must not be null.radius
- must not be null.args
- must not be null.public Long geoRemove(byte[] key, byte[]... members)
RedisGeoCommands
geoRemove
in interface RedisGeoCommands
key
- must not be null.members
- must not be null.public Long geoRemove(String key, String... members)
StringRedisConnection
geoRemove
in interface StringRedisConnection
key
- must not be null.members
- must not be null.public List<Object> closePipeline()
RedisConnection
closePipeline
in interface RedisConnection
public boolean isPipelined()
RedisConnection
isPipelined
in interface RedisConnection
RedisConnection.openPipeline()
,
RedisConnection.isQueueing()
public void openPipeline()
RedisConnection
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.openPipeline
in interface RedisConnection
RedisTxCommands.multi()
public Object execute(String command)
execute
in interface StringRedisConnection
public Object execute(String command, byte[]... args)
RedisCommands
execute
in interface RedisCommands
command
- Command to executeargs
- Possible command arguments (may be null)public Object execute(String command, String... args)
execute
in interface StringRedisConnection
public Boolean pExpire(String key, long millis)
StringRedisConnection
key
in milliseconds.
See http://redis.io/commands/pexpire
pExpire
in interface StringRedisConnection
public Boolean pExpireAt(String key, long unixTimeInMillis)
StringRedisConnection
key
as a UNIX timestamp in milliseconds.
See http://redis.io/commands/pexpireat
pExpireAt
in interface StringRedisConnection
public Long pTtl(String key)
StringRedisConnection
key
in milliseconds.
See http://redis.io/commands/pttl
pTtl
in interface StringRedisConnection
public Long pTtl(String key, TimeUnit timeUnit)
StringRedisConnection
key
in and convert it to the given TimeUnit
.
See http://redis.io/commands/pttl
pTtl
in interface StringRedisConnection
public String scriptLoad(String script)
scriptLoad
in interface StringRedisConnection
public <T> T eval(String script, ReturnType returnType, int numKeys, String... keysAndArgs)
eval
in interface StringRedisConnection
public <T> T evalSha(String scriptSha1, ReturnType returnType, int numKeys, String... keysAndArgs)
evalSha
in interface StringRedisConnection
public Long time()
RedisServerCommands
TIME
command.time
in interface RedisServerCommands
public List<RedisClientInfo> getClientList()
RedisServerCommands
See http://redis.io/commands/client-list
getClientList
in interface RedisServerCommands
getClientList
in interface StringRedisConnection
List
of RedisClientInfo
objects.RedisServerCommands.getClientList()
public void slaveOf(String host, int port)
RedisServerCommands
See http://redis.io/commands/slaveof
slaveOf
in interface RedisServerCommands
public void slaveOfNoOne()
RedisServerCommands
See http://redis.io/commands/slaveof
slaveOfNoOne
in interface RedisServerCommands
public Cursor<byte[]> scan(ScanOptions options)
RedisKeyCommands
Cursor
to iterate over keys.
See http://redis.io/commands/scan
scan
in interface RedisKeyCommands
public Cursor<RedisZSetCommands.Tuple> zScan(byte[] key, ScanOptions options)
RedisZSetCommands
zScan
in interface RedisZSetCommands
public Cursor<byte[]> sScan(byte[] key, ScanOptions options)
RedisSetCommands
sScan
in interface RedisSetCommands
public Cursor<Map.Entry<byte[],byte[]>> hScan(byte[] key, ScanOptions options)
RedisHashCommands
Cursor
to iterate over entries in hash at key
.hScan
in interface RedisHashCommands
http://redis.io/commands/scan
public void setDeserializePipelineAndTxResults(boolean deserializePipelineAndTxResults)
closePipeline()
and exec()
will be of the type returned by the underlying connectiondeserializePipelineAndTxResults
- Whether or not to deserialize pipeline and tx resultspublic void setClientName(byte[] name)
RedisServerCommands
setClientName
in interface RedisServerCommands
public void setClientName(String name)
StringRedisConnection
name
to connection using registered RedisSerializer
for name conversion.setClientName
in interface StringRedisConnection
RedisServerCommands.setClientName(byte[])
public void killClient(String host, int port)
RedisServerCommands
killClient
in interface RedisServerCommands
host
- of connection to close.port
- of connection to closepublic String getClientName()
RedisServerCommands
See http://redis.io/commands/client-getname
getClientName
in interface RedisServerCommands
public Cursor<Map.Entry<String,String>> hScan(String key, ScanOptions options)
hScan
in interface StringRedisConnection
key
- must not be null.RedisHashCommands.hScan(byte[], ScanOptions)
public Cursor<String> sScan(String key, ScanOptions options)
sScan
in interface StringRedisConnection
key
- must not be null.RedisSetCommands.sScan(byte[], ScanOptions)
public Cursor<StringRedisConnection.StringTuple> zScan(String key, ScanOptions options)
zScan
in interface StringRedisConnection
key
- must not be null.RedisZSetCommands.zScan(byte[], ScanOptions)
public RedisSentinelConnection getSentinelConnection()
getSentinelConnection
in interface RedisConnection
public Set<byte[]> zRangeByScore(String key, String min, String max)
zRangeByScore
in interface StringRedisConnection
key
- must not be null.public Set<byte[]> zRangeByScore(String key, String min, String max, long offset, long count)
zRangeByScore
in interface StringRedisConnection
key
- must not be null.public Set<byte[]> zRangeByScore(byte[] key, String min, String max)
RedisZSetCommands
min
and max
from sorted set.
See http://redis.io/commands/zrangebyscore
zRangeByScore
in interface RedisZSetCommands
public Set<byte[]> zRangeByScore(byte[] key, String min, String max, long offset, long count)
RedisZSetCommands
begin
to end
where score is between min
and max
from
sorted set.
See http://redis.io/commands/zrangebyscore
zRangeByScore
in interface RedisZSetCommands
public Long pfAdd(byte[] key, byte[]... values)
HyperLogLogCommands
pfAdd
in interface HyperLogLogCommands
public Long pfAdd(String key, String... values)
StringRedisConnection
pfAdd
in interface StringRedisConnection
key
- must not be null.public Long pfCount(byte[]... keys)
HyperLogLogCommands
pfCount
in interface HyperLogLogCommands
public Long pfCount(String... keys)
pfCount
in interface StringRedisConnection
public void pfMerge(byte[] destinationKey, byte[]... sourceKeys)
HyperLogLogCommands
pfMerge
in interface HyperLogLogCommands
public void pfMerge(String destinationKey, String... sourceKeys)
pfMerge
in interface StringRedisConnection
public Set<byte[]> zRangeByLex(byte[] key)
RedisZSetCommands
zRangeByLex
in interface RedisZSetCommands
key
- must not be null.public Set<byte[]> zRangeByLex(byte[] key, RedisZSetCommands.Range range)
RedisZSetCommands
RedisZSetCommands.Range
from the sorted set at key in lexicographical ordering.zRangeByLex
in interface RedisZSetCommands
key
- must not be null.range
- must not be null.public Set<byte[]> zRangeByLex(byte[] key, RedisZSetCommands.Range range, RedisZSetCommands.Limit limit)
RedisZSetCommands
RedisZSetCommands.Range
from the sorted set at key in lexicographical ordering. Result is
limited via RedisZSetCommands.Limit
.zRangeByLex
in interface RedisZSetCommands
key
- must not be null.range
- must not be null.public Set<String> zRangeByLex(String key)
StringRedisConnection
zRangeByLex
in interface StringRedisConnection
key
- must not be null.public Set<String> zRangeByLex(String key, RedisZSetCommands.Range range)
StringRedisConnection
Range
from the sorted set at key in lexicographical orderingzRangeByLex
in interface StringRedisConnection
key
- must not be null.range
- must not be null.public Set<String> zRangeByLex(String key, RedisZSetCommands.Range range, RedisZSetCommands.Limit limit)
StringRedisConnection
Range
from the sorted set at key in lexicographical ordering. Result is
limited via Limit
.zRangeByLex
in interface StringRedisConnection
key
- must not be null.range
- must not be null.public void migrate(byte[] key, RedisNode target, int dbIndex, RedisServerCommands.MigrateOption option)
migrate
in interface RedisServerCommands
key
- must not be null.target
- must not be null.option
- can be null. Defaulted to RedisServerCommands.MigrateOption.COPY
.public void migrate(byte[] key, RedisNode target, int dbIndex, RedisServerCommands.MigrateOption option, long timeout)
migrate
in interface RedisServerCommands
key
- must not be null.target
- must not be null.option
- can be null. Defaulted to RedisServerCommands.MigrateOption.COPY
.public RedisConnection getDelegate()
DecoratedRedisConnection
RedisConnection
.getDelegate
in interface DecoratedRedisConnection
Copyright © 2011-2016–2016 Pivotal Software, Inc.. All rights reserved.