Interface RKeysRx


  • public interface RKeysRx
    Author:
    Nikita Koksharov
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      io.reactivex.rxjava3.core.Single<>  name)
      Clear an expire timeout or expire date for object.
      io.reactivex.rxjava3.core.Completable  name,  host, int port, int database, long timeout)
      Copy object from source Redis instance to destination Redis instance
      io.reactivex.rxjava3.core.Single<> count()
      Returns the number of keys in the currently-selected database
      io.reactivex.rxjava3.core.Single<> ... names)
      Checks if provided keys exist
      io.reactivex.rxjava3.core.Single<> ... keys)
      Delete multiple objects by name.
      io.reactivex.rxjava3.core.Single<>  pattern)
      Delete multiple objects by a key pattern.
      io.reactivex.rxjava3.core.Single<>  name, long timeToLive,  timeUnit)
      Set a timeout for object.
      io.reactivex.rxjava3.core.Single<>  name, long timestamp)
      Set an expire date for object.
      io.reactivex.rxjava3.core.Completable flushall()
      Delete all the keys of all the existing databases Uses FLUSHALL Redis command.
      io.reactivex.rxjava3.core.Completable flushallParallel()
      Delete all keys of all existing databases in background without blocking server.
      io.reactivex.rxjava3.core.Completable flushdb()
      Delete all the keys of the currently selected database Uses FLUSHDB Redis command.
      io.reactivex.rxjava3.core.Completable flushdbParallel()
      Delete all keys of currently selected database in background without blocking server.
      io.reactivex.rxjava3.core.Flowable<> getKeys()
      Load keys in incrementally iterate mode.
      io.reactivex.rxjava3.core.Flowable<> getKeys​(int count)
      Load keys in incrementally iterate mode.
      io.reactivex.rxjava3.core.Flowable<>  pattern)
      Find keys by pattern and load it in incrementally iterate mode.
      io.reactivex.rxjava3.core.Flowable<>  pattern, int count)
      Get all keys by pattern using iterator.
      io.reactivex.rxjava3.core.Single<>  key)
      Get hash slot identifier for key.
      io.reactivex.rxjava3.core.Single<RType>  key)
      Get Redis object type by key
      io.reactivex.rxjava3.core.Completable  name,  host, int port, int database, long timeout)
      Transfer object from source Redis instance to destination Redis instance
      io.reactivex.rxjava3.core.Single<>  name, int database)
      Move object to another database
      io.reactivex.rxjava3.core.Maybe<> randomKey()
      Get random key Uses RANDOM_KEY Redis command.
      io.reactivex.rxjava3.core.Single<>  name)
      Remaining time to live of Redisson object that has a timeout
      io.reactivex.rxjava3.core.Completable  currentName,  newName)
      Rename current object key to newName
      io.reactivex.rxjava3.core.Single<>  oldName,  newName)
      Rename object with oldName to newName only if new key is not exists
      io.reactivex.rxjava3.core.Completable swapdb​(int db1, int db2)
      Swap two databases.
      io.reactivex.rxjava3.core.Single<> ... names)
      Update the last access time of an object.
      io.reactivex.rxjava3.core.Single<> ... keys)
      Delete multiple objects by name.
    • Method Detail

      • move

        io.reactivex.rxjava3.core.Single<> move​( name,
                                                       int database)
        Move object to another database
        Parameters:
        name - of object
        database - - Redis database number
        Returns:
        true if key was moved else false
      • migrate

        io.reactivex.rxjava3.core.Completable migrate​( name,
                                                       host,
                                                      int port,
                                                      int database,
                                                      long timeout)
        Transfer object from source Redis instance to destination Redis instance
        Parameters:
        name - of object
        host - - destination host
        port - - destination port
        database - - destination database
        timeout - - maximum idle time in any moment of the communication with the destination instance in milliseconds
        Returns:
        void
      • copy

        io.reactivex.rxjava3.core.Completable copy​( name,
                                                    host,
                                                   int port,
                                                   int database,
                                                   long timeout)
        Copy object from source Redis instance to destination Redis instance
        Parameters:
        name - of object
        host - - destination host
        port - - destination port
        database - - destination database
        timeout - - maximum idle time in any moment of the communication with the destination instance in milliseconds
        Returns:
        void
      • expire

        io.reactivex.rxjava3.core.Single<> expire​( name,
                                                         long timeToLive,
                                                          timeUnit)
        Set a timeout for object. After the timeout has expired, the key will automatically be deleted.
        Parameters:
        name - of object
        timeToLive - - timeout before object will be deleted
        timeUnit - - timeout time unit
        Returns:
        true if the timeout was set and false if not
      • expireAt

        io.reactivex.rxjava3.core.Single<> expireAt​( name,
                                                           long timestamp)
        Set an expire date for object. When expire date comes the key will automatically be deleted.
        Parameters:
        name - of object
        timestamp - - expire date in milliseconds (Unix timestamp)
        Returns:
        true if the timeout was set and false if not
      • clearExpire

        io.reactivex.rxjava3.core.Single<> clearExpire​( name)
        Clear an expire timeout or expire date for object.
        Parameters:
        name - of object
        Returns:
        true if timeout was removed false if object does not exist or does not have an associated timeout
      • renamenx

        io.reactivex.rxjava3.core.Single<> renamenx​( oldName,
                                                            newName)
        Rename object with oldName to newName only if new key is not exists
        Parameters:
        oldName - - old name of object
        newName - - new name of object
        Returns:
        true if object has been renamed successfully and false otherwise
      • rename

        io.reactivex.rxjava3.core.Completable rename​( currentName,
                                                      newName)
        Rename current object key to newName
        Parameters:
        currentName - - current name of object
        newName - - new name of object
        Returns:
        void
      • remainTimeToLive

        io.reactivex.rxjava3.core.Single<> remainTimeToLive​( name)
        Remaining time to live of Redisson object that has a timeout
        Parameters:
        name - of key
        Returns:
        time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
      • touch

        io.reactivex.rxjava3.core.Single<> touch​(... names)
        Update the last access time of an object.
        Parameters:
        names - of keys
        Returns:
        count of objects were touched
      • countExists

        io.reactivex.rxjava3.core.Single<> countExists​(... names)
        Checks if provided keys exist
        Parameters:
        names - of keys
        Returns:
        amount of existing keys
      • getType

        io.reactivex.rxjava3.core.Single< key)
        Get Redis object type by key
        Parameters:
        key - - name of key
        Returns:
        type of key
      • getKeys

        io.reactivex.rxjava3.core.Flowable<> getKeys()
        Load keys in incrementally iterate mode. Keys traversed with SCAN operation. Each SCAN operation loads up to 10 keys per request.
        Returns:
        keys
      • getKeys

        io.reactivex.rxjava3.core.Flowable<> getKeys​(int count)
        Load keys in incrementally iterate mode. Keys traversed with SCAN operation. Each SCAN operation loads up to count keys per request.
        Parameters:
        count - - keys loaded per request to Redis
        Returns:
        keys
      • getKeysByPattern

        io.reactivex.rxjava3.core.Flowable<> getKeysByPattern​( pattern)
        Find keys by pattern and load it in incrementally iterate mode. Keys traversed with SCAN operation. Each SCAN operation loads up to 10 keys per request.

        Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo

        Parameters:
        pattern - - match pattern
        Returns:
        keys
      • getKeysByPattern

        io.reactivex.rxjava3.core.Flowable<> getKeysByPattern​( pattern,
                                                                    int count)
        Get all keys by pattern using iterator. Keys traversed with SCAN operation. Each SCAN operation loads up to count keys per request.

        Supported glob-style patterns:

        h?llo subscribes to hello, hallo and hxllo

        h*llo subscribes to hllo and heeeello

        h[ae]llo subscribes to hello and hallo, but not hillo

        Parameters:
        pattern - - match pattern
        count - - keys loaded per request to Redis
        Returns:
        keys
      • getSlot

        io.reactivex.rxjava3.core.Single<> getSlot​( key)
        Get hash slot identifier for key. Available for cluster nodes only. Uses KEYSLOT Redis command.
        Parameters:
        key - - name of key
        Returns:
        slot number
      • randomKey

        io.reactivex.rxjava3.core.Maybe<> randomKey()
        Get random key Uses RANDOM_KEY Redis command.
        Returns:
        random key
      • deleteByPattern

        io.reactivex.rxjava3.core.Single<> deleteByPattern​( pattern)
        Delete multiple objects by a key pattern. Uses Lua script. Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo
        Parameters:
        pattern - - match pattern
        Returns:
        deleted objects amount
      • delete

        io.reactivex.rxjava3.core.Single<> delete​(... keys)
        Delete multiple objects by name. Uses DEL Redis command.
        Parameters:
        keys - - object names
        Returns:
        deleted objects amount
      • unlink

        io.reactivex.rxjava3.core.Single<> unlink​(... keys)
        Delete multiple objects by name. Actual removal will happen later asynchronously.

        Requires Redis 4.0+

        Parameters:
        keys - of objects
        Returns:
        number of removed keys
      • count

        io.reactivex.rxjava3.core.Single<> count()
        Returns the number of keys in the currently-selected database
        Returns:
        count of keys
      • flushdb

        io.reactivex.rxjava3.core.Completable flushdb()
        Delete all the keys of the currently selected database Uses FLUSHDB Redis command.
        Returns:
        void
      • swapdb

        io.reactivex.rxjava3.core.Completable swapdb​(int db1,
                                                     int db2)
        Swap two databases.

        Requires Redis 4.0+

        Returns:
        void
      • flushall

        io.reactivex.rxjava3.core.Completable flushall()
        Delete all the keys of all the existing databases Uses FLUSHALL Redis command.
        Returns:
        void
      • flushdbParallel

        io.reactivex.rxjava3.core.Completable flushdbParallel()
        Delete all keys of currently selected database in background without blocking server.

        Requires Redis 4.0+

        Returns:
        void
      • flushallParallel

        io.reactivex.rxjava3.core.Completable flushallParallel()
        Delete all keys of all existing databases in background without blocking server.

        Requires Redis 4.0+

        Returns:
        void