Package org.redisson

Class RedissonBatch

  • All Implemented Interfaces:
    RBatch

    public class RedissonBatch
    extends Object
    implements RBatch
    Author:
    Nikita Koksharov
    • Method Detail

      • getBucket

        public <V> RBucketAsync<V> getBucket​(String name)
        Description copied from interface: RBatch
        Returns object holder by name
        Specified by:
        getBucket in interface RBatch
        Type Parameters:
        V - type of object
        Parameters:
        name - - name of object
        Returns:
        Bucket object
      • getHyperLogLog

        public <V> RHyperLogLogAsync<V> getHyperLogLog​(String name)
        Description copied from interface: RBatch
        Returns HyperLogLog object
        Specified by:
        getHyperLogLog in interface RBatch
        Type Parameters:
        V - type of object
        Parameters:
        name - - name of object
        Returns:
        HyperLogLog object
      • getList

        public <V> RListAsync<V> getList​(String name)
        Description copied from interface: RBatch
        Returns list instance by name.
        Specified by:
        getList in interface RBatch
        Type Parameters:
        V - type of object
        Parameters:
        name - - name of object
        Returns:
        List object
      • getMap

        public <K,​V> RMapAsync<K,​V> getMap​(String name)
        Description copied from interface: RBatch
        Returns map instance by name.
        Specified by:
        getMap in interface RBatch
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        Map object
      • getSet

        public <V> RSetAsync<V> getSet​(String name)
        Description copied from interface: RBatch
        Returns set instance by name.
        Specified by:
        getSet in interface RBatch
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        Set object
      • getTopic

        public RTopicAsync getTopic​(String name)
        Description copied from interface: RBatch
        Returns topic instance by name.
        Specified by:
        getTopic in interface RBatch
        Parameters:
        name - - name of object
        Returns:
        Topic object
      • getQueue

        public <V> RQueueAsync<V> getQueue​(String name)
        Description copied from interface: RBatch
        Returns queue instance by name.
        Specified by:
        getQueue in interface RBatch
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        Queue object
      • getBlockingQueue

        public <V> RBlockingQueueAsync<V> getBlockingQueue​(String name)
        Description copied from interface: RBatch
        Returns blocking queue instance by name.
        Specified by:
        getBlockingQueue in interface RBatch
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        BlockingQueue object
      • getBlockingDeque

        public <V> RBlockingDequeAsync<V> getBlockingDeque​(String name)
        Description copied from interface: RBatch
        Returns blocking deque instance by name.
        Specified by:
        getBlockingDeque in interface RBatch
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        BlockingDeque object
      • getDeque

        public <V> RDequeAsync<V> getDeque​(String name)
        Description copied from interface: RBatch
        Returns deque instance by name.
        Specified by:
        getDeque in interface RBatch
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        Deque object
      • getAtomicLong

        public RAtomicLongAsync getAtomicLong​(String name)
        Description copied from interface: RBatch
        Returns atomicLong instance by name.
        Specified by:
        getAtomicLong in interface RBatch
        Parameters:
        name - - name of object
        Returns:
        AtomicLong object
      • getAtomicDouble

        public RAtomicDoubleAsync getAtomicDouble​(String name)
        Description copied from interface: RBatch
        Returns atomicDouble instance by name.
        Specified by:
        getAtomicDouble in interface RBatch
        Parameters:
        name - - name of object
        Returns:
        AtomicDouble object
      • getScoredSortedSet

        public <V> RScoredSortedSetAsync<V> getScoredSortedSet​(String name)
        Description copied from interface: RBatch
        Returns Redis Sorted Set instance by name
        Specified by:
        getScoredSortedSet in interface RBatch
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        ScoredSortedSet object
      • getLexSortedSet

        public RLexSortedSetAsync getLexSortedSet​(String name)
        Description copied from interface: RBatch
        Returns String based Redis Sorted Set instance by name All elements are inserted with the same score during addition, in order to force lexicographical ordering
        Specified by:
        getLexSortedSet in interface RBatch
        Parameters:
        name - - name of object
        Returns:
        LexSortedSet object
      • getBitSet

        public RBitSetAsync getBitSet​(String name)
        Description copied from interface: RBatch
        Returns bitSet instance by name.
        Specified by:
        getBitSet in interface RBatch
        Parameters:
        name - - name of object
        Returns:
        BitSet object
      • getMapCache

        public <K,​V> RMapCacheAsync<K,​V> getMapCache​(String name,
                                                                 Codec codec)
        Description copied from interface: RBatch
        Returns map-based cache instance by name using provided codec for both cache keys and values. Supports entry eviction with a given TTL value.

        If eviction is not required then it's better to use regular map RBatch.getMap(String, Codec).

        Specified by:
        getMapCache in interface RBatch
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for keys and values
        Returns:
        MapCache object
      • getMapCache

        public <K,​V> RMapCacheAsync<K,​V> getMapCache​(String name)
        Description copied from interface: RBatch
        Returns map-based cache instance by name. Supports entry eviction with a given TTL value.

        If eviction is not required then it's better to use regular map RBatch.getMap(String).

        Specified by:
        getMapCache in interface RBatch
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        MapCache object
      • getScript

        public RScriptAsync getScript()
        Description copied from interface: RBatch
        Returns script operations object
        Specified by:
        getScript in interface RBatch
        Returns:
        Script object
      • getScript

        public RScript getScript​(Codec codec)
        Description copied from interface: RBatch
        Returns script operations object using provided codec.
        Specified by:
        getScript in interface RBatch
        Parameters:
        codec - - codec for params and result
        Returns:
        Script object
      • getKeys

        public RKeysAsync getKeys()
        Description copied from interface: RBatch
        Returns keys operations. Each of Redis/Redisson object associated with own key
        Specified by:
        getKeys in interface RBatch
        Returns:
        Keys object
      • getSetCache

        public <V> RSetCacheAsync<V> getSetCache​(String name)
        Description copied from interface: RBatch
        Returns set-based cache instance by name. Uses map (value_hash, value) under the hood for minimal memory consumption. Supports value eviction with a given TTL value.

        If eviction is not required then it's better to use regular map RBatch.getSet(String, Codec).

        Specified by:
        getSetCache in interface RBatch
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        SetCache object
      • getSetCache

        public <V> RSetCacheAsync<V> getSetCache​(String name,
                                                 Codec codec)
        Description copied from interface: RBatch
        Returns set-based cache instance by name using provided codec for values. Uses map (value_hash, value) under the hood for minimal memory consumption. Supports value eviction with a given TTL value.

        If eviction is not required then it's better to use regular map RBatch.getSet(String, Codec).

        Specified by:
        getSetCache in interface RBatch
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for values
        Returns:
        SetCache object
      • execute

        public BatchResult<?> execute()
        Description copied from interface: RBatch
        Executes all operations accumulated during async methods invocations.

        If cluster configuration used then operations are grouped by slot ids and may be executed on different servers. Thus command execution order could be changed

        Specified by:
        execute in interface RBatch
        Returns:
        List with result object for each command
      • executeAsync

        public RFuture<BatchResult<?>> executeAsync()
        Description copied from interface: RBatch
        Executes all operations accumulated during async methods invocations asynchronously.

        In cluster configurations operations grouped by slot ids so may be executed on different servers. Thus command execution order could be changed

        Specified by:
        executeAsync in interface RBatch
        Returns:
        List with result object for each command
      • discard

        public void discard()
        Description copied from interface: RBatch
        Discard batched commands and release allocated buffers used for parameters encoding.
        Specified by:
        discard in interface RBatch
      • discardAsync

        public RFuture<Void> discardAsync()
        Description copied from interface: RBatch
        Discard batched commands and release allocated buffers used for parameters encoding.
        Specified by:
        discardAsync in interface RBatch
        Returns:
        void
      • getSetMultimap

        public <K,​V> RMultimapAsync<K,​V> getSetMultimap​(String name)
        Description copied from interface: RBatch
        Returns Set based MultiMap instance by name.
        Specified by:
        getSetMultimap in interface RBatch
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        Multimap object
      • getSetMultimap

        public <K,​V> RMultimapAsync<K,​V> getSetMultimap​(String name,
                                                                    Codec codec)
        Description copied from interface: RBatch
        Returns Set based MultiMap instance by name using provided codec for both map keys and values.
        Specified by:
        getSetMultimap in interface RBatch
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        codec - - provided codec
        Returns:
        Multimap object
      • getListMultimap

        public <K,​V> RMultimapAsync<K,​V> getListMultimap​(String name)
        Description copied from interface: RBatch
        Returns List based MultiMap instance by name.
        Specified by:
        getListMultimap in interface RBatch
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        ListMultimap object
      • getListMultimap

        public <K,​V> RMultimapAsync<K,​V> getListMultimap​(String name,
                                                                     Codec codec)
        Description copied from interface: RBatch
        Returns List based MultiMap instance by name using provided codec for both map keys and values.
        Specified by:
        getListMultimap in interface RBatch
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for keys and values
        Returns:
        ListMultimap object
      • getGeo

        public <V> RGeoAsync<V> getGeo​(String name)
        Description copied from interface: RBatch
        Returns geospatial items holder instance by name.
        Specified by:
        getGeo in interface RBatch
        Type Parameters:
        V - type of object
        Parameters:
        name - - name of object
        Returns:
        Geo object
      • getGeo

        public <V> RGeoAsync<V> getGeo​(String name,
                                       Codec codec)
        Description copied from interface: RBatch
        Returns geospatial items holder instance by name using provided codec for geospatial members.
        Specified by:
        getGeo in interface RBatch
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for value
        Returns:
        Geo object
      • getSetMultimapCache

        public <K,​V> RMultimapCacheAsync<K,​V> getSetMultimapCache​(String name)
        Description copied from interface: RBatch
        Returns Set based Multimap instance by name. Supports key-entry eviction with a given TTL value.

        If eviction is not required then it's better to use regular map RBatch.getSetMultimap(String).

        Specified by:
        getSetMultimapCache in interface RBatch
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        SetMultimapCache object
      • getSetMultimapCache

        public <K,​V> RMultimapCacheAsync<K,​V> getSetMultimapCache​(String name,
                                                                              Codec codec)
        Description copied from interface: RBatch
        Returns Set based Multimap instance by name using provided codec for both map keys and values. Supports key-entry eviction with a given TTL value.

        If eviction is not required then it's better to use regular map RBatch.getSetMultimap(String, Codec).

        Specified by:
        getSetMultimapCache in interface RBatch
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        codec - - provided codec
        Returns:
        SetMultimapCache object
      • getListMultimapCache

        public <K,​V> RMultimapCacheAsync<K,​V> getListMultimapCache​(String name)
        Description copied from interface: RBatch
        Returns List based Multimap instance by name. Supports key-entry eviction with a given TTL value.

        If eviction is not required then it's better to use regular map RBatch.getSetMultimap(String).

        Specified by:
        getListMultimapCache in interface RBatch
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        ListMultimapCache object
      • getListMultimapCache

        public <K,​V> RMultimapCacheAsync<K,​V> getListMultimapCache​(String name,
                                                                               Codec codec)
        Description copied from interface: RBatch
        Returns List based Multimap instance by name using provided codec for both map keys and values. Supports key-entry eviction with a given TTL value.

        If eviction is not required then it's better to use regular map RBatch.getSetMultimap(String, Codec).

        Specified by:
        getListMultimapCache in interface RBatch
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for keys and values
        Returns:
        ListMultimapCache object
      • getStream

        public <K,​V> RStreamAsync<K,​V> getStream​(String name)
        Description copied from interface: RBatch
        Returns stream instance by name
        Specified by:
        getStream in interface RBatch
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - of stream
        Returns:
        RStream object
      • getStream

        public <K,​V> RStreamAsync<K,​V> getStream​(String name,
                                                             Codec codec)
        Description copied from interface: RBatch
        Returns stream instance by name using provided codec for entries.
        Specified by:
        getStream in interface RBatch
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of stream
        codec - - codec for entry
        Returns:
        RStream object