org.redisson.api.RBatchReactive Maven / Gradle / Ivy
Show all versions of redisson-all Show documentation
/**
* Copyright (c) 2013-2024 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.redisson.api;
import org.redisson.client.codec.Codec;
import org.redisson.codec.JsonCodec;
import reactor.core.publisher.Mono;
/**
* Reactive interface for Redis pipeline feature.
*
* All method invocations on objects
* from this interface are batched to separate queue and could be executed later
* with execute()
method.
*
*
* @author Nikita Koksharov
*
*/
public interface RBatchReactive {
/**
* Returns stream instance by name
*
* Requires Redis 5.0.0 and higher.
*
* @param type of key
* @param type of value
* @param name of stream
* @return RStream object
*/
RStreamReactive getStream(String name);
/**
* Returns stream instance by name
* using provided codec
for entries.
*
* Requires Redis 5.0.0 and higher.
*
* @param type of key
* @param type of value
* @param name - name of stream
* @param codec - codec for entry
* @return RStream object
*/
RStreamReactive getStream(String name, Codec codec);
/**
* Returns geospatial items holder instance by name
.
*
* @param type of value
* @param name - name of object
* @return Geo object
*/
RGeoReactive getGeo(String name);
/**
* Returns geospatial items holder instance by name
* using provided codec for geospatial members.
*
* @param type of value
* @param name - name of object
* @param codec - codec for value
* @return Geo object
*/
RGeoReactive getGeo(String name, Codec codec);
/**
* Returns Set based Multimap instance by name.
*
* @param type of key
* @param type of value
* @param name - name of object
* @return SetMultimap object
*/
RSetMultimapReactive getSetMultimap(String name);
/**
* Returns Set based Multimap instance by name
* using provided codec for both map keys and values.
*
* @param type of key
* @param type of value
* @param name - name of object
* @param codec - codec for keys and values
* @return SetMultimap object
*/
RSetMultimapReactive getSetMultimap(String name, Codec codec);
/**
* Returns Set based Multimap cache instance by name.
* Supports key eviction by specifying a time to live.
* If eviction is not required then it's better to use regular set multimap {@link #getSetMultimap(String)}.
*
* @param type of key
* @param type of value
* @param name - name of object
* @return RSetMultimapCacheRx object
*/
RSetMultimapCacheReactive getSetMultimapCache(String name);
/**
* Returns Set based Multimap cache instance by name using provided codec for both map keys and values.
* Supports key eviction by specifying a time to live.
* If eviction is not required then it's better to use regular set multimap {@link #getSetMultimap(String, Codec)}.
*
* @param type of key
* @param type of value
* @param name - name of object
* @param codec - codec for keys and values
* @return RSetMultimapCacheRx object
*/
RSetMultimapCacheReactive getSetMultimapCache(String name, Codec codec);
/**
* 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 {@link #getSet(String, Codec)}.
*
* @param type of value
* @param name - name of object
* @return SetCache object
*/
RSetCacheReactive getSetCache(String name);
/**
* 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 {@link #getSet(String, Codec)}.
*
* @param type of value
* @param name - name of object
* @param codec - codec for values
* @return SetCache object
*/
RSetCacheReactive getSetCache(String name, Codec codec);
/**
* 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 {@link #getMap(String, Codec)}.
*
* @param type of key
* @param type of value
* @param name - name of object
* @param codec - codec for keys and values
* @return MapCache object
*/
RMapCacheReactive getMapCache(String name, Codec codec);
/**
* 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 {@link #getMap(String)}.
*
* @param type of key
* @param type of value
* @param name - name of object
* @return MapCache object
*/
RMapCacheReactive getMapCache(String name);
/**
* Returns map instance by name.
* Supports entry eviction with a given TTL.
*
* Requires Redis 7.4.0 and higher.
*
* @param type of key
* @param type of value
* @param name name of object
* @return Map object
*/
RMapCacheNativeReactive getMapCacheNative(String name);
/**
* Returns map instance by name
* using provided codec for both map keys and values.
* Supports entry eviction with a given TTL.
*
* Requires Redis 7.4.0 and higher.
*
* @param type of key
* @param type of value
* @param name name of object
* @param codec codec for keys and values
* @return Map object
*/
RMapCacheNativeReactive getMapCacheNative(String name, Codec codec);
/**
* Returns List based Multimap instance by name.
* Supports key-entry eviction with a given TTL value.
* Stores insertion order and allows duplicates for values mapped to key.
*
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
*
* Requires Redis 7.4.0 and higher.
*
* @param type of key
* @param type of value
* @param name name of object
* @return ListMultimapCache object
*/
RListMultimapCacheReactive getListMultimapCacheNative(String name);
/**
* 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.
* Stores insertion order and allows duplicates for values mapped to key.
*
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
*
* Requires Redis 7.4.0 and higher.
*
* @param type of key
* @param type of value
* @param name name of object
* @param codec codec for keys and values
* @return ListMultimapCache object
*/
RListMultimapCacheReactive getListMultimapCacheNative(String name, Codec codec);
/**
* Returns Set based Multimap instance by name.
* Supports key-entry eviction with a given TTL value.
* Doesn't allow duplications for values mapped to key.
*
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
*
* Requires Redis 7.4.0 and higher.
*
* @param type of key
* @param type of value
* @param name name of object
* @return SetMultimapCache object
*/
RSetMultimapCacheReactive getSetMultimapCacheNative(String name);
/**
* 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.
* Doesn't allow duplications for values mapped to key.
*
* Uses Redis native commands for entry expiration and not a scheduled eviction task.
*
* Requires Redis 7.4.0 and higher.
*
* @param type of key
* @param type of value
* @param name name of object
* @param codec codec for keys and values
* @return SetMultimapCache object
*/
RSetMultimapCacheReactive getSetMultimapCacheNative(String name, Codec codec);
/**
* Returns object holder by name
*
* @param type of value
* @param name - name of object
* @return Bucket object
*/
RBucketReactive getBucket(String name);
RBucketReactive getBucket(String name, Codec codec);
/**
* Returns JSON data holder instance by name using provided codec.
*
* @see org.redisson.codec.JacksonCodec
*
* @param type of value
* @param name name of object
* @param codec codec for values
* @return JsonBucket object
*/
RJsonBucketReactive getJsonBucket(String name, JsonCodec codec);
/**
* Returns HyperLogLog object by name
*
* @param type of value
* @param name - name of object
* @return HyperLogLog object
*/
RHyperLogLogReactive getHyperLogLog(String name);
RHyperLogLogReactive getHyperLogLog(String name, Codec codec);
/**
* Returns list instance by name.
*
* @param type of value
* @param name - name of object
* @return List object
*/
RListReactive getList(String name);
RListReactive getList(String name, Codec codec);
/**
* Returns List based MultiMap instance by name.
*
* @param type of key
* @param type of value
* @param name - name of object
* @return ListMultimap object
*/
RListMultimapReactive getListMultimap(String name);
/**
* Returns List based MultiMap instance by name
* using provided codec for both map keys and values.
*
* @param type of key
* @param type of value
* @param name - name of object
* @param codec - codec for keys and values
* @return ListMultimap object
*/
RListMultimapReactive getListMultimap(String name, Codec codec);
/**
* Returns List based Multimap cache instance by name.
* Supports key eviction by specifying a time to live.
* If eviction is not required then it's better to use regular list multimap {@link #getListMultimap(String)}.
*
* @param type of key
* @param type of value
* @param name - name of object
* @return RListMultimapCacheRx object
*/
RListMultimapReactive getListMultimapCache(String name);
/**
* Returns List based Multimap cache instance by name using provided codec for both map keys and values.
* Supports key eviction by specifying a time to live.
* If eviction is not required then it's better to use regular list multimap {@link #getListMultimap(String, Codec)}.
*
* @param type of key
* @param type of value
* @param name - name of object
* @param codec - codec for keys and values
* @return RListMultimapCacheRx object
*/
RListMultimapReactive getListMultimapCache(String name, Codec codec);
/**
* Returns map instance by name.
*
* @param type of key
* @param type of value
* @param name - name of object
* @return Map object
*/
RMapReactive getMap(String name);
RMapReactive getMap(String name, Codec codec);
/**
* Returns set instance by name.
*
* @param type of value
* @param name - name of object
* @return Set object
*/
RSetReactive getSet(String name);
RSetReactive getSet(String name, Codec codec);
/**
* Returns topic instance by name.
*
* @param name - name of object
* @return Topic object
*/
RTopicReactive getTopic(String name);
RTopicReactive getTopic(String name, Codec codec);
/**
* Returns Sharded Topic instance by name.
*
* Messages are delivered to message listeners connected to the same Topic.
*
*
* @param name - name of object
* @return Topic object
*/
RShardedTopicReactive getShardedTopic(String name);
/**
* Returns Sharded Topic instance by name using provided codec for messages.
*
* Messages are delivered to message listeners connected to the same Topic.
*
*
* @param name - name of object
* @param codec - codec for message
* @return Topic object
*/
RShardedTopicReactive getShardedTopic(String name, Codec codec);
/**
* Returns queue instance by name.
*
* @param type of value
* @param name - name of object
* @return Queue object
*/
RQueueReactive getQueue(String name);
RQueueReactive getQueue(String name, Codec codec);
/**
* Returns blocking queue instance by name.
*
* @param type of value
* @param name - name of object
* @return BlockingQueue object
*/
RBlockingQueueReactive getBlockingQueue(String name);
RBlockingQueueReactive getBlockingQueue(String name, Codec codec);
/**
* Returns blocking deque instance by name.
*
* @param type of value
* @param name - name of object
* @return BlockingDeque object
*/
RBlockingDequeReactive getBlockingDeque(String name);
RBlockingDequeReactive getBlockingDeque(String name, Codec codec);
/**
* Returns deque instance by name.
*
* @param type of value
* @param name - name of object
* @return Deque object
*/
RDequeReactive getDeque(String name);
RDequeReactive getDeque(String name, Codec codec);
/**
* Returns "atomic long" instance by name.
*
* @param name - name of object
* @return AtomicLong object
*/
RAtomicLongReactive getAtomicLong(String name);
/**
* Returns atomicDouble instance by name.
*
* @param name - name of object
* @return AtomicDouble object
*/
RAtomicDoubleReactive getAtomicDouble(String name);
/**
* Returns Redis Sorted Set instance by name
*
* @param type of value
* @param name - name of object
* @return ScoredSortedSet object
*/
RScoredSortedSetReactive getScoredSortedSet(String name);
RScoredSortedSetReactive getScoredSortedSet(String name, Codec codec);
/**
* 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
*
* @param name - name of object
* @return LexSortedSet object
*/
RLexSortedSetReactive getLexSortedSet(String name);
/**
* Returns bitSet instance by name.
*
* @param name of bitSet
* @return BitSet object
*/
RBitSetReactive getBitSet(String name);
/**
* Returns script operations object
*
* @return Script object
*/
RScriptReactive getScript();
/**
* Returns script operations object using provided codec.
*
* @param codec - codec for params and result
* @return Script object
*/
RScriptReactive getScript(Codec codec);
/**
* Returns interface for Redis Function feature
*
* @return function object
*/
RFunctionReactive getFunction();
/**
* Returns interface for Redis Function feature using provided codec
*
* @param codec - codec for params and result
* @return function interface
*/
RFunctionReactive getFunction(Codec codec);
/**
* Returns keys operations.
* Each of Redis/Redisson object associated with own key
*
* @return Keys object
*/
RKeysReactive getKeys();
/**
* Returns API for RediSearch module
*
* @return RSearchReactive object
*/
RSearchReactive getSearch();
/**
* Returns API for RediSearch module using defined codec for attribute values.
*
* @param codec codec for entry
* @return RSearchReactive object
*/
RSearchReactive getSearch(Codec codec);
/**
* Executes all operations accumulated during Reactive methods invocations Reactivehronously.
*
* In cluster configurations operations grouped by slot ids
* so may be executed on different servers. Thus command execution order could be changed
*
* @return List with result object for each command
*/
Mono> execute();
/**
* Discard batched commands and release allocated buffers used for parameters encoding.
*
* @return void
*/
Mono discard();
}