Module lettuce.core
Package io.lettuce.core.cluster.api.sync
Interface NodeSelectionKeyCommands<K,V>
- Type Parameters:
K- Key type.V- Value type.
- All Known Subinterfaces:
NodeSelectionCommands<K,V>
public interface NodeSelectionKeyCommands<K,V>
Synchronous executed commands on a node selection for Keys (Key manipulation/querying).
- Since:
- 4.0
- Author:
- Mark Paluch
- Generated class:
- by io.lettuce.apigenerator.CreateSyncNodeSelectionClusterApi
-
Method Summary
Modifier and Type Method Description Executions<Boolean>copy(K source, K destination)Copy the value stored at the source key to the destination key.Executions<Boolean>copy(K source, K destination, CopyArgs copyArgs)Copy the value stored at the source key to the destination key.Executions<Long>del(K... keys)Delete one or more keys.Executions<byte[]>dump(K key)Return a serialized version of the value stored at the specified key.Executions<Long>exists(K... keys)Determine how many keys exist.Executions<Boolean>expire(K key, long seconds)Set a key's time to live in seconds.Executions<Boolean>expire(K key, Duration seconds)Set a key's time to live in seconds.Executions<Boolean>expireat(K key, long timestamp)Set the expiration for a key as a UNIX timestamp.Executions<Boolean>expireat(K key, Instant timestamp)Set the expiration for a key as a UNIX timestamp.Executions<Boolean>expireat(K key, Date timestamp)Set the expiration for a key as a UNIX timestamp.Executions<Long>keys(KeyStreamingChannel<K> channel, K pattern)Find all keys matching the given pattern.Executions<List<K>>keys(K pattern)Find all keys matching the given pattern.Executions<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.Executions<String>migrate(String host, int port, K key, int db, long timeout)Atomically transfer a key from a Redis instance to another one.Executions<Boolean>move(K key, int db)Move a key to another database.Executions<String>objectEncoding(K key)Returns the kind of internal representation used in order to store the value associated with thekey.Executions<Long>objectFreq(K key)Returns the logarithmic access frequency counter of the object stored at the specifiedkey.Executions<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).Executions<Long>objectRefcount(K key)Returns the number of references of the value associated with the specified key.Executions<Boolean>persist(K key)Remove the expiration from a key.Executions<Boolean>pexpire(K key, long milliseconds)Set a key's time to live in milliseconds.Executions<Boolean>pexpire(K key, Duration milliseconds)Set a key's time to live in milliseconds.Executions<Boolean>pexpireat(K key, long timestamp)Set the expiration for a key as a UNIX timestamp specified in milliseconds.Executions<Boolean>pexpireat(K key, Instant timestamp)Set the expiration for a key as a UNIX timestamp specified in milliseconds.Executions<Boolean>pexpireat(K key, Date timestamp)Set the expiration for a key as a UNIX timestamp specified in milliseconds.Executions<Long>pttl(K key)Get the time to live for a key in milliseconds.Executions<K>randomkey()Return a random key from the keyspace.Executions<String>rename(K key, K newKey)Rename a key.Executions<Boolean>renamenx(K key, K newKey)Rename a key, only if the new key does not exist.Executions<String>restore(K key, byte[] value, RestoreArgs args)Create a key using the provided serialized value, previously obtained using DUMP.Executions<String>restore(K key, long ttl, byte[] value)Create a key using the provided serialized value, previously obtained using DUMP.Executions<KeyScanCursor<K>>scan()Incrementally iterate the keys space.Executions<StreamScanCursor>scan(KeyStreamingChannel<K> channel)Incrementally iterate the keys space.Executions<StreamScanCursor>scan(KeyStreamingChannel<K> channel, ScanArgs scanArgs)Incrementally iterate the keys space.Executions<StreamScanCursor>scan(KeyStreamingChannel<K> channel, ScanCursor scanCursor)Incrementally iterate the keys space.Executions<StreamScanCursor>scan(KeyStreamingChannel<K> channel, ScanCursor scanCursor, ScanArgs scanArgs)Incrementally iterate the keys space.Executions<KeyScanCursor<K>>scan(ScanArgs scanArgs)Incrementally iterate the keys space.Executions<KeyScanCursor<K>>scan(ScanCursor scanCursor)Incrementally iterate the keys space.Executions<KeyScanCursor<K>>scan(ScanCursor scanCursor, ScanArgs scanArgs)Incrementally iterate the keys space.Executions<Long>sort(ValueStreamingChannel<V> channel, K key)Sort the elements in a list, set or sorted set.Executions<Long>sort(ValueStreamingChannel<V> channel, K key, SortArgs sortArgs)Sort the elements in a list, set or sorted set.Executions<List<V>>sort(K key)Sort the elements in a list, set or sorted set.Executions<List<V>>sort(K key, SortArgs sortArgs)Sort the elements in a list, set or sorted set.Executions<Long>sortStore(K key, SortArgs sortArgs, K destination)Sort the elements in a list, set or sorted set.Executions<Long>touch(K... keys)Touch one or more keys.Executions<Long>ttl(K key)Get the time to live for a key.Executions<String>type(K key)Determine the type stored at key.Executions<Long>unlink(K... keys)Unlink one or more keys (non blocking DEL).
-
Method Details
-
copy
Copy the value stored at the source key to the destination key.- Parameters:
source- the source.destination- the destination.- Returns:
- Boolean integer-reply specifically:
trueif source was copied.falseif source was not copied. - Since:
- 6.1
-
copy
Copy the value stored at the source key to the destination key.- Parameters:
source- the source.destination- the destination.copyArgs- the copyArgs.- Returns:
- Boolean integer-reply specifically:
trueif source was copied.falseif source was not copied. - Since:
- 6.1
-
del
Delete one or more keys.- Parameters:
keys- the keys.- Returns:
- Long integer-reply The number of keys that were removed.
-
unlink
Unlink one or more keys (non blocking DEL).- Parameters:
keys- the keys.- Returns:
- Long integer-reply The number of keys that were removed.
-
dump
Return a serialized version of the value stored at the specified key.- Parameters:
key- the key.- Returns:
- byte[] bulk-string-reply the serialized value.
-
exists
Determine how many keys exist.- Parameters:
keys- the keys.- Returns:
- Long integer-reply specifically: Number of existing keys.
-
expire
Set a key's time to live in seconds.- Parameters:
key- the key.seconds- the seconds type: long.- Returns:
- Boolean integer-reply specifically:
trueif the timeout was set.falseifkeydoes not exist or the timeout could not be set.
-
expire
Set a key's time to live in seconds.- Parameters:
key- the key.seconds- the seconds.- Returns:
- Boolean integer-reply specifically:
trueif the timeout was set.falseifkeydoes not exist or the timeout could not be set. - Since:
- 6.1
-
expireat
Set the expiration for a key as a UNIX timestamp.- Parameters:
key- the key.timestamp- the timestamp type: posix time.- Returns:
- Boolean integer-reply specifically:
trueif the timeout was set.falseifkeydoes not exist or the timeout could not be set (see:EXPIRE).
-
expireat
Set the expiration for a key as a UNIX timestamp.- Parameters:
key- the key.timestamp- the timestamp type: posix time.- Returns:
- Boolean integer-reply specifically:
trueif the timeout was set.falseifkeydoes not exist or the timeout could not be set (see:EXPIRE).
-
expireat
Set the expiration for a key as a UNIX timestamp.- Parameters:
key- the key.timestamp- the timestamp type: posix time.- Returns:
- Boolean integer-reply specifically:
trueif the timeout was set.falseifkeydoes not exist or the timeout could not be set (see:EXPIRE). - Since:
- 6.1
-
keys
Find all keys matching the given pattern.- Parameters:
pattern- the pattern type: patternkey (pattern).- Returns:
- List<K> array-reply list of keys matching
pattern.
-
keys
Find all keys matching the given pattern.- Parameters:
channel- the channel.pattern- the pattern.- Returns:
- Long array-reply list of keys matching
pattern.
-
migrate
Atomically transfer a key from a Redis instance to another one.- Parameters:
host- the host.port- the port.key- the key.db- the database.timeout- the timeout in milliseconds.- Returns:
- String simple-string-reply The command returns OK on success.
-
migrate
Executions<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.- Parameters:
host- the host.port- the port.db- the database.timeout- the timeout in milliseconds.migrateArgs- migrate args that allow to configure further options.- Returns:
- String simple-string-reply The command returns OK on success.
-
move
Move a key to another database.- Parameters:
key- the key.db- the db type: long.- Returns:
- Boolean integer-reply specifically:.
-
objectEncoding
Returns the kind of internal representation used in order to store the value associated with thekey.- Parameters:
key- the key.- Returns:
- String.
-
objectFreq
Returns the logarithmic access frequency counter of the object stored at the specifiedkey.- Parameters:
key- the key.- Returns:
- Long.
- Since:
- 6.1
-
objectIdletime
Returns the number of seconds since the object stored at the specified key is idle (not requested by read or write operations).- Parameters:
key- the key.- Returns:
- number of seconds since the object stored at the specified key is idle.
-
objectRefcount
Returns the number of references of the value associated with the specified key.- Parameters:
key- the key.- Returns:
- Long.
-
persist
Remove the expiration from a key.- Parameters:
key- the key.- Returns:
- Boolean integer-reply specifically:
trueif the timeout was removed.falseifkeydoes not exist or does not have an associated timeout.
-
pexpire
Set a key's time to live in milliseconds.- Parameters:
key- the key.milliseconds- the milliseconds type: long.- Returns:
- integer-reply, specifically:
trueif the timeout was set.falseifkeydoes not exist or the timeout could not be set.
-
pexpire
Set a key's time to live in milliseconds.- Parameters:
key- the key.milliseconds- the milliseconds.- Returns:
- integer-reply, specifically:
trueif the timeout was set.falseifkeydoes not exist or the timeout could not be set. - Since:
- 6.1
-
pexpireat
Set the expiration for a key as a UNIX timestamp specified in milliseconds.- Parameters:
key- the key.timestamp- the milliseconds-timestamp type: posix time.- Returns:
- Boolean integer-reply specifically:
trueif the timeout was set.falseifkeydoes not exist or the timeout could not be set (see:EXPIRE).
-
pexpireat
Set the expiration for a key as a UNIX timestamp specified in milliseconds.- Parameters:
key- the key.timestamp- the milliseconds-timestamp type: posix time.- Returns:
- Boolean integer-reply specifically:
trueif the timeout was set.falseifkeydoes not exist or the timeout could not be set (see:EXPIRE).
-
pexpireat
Set the expiration for a key as a UNIX timestamp specified in milliseconds.- Parameters:
key- the key.timestamp- the milliseconds-timestamp type: posix time.- Returns:
- Boolean integer-reply specifically:
trueif the timeout was set.falseifkeydoes not exist or the timeout could not be set (see:EXPIRE).
-
pttl
Get the time to live for a key in milliseconds.- Parameters:
key- the key.- Returns:
- Long integer-reply TTL in milliseconds, or a negative value in order to signal an error (see the description above).
-
randomkey
Executions<K> randomkey()Return a random key from the keyspace.- Returns:
- K bulk-string-reply the random key, or
nullwhen the database is empty.
-
rename
Rename a key.- Parameters:
key- the key.newKey- the newkey type: key.- Returns:
- String simple-string-reply.
-
renamenx
Rename a key, only if the new key does not exist.- Parameters:
key- the key.newKey- the newkey type: key.- Returns:
- Boolean integer-reply specifically:
trueifkeywas renamed tonewkey.falseifnewkeyalready exists.
-
restore
Create a key using the provided serialized value, previously obtained using DUMP.- Parameters:
key- the key.ttl- the ttl type: long.value- the serialized-value type: string.- Returns:
- String simple-string-reply The command returns OK on success.
-
restore
Create a key using the provided serialized value, previously obtained using DUMP.- Parameters:
key- the key.value- the serialized-value type: string.args- theRestoreArgs, must not benull.- Returns:
- String simple-string-reply The command returns OK on success.
- Since:
- 5.1
-
sort
Sort the elements in a list, set or sorted set.- Parameters:
key- the key.- Returns:
- List<V> array-reply list of sorted elements.
-
sort
Sort the elements in a list, set or sorted set.- Parameters:
channel- streaming channel that receives a call for every value.key- the key.- Returns:
- Long number of values.
-
sort
Sort the elements in a list, set or sorted set.- Parameters:
key- the key.sortArgs- sort arguments.- Returns:
- List<V> array-reply list of sorted elements.
-
sort
Sort the elements in a list, set or sorted set.- Parameters:
channel- streaming channel that receives a call for every value.key- the key.sortArgs- sort arguments.- Returns:
- Long number of values.
-
sortStore
Sort the elements in a list, set or sorted set.- Parameters:
key- the key.sortArgs- sort arguments.destination- the destination key to store sort results.- Returns:
- Long number of values.
-
touch
Touch one or more keys. Touch sets the last accessed time for a key. Non-exsitent keys wont get created.- Parameters:
keys- the keys.- Returns:
- Long integer-reply the number of found keys.
-
ttl
Get the time to live for a key.- Parameters:
key- the key.- Returns:
- Long integer-reply TTL in seconds, or a negative value in order to signal an error (see the description above).
-
type
Determine the type stored at key.- Parameters:
key- the key.- Returns:
- String simple-string-reply type of
key, ornonewhenkeydoes not exist.
-
scan
Executions<KeyScanCursor<K>> scan()Incrementally iterate the keys space.- Returns:
- KeyScanCursor<K> scan cursor.
-
scan
Incrementally iterate the keys space. UseKeyScanArgsto specifySCAN-specific arguments.- Parameters:
scanArgs- scan arguments.- Returns:
- KeyScanCursor<K> scan cursor.
- See Also:
KeyScanArgs
-
scan
Incrementally iterate the keys space. UseKeyScanArgsto specifySCAN-specific arguments.- Parameters:
scanCursor- cursor to resume from a previous scan, must not benull.scanArgs- scan arguments.- Returns:
- KeyScanCursor<K> scan cursor.
- See Also:
KeyScanArgs
-
scan
Incrementally iterate the keys space.- Parameters:
scanCursor- cursor to resume from a previous scan, must not benull.- Returns:
- KeyScanCursor<K> scan cursor.
-
scan
Incrementally iterate the keys space.- Parameters:
channel- streaming channel that receives a call for every key.- Returns:
- StreamScanCursor scan cursor.
-
scan
Incrementally iterate the keys space. UseKeyScanArgsto specifySCAN-specific arguments.- Parameters:
channel- streaming channel that receives a call for every key.scanArgs- scan arguments.- Returns:
- StreamScanCursor scan cursor.
- See Also:
KeyScanArgs
-
scan
Executions<StreamScanCursor> scan(KeyStreamingChannel<K> channel, ScanCursor scanCursor, ScanArgs scanArgs)Incrementally iterate the keys space. UseKeyScanArgsto specifySCAN-specific arguments.- Parameters:
channel- streaming channel that receives a call for every key.scanCursor- cursor to resume from a previous scan, must not benull.scanArgs- scan arguments.- Returns:
- StreamScanCursor scan cursor.
- See Also:
KeyScanArgs
-
scan
Incrementally iterate the keys space.- Parameters:
channel- streaming channel that receives a call for every key.scanCursor- cursor to resume from a previous scan, must not benull.- Returns:
- StreamScanCursor scan cursor.
-