K
- Key type.V
- Value type.public interface NodeSelectionKeyAsyncCommands<K,V>
Modifier and Type | Method and Description |
---|---|
AsyncExecutions<Boolean> |
copy(K source,
K destination)
Copy the value stored at the source key to the destination key.
|
AsyncExecutions<Boolean> |
copy(K source,
K destination,
CopyArgs copyArgs)
Copy the value stored at the source key to the destination key.
|
AsyncExecutions<Long> |
del(K... keys)
Delete one or more keys.
|
AsyncExecutions<byte[]> |
dump(K key)
Return a serialized version of the value stored at the specified key.
|
AsyncExecutions<Long> |
exists(K... keys)
Determine how many keys exist.
|
AsyncExecutions<Boolean> |
expire(K key,
Duration seconds)
Set a key's time to live in seconds.
|
AsyncExecutions<Boolean> |
expire(K key,
Duration seconds,
ExpireArgs expireArgs)
Set a key's time to live in seconds.
|
AsyncExecutions<Boolean> |
expire(K key,
long seconds)
Set a key's time to live in seconds.
|
AsyncExecutions<Boolean> |
expire(K key,
long seconds,
ExpireArgs expireArgs)
Set a key's time to live in seconds.
|
AsyncExecutions<Boolean> |
expireat(K key,
Date timestamp)
Set the expiration for a key as a UNIX timestamp.
|
AsyncExecutions<Boolean> |
expireat(K key,
Date timestamp,
ExpireArgs expireArgs)
Set the expiration for a key as a UNIX timestamp.
|
AsyncExecutions<Boolean> |
expireat(K key,
Instant timestamp)
Set the expiration for a key as a UNIX timestamp.
|
AsyncExecutions<Boolean> |
expireat(K key,
Instant timestamp,
ExpireArgs expireArgs)
Set the expiration for a key as a UNIX timestamp.
|
AsyncExecutions<Boolean> |
expireat(K key,
long timestamp)
Set the expiration for a key as a UNIX timestamp.
|
AsyncExecutions<Boolean> |
expireat(K key,
long timestamp,
ExpireArgs expireArgs)
Set the expiration for a key as a UNIX timestamp.
|
AsyncExecutions<Long> |
expiretime(K key)
Get the time to live for a key in as unix timestamp in seconds.
|
AsyncExecutions<List<K>> |
keys(K pattern)
Find all keys matching the given pattern.
|
AsyncExecutions<Long> |
keys(KeyStreamingChannel<K> channel,
K pattern)
Find all keys matching the given pattern.
|
AsyncExecutions<String> |
migrate(String host,
int port,
int db,
long timeout,
MigrateArgs<K> migrateArgs)
Atomically transfer one or more keys from a Redis instance to another one.
|
AsyncExecutions<String> |
migrate(String host,
int port,
K key,
int db,
long timeout)
Atomically transfer a key from a Redis instance to another one.
|
AsyncExecutions<Boolean> |
move(K key,
int db)
Move a key to another database.
|
AsyncExecutions<String> |
objectEncoding(K key)
Returns the kind of internal representation used in order to store the value associated with the
key . |
AsyncExecutions<Long> |
objectFreq(K key)
Returns the logarithmic access frequency counter of the object stored at the specified
key . |
AsyncExecutions<Long> |
objectIdletime(K key)
Returns the number of seconds since the object stored at the specified key is idle (not requested by read or write
operations).
|
AsyncExecutions<Long> |
objectRefcount(K key)
Returns the number of references of the value associated with the specified key.
|
AsyncExecutions<Boolean> |
persist(K key)
Remove the expiration from a key.
|
AsyncExecutions<Boolean> |
pexpire(K key,
Duration milliseconds)
Set a key's time to live in milliseconds.
|
AsyncExecutions<Boolean> |
pexpire(K key,
Duration milliseconds,
ExpireArgs expireArgs)
Set a key's time to live in milliseconds.
|
AsyncExecutions<Boolean> |
pexpire(K key,
long milliseconds)
Set a key's time to live in milliseconds.
|
AsyncExecutions<Boolean> |
pexpire(K key,
long milliseconds,
ExpireArgs expireArgs)
Set a key's time to live in milliseconds.
|
AsyncExecutions<Boolean> |
pexpireat(K key,
Date timestamp)
Set the expiration for a key as a UNIX timestamp specified in milliseconds.
|
AsyncExecutions<Boolean> |
pexpireat(K key,
Date timestamp,
ExpireArgs expireArgs)
Set the expiration for a key as a UNIX timestamp specified in milliseconds.
|
AsyncExecutions<Boolean> |
pexpireat(K key,
Instant timestamp)
Set the expiration for a key as a UNIX timestamp specified in milliseconds.
|
AsyncExecutions<Boolean> |
pexpireat(K key,
Instant timestamp,
ExpireArgs expireArgs)
Set the expiration for a key as a UNIX timestamp specified in milliseconds.
|
AsyncExecutions<Boolean> |
pexpireat(K key,
long timestamp)
Set the expiration for a key as a UNIX timestamp specified in milliseconds.
|
AsyncExecutions<Boolean> |
pexpireat(K key,
long timestamp,
ExpireArgs expireArgs)
Set the expiration for a key as a UNIX timestamp specified in milliseconds.
|
AsyncExecutions<Long> |
pexpiretime(K key)
Get the time to live for a key in as unix timestamp in milliseconds.
|
AsyncExecutions<Long> |
pttl(K key)
Get the time to live for a key in milliseconds.
|
AsyncExecutions<K> |
randomkey()
Return a random key from the keyspace.
|
AsyncExecutions<String> |
rename(K key,
K newKey)
Rename a key.
|
AsyncExecutions<Boolean> |
renamenx(K key,
K newKey)
Rename a key, only if the new key does not exist.
|
AsyncExecutions<String> |
restore(K key,
byte[] value,
RestoreArgs args)
Create a key using the provided serialized value, previously obtained using DUMP.
|
AsyncExecutions<String> |
restore(K key,
long ttl,
byte[] value)
Create a key using the provided serialized value, previously obtained using DUMP.
|
AsyncExecutions<KeyScanCursor<K>> |
scan()
Incrementally iterate the keys space.
|
AsyncExecutions<StreamScanCursor> |
scan(KeyStreamingChannel<K> channel)
Incrementally iterate the keys space.
|
AsyncExecutions<StreamScanCursor> |
scan(KeyStreamingChannel<K> channel,
ScanArgs scanArgs)
Incrementally iterate the keys space.
|
AsyncExecutions<StreamScanCursor> |
scan(KeyStreamingChannel<K> channel,
ScanCursor scanCursor)
Incrementally iterate the keys space.
|
AsyncExecutions<StreamScanCursor> |
scan(KeyStreamingChannel<K> channel,
ScanCursor scanCursor,
ScanArgs scanArgs)
Incrementally iterate the keys space.
|
AsyncExecutions<KeyScanCursor<K>> |
scan(ScanArgs scanArgs)
Incrementally iterate the keys space.
|
AsyncExecutions<KeyScanCursor<K>> |
scan(ScanCursor scanCursor)
Incrementally iterate the keys space.
|
AsyncExecutions<KeyScanCursor<K>> |
scan(ScanCursor scanCursor,
ScanArgs scanArgs)
Incrementally iterate the keys space.
|
AsyncExecutions<List<V>> |
sort(K key)
Sort the elements in a list, set or sorted set.
|
AsyncExecutions<List<V>> |
sort(K key,
SortArgs sortArgs)
Sort the elements in a list, set or sorted set.
|
AsyncExecutions<Long> |
sort(ValueStreamingChannel<V> channel,
K key)
Sort the elements in a list, set or sorted set.
|
AsyncExecutions<Long> |
sort(ValueStreamingChannel<V> channel,
K key,
SortArgs sortArgs)
Sort the elements in a list, set or sorted set.
|
AsyncExecutions<List<V>> |
sortReadOnly(K key)
Sort the elements in a list, set or sorted set.
|
AsyncExecutions<List<V>> |
sortReadOnly(K key,
SortArgs sortArgs)
Sort the elements in a list, set or sorted set.
|
AsyncExecutions<Long> |
sortReadOnly(ValueStreamingChannel<V> channel,
K key)
Sort the elements in a list, set or sorted set.
|
AsyncExecutions<Long> |
sortReadOnly(ValueStreamingChannel<V> channel,
K key,
SortArgs sortArgs)
Sort the elements in a list, set or sorted set.
|
AsyncExecutions<Long> |
sortStore(K key,
SortArgs sortArgs,
K destination)
Sort the elements in a list, set or sorted set.
|
AsyncExecutions<Long> |
touch(K... keys)
Touch one or more keys.
|
AsyncExecutions<Long> |
ttl(K key)
Get the time to live for a key.
|
AsyncExecutions<String> |
type(K key)
Determine the type stored at key.
|
AsyncExecutions<Long> |
unlink(K... keys)
Unlink one or more keys (non blocking DEL).
|
AsyncExecutions<Boolean> copy(K source, K destination)
source
- the source.destination
- the destination.true
if source was copied. false
if source was not copied.AsyncExecutions<Boolean> copy(K source, K destination, CopyArgs copyArgs)
source
- the source.destination
- the destination.copyArgs
- the copyArgs.true
if source was copied. false
if source was not copied.AsyncExecutions<Long> del(K... keys)
keys
- the keys.AsyncExecutions<Long> unlink(K... keys)
keys
- the keys.AsyncExecutions<byte[]> dump(K key)
key
- the key.AsyncExecutions<Long> exists(K... keys)
keys
- the keys.AsyncExecutions<Boolean> expire(K key, long seconds)
key
- the key.seconds
- the seconds type: long.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set.AsyncExecutions<Boolean> expire(K key, long seconds, ExpireArgs expireArgs)
key
- the key.seconds
- the seconds type: long.expireArgs
- the expiry arguments.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set.AsyncExecutions<Boolean> expire(K key, Duration seconds)
key
- the key.seconds
- the seconds.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set.AsyncExecutions<Boolean> expire(K key, Duration seconds, ExpireArgs expireArgs)
key
- the key.seconds
- the seconds.expireArgs
- the expiry arguments.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set.AsyncExecutions<Boolean> expireat(K key, long timestamp)
key
- the key.timestamp
- the timestamp type: posix time.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set (see: EXPIRE
).AsyncExecutions<Boolean> expireat(K key, long timestamp, ExpireArgs expireArgs)
key
- the key.timestamp
- the timestamp type: posix time.expireArgs
- the expiry arguments.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set (see: EXPIRE
).AsyncExecutions<Boolean> expireat(K key, Date timestamp)
key
- the key.timestamp
- the timestamp type: posix time.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set (see: EXPIRE
).AsyncExecutions<Boolean> expireat(K key, Date timestamp, ExpireArgs expireArgs)
key
- the key.timestamp
- the timestamp type: posix time.expireArgs
- the expiry arguments.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set (see: EXPIRE
).AsyncExecutions<Boolean> expireat(K key, Instant timestamp)
key
- the key.timestamp
- the timestamp type: posix time.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set (see: EXPIRE
).AsyncExecutions<Boolean> expireat(K key, Instant timestamp, ExpireArgs expireArgs)
key
- the key.timestamp
- the timestamp type: posix time.expireArgs
- the expiry arguments.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set (see: EXPIRE
).AsyncExecutions<Long> expiretime(K key)
key
- the key.-1
if
the key exists but has no associated expiration time. The command returns -2
if the key does not exist.AsyncExecutions<List<K>> keys(K pattern)
pattern
- the pattern type: patternkey (pattern).pattern
.AsyncExecutions<Long> keys(KeyStreamingChannel<K> channel, K pattern)
channel
- the channel.pattern
- the pattern.pattern
.AsyncExecutions<String> migrate(String host, int port, K key, int db, long timeout)
host
- the host.port
- the port.key
- the key.db
- the database.timeout
- the timeout in milliseconds.AsyncExecutions<String> migrate(String host, int port, int db, long timeout, MigrateArgs<K> migrateArgs)
host
- the host.port
- the port.db
- the database.timeout
- the timeout in milliseconds.migrateArgs
- migrate args that allow to configure further options.AsyncExecutions<Boolean> move(K key, int db)
key
- the key.db
- the db type: long.AsyncExecutions<String> objectEncoding(K key)
key
.key
- the key.AsyncExecutions<Long> objectFreq(K key)
key
.key
- the key.AsyncExecutions<Long> objectIdletime(K key)
key
- the key.AsyncExecutions<Long> objectRefcount(K key)
key
- the key.AsyncExecutions<Boolean> persist(K key)
key
- the key.true
if the timeout was removed. false
if key
does not exist or does not have an
associated timeout.AsyncExecutions<Boolean> pexpire(K key, long milliseconds)
key
- the key.milliseconds
- the milliseconds type: long.true
if the timeout was set. false
if key
does not exist or
the timeout could not be set.AsyncExecutions<Boolean> pexpire(K key, long milliseconds, ExpireArgs expireArgs)
key
- the key.milliseconds
- the milliseconds type: long.expireArgs
- the expiry arguments.true
if the timeout was set. false
if key
does not exist or
the timeout could not be set.AsyncExecutions<Boolean> pexpire(K key, Duration milliseconds)
key
- the key.milliseconds
- the milliseconds.true
if the timeout was set. false
if key
does not exist or
the timeout could not be set.AsyncExecutions<Boolean> pexpire(K key, Duration milliseconds, ExpireArgs expireArgs)
key
- the key.milliseconds
- the milliseconds.expireArgs
- the expiry arguments.true
if the timeout was set. false
if key
does not exist or
the timeout could not be set.AsyncExecutions<Boolean> pexpireat(K key, long timestamp)
key
- the key.timestamp
- the milliseconds-timestamp type: posix time.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set (see: EXPIRE
).AsyncExecutions<Boolean> pexpireat(K key, long timestamp, ExpireArgs expireArgs)
key
- the key.timestamp
- the milliseconds-timestamp type: posix time.expireArgs
- the expiry arguments.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set (see: EXPIRE
).AsyncExecutions<Boolean> pexpireat(K key, Date timestamp)
key
- the key.timestamp
- the milliseconds-timestamp type: posix time.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set (see: EXPIRE
).AsyncExecutions<Boolean> pexpireat(K key, Date timestamp, ExpireArgs expireArgs)
key
- the key.timestamp
- the milliseconds-timestamp type: posix time.expireArgs
- the expiry arguments.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set (see: EXPIRE
).AsyncExecutions<Boolean> pexpireat(K key, Instant timestamp)
key
- the key.timestamp
- the milliseconds-timestamp type: posix time.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set (see: EXPIRE
).AsyncExecutions<Boolean> pexpireat(K key, Instant timestamp, ExpireArgs expireArgs)
key
- the key.timestamp
- the milliseconds-timestamp type: posix time.expireArgs
- the expiry arguments.true
if the timeout was set. false
if key
does not
exist or the timeout could not be set (see: EXPIRE
).AsyncExecutions<Long> pexpiretime(K key)
key
- the key.-1
if the key exists but has no associated expiration time. The command returns -2
if the key
does not exist.AsyncExecutions<Long> pttl(K key)
key
- the key.-1
if the key exists but has no associated expiration time. The command returns -2
if the key
does not exist.AsyncExecutions<K> randomkey()
null
when the database is empty.AsyncExecutions<String> rename(K key, K newKey)
key
- the key.newKey
- the newkey type: key.AsyncExecutions<Boolean> renamenx(K key, K newKey)
key
- the key.newKey
- the newkey type: key.true
if key
was renamed to newkey
. false
if newkey
already exists.AsyncExecutions<String> restore(K key, long ttl, byte[] value)
key
- the key.ttl
- the ttl type: long.value
- the serialized-value type: string.AsyncExecutions<String> restore(K key, byte[] value, RestoreArgs args)
key
- the key.value
- the serialized-value type: string.args
- the RestoreArgs
, must not be null
.AsyncExecutions<List<V>> sort(K key)
key
- the key.AsyncExecutions<Long> sort(ValueStreamingChannel<V> channel, K key)
channel
- streaming channel that receives a call for every value.key
- the key.AsyncExecutions<List<V>> sort(K key, SortArgs sortArgs)
key
- the key.sortArgs
- sort arguments.AsyncExecutions<Long> sort(ValueStreamingChannel<V> channel, K key, SortArgs sortArgs)
channel
- streaming channel that receives a call for every value.key
- the key.sortArgs
- sort arguments.AsyncExecutions<List<V>> sortReadOnly(K key)
key
- the key.AsyncExecutions<Long> sortReadOnly(ValueStreamingChannel<V> channel, K key)
channel
- streaming channel that receives a call for every value.key
- the key.AsyncExecutions<List<V>> sortReadOnly(K key, SortArgs sortArgs)
key
- the key.sortArgs
- sort arguments.AsyncExecutions<Long> sortReadOnly(ValueStreamingChannel<V> channel, K key, SortArgs sortArgs)
channel
- streaming channel that receives a call for every value.key
- the key.sortArgs
- sort arguments.AsyncExecutions<Long> sortStore(K key, SortArgs sortArgs, K destination)
key
- the key.sortArgs
- sort arguments.destination
- the destination key to store sort results.AsyncExecutions<Long> touch(K... keys)
keys
- the keys.AsyncExecutions<Long> ttl(K key)
key
- the key.-1
if the key exists but has no associated expiration time. The command returns -2
if the key
does not exist.AsyncExecutions<String> type(K key)
key
- the key.key
, or none
when key
does not exist.AsyncExecutions<KeyScanCursor<K>> scan()
AsyncExecutions<KeyScanCursor<K>> scan(ScanArgs scanArgs)
KeyScanArgs
to specify SCAN
-specific arguments.scanArgs
- scan arguments.KeyScanArgs
AsyncExecutions<KeyScanCursor<K>> scan(ScanCursor scanCursor, ScanArgs scanArgs)
KeyScanArgs
to specify SCAN
-specific arguments.scanCursor
- cursor to resume from a previous scan, must not be null
.scanArgs
- scan arguments.KeyScanArgs
AsyncExecutions<KeyScanCursor<K>> scan(ScanCursor scanCursor)
scanCursor
- cursor to resume from a previous scan, must not be null
.AsyncExecutions<StreamScanCursor> scan(KeyStreamingChannel<K> channel)
channel
- streaming channel that receives a call for every key.AsyncExecutions<StreamScanCursor> scan(KeyStreamingChannel<K> channel, ScanArgs scanArgs)
KeyScanArgs
to specify SCAN
-specific arguments.channel
- streaming channel that receives a call for every key.scanArgs
- scan arguments.KeyScanArgs
AsyncExecutions<StreamScanCursor> scan(KeyStreamingChannel<K> channel, ScanCursor scanCursor, ScanArgs scanArgs)
KeyScanArgs
to specify SCAN
-specific arguments.channel
- streaming channel that receives a call for every key.scanCursor
- cursor to resume from a previous scan, must not be null
.scanArgs
- scan arguments.KeyScanArgs
AsyncExecutions<StreamScanCursor> scan(KeyStreamingChannel<K> channel, ScanCursor scanCursor)
channel
- streaming channel that receives a call for every key.scanCursor
- cursor to resume from a previous scan, must not be null
.Copyright © 2025 lettuce.io. All rights reserved.