public interface RedisKeyCommands
Modifier and Type | Method and Description |
---|---|
Long |
del(byte[]... keys)
Delete given
keys . |
byte[] |
dump(byte[] key)
Retrieve serialized version of the value stored at
key . |
Boolean |
exists(byte[] key)
Determine if given
key exists. |
Boolean |
expire(byte[] key,
long seconds)
Set time to live for given
key in seconds. |
Boolean |
expireAt(byte[] key,
long unixTime)
Set the expiration for given
key as a UNIX timestamp. |
Set<byte[]> |
keys(byte[] pattern)
Find all keys matching the given
pattern . |
Boolean |
move(byte[] key,
int dbIndex)
Move given
key to database with index . |
Boolean |
persist(byte[] key)
Remove the expiration from given
key . |
Boolean |
pExpire(byte[] key,
long millis)
Set time to live for given
key in milliseconds. |
Boolean |
pExpireAt(byte[] key,
long unixTimeInMillis)
Set the expiration for given
key as a UNIX timestamp in milliseconds. |
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 . |
byte[] |
randomKey()
Return a random key from the keyspace.
|
void |
rename(byte[] oldName,
byte[] newName)
Rename key
oleName to newName . |
Boolean |
renameNX(byte[] oldName,
byte[] newName)
Rename key
oleName to newName only if newName does not exist. |
void |
restore(byte[] key,
long ttlInMillis,
byte[] serializedValue)
|
Cursor<byte[]> |
scan(ScanOptions options)
Use a
Cursor to iterate over keys. |
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 . |
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 . |
DataType |
type(byte[] key)
Determine the type stored at
key . |
Boolean exists(byte[] key)
key
exists.
See http://redis.io/commands/exists
key
- Long del(byte[]... keys)
keys
.
See http://redis.io/commands/del
keys
- DataType type(byte[] key)
key
.
See http://redis.io/commands/type
key
- Set<byte[]> keys(byte[] pattern)
pattern
.
See http://redis.io/commands/keys
pattern
- Cursor<byte[]> scan(ScanOptions options)
Cursor
to iterate over keys.
See http://redis.io/commands/scan
options
- byte[] randomKey()
See http://redis.io/commands/randomkey
void rename(byte[] oldName, byte[] newName)
oleName
to newName
.
See http://redis.io/commands/rename
oldName
- newName
- Boolean renameNX(byte[] oldName, byte[] newName)
oleName
to newName
only if newName
does not exist.
See http://redis.io/commands/renamenx
oldName
- newName
- Boolean expire(byte[] key, long seconds)
key
in seconds.
See http://redis.io/commands/expire
key
- seconds
- Boolean pExpire(byte[] key, long millis)
key
in milliseconds.
See http://redis.io/commands/pexpire
key
- millis
- Boolean expireAt(byte[] key, long unixTime)
key
as a UNIX timestamp.
See http://redis.io/commands/expireat
key
- unixTime
- Boolean pExpireAt(byte[] key, long unixTimeInMillis)
key
as a UNIX timestamp in milliseconds.
See http://redis.io/commands/pexpireat
key
- unixTimeInMillis
- Boolean persist(byte[] key)
key
.
See http://redis.io/commands/persist
key
- Boolean move(byte[] key, int dbIndex)
key
to database with index
.
See http://redis.io/commands/move
key
- dbIndex
- Long ttl(byte[] key)
key
in seconds.
See http://redis.io/commands/ttl
key
- Long ttl(byte[] key, TimeUnit timeUnit)
key
in and convert it to the given TimeUnit
.
See http://redis.io/commands/ttl
key
- timeUnit
- Long pTtl(byte[] key)
key
in milliseconds.
See http://redis.io/commands/pttl
key
- Long pTtl(byte[] key, TimeUnit timeUnit)
key
in and convert it to the given TimeUnit
.
See http://redis.io/commands/pttl
key
- timeUnit
- List<byte[]> sort(byte[] key, SortParameters params)
key
.
See http://redis.io/commands/sort
key
- params
- Long sort(byte[] key, SortParameters params, byte[] storeKey)
key
and store result in storeKey
.
See http://redis.io/commands/sort
key
- params
- storeKey
- byte[] dump(byte[] key)
key
.
See http://redis.io/commands/dump
key
- void restore(byte[] key, long ttlInMillis, byte[] serializedValue)
key
using the serializedValue
, previously obtained using dump(byte[])
.
See http://redis.io/commands/restore
key
- ttlInMillis
- serializedValue
- Copyright © 2011-2016–2016 Pivotal Software, Inc.. All rights reserved.