Interface NodeSelectionKeyAsyncCommands<K,​V>

  • Type Parameters:
    K - Key type.
    V - Value type.
    All Known Subinterfaces:
    NodeSelectionAsyncCommands<K,​V>

    public interface NodeSelectionKeyAsyncCommands<K,​V>
    Asynchronous executed commands on a node selection for Keys (Key manipulation/querying).
    Since:
    4.0
    Author:
    Mark Paluch
    Generated class:
    by io.lettuce.apigenerator.CreateAsyncNodeSelectionClusterApi
    • Method Detail

      • copy

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<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

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

        AsyncExecutions<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

        AsyncExecutions<Boolean> expire​(K key,
                                        long seconds,
                                        ExpireArgs expireArgs)
        Set a key's time to live in seconds.
        Parameters:
        key - the key.
        seconds - the seconds type: long.
        expireArgs - the expire arguments.
        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.2
      • expire

        AsyncExecutions<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
      • expire

        AsyncExecutions<Boolean> expire​(K key,
                                        Duration seconds,
                                        ExpireArgs expireArgs)
        Set a key's time to live in seconds.
        Parameters:
        key - the key.
        seconds - the seconds.
        expireArgs - the expire arguments.
        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.2
      • expireat

        AsyncExecutions<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

        AsyncExecutions<Boolean> expireat​(K key,
                                          long timestamp,
                                          ExpireArgs expireArgs)
        Set the expiration for a key as a UNIX timestamp.
        Parameters:
        key - the key.
        timestamp - the timestamp type: posix time.
        expireArgs - the expire arguments.
        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.2
      • expireat

        AsyncExecutions<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

        AsyncExecutions<Boolean> expireat​(K key,
                                          Date timestamp,
                                          ExpireArgs expireArgs)
        Set the expiration for a key as a UNIX timestamp.
        Parameters:
        key - the key.
        timestamp - the timestamp type: posix time.
        expireArgs - the expire arguments.
        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.2
      • expireat

        AsyncExecutions<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
      • expireat

        AsyncExecutions<Boolean> expireat​(K key,
                                          Instant timestamp,
                                          ExpireArgs expireArgs)
        Set the expiration for a key as a UNIX timestamp.
        Parameters:
        key - the key.
        timestamp - the timestamp type: posix time.
        expireArgs - the expire arguments.
        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.2
      • expiretime

        AsyncExecutions<Long> expiretime​(K key)
        Get the time to live for a key in as unix timestamp in seconds.
        Parameters:
        key - the key.
        Returns:
        Long integer-reply in seconds, or a negative value in order to signal an error. The command returns -1 if the key exists but has no associated expiration time. The command returns -2 if the key does not exist.
        Since:
        6.2
      • keys

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<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

        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.
        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

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<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

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

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

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<Boolean> pexpire​(K key,
                                         long milliseconds,
                                         ExpireArgs expireArgs)
        Set a key's time to live in milliseconds.
        Parameters:
        key - the key.
        milliseconds - the milliseconds type: long.
        expireArgs - the expire arguments.
        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.2
      • pexpire

        AsyncExecutions<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
      • pexpire

        AsyncExecutions<Boolean> pexpire​(K key,
                                         Duration milliseconds,
                                         ExpireArgs expireArgs)
        Set a key's time to live in milliseconds.
        Parameters:
        key - the key.
        milliseconds - the milliseconds.
        expireArgs - the expire arguments.
        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.2
      • pexpireat

        AsyncExecutions<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

        AsyncExecutions<Boolean> pexpireat​(K key,
                                           long timestamp,
                                           ExpireArgs expireArgs)
        Set the expiration for a key as a UNIX timestamp specified in milliseconds.
        Parameters:
        key - the key.
        timestamp - the milliseconds-timestamp type: posix time.
        expireArgs - the expire arguments.
        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.2
      • pexpireat

        AsyncExecutions<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

        AsyncExecutions<Boolean> pexpireat​(K key,
                                           Date timestamp,
                                           ExpireArgs expireArgs)
        Set the expiration for a key as a UNIX timestamp specified in milliseconds.
        Parameters:
        key - the key.
        timestamp - the milliseconds-timestamp type: posix time.
        expireArgs - the expire arguments.
        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.2
      • pexpireat

        AsyncExecutions<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).
      • pexpireat

        AsyncExecutions<Boolean> pexpireat​(K key,
                                           Instant timestamp,
                                           ExpireArgs expireArgs)
        Set the expiration for a key as a UNIX timestamp specified in milliseconds.
        Parameters:
        key - the key.
        timestamp - the milliseconds-timestamp type: posix time.
        expireArgs - the expire arguments.
        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.2
      • pexpiretime

        AsyncExecutions<Long> pexpiretime​(K key)
        Get the time to live for a key in as unix timestamp in milliseconds.
        Parameters:
        key - the key.
        Returns:
        Long integer-reply in milliseconds, or a negative value in order to signal an error. The command returns -1 if the key exists but has no associated expiration time. The command returns -2 if the key does not exist.
        Since:
        6.2
      • pttl

        AsyncExecutions<Long> pttl​(K key)
        Get the time to live for a key in milliseconds.
        Parameters:
        key - the key.
        Returns:
        Long integer-reply in milliseconds, or a negative value in order to signal an error. The command returns -1 if the key exists but has no associated expiration time. The command returns -2 if the key does not exist.
      • randomkey

        AsyncExecutions<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

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

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<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.
      • sortReadOnly

        AsyncExecutions<List<V>> sortReadOnly​(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.
        Since:
        6.2
      • sortReadOnly

        AsyncExecutions<Long> sortReadOnly​(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.
        Since:
        6.2
      • sortReadOnly

        AsyncExecutions<List<V>> sortReadOnly​(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.
        Since:
        6.2
      • sortReadOnly

        AsyncExecutions<Long> sortReadOnly​(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.
        Since:
        6.2
      • sortStore

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<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. The command returns -1 if the key exists but has no associated expiration time. The command returns -2 if the key does not exist.
      • type

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<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

        AsyncExecutions<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.