Class RedissonTransactionalMap<K,​V>

    • Method Detail

      • expireAsync

        public > expireAsync​(long timeToLive,
                                             timeUnit)
        Description copied from interface: RExpirableAsync
        Set a timeout for object in async mode. After the timeout has expired, the key will automatically be deleted.
        Specified by:
        expireAsync in interface RExpirableAsync
        Parameters:
        timeToLive - - timeout before object will be deleted
        timeUnit - - timeout time unit
        Returns:
        true if the timeout was set and false if not
      • expireAsync

        public > expireAsync​( timestamp)
        Description copied from interface: RExpirableAsync
        Set an expire date for object. When expire date comes the key will automatically be deleted.
        Specified by:
        expireAsync in interface RExpirableAsync
        Parameters:
        timestamp - - expire date
        Returns:
        true if the timeout was set and false if not
      • clearExpireAsync

        public > clearExpireAsync()
        Description copied from interface: RExpirableAsync
        Clear an expire timeout or expire date for object in async mode. Object will not be deleted.
        Specified by:
        clearExpireAsync in interface RExpirableAsync
        Returns:
        true if the timeout was cleared and false if not
      • moveAsync

        public > moveAsync​(int database)
        Description copied from interface: RObjectAsync
        Move object to another database in async mode
        Specified by:
        moveAsync in interface RObjectAsync
        Overrides:
        moveAsync in class RedissonObject
        Parameters:
        database - - number of Redis database
        Returns:
        true if key was moved false if not
      • migrateAsync

        public > migrateAsync​( host,
                                          int port,
                                          int database,
                                          long timeout)
        Description copied from interface: RObjectAsync
        Transfer object from source Redis instance to destination Redis instance in async mode
        Specified by:
        migrateAsync in interface RObjectAsync
        Overrides:
        migrateAsync in class RedissonObject
        Parameters:
        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
      • mapReduce

        public <KOut,​VOut> RMapReduce<K,​V,​KOut,​VOut> mapReduce()
        Description copied from interface: RMap
        Returns RMapReduce object associated with this map
        Specified by:
        mapReduce in interface RMap<K,​V>
        Overrides:
        mapReduce in class RedissonMap<K,​V>
        Type Parameters:
        KOut - output key
        VOut - output value
        Returns:
        MapReduce instance
      • containsKeyAsync

        public > containsKeyAsync​( key)
        Description copied from interface: RMapAsync
        Returns true if this map contains map entry mapped by specified key, otherwise false
        Specified by:
        containsKeyAsync in interface RMapAsync<K,​V>
        Overrides:
        containsKeyAsync in class RedissonMap<K,​V>
        Parameters:
        key - - map key
        Returns:
        true if this map contains map entry mapped by specified key, otherwise false
      • containsValueAsync

        public > containsValueAsync​( value)
        Description copied from interface: RMapAsync
        Returns true if this map contains any map entry with specified value, otherwise false
        Specified by:
        containsValueAsync in interface RMapAsync<K,​V>
        Overrides:
        containsValueAsync in class RedissonMap<K,​V>
        Parameters:
        value - - map value
        Returns:
        true if this map contains any map entry with specified value, otherwise false
      • valueSizeAsync

        public > valueSizeAsync​(K key)
        Description copied from interface: RMapAsync
        Returns size of value mapped by key in bytes
        Specified by:
        valueSizeAsync in interface RMapAsync<K,​V>
        Overrides:
        valueSizeAsync in class RedissonMap<K,​V>
        Parameters:
        key - - map key
        Returns:
        size of value
      • unlinkAsync

        public > unlinkAsync()
        Description copied from interface: RObjectAsync
        Delete the objects. Actual removal will happen later asynchronously.

        Requires Redis 4.0+

        Specified by:
        unlinkAsync in interface RObjectAsync
        Overrides:
        unlinkAsync in class RedissonObject
        Returns:
        true if it was exist and deleted else false
      • checkState

        protected void checkState()
      • loadAllAsync

        public > loadAllAsync​(boolean replaceExistingValues,
                                          int parallelism)
        Description copied from interface: RMapAsync
        Loads all map entries to this Redis map using MapLoader.
        Specified by:
        loadAllAsync in interface RMapAsync<K,​V>
        Overrides:
        loadAllAsync in class RedissonMap<K,​V>
        Parameters:
        replaceExistingValues - - true if existed values should be replaced, false otherwise.
        parallelism - - parallelism level, used to increase speed of process execution
        Returns:
        void
      • loadAllAsync

        public > loadAllAsync​(<? extends K> keys,
                                          boolean replaceExistingValues,
                                          int parallelism)
        Description copied from interface: RMapAsync
        Loads map entries using MapLoader whose keys are listed in defined keys parameter.
        Specified by:
        loadAllAsync in interface RMapAsync<K,​V>
        Overrides:
        loadAllAsync in class RedissonMap<K,​V>
        Parameters:
        keys - - map keys
        replaceExistingValues - - true if existed values should be replaced, false otherwise.
        parallelism - - parallelism level, used to increase speed of process execution
        Returns:
        void
      • getFairLock

        public RLock getFairLock​(K key)
        Description copied from interface: RMap
        Returns RLock instance associated with key
        Specified by:
        getFairLock in interface RMap<K,​V>
        Overrides:
        getFairLock in class RedissonMap<K,​V>
        Parameters:
        key - - map key
        Returns:
        fairlock
      • getSemaphore

        public RSemaphore getSemaphore​(K key)
        Description copied from interface: RMap
        Returns RSemaphore instance associated with key
        Specified by:
        getSemaphore in interface RMap<K,​V>
        Overrides:
        getSemaphore in class RedissonMap<K,​V>
        Parameters:
        key - - map key
        Returns:
        semaphore
      • getLock

        public RLock getLock​(K key)
        Description copied from interface: RMap
        Returns RLock instance associated with key
        Specified by:
        getLock in interface RMap<K,​V>
        Overrides:
        getLock in class RedissonMap<K,​V>
        Parameters:
        key - - map key
        Returns:
        lock
      • expire

        public boolean expire​(long timeToLive,
                               timeUnit)
        Description copied from interface: RExpirable
        Set a timeout for object. After the timeout has expired, the key will automatically be deleted.
        Specified by:
        expire in interface RExpirable
        Parameters:
        timeToLive - - timeout before object will be deleted
        timeUnit - - timeout time unit
        Returns:
        true if the timeout was set and false if not
      • expireAt

        public boolean expireAt​(long timestamp)
        Description copied from interface: RExpirable
        Specified by:
        expireAt in interface RExpirable
        Parameters:
        timestamp - - expire date in milliseconds (Unix timestamp)
        Returns:
        true if the timeout was set and false if not
      • expire

        public boolean expire​( instant)
        Description copied from interface: RExpirable
        Set an expire date for object. When expire date comes the key will automatically be deleted.
        Specified by:
        expire in interface RExpirable
        Parameters:
        instant - - expire date
        Returns:
        true if the timeout was set and false if not
      • expireAt

        public boolean expireAt​( timestamp)
        Description copied from interface: RExpirable
        Specified by:
        expireAt in interface RExpirable
        Parameters:
        timestamp - - expire date
        Returns:
        true if the timeout was set and false if not
      • clearExpire

        public boolean clearExpire()
        Description copied from interface: RExpirable
        Clear an expire timeout or expire date for object.
        Specified by:
        clearExpire in interface RExpirable
        Returns:
        true if timeout was removed false if object does not exist or does not have an associated timeout
      • remainTimeToLive

        public long remainTimeToLive()
        Description copied from interface: RExpirable
        Remaining time to live of Redisson object that has a timeout
        Specified by:
        remainTimeToLive in interface RExpirable
        Returns:
        time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
      • remainTimeToLiveAsync

        public > remainTimeToLiveAsync()
        Description copied from interface: RExpirableAsync
        Remaining time to live of Redisson object that has a timeout
        Specified by:
        remainTimeToLiveAsync in interface RExpirableAsync
        Returns:
        time in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
      • expireAsync

        protected > expireAsync​(long timeToLive,
                                                timeUnit,
                                               ... keys)
      • expireAtAsync

        protected > expireAtAsync​(long timestamp,
                                                 ... keys)
      • clearExpireAsync

        protected > clearExpireAsync​(... keys)