public interface RBatch
All method invocations on objects
from this interface are batched to separate queue and could be executed later
with execute()
or executeAsync()
methods.
Please be aware, atomicity is not guaranteed.
Modifier and Type | Method and Description |
---|---|
BatchResult<?> |
execute()
Executes all operations accumulated during async methods invocations.
|
RFuture<BatchResult<?>> |
executeAsync()
Executes all operations accumulated during async methods invocations asynchronously.
|
void |
executeSkipResult()
Deprecated.
|
RFuture<Void> |
executeSkipResultAsync()
Deprecated.
|
RAtomicDoubleAsync |
getAtomicDouble(String name)
Returns atomicDouble instance by name.
|
RAtomicLongAsync |
getAtomicLong(String name)
Returns atomicLong instance by name.
|
RBitSetAsync |
getBitSet(String name) |
<V> RBlockingDequeAsync<V> |
getBlockingDeque(String name)
Returns blocking deque instance by name.
|
<V> RBlockingDequeAsync<V> |
getBlockingDeque(String name,
Codec codec) |
<V> RBlockingQueueAsync<V> |
getBlockingQueue(String name)
Returns blocking queue instance by name.
|
<V> RBlockingQueueAsync<V> |
getBlockingQueue(String name,
Codec codec) |
<V> RBucketAsync<V> |
getBucket(String name)
Returns object holder by
name |
<V> RBucketAsync<V> |
getBucket(String name,
Codec codec) |
<V> RDequeAsync<V> |
getDeque(String name)
Returns deque instance by name.
|
<V> RDequeAsync<V> |
getDeque(String name,
Codec codec) |
<V> RGeoAsync<V> |
getGeo(String name)
Returns geospatial items holder instance by
name . |
<V> RGeoAsync<V> |
getGeo(String name,
Codec codec)
Returns geospatial items holder instance by
name
using provided codec for geospatial members. |
<V> RHyperLogLogAsync<V> |
getHyperLogLog(String name)
Returns HyperLogLog object
|
<V> RHyperLogLogAsync<V> |
getHyperLogLog(String name,
Codec codec) |
RKeysAsync |
getKeys()
Returns keys operations.
|
RLexSortedSetAsync |
getLexSortedSet(String name)
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
|
<V> RListAsync<V> |
getList(String name)
Returns list instance by name.
|
<V> RListAsync<V> |
getList(String name,
Codec codec) |
<K,V> RMultimapAsync<K,V> |
getListMultimap(String name)
Returns List based MultiMap instance by name.
|
<K,V> RMultimapAsync<K,V> |
getListMultimap(String name,
Codec codec)
Returns List based MultiMap instance by name
using provided codec for both map keys and values.
|
<K,V> RMultimapAsync<K,V> |
getListMultimapCache(String name)
Returns List based Multimap instance by name.
|
<K,V> RMultimapAsync<K,V> |
getListMultimapCache(String name,
Codec codec)
Returns List based Multimap instance by name
using provided codec for both map keys and values.
|
<K,V> RMapAsync<K,V> |
getMap(String name)
Returns map instance by name.
|
<K,V> RMapAsync<K,V> |
getMap(String name,
Codec codec) |
<K,V> RMapCacheAsync<K,V> |
getMapCache(String name)
Returns map-based cache instance by
name . |
<K,V> RMapCacheAsync<K,V> |
getMapCache(String name,
Codec codec)
Returns map-based cache instance by
name
using provided codec for both cache keys and values. |
<V> RQueueAsync<V> |
getQueue(String name)
Returns queue instance by name.
|
<V> RQueueAsync<V> |
getQueue(String name,
Codec codec) |
<V> RScoredSortedSetAsync<V> |
getScoredSortedSet(String name)
Returns Redis Sorted Set instance by name
|
<V> RScoredSortedSetAsync<V> |
getScoredSortedSet(String name,
Codec codec) |
RScriptAsync |
getScript()
Returns script operations object
|
<V> RSetAsync<V> |
getSet(String name)
Returns set instance by name.
|
<V> RSetAsync<V> |
getSet(String name,
Codec codec) |
<V> RSetCacheAsync<V> |
getSetCache(String name)
Returns set-based cache instance by
name . |
<V> RSetCacheAsync<V> |
getSetCache(String name,
Codec codec)
Returns set-based cache instance by
name
using provided codec for values. |
<K,V> RMultimapAsync<K,V> |
getSetMultimap(String name)
Returns Set based MultiMap instance by name.
|
<K,V> RMultimapAsync<K,V> |
getSetMultimap(String name,
Codec codec)
Returns Set based MultiMap instance by name
using provided codec for both map keys and values.
|
<K,V> RMultimapCacheAsync<K,V> |
getSetMultimapCache(String name)
Returns Set based Multimap instance by name.
|
<K,V> RMultimapCacheAsync<K,V> |
getSetMultimapCache(String name,
Codec codec)
Returns Set based Multimap instance by name
using provided codec for both map keys and values.
|
<M> RTopicAsync<M> |
getTopic(String name)
Returns topic instance by name.
|
<M> RTopicAsync<M> |
getTopic(String name,
Codec codec) |
RBatch |
retryAttempts(int retryAttempts)
Defines attempts amount to re-send Redis commands batch
if it hasn't been sent already.
|
RBatch |
retryInterval(long retryInterval,
TimeUnit unit)
Defines time interval for each attempt to send Redis commands batch
if it hasn't been sent already.
|
RBatch |
skipResult()
Inform Redis not to send reply for this batch.
|
RBatch |
syncSlaves(int slaves,
long timeout,
TimeUnit unit)
Synchronize write operations execution across defined amount
of Redis slave nodes within defined timeout.
|
RBatch |
timeout(long timeout,
TimeUnit unit)
Defines timeout for Redis response.
|
<V> RGeoAsync<V> getGeo(String name)
name
.V
- type of objectname
- - name of object<V> RGeoAsync<V> getGeo(String name, Codec codec)
name
using provided codec for geospatial members.V
- type of valuename
- - name of objectcodec
- - codec for value<K,V> RMultimapAsync<K,V> getSetMultimap(String name)
K
- type of keyV
- type of valuename
- - name of object<K,V> RMultimapAsync<K,V> getSetMultimap(String name, Codec codec)
K
- type of keyV
- type of valuename
- - name of objectcodec
- - provided codec<K,V> RMultimapCacheAsync<K,V> getSetMultimapCache(String name)
If eviction is not required then it's better to use regular map getSetMultimap(String)
.
K
- type of keyV
- type of valuename
- - name of object<K,V> RMultimapCacheAsync<K,V> getSetMultimapCache(String name, Codec codec)
If eviction is not required then it's better to use regular map getSetMultimap(String, Codec)
.
K
- type of keyV
- type of valuename
- - name of objectcodec
- - provided codec<V> RSetCacheAsync<V> getSetCache(String name)
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 getSet(String, Codec)
.
V
- type of valuename
- - name of object<V> RSetCacheAsync<V> getSetCache(String name, Codec codec)
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 getSet(String, Codec)
.
V
- type of valuename
- - name of objectcodec
- - codec for values<K,V> RMapCacheAsync<K,V> getMapCache(String name, Codec codec)
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 getMap(String, Codec)
.
K
- type of keyV
- type of valuename
- - name of objectcodec
- - codec for keys and values<K,V> RMapCacheAsync<K,V> getMapCache(String name)
name
.
Supports entry eviction with a given TTL value.
If eviction is not required then it's better to use regular map getMap(String)
.
K
- type of keyV
- type of valuename
- - name of object<V> RBucketAsync<V> getBucket(String name)
name
V
- type of objectname
- - name of object<V> RBucketAsync<V> getBucket(String name, Codec codec)
<V> RHyperLogLogAsync<V> getHyperLogLog(String name)
V
- type of objectname
- - name of object<V> RHyperLogLogAsync<V> getHyperLogLog(String name, Codec codec)
<V> RListAsync<V> getList(String name)
V
- type of objectname
- - name of object<V> RListAsync<V> getList(String name, Codec codec)
<K,V> RMultimapAsync<K,V> getListMultimap(String name)
K
- type of keyV
- type of valuename
- - name of object<K,V> RMultimapAsync<K,V> getListMultimap(String name, Codec codec)
K
- type of keyV
- type of valuename
- - name of objectcodec
- - codec for keys and values<K,V> RMultimapAsync<K,V> getListMultimapCache(String name)
If eviction is not required then it's better to use regular map getSetMultimap(String)
.
K
- type of keyV
- type of valuename
- - name of object<K,V> RMultimapAsync<K,V> getListMultimapCache(String name, Codec codec)
If eviction is not required then it's better to use regular map getSetMultimap(String, Codec)
.
K
- type of keyV
- type of valuename
- - name of objectcodec
- - codec for keys and values<K,V> RMapAsync<K,V> getMap(String name)
K
- type of keyV
- type of valuename
- - name of object<V> RSetAsync<V> getSet(String name)
V
- type of valuename
- - name of object<M> RTopicAsync<M> getTopic(String name)
M
- type of messagename
- - name of object<M> RTopicAsync<M> getTopic(String name, Codec codec)
<V> RQueueAsync<V> getQueue(String name)
V
- type of valuename
- - name of object<V> RQueueAsync<V> getQueue(String name, Codec codec)
<V> RBlockingQueueAsync<V> getBlockingQueue(String name)
V
- type of valuename
- - name of object<V> RBlockingQueueAsync<V> getBlockingQueue(String name, Codec codec)
<V> RDequeAsync<V> getDeque(String name)
V
- type of valuename
- - name of object<V> RDequeAsync<V> getDeque(String name, Codec codec)
<V> RBlockingDequeAsync<V> getBlockingDeque(String name)
V
- type of valuename
- - name of object<V> RBlockingDequeAsync<V> getBlockingDeque(String name, Codec codec)
RAtomicLongAsync getAtomicLong(String name)
name
- - name of objectRAtomicDoubleAsync getAtomicDouble(String name)
name
- - name of object<V> RScoredSortedSetAsync<V> getScoredSortedSet(String name)
V
- type of valuename
- - name of object<V> RScoredSortedSetAsync<V> getScoredSortedSet(String name, Codec codec)
RLexSortedSetAsync getLexSortedSet(String name)
name
- - name of objectRBitSetAsync getBitSet(String name)
RScriptAsync getScript()
RKeysAsync getKeys()
BatchResult<?> execute() throws RedisException
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
RedisException
- in case of any errorRFuture<BatchResult<?>> executeAsync()
In cluster configurations operations grouped by slot ids so may be executed on different servers. Thus command execution order could be changed
@Deprecated void executeSkipResult()
@Deprecated RFuture<Void> executeSkipResultAsync()
RBatch skipResult()
NOTE: Redis 3.2+ required
RBatch syncSlaves(int slaves, long timeout, TimeUnit unit)
NOTE: Redis 3.0+ required
slaves
- amount to synctimeout
- for sync operationunit
- valueRBatch timeout(long timeout, TimeUnit unit)
0
value means use Config.setTimeout
value instead.
Default is 0
timeout
- valueunit
- valueRBatch retryInterval(long retryInterval, TimeUnit unit)
0
value means use Config.setRetryInterval
value instead.
Default is 0
retryInterval
- valueunit
- valueRBatch retryAttempts(int retryAttempts)
0
value means use Config.setRetryAttempts
value instead.
Default is 0
retryAttempts
- valueCopyright © 2014–2017 The Redisson Project. All rights reserved.