Module lettuce.core

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 Details

    • copy

      Executions<Boolean> copy​(K source, K destination)
      Copy the value stored at the source key to the destination key.
      Parameters:
      source - the source.
      destination - the destination.
      Returns:
      Boolean integer-reply specifically: true if source was copied. false if source was not copied.
      Since:
      6.1
    • copy

      Executions<Boolean> copy​(K source, K destination, CopyArgs copyArgs)
      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: true if source was copied. false if source was not copied.
      Since:
      6.1
    • del

      Executions<Long> del​(K... keys)
      Delete one or more keys.
      Parameters:
      keys - the keys.
      Returns:
      Long integer-reply The number of keys that were removed.
    • unlink

      Executions<Long> unlink​(K... keys)
      Unlink one or more keys (non blocking DEL).
      Parameters:
      keys - the keys.
      Returns:
      Long integer-reply The number of keys that were removed.
    • dump

      Executions<byte[]> dump​(K key)
      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

      Executions<Long> exists​(K... keys)
      Determine how many keys exist.
      Parameters:
      keys - the keys.
      Returns:
      Long integer-reply specifically: Number of existing keys.
    • expire

      Executions<Boolean> expire​(K key, long seconds)
      Set a key's time to live in seconds.
      Parameters:
      key - the key.
      seconds - the seconds type: long.
      Returns:
      Boolean integer-reply specifically: true if the timeout was set. false if key does not exist or the timeout could not be set.
    • expire

      Executions<Boolean> expire​(K key, Duration seconds)
      Set a key's time to live in seconds.
      Parameters:
      key - the key.
      seconds - the seconds.
      Returns:
      Boolean integer-reply specifically: true if the timeout was set. false if key does not exist or the timeout could not be set.
      Since:
      6.1
    • expireat

      Executions<Boolean> expireat​(K key, long timestamp)
      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: true if the timeout was set. false if key does not exist or the timeout could not be set (see: EXPIRE).
    • expireat

      Executions<Boolean> expireat​(K key, Date timestamp)
      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: true if the timeout was set. false if key does not exist or the timeout could not be set (see: EXPIRE).
    • expireat

      Executions<Boolean> expireat​(K key, Instant timestamp)
      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: true if the timeout was set. false if key does not exist or the timeout could not be set (see: EXPIRE).
      Since:
      6.1
    • keys

      Executions<List<K>> keys​(K pattern)
      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

      Executions<Long> keys​(KeyStreamingChannel<K> channel, K pattern)
      Find all keys matching the given pattern.
      Parameters:
      channel - the channel.
      pattern - the pattern.
      Returns:
      Long array-reply list of keys matching pattern.
    • migrate

      Executions<String> migrate​(String host, int port, K key, int db, long timeout)
      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

      Executions<Boolean> move​(K key, int db)
      Move a key to another database.
      Parameters:
      key - the key.
      db - the db type: long.
      Returns:
      Boolean integer-reply specifically:.
    • objectEncoding

      Executions<String> objectEncoding​(K key)
      Returns the kind of internal representation used in order to store the value associated with the key.
      Parameters:
      key - the key.
      Returns:
      String.
    • objectFreq

      Executions<Long> objectFreq​(K key)
      Returns the logarithmic access frequency counter of the object stored at the specified key.
      Parameters:
      key - the key.
      Returns:
      Long.
      Since:
      6.1
    • objectIdletime

      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).
      Parameters:
      key - the key.
      Returns:
      number of seconds since the object stored at the specified key is idle.
    • objectRefcount

      Executions<Long> objectRefcount​(K key)
      Returns the number of references of the value associated with the specified key.
      Parameters:
      key - the key.
      Returns:
      Long.
    • persist

      Executions<Boolean> persist​(K key)
      Remove the expiration from a key.
      Parameters:
      key - the key.
      Returns:
      Boolean integer-reply specifically: true if the timeout was removed. false if key does not exist or does not have an associated timeout.
    • pexpire

      Executions<Boolean> pexpire​(K key, long milliseconds)
      Set a key's time to live in milliseconds.
      Parameters:
      key - the key.
      milliseconds - the milliseconds type: long.
      Returns:
      integer-reply, specifically: true if the timeout was set. false if key does not exist or the timeout could not be set.
    • pexpire

      Executions<Boolean> pexpire​(K key, Duration milliseconds)
      Set a key's time to live in milliseconds.
      Parameters:
      key - the key.
      milliseconds - the milliseconds.
      Returns:
      integer-reply, specifically: true if the timeout was set. false if key does not exist or the timeout could not be set.
      Since:
      6.1
    • pexpireat

      Executions<Boolean> pexpireat​(K key, long timestamp)
      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: true if the timeout was set. false if key does not exist or the timeout could not be set (see: EXPIRE).
    • pexpireat

      Executions<Boolean> pexpireat​(K key, Date timestamp)
      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: true if the timeout was set. false if key does not exist or the timeout could not be set (see: EXPIRE).
    • pexpireat

      Executions<Boolean> pexpireat​(K key, Instant timestamp)
      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: true if the timeout was set. false if key does not exist or the timeout could not be set (see: EXPIRE).
    • pttl

      Executions<Long> pttl​(K key)
      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 null when the database is empty.
    • rename

      Executions<String> rename​(K key, K newKey)
      Rename a key.
      Parameters:
      key - the key.
      newKey - the newkey type: key.
      Returns:
      String simple-string-reply.
    • renamenx

      Executions<Boolean> renamenx​(K key, K newKey)
      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: true if key was renamed to newkey. false if newkey already exists.
    • restore

      Executions<String> restore​(K key, long ttl, byte[] value)
      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

      Executions<String> restore​(K key, byte[] value, RestoreArgs args)
      Create a key using the provided serialized value, previously obtained using DUMP.
      Parameters:
      key - the key.
      value - the serialized-value type: string.
      args - the RestoreArgs, must not be null.
      Returns:
      String simple-string-reply The command returns OK on success.
      Since:
      5.1
    • sort

      Executions<List<V>> sort​(K key)
      Sort the elements in a list, set or sorted set.
      Parameters:
      key - the key.
      Returns:
      List<V> array-reply list of sorted elements.
    • sort

      Executions<Long> sort​(ValueStreamingChannel<V> channel, K key)
      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

      Executions<List<V>> sort​(K key, SortArgs sortArgs)
      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

      Executions<Long> sort​(ValueStreamingChannel<V> channel, K key, SortArgs sortArgs)
      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

      Executions<Long> sortStore​(K key, SortArgs sortArgs, K destination)
      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

      Executions<Long> touch​(K... keys)
      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

      Executions<Long> ttl​(K key)
      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

      Executions<String> type​(K key)
      Determine the type stored at key.
      Parameters:
      key - the key.
      Returns:
      String simple-string-reply type of key, or none when key does not exist.
    • scan

      Incrementally iterate the keys space.
      Returns:
      KeyScanCursor<K> scan cursor.
    • scan

      Executions<KeyScanCursor<K>> scan​(ScanArgs scanArgs)
      Incrementally iterate the keys space. Use KeyScanArgs to specify SCAN-specific arguments.
      Parameters:
      scanArgs - scan arguments.
      Returns:
      KeyScanCursor<K> scan cursor.
      See Also:
      KeyScanArgs
    • scan

      Executions<KeyScanCursor<K>> scan​(ScanCursor scanCursor, ScanArgs scanArgs)
      Incrementally iterate the keys space. Use KeyScanArgs to specify SCAN-specific arguments.
      Parameters:
      scanCursor - cursor to resume from a previous scan, must not be null.
      scanArgs - scan arguments.
      Returns:
      KeyScanCursor<K> scan cursor.
      See Also:
      KeyScanArgs
    • scan

      Executions<KeyScanCursor<K>> scan​(ScanCursor scanCursor)
      Incrementally iterate the keys space.
      Parameters:
      scanCursor - cursor to resume from a previous scan, must not be null.
      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

      Executions<StreamScanCursor> scan​(KeyStreamingChannel<K> channel, ScanArgs scanArgs)
      Incrementally iterate the keys space. Use KeyScanArgs to specify SCAN-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. Use KeyScanArgs to specify SCAN-specific arguments.
      Parameters:
      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.
      Returns:
      StreamScanCursor scan cursor.
      See Also:
      KeyScanArgs
    • scan

      Executions<StreamScanCursor> scan​(KeyStreamingChannel<K> channel, ScanCursor scanCursor)
      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 be null.
      Returns:
      StreamScanCursor scan cursor.