Package org.redisson.command
Class CommandBatchService
- java.lang.Object
-
- org.redisson.command.CommandAsyncService
-
- org.redisson.command.CommandBatchService
-
- All Implemented Interfaces:
CommandAsyncExecutor
public class CommandBatchService extends CommandAsyncService
- Author:
- Nikita Koksharov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CommandBatchService.ConnectionEntry
static class
CommandBatchService.Entry
-
Field Summary
-
Fields inherited from class org.redisson.command.CommandAsyncService
redisson, redissonReactive, redissonRx
-
-
Constructor Summary
Constructors Constructor Description CommandBatchService(ConnectionManager connectionManager)
CommandBatchService(ConnectionManager connectionManager, BatchOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(RFuture<?> future, List<CommandBatchService> services)
<V,R>
voidasync(boolean readOnlyMode, NodeSource nodeSource, Codec codec, RedisCommand<V> command, Object[] params, RPromise<R> mainPromise, int attempt, boolean ignoreRedirect, RFuture<RedisConnection> connFuture)
protected <R> RPromise<R>
createPromise()
BatchResult<?>
execute()
BatchResult<?>
execute(BatchOptions options)
RFuture<List<?>>
executeAsync()
<R> RFuture<R>
executeAsync(BatchOptions options)
RFuture<Void>
executeAsyncVoid()
protected void
free(CommandBatchService.Entry entry)
protected <V> RFuture<RedisConnection>
getConnection(boolean readOnlyMode, NodeSource source, RedisCommand<V> command)
BatchOptions
getOptions()
protected void
handle(RPromise<Void> mainPromise, AtomicInteger slots, io.netty.util.concurrent.Future<?> future)
protected <V,R>
voidhandleError(AsyncDetails<V,R> details, RPromise<R> promise, Throwable cause)
protected <V,R>
voidhandleSuccess(AsyncDetails<V,R> details, RPromise<R> promise, RedisCommand<?> command, R res)
protected boolean
isEvalCacheActive()
protected boolean
isRedisBasedQueue()
protected boolean
isWaitCommand(BatchCommandData<?,?> c)
protected <V,R>
voidreleaseConnection(NodeSource source, RFuture<RedisConnection> connectionFuture, boolean isReadOnly, RPromise<R> attemptPromise, AsyncDetails<V,R> details)
protected <R,V>
voidsendCommand(AsyncDetails<V,R> details, RedisConnection connection)
-
Methods inherited from class org.redisson.command.CommandAsyncService
await, checkAttemptFuture, convertException, enableRedissonReferenceSupport, enableRedissonReferenceSupport, enableRedissonReferenceSupport, evalAllAsync, evalReadAsync, evalReadAsync, evalReadAsync, evalWriteAllAsync, evalWriteAsync, evalWriteAsync, free, get, getConnectionManager, isRedissonReferenceSupportEnabled, readAllAsync, readAllAsync, readAllAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readAsync, readRandomAsync, readRandomAsync, syncSubscription, tryHandleReference, writeAllAsync, writeAllAsync, writeAllAsync, writeAsync, writeAsync, writeAsync, writeAsync
-
-
-
-
Constructor Detail
-
CommandBatchService
public CommandBatchService(ConnectionManager connectionManager)
-
CommandBatchService
public CommandBatchService(ConnectionManager connectionManager, BatchOptions options)
-
-
Method Detail
-
getOptions
public BatchOptions getOptions()
-
add
public void add(RFuture<?> future, List<CommandBatchService> services)
-
async
public <V,R> void async(boolean readOnlyMode, NodeSource nodeSource, Codec codec, RedisCommand<V> command, Object[] params, RPromise<R> mainPromise, int attempt, boolean ignoreRedirect, RFuture<RedisConnection> connFuture)
- Overrides:
async
in classCommandAsyncService
-
createPromise
protected <R> RPromise<R> createPromise()
- Overrides:
createPromise
in classCommandAsyncService
-
releaseConnection
protected <V,R> void releaseConnection(NodeSource source, RFuture<RedisConnection> connectionFuture, boolean isReadOnly, RPromise<R> attemptPromise, AsyncDetails<V,R> details)
- Overrides:
releaseConnection
in classCommandAsyncService
-
handleSuccess
protected <V,R> void handleSuccess(AsyncDetails<V,R> details, RPromise<R> promise, RedisCommand<?> command, R res)
- Overrides:
handleSuccess
in classCommandAsyncService
-
handleError
protected <V,R> void handleError(AsyncDetails<V,R> details, RPromise<R> promise, Throwable cause)
- Overrides:
handleError
in classCommandAsyncService
-
sendCommand
protected <R,V> void sendCommand(AsyncDetails<V,R> details, RedisConnection connection)
- Overrides:
sendCommand
in classCommandAsyncService
-
getConnection
protected <V> RFuture<RedisConnection> getConnection(boolean readOnlyMode, NodeSource source, RedisCommand<V> command)
- Overrides:
getConnection
in classCommandAsyncService
-
execute
public BatchResult<?> execute()
-
execute
public BatchResult<?> execute(BatchOptions options)
-
executeAsync
public <R> RFuture<R> executeAsync(BatchOptions options)
-
isRedisBasedQueue
protected boolean isRedisBasedQueue()
-
free
protected void free(CommandBatchService.Entry entry)
-
isWaitCommand
protected boolean isWaitCommand(BatchCommandData<?,?> c)
-
handle
protected void handle(RPromise<Void> mainPromise, AtomicInteger slots, io.netty.util.concurrent.Future<?> future)
-
isEvalCacheActive
protected boolean isEvalCacheActive()
- Overrides:
isEvalCacheActive
in classCommandAsyncService
-
-