Package org.redisson

Class RedissonMap<K,​V>

    • Method Detail

      • 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>
        Type Parameters:
        KOut - output key
        VOut - output value
        Returns:
        MapReduce instance
      • 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>
        Parameters:
        key - - map key
        Returns:
        lock
      • getReadWriteLock

        public RReadWriteLock getReadWriteLock​(K key)
        Description copied from interface: RMap
        Returns RReadWriteLock instance associated with key
        Specified by:
        getReadWriteLock in interface RMap<K,​V>
        Parameters:
        key - - map key
        Returns:
        readWriteLock
      • size

        public int size()
        Specified by:
        size in interface Map<K,​V>
      • valueSize

        public int valueSize​(K key)
        Description copied from interface: RMap
        Returns size of value mapped by key in bytes
        Specified by:
        valueSize in interface RMap<K,​V>
        Parameters:
        key - - map key
        Returns:
        size of value
      • valueSizeAsync

        public RFuture<Integer> 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>
        Parameters:
        key - - map key
        Returns:
        size of value
      • checkKey

        protected void checkKey​(Object key)
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Map<K,​V>
      • containsKey

        public boolean containsKey​(Object key)
        Specified by:
        containsKey in interface Map<K,​V>
      • getAll

        public Map<K,​V> getAll​(Set<K> keys)
        Description copied from interface: RMap
        Gets a map slice contained the mappings with defined keys by one operation.

        If map doesn't contain value/values for specified key/keys and MapLoader is defined then value/values will be loaded in read-through mode.

        The returned map is NOT backed by the original map.

        Specified by:
        getAll in interface RMap<K,​V>
        Parameters:
        keys - - map keys
        Returns:
        Map slice
      • getAllAsync

        public RFuture<Map<K,​V>> getAllAsync​(Set<K> keys)
        Description copied from interface: RMapAsync
        Gets a map slice contained the mappings with defined keys by one operation.

        If map doesn't contain value/values for specified key/keys and MapLoader is defined then value/values will be loaded in read-through mode.

        The returned map is NOT backed by the original map.

        Specified by:
        getAllAsync in interface RMapAsync<K,​V>
        Parameters:
        keys - - map keys
        Returns:
        Map slice
      • hasNoLoader

        protected boolean hasNoLoader()
      • getAllOperationAsync

        public RFuture<Map<K,​V>> getAllOperationAsync​(Set<K> keys)
      • get

        public V get​(Object key)
        Description copied from interface: RMap
        Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

        If map doesn't contain value for specified key and MapLoader is defined then value will be loaded in read-through mode.

        Specified by:
        get in interface Map<K,​V>
        Specified by:
        get in interface RMap<K,​V>
        Parameters:
        key - the key whose associated value is to be returned
        Returns:
        the value to which the specified key is mapped, or null if this map contains no mapping for the key
      • put

        public V put​(K key,
                     V value)
        Description copied from interface: RMap
        Associates the specified value with the specified key in async manner.

        If MapWriter is defined then new map entry is stored in write-through mode.

        Specified by:
        put in interface Map<K,​V>
        Specified by:
        put in interface RMap<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        previous associated value
      • remove

        public V remove​(Object key)
        Description copied from interface: RMap
        Removes key from map and returns associated value in async manner.

        If MapWriter is defined then keyis deleted in write-through mode.

        Specified by:
        remove in interface Map<K,​V>
        Specified by:
        remove in interface RMap<K,​V>
        Parameters:
        key - - map key
        Returns:
        deleted value, null if there wasn't any association
      • putAll

        public final void putAll​(Map<? extends K,​? extends V> map)
        Description copied from interface: RMap
        Associates the specified value with the specified key in batch.

        If MapWriter is defined then new map entries will be stored in write-through mode.

        Specified by:
        putAll in interface Map<K,​V>
        Specified by:
        putAll in interface RMap<K,​V>
        Parameters:
        map - mappings to be stored in this map
      • putAll

        public void putAll​(Map<? extends K,​? extends V> map,
                           int batchSize)
        Description copied from interface: RMap
        Associates the specified value with the specified key in batch. Batch inserted by chunks limited by batchSize amount to avoid OOM and/or Redis response timeout error for map with big size.

        If MapWriter is defined then new map entries are stored in write-through mode.

        Specified by:
        putAll in interface RMap<K,​V>
        Parameters:
        map - mappings to be stored in this map
        batchSize - - map chunk size
      • putAllAsync

        public RFuture<Void> putAllAsync​(Map<? extends K,​? extends V> map,
                                         int batchSize)
        Description copied from interface: RMapAsync
        Associates the specified value with the specified key in batch. Batch inserted by chunks limited by batchSize amount to avoid OOM and/or Redis response timeout error for map with big size.

        If MapWriter is defined then new map entries are stored in write-through mode.

        Specified by:
        putAllAsync in interface RMapAsync<K,​V>
        Parameters:
        map - mappings to be stored in this map
        batchSize - - map chunk size
        Returns:
        void
      • putAllAsync

        public final RFuture<Void> putAllAsync​(Map<? extends K,​? extends V> map)
        Description copied from interface: RMapAsync
        Associates the specified value with the specified key in batch.

        If MapWriter is defined then new map entries are stored in write-through mode.

        Specified by:
        putAllAsync in interface RMapAsync<K,​V>
        Parameters:
        map - mappings to be stored in this map
        Returns:
        void
      • putAllOperationAsync

        protected RFuture<Void> putAllOperationAsync​(Map<? extends K,​? extends V> map)
      • clear

        public void clear()
        Specified by:
        clear in interface Map<K,​V>
      • keySet

        public Set<K> keySet()
        Description copied from interface: RMap
        Returns key set of this map. Keys are loaded in batch. Batch size is 10.
        Specified by:
        keySet in interface Map<K,​V>
        Specified by:
        keySet in interface RMap<K,​V>
        Returns:
        key set
        See Also:
        RMap.readAllKeySet()
      • keySet

        public Set<K> keySet​(String pattern)
        Description copied from interface: RMap
        Returns key set of this map. If pattern is not null then only keys match this pattern are loaded. 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

        Specified by:
        keySet in interface RMap<K,​V>
        Parameters:
        pattern - - key pattern
        Returns:
        key set
        See Also:
        RMap.readAllKeySet()
      • keySet

        public Set<K> keySet​(String pattern,
                             int count)
        Description copied from interface: RMap
        Returns key set of this map. If pattern is not null then only keys match this pattern are loaded. Keys are loaded in batch. Batch size is defined by count param. 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

        Specified by:
        keySet in interface RMap<K,​V>
        Parameters:
        pattern - - key pattern
        count - - size of keys batch
        Returns:
        key set
        See Also:
        RMap.readAllKeySet()
      • keySet

        public Set<K> keySet​(int count)
        Description copied from interface: RMap
        Returns key set of this map. Keys are loaded in batch. Batch size is defined by count param.
        Specified by:
        keySet in interface RMap<K,​V>
        Parameters:
        count - - size of keys batch
        Returns:
        key set
        See Also:
        RMap.readAllKeySet()
      • values

        public Collection<V> values()
        Description copied from interface: RMap
        Returns values collection of this map. Values are loaded in batch. Batch size is 10.
        Specified by:
        values in interface Map<K,​V>
        Specified by:
        values in interface RMap<K,​V>
        Returns:
        values collection
        See Also:
        RMap.readAllValues()
      • values

        public Collection<V> values​(String keyPattern,
                                    int count)
        Description copied from interface: RMap
        Returns values collection of this map. Values are loaded in batch. Batch size is defined by count param. If keyPattern is not null then only values mapped by matched keys of this pattern are loaded. 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

        Specified by:
        values in interface RMap<K,​V>
        Parameters:
        keyPattern - - key pattern
        count - - size of values batch
        Returns:
        values collection
        See Also:
        RMap.readAllValues()
      • values

        public Collection<V> values​(String keyPattern)
        Description copied from interface: RMap
        Returns values collection of this map. Values are loaded in batch. Batch size is 10. If keyPattern is not null then only values mapped by matched keys of this pattern are loaded. 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

        Specified by:
        values in interface RMap<K,​V>
        Parameters:
        keyPattern - - key pattern
        Returns:
        values collection
        See Also:
        RMap.readAllValues()
      • values

        public Collection<V> values​(int count)
        Description copied from interface: RMap
        Returns values collection of this map. Values are loaded in batch. Batch size is defined by count param.
        Specified by:
        values in interface RMap<K,​V>
        Parameters:
        count - - size of values batch
        Returns:
        values collection
        See Also:
        RMap.readAllValues()
      • entrySet

        public Set<Map.Entry<K,​V>> entrySet()
        Description copied from interface: RMap
        Returns map entries collection. Map entries are loaded in batch. Batch size is 10.
        Specified by:
        entrySet in interface Map<K,​V>
        Specified by:
        entrySet in interface RMap<K,​V>
        Returns:
        map entries collection
        See Also:
        RMap.readAllEntrySet()
      • entrySet

        public Set<Map.Entry<K,​V>> entrySet​(String keyPattern)
        Description copied from interface: RMap
        Returns map entries collection. Map entries are loaded in batch. Batch size is 10. If keyPattern is not null then only entries mapped by matched keys of this pattern are loaded. 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

        Specified by:
        entrySet in interface RMap<K,​V>
        Parameters:
        keyPattern - - key pattern
        Returns:
        map entries collection
        See Also:
        RMap.readAllEntrySet()
      • entrySet

        public Set<Map.Entry<K,​V>> entrySet​(String keyPattern,
                                                  int count)
        Description copied from interface: RMap
        Returns map entries collection. Map entries are loaded in batch. Batch size is defined by count param. If keyPattern is not null then only entries mapped by matched keys of this pattern are loaded. 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

        Specified by:
        entrySet in interface RMap<K,​V>
        Parameters:
        keyPattern - - key pattern
        count - - size of entries batch
        Returns:
        map entries collection
        See Also:
        RMap.readAllEntrySet()
      • entrySet

        public Set<Map.Entry<K,​V>> entrySet​(int count)
        Description copied from interface: RMap
        Returns map entries collection. Map entries are loaded in batch. Batch size is defined by count param.
        Specified by:
        entrySet in interface RMap<K,​V>
        Parameters:
        count - - size of entries batch
        Returns:
        map entries collection
        See Also:
        RMap.readAllEntrySet()
      • readAllKeySet

        public Set<K> readAllKeySet()
        Description copied from interface: RMap
        Read all keys at once
        Specified by:
        readAllKeySet in interface RMap<K,​V>
        Returns:
        keys
      • readAllValues

        public Collection<V> readAllValues()
        Description copied from interface: RMap
        Read all values at once
        Specified by:
        readAllValues in interface RMap<K,​V>
        Returns:
        values
      • readAllEntrySet

        public Set<Map.Entry<K,​V>> readAllEntrySet()
        Description copied from interface: RMap
        Read all map entries at once
        Specified by:
        readAllEntrySet in interface RMap<K,​V>
        Returns:
        entries
      • readAllMap

        public Map<K,​V> readAllMap()
        Description copied from interface: RMap
        Read all map as local instance at once
        Specified by:
        readAllMap in interface RMap<K,​V>
        Returns:
        map
      • putIfAbsent

        public V putIfAbsent​(K key,
                             V value)
        Description copied from interface: RMap
        Associates the specified value with the specified key only if there is no any association with specifiedkey.

        If MapWriter is defined then new map entry is stored in write-through mode.

        Specified by:
        putIfAbsent in interface ConcurrentMap<K,​V>
        Specified by:
        putIfAbsent in interface Map<K,​V>
        Specified by:
        putIfAbsent in interface RMap<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        null if key is a new one in the hash and value was set. Previous value if key already exists in the hash and change hasn't been made.
      • putIfAbsentAsync

        public RFuture<V> putIfAbsentAsync​(K key,
                                           V value)
        Description copied from interface: RMapAsync
        Associates the specified value with the specified key only if there is no any association with specifiedkey.

        If MapWriter is defined then new map entry is stored in write-through mode.

        Specified by:
        putIfAbsentAsync in interface RMapAsync<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        null if key is a new one in the hash and value was set. Previous value if key already exists in the hash and change hasn't been made.
      • hasNoWriter

        protected boolean hasNoWriter()
      • putIfAbsentOperationAsync

        protected RFuture<V> putIfAbsentOperationAsync​(K key,
                                                       V value)
      • fastPutIfAbsent

        public boolean fastPutIfAbsent​(K key,
                                       V value)
        Description copied from interface: RMap
        Associates the specified value with the specified key only if there is no any association with specifiedkey.

        Works faster than RMap.putIfAbsent(Object, Object) but not returning the previous value associated with key

        If MapWriter is defined then new map entry is stored in write-through mode.

        Specified by:
        fastPutIfAbsent in interface RMap<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        true if key is a new one in the hash and value was set. false if key already exists in the hash and change hasn't been made.
      • fastPutIfAbsentAsync

        public RFuture<Boolean> fastPutIfAbsentAsync​(K key,
                                                     V value)
        Description copied from interface: RMapAsync
        Associates the specified value with the specified key only if there is no any association with specifiedkey.

        Works faster than RMapAsync.putIfAbsentAsync(Object, Object) but not returning the previous value associated with key

        If MapWriter is defined then new map entry is stored in write-through mode.

        Specified by:
        fastPutIfAbsentAsync in interface RMapAsync<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        true if key is a new one in the hash and value was set. false if key already exists in the hash and change hasn't been made.
      • fastPutIfAbsentOperationAsync

        protected RFuture<Boolean> fastPutIfAbsentOperationAsync​(K key,
                                                                 V value)
      • remove

        public boolean remove​(Object key,
                              Object value)
        Description copied from interface: RMap
        Removes key from map only if it associated with value.

        If MapWriter is defined then keyis deleted in write-through mode.

        Specified by:
        remove in interface ConcurrentMap<K,​V>
        Specified by:
        remove in interface Map<K,​V>
        Specified by:
        remove in interface RMap<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        true if map entry has been replaced otherwise false.
      • removeAsync

        public RFuture<Boolean> removeAsync​(Object key,
                                            Object value)
        Description copied from interface: RMapAsync
        Removes key from map only if it associated with value.

        If MapWriter is defined then keyis deleted in write-through mode.

        Specified by:
        removeAsync in interface RMapAsync<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        true if map entry has been replaced otherwise false.
      • checkValue

        protected void checkValue​(Object value)
      • replace

        public boolean replace​(K key,
                               V oldValue,
                               V newValue)
        Description copied from interface: RMap
        Replaces previous oldValue with a newValue associated with the key. If previous value doesn't exist or equal to oldValue then method returns false.

        If MapWriter is defined then newValueis written in write-through mode.

        Specified by:
        replace in interface ConcurrentMap<K,​V>
        Specified by:
        replace in interface Map<K,​V>
        Specified by:
        replace in interface RMap<K,​V>
        Parameters:
        key - - map key
        oldValue - - map old value
        newValue - - map new value
        Returns:
        true if value has been replaced otherwise false.
      • replaceAsync

        public RFuture<Boolean> replaceAsync​(K key,
                                             V oldValue,
                                             V newValue)
        Description copied from interface: RMapAsync
        Replaces previous oldValue with a newValue associated with the key. If previous value doesn't exist or equal to oldValue then method returns false.

        If MapWriter is defined then newValueis written in write-through mode.

        Specified by:
        replaceAsync in interface RMapAsync<K,​V>
        Parameters:
        key - - map key
        oldValue - - map old value
        newValue - - map new value
        Returns:
        true if value has been replaced otherwise false.
      • replaceOperationAsync

        protected RFuture<Boolean> replaceOperationAsync​(K key,
                                                         V oldValue,
                                                         V newValue)
      • replace

        public V replace​(K key,
                         V value)
        Description copied from interface: RMap
        Replaces previous value with a new value associated with the key. If there wasn't any association before then method returns null.

        If MapWriter is defined then new valueis written in write-through mode.

        Specified by:
        replace in interface ConcurrentMap<K,​V>
        Specified by:
        replace in interface Map<K,​V>
        Specified by:
        replace in interface RMap<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        previous associated value or null if there wasn't any association and change hasn't been made
      • replaceAsync

        public RFuture<V> replaceAsync​(K key,
                                       V value)
        Description copied from interface: RMapAsync
        Replaces previous value with a new value associated with the key. If there wasn't any association before then method returns null.

        If MapWriter is defined then new valueis written in write-through mode.

        Specified by:
        replaceAsync in interface RMapAsync<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        previous associated value or null if there wasn't any association and change hasn't been made
      • replaceOperationAsync

        protected RFuture<V> replaceOperationAsync​(K key,
                                                   V value)
      • fastReplace

        public boolean fastReplace​(K key,
                                   V value)
        Description copied from interface: RMap
        Replaces previous value with a new value associated with the key.

        Works faster than RMap.replace(Object, Object) but not returning the previous value associated with key

        If MapWriter is defined then new map entry is stored in write-through mode.

        Specified by:
        fastReplace in interface RMap<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        true if key exists and value was updated. false if key doesn't exists and value wasn't updated.
      • fastReplaceAsync

        public RFuture<Boolean> fastReplaceAsync​(K key,
                                                 V value)
        Description copied from interface: RMapAsync
        Replaces previous value with a new value associated with the key.

        Works faster than RMapAsync.replaceAsync(Object, Object) but not returning the previous value associated with key

        If MapWriter is defined then new map entry is stored in write-through mode.

        Specified by:
        fastReplaceAsync in interface RMapAsync<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        true if key exists and value was updated. false if key doesn't exists and value wasn't updated.
      • fastReplaceOperationAsync

        protected RFuture<Boolean> fastReplaceOperationAsync​(K key,
                                                             V value)
      • getOperationAsync

        public RFuture<V> getOperationAsync​(K key)
      • getAsync

        public RFuture<V> getAsync​(K key)
        Description copied from interface: RMapAsync
        Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

        If map doesn't contain value for specified key and MapLoader is defined then value will be loaded in read-through mode.

        Specified by:
        getAsync in interface RMapAsync<K,​V>
        Parameters:
        key - the key whose associated value is to be returned
        Returns:
        the value to which the specified key is mapped, or null if this map contains no mapping for the key
      • loadAll

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

        public RFuture<Void> 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>
        Parameters:
        replaceExistingValues - - true if existed values should be replaced, false otherwise.
        parallelism - - parallelism level, used to increase speed of process execution
        Returns:
        void
      • loadAll

        public void loadAll​(Set<? extends K> keys,
                            boolean replaceExistingValues,
                            int parallelism)
        Description copied from interface: RMap
        Loads map entries using MapLoader whose keys are listed in defined keys parameter.
        Specified by:
        loadAll in interface RMap<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
      • loadAllAsync

        public RFuture<Void> loadAllAsync​(Set<? 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>
        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
      • putAsync

        public RFuture<V> putAsync​(K key,
                                   V value)
        Description copied from interface: RMapAsync
        Associates the specified value with the specified key in async manner.

        If MapWriter is defined then new map entry is stored in write-through mode.

        Specified by:
        putAsync in interface RMapAsync<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        previous associated value
      • putOperationAsync

        protected RFuture<V> putOperationAsync​(K key,
                                               V value)
      • removeAsync

        public RFuture<V> removeAsync​(K key)
        Description copied from interface: RMapAsync
        Removes key from map and returns associated value in async manner.

        If MapWriter is defined then keyis deleted in write-through mode.

        Specified by:
        removeAsync in interface RMapAsync<K,​V>
        Parameters:
        key - - map key
        Returns:
        deleted value or null if there wasn't any association
      • removeOperationAsync

        protected RFuture<V> removeOperationAsync​(K key)
      • fastPutAsync

        public RFuture<Boolean> fastPutAsync​(K key,
                                             V value)
        Description copied from interface: RMapAsync
        Associates the specified value with the specified key in async manner.

        Works faster than RMapAsync.putAsync(Object, Object) but not returning the previous value associated with key

        If MapWriter is defined then new map entry is stored in write-through mode.

        Specified by:
        fastPutAsync in interface RMapAsync<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        true if key is a new one in the hash and value was set. false if key already exists in the hash and the value was updated.
      • fastPutOperationAsync

        protected RFuture<Boolean> fastPutOperationAsync​(K key,
                                                         V value)
      • fastPut

        public boolean fastPut​(K key,
                               V value)
        Description copied from interface: RMap
        Associates the specified value with the specified key.

        Works faster than RMap.put(Object, Object) but not returning the previous value associated with key

        If MapWriter is defined then new map entry is stored in write-through mode.

        Specified by:
        fastPut in interface RMap<K,​V>
        Parameters:
        key - - map key
        value - - map value
        Returns:
        true if key is a new key in the hash and value was set. false if key already exists in the hash and the value was updated.
      • fastRemoveAsync

        public RFuture<Long> fastRemoveAsync​(K... keys)
        Description copied from interface: RMapAsync
        Removes keys from map by one operation in async manner.

        Works faster than RMapAsync.removeAsync(Object, Object) but doesn't return the value associated with key.

        If MapWriter is defined then keysare deleted in write-through mode.

        Specified by:
        fastRemoveAsync in interface RMapAsync<K,​V>
        Parameters:
        keys - - map keys
        Returns:
        the number of keys that were removed from the hash, not including specified but non existing keys
      • fastRemoveOperationBatchAsync

        protected RFuture<List<Long>> fastRemoveOperationBatchAsync​(K... keys)
      • fastRemoveOperationAsync

        protected RFuture<Long> fastRemoveOperationAsync​(K... keys)
      • fastRemove

        public long fastRemove​(K... keys)
        Description copied from interface: RMap
        Removes keys from map by one operation

        Works faster than RMap.remove(Object) but not returning the value associated with key

        If MapWriter is defined then keysare deleted in write-through mode.

        Specified by:
        fastRemove in interface RMap<K,​V>
        Parameters:
        keys - - map keys
        Returns:
        the number of keys that were removed from the hash, not including specified but non existing keys
      • addAndGet

        public V addAndGet​(K key,
                           Number value)
        Description copied from interface: RMap
        Atomically adds the given delta to the current value by mapped key. Works only for numeric values!
        Specified by:
        addAndGet in interface RMap<K,​V>
        Parameters:
        key - - map key
        value - the value to add
        Returns:
        the updated value
      • addAndGetAsync

        public RFuture<V> addAndGetAsync​(K key,
                                         Number value)
        Description copied from interface: RMapAsync
        Atomically adds the given delta to the current value by mapped key. Works only for numeric values!
        Specified by:
        addAndGetAsync in interface RMapAsync<K,​V>
        Parameters:
        key - - map key
        value - - delta the value to add
        Returns:
        the updated value
      • addAndGetOperationAsync

        protected RFuture<V> addAndGetOperationAsync​(K key,
                                                     Number value)
      • keyIterator

        protected Iterator<K> keyIterator​(String pattern,
                                          int count)
      • valueIterator

        protected Iterator<V> valueIterator​(String pattern,
                                            int count)
      • expire

        public boolean expire​(long timeToLive,
                              TimeUnit 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
      • expireAsync

        public RFuture<Boolean> expireAsync​(long timeToLive,
                                            TimeUnit 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
      • expireAt

        public boolean expireAt​(long timestamp)
        Description copied from interface: RExpirable
        Set an expire date for object. When expire date comes the key will automatically be deleted.
        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
      • expireAtAsync

        public RFuture<Boolean> expireAtAsync​(long timestamp)
        Description copied from interface: RExpirableAsync
        Set an expire date for object in async mode. When expire date comes the key will automatically be deleted.
        Specified by:
        expireAtAsync in interface RExpirableAsync
        Parameters:
        timestamp - - expire date in milliseconds (Unix timestamp)
        Returns:
        true if the timeout was set and false if not
      • expireAt

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

        public RFuture<Boolean> expireAtAsync​(Date timestamp)
        Description copied from interface: RExpirableAsync
        Set an expire date for object in async mode. When expire date comes the key will automatically be deleted.
        Specified by:
        expireAtAsync in interface RExpirableAsync
        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
      • clearExpireAsync

        public RFuture<Boolean> 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
      • 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 RFuture<Long> 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.