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 time to live for
key in milliseconds. |
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. |
DataType |
type(byte[] key)
Determine the type stored at
key. |
Boolean exists(byte[] key)
key exists.key - http://redis.io/commands/existsLong del(byte[]... keys)
keys.keys - http://redis.io/commands/delDataType type(byte[] key)
key.key - http://redis.io/commands/typeSet<byte[]> keys(byte[] pattern)
pattern.pattern - http://redis.io/commands/keysCursor<byte[]> scan(ScanOptions options)
Cursor to iterate over keys. count - pattern - http://redis.io/commands/scanbyte[] randomKey()
http://redis.io/commands/randomkeyvoid rename(byte[] oldName,
byte[] newName)
oleName to newName.oldName - newName - http://redis.io/commands/renameBoolean renameNX(byte[] oldName, byte[] newName)
oleName to newName only if newName does not exist.oldName - newName - http://redis.io/commands/renamenxBoolean expire(byte[] key, long seconds)
key in seconds.key - seconds - http://redis.io/commands/expireBoolean pExpire(byte[] key, long millis)
key in milliseconds.key - millis - http://redis.io/commands/pexpireBoolean expireAt(byte[] key, long unixTime)
key as a UNIX timestamp.key - unixTime - http://redis.io/commands/expireatBoolean pExpireAt(byte[] key, long unixTimeInMillis)
key as a UNIX timestamp in milliseconds.key - unixTimeInMillis - http://redis.io/commands/pexpireatBoolean persist(byte[] key)
key.key - http://redis.io/commands/persistBoolean move(byte[] key, int dbIndex)
key to database with index.key - dbIndex - http://redis.io/commands/moveLong ttl(byte[] key)
key in seconds.key - http://redis.io/commands/ttlLong pTtl(byte[] key)
key in milliseconds.key - http://redis.io/commands/pttlList<byte[]> sort(byte[] key, SortParameters params)
key.key - params - http://redis.io/commands/sortLong sort(byte[] key, SortParameters params, byte[] storeKey)
key and store result in storeKey.key - params - storeKey - http://redis.io/commands/sortbyte[] dump(byte[] key)
key.key - http://redis.io/commands/dumpvoid restore(byte[] key,
long ttlInMillis,
byte[] serializedValue)
key - ttlInMillis - serializedValue - http://redis.io/commands/restore