Interface RKeysAsync

  • All Known Subinterfaces:
    RKeys
    All Known Implementing Classes:
    RedissonKeys

    public interface RKeysAsync
    Author:
    Nikita Koksharov
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      >  name)
      Clear an expire timeout or expire date for object.
      >  name,  host, int port, int database, long timeout)
      Copy object from source Redis instance to destination Redis instance in async mode
      > countAsync()
      Returns the number of keys in the currently-selected database in async mode
      > ... names)
      Checks if provided keys exist
      > ... keys)
      Delete multiple objects by name
      > deleteAsync​(RObject... objects)
      Delete multiple objects
      >  pattern)
      Delete multiple objects by a key pattern.
      >  name, long timeToLive,  timeUnit)
      Set a timeout for object.
      >  name, long timestamp)
      Set an expire date for object.
      > flushallAsync()
      Delete all keys of all existing databases
      > flushallParallelAsync()
      Delete all keys of all existing databases in background without blocking server.
      > flushdbAsync()
      Delete all keys of currently selected database
      > flushdbParallelAsync()
      Delete all keys of currently selected database in background without blocking server.
      >  key)
      Get hash slot identifier for key in async mode.
      RFuture<RType>  key)
      Get Redis object type by key
      >  name,  host, int port, int database, long timeout)
      Transfer object from source Redis instance to destination Redis instance
      >  name, int database)
      Move object to another database
      > randomKeyAsync()
      Get random key in async mode
      >  name)
      Remaining time to live of Redisson object that has a timeout
      >  currentName,  newName)
      Rename current object key to newName
      >  oldName,  newName)
      Rename object with oldName to newName only if new key is not exists
      > swapdbAsync​(int db1, int db2)
      Swap two databases.
      > ... names)
      Update the last access time of an object.
      > ... keys)
      Delete multiple objects by name.
    • Method Detail

      • moveAsync

        > moveAsync​( name,
                                   int database)
        Move object to another database
        Parameters:
        name - of object
        database - - Redis database number
        Returns:
        true if key was moved else false
      • migrateAsync

        > migrateAsync​( 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
      • copyAsync

        > copyAsync​( name,
                                 host,
                                int port,
                                int database,
                                long timeout)
        Copy object from source Redis instance to destination Redis instance in async mode
        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
      • expireAsync

        > expireAsync​( 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
      • expireAtAsync

        > expireAtAsync​( 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
      • clearExpireAsync

        > clearExpireAsync​( 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
      • renamenxAsync

        > renamenxAsync​( 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
      • renameAsync

        > renameAsync​( currentName,
                                   newName)
        Rename current object key to newName
        Parameters:
        currentName - - current name of object
        newName - - new name of object
        Returns:
        void
      • remainTimeToLiveAsync

        > remainTimeToLiveAsync​( 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.
      • touchAsync

        > touchAsync​(... names)
        Update the last access time of an object.
        Parameters:
        names - of keys
        Returns:
        count of objects were touched
      • countExistsAsync

        > countExistsAsync​(... names)
        Checks if provided keys exist
        Parameters:
        names - of keys
        Returns:
        amount of existing keys
      • getTypeAsync

         key)
        Get Redis object type by key
        Parameters:
        key - - name of key
        Returns:
        type of key
      • getSlotAsync

        > getSlotAsync​( key)
        Get hash slot identifier for key in async mode. Available for cluster nodes only
        Parameters:
        key - - name of key
        Returns:
        slot
      • randomKeyAsync

        > randomKeyAsync()
        Get random key in async mode
        Returns:
        random key
      • deleteByPatternAsync

        > deleteByPatternAsync​( pattern)
        Delete multiple objects by a key pattern.

        Method executes in NON atomic way in cluster mode due to lua script limitations.

        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:
        number of removed keys
      • deleteAsync

        > deleteAsync​(RObject... objects)
        Delete multiple objects
        Parameters:
        objects - of Redisson
        Returns:
        number of removed keys
      • deleteAsync

        > deleteAsync​(... keys)
        Delete multiple objects by name
        Parameters:
        keys - - object names
        Returns:
        number of removed keys
      • unlinkAsync

        > unlinkAsync​(... keys)
        Delete multiple objects by name. Actual removal will happen later asynchronously.

        Requires Redis 4.0+

        Parameters:
        keys - - object names
        Returns:
        number of removed keys
      • countAsync

        > countAsync()
        Returns the number of keys in the currently-selected database in async mode
        Returns:
        number of keys
      • swapdbAsync

        > swapdbAsync​(int db1,
                                  int db2)
        Swap two databases.

        Requires Redis 4.0+

        Returns:
        void
      • flushdbAsync

        > flushdbAsync()
        Delete all keys of currently selected database
        Returns:
        void
      • flushallAsync

        > flushallAsync()
        Delete all keys of all existing databases
        Returns:
        void
      • flushdbParallelAsync

        > flushdbParallelAsync()
        Delete all keys of currently selected database in background without blocking server.

        Requires Redis 4.0+

        Returns:
        void
      • flushallParallelAsync

        > flushallParallelAsync()
        Delete all keys of all existing databases in background without blocking server.

        Requires Redis 4.0+

        Returns:
        void