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
oldName to newName . |
Boolean |
renameNX(byte[] oldName,
byte[] newName)
Rename key
oldName 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.key
- must not be null.Long del(byte[]... keys)
keys
.keys
- must not be null.DataType type(byte[] key)
key
.key
- must not be null.Set<byte[]> keys(byte[] pattern)
pattern
.pattern
- must not be null.Cursor<byte[]> scan(ScanOptions options)
Cursor
to iterate over keys.options
- must not be null.byte[] randomKey()
void rename(byte[] oldName, byte[] newName)
oldName
to newName
.oldName
- must not be null.newName
- must not be null.Boolean renameNX(byte[] oldName, byte[] newName)
oldName
to newName
only if newName
does not exist.oldName
- must not be null.newName
- must not be null.Boolean expire(byte[] key, long seconds)
key
in seconds.key
- must not be null.seconds
- Boolean pExpire(byte[] key, long millis)
key
in milliseconds.key
- must not be null.millis
- Boolean expireAt(byte[] key, long unixTime)
key
as a UNIX timestamp.key
- must not be null.unixTime
- Boolean pExpireAt(byte[] key, long unixTimeInMillis)
key
as a UNIX timestamp in milliseconds.key
- must not be null.unixTimeInMillis
- Boolean persist(byte[] key)
key
.key
- must not be null.Boolean move(byte[] key, int dbIndex)
key
to database with index
.key
- must not be null.dbIndex
- Long ttl(byte[] key)
key
in seconds.key
- must not be null.Long ttl(byte[] key, TimeUnit timeUnit)
key
in and convert it to the given TimeUnit
.key
- must not be null.timeUnit
- must not be null.Long pTtl(byte[] key)
key
in milliseconds.key
- must not be null.Long pTtl(byte[] key, TimeUnit timeUnit)
key
in and convert it to the given TimeUnit
.key
- must not be null.timeUnit
- must not be null.List<byte[]> sort(byte[] key, SortParameters params)
key
.key
- must not be null.params
- must not be null.Long sort(byte[] key, SortParameters params, byte[] storeKey)
key
and store result in storeKey
.key
- must not be null.params
- must not be null.storeKey
- must not be null.byte[] dump(byte[] key)
key
.key
- must not be null.void restore(byte[] key, long ttlInMillis, byte[] serializedValue)
key
- must not be null.ttlInMillis
- serializedValue
- must not be null.Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.