Package org.redisson.command
Class CommandAsyncService
- java.lang.Object
-
- org.redisson.command.CommandAsyncService
-
- All Implemented Interfaces:
CommandAsyncExecutor
- Direct Known Subclasses:
CommandBatchService
,CommandReactiveService
,CommandSyncService
public class CommandAsyncService extends Object implements CommandAsyncExecutor
- Author:
- Nikita Koksharov
-
-
Field Summary
Fields Modifier and Type Field Description protected RedissonClient
redisson
protected RedissonReactiveClient
redissonReactive
-
Constructor Summary
Constructors Constructor Description CommandAsyncService(ConnectionManager connectionManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <V,R>
voidasync(boolean readOnlyMode, NodeSource source, Codec codec, RedisCommand<V> command, Object[] params, RPromise<R> mainPromise, int attempt, boolean ignoreRedirect, RFuture<RedisConnection> connFuture)
boolean
await(RFuture<?> future, long timeout, TimeUnit timeoutUnit)
protected <R,V>
voidcheckAttemptFuture(NodeSource source, AsyncDetails<V,R> details, io.netty.util.concurrent.Future<R> future, boolean ignoreRedirect)
<V> RedisException
convertException(RFuture<V> future)
protected <R> RPromise<R>
createPromise()
CommandAsyncExecutor
enableRedissonReferenceSupport(RedissonClient redisson)
CommandAsyncExecutor
enableRedissonReferenceSupport(RedissonReactiveClient redissonReactive)
<T,R>
RFuture<R>evalAllAsync(boolean readOnlyMode, RedisCommand<T> command, SlotCallback<T,R> callback, String script, List<Object> keys, Object... params)
<T,R>
RFuture<R>evalReadAsync(String key, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params)
<T,R>
RFuture<R>evalReadAsync(RedisClient client, String name, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params)
<T,R>
RFuture<R>evalReadAsync(MasterSlaveEntry entry, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params)
<T,R>
RFuture<R>evalWriteAllAsync(RedisCommand<T> command, SlotCallback<T,R> callback, String script, List<Object> keys, Object... params)
<T,R>
RFuture<R>evalWriteAsync(String key, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params)
<T,R>
RFuture<R>evalWriteAsync(MasterSlaveEntry entry, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params)
protected void
free(Object[] params)
<V> V
get(RFuture<V> future)
protected <V> RFuture<RedisConnection>
getConnection(boolean readOnlyMode, NodeSource source, RedisCommand<V> command)
ConnectionManager
getConnectionManager()
protected <V,R>
voidhandleError(AsyncDetails<V,R> details, RPromise<R> mainPromise, Throwable cause)
protected <V,R>
voidhandleSuccess(AsyncDetails<V,R> details, RPromise<R> promise, RedisCommand<?> command, R res)
boolean
isRedissonReferenceSupportEnabled()
<T,R>
RFuture<Collection<R>>readAllAsync(Collection<R> results, RedisCommand<T> command, Object... params)
<T,R>
RFuture<Collection<R>>readAllAsync(RedisCommand<T> command, Object... params)
<R,T>
RFuture<R>readAllAsync(RedisCommand<T> command, SlotCallback<T,R> callback, Object... params)
<T,R>
RFuture<R>readAsync(byte[] key, Codec codec, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>readAsync(String key, Codec codec, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>readAsync(String key, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>readAsync(RedisClient client, byte[] key, Codec codec, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>readAsync(RedisClient client, String name, Codec codec, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>readAsync(RedisClient client, Codec codec, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>readAsync(RedisClient client, MasterSlaveEntry entry, Codec codec, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>readAsync(MasterSlaveEntry entry, Codec codec, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>readRandomAsync(Codec codec, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>readRandomAsync(MasterSlaveEntry entry, Codec codec, RedisCommand<T> command, Object... params)
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)
void
syncSubscription(RFuture<?> future)
protected <T> T
tryHandleReference(T o)
<R,T>
RFuture<R>writeAllAsync(Codec codec, RedisCommand<T> command, SlotCallback<T,R> callback, Object... params)
<T> RFuture<Void>
writeAllAsync(RedisCommand<T> command, Object... params)
<R,T>
RFuture<R>writeAllAsync(RedisCommand<T> command, SlotCallback<T,R> callback, Object... params)
<T,R>
RFuture<R>writeAsync(byte[] key, Codec codec, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>writeAsync(String key, Codec codec, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>writeAsync(String key, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>writeAsync(MasterSlaveEntry entry, Codec codec, RedisCommand<T> command, Object... params)
-
-
-
Field Detail
-
redisson
protected RedissonClient redisson
-
redissonReactive
protected RedissonReactiveClient redissonReactive
-
-
Constructor Detail
-
CommandAsyncService
public CommandAsyncService(ConnectionManager connectionManager)
-
-
Method Detail
-
getConnectionManager
public ConnectionManager getConnectionManager()
- Specified by:
getConnectionManager
in interfaceCommandAsyncExecutor
-
enableRedissonReferenceSupport
public CommandAsyncExecutor enableRedissonReferenceSupport(RedissonClient redisson)
- Specified by:
enableRedissonReferenceSupport
in interfaceCommandAsyncExecutor
-
enableRedissonReferenceSupport
public CommandAsyncExecutor enableRedissonReferenceSupport(RedissonReactiveClient redissonReactive)
- Specified by:
enableRedissonReferenceSupport
in interfaceCommandAsyncExecutor
-
isRedissonReferenceSupportEnabled
public boolean isRedissonReferenceSupportEnabled()
- Specified by:
isRedissonReferenceSupportEnabled
in interfaceCommandAsyncExecutor
-
syncSubscription
public void syncSubscription(RFuture<?> future)
- Specified by:
syncSubscription
in interfaceCommandAsyncExecutor
-
get
public <V> V get(RFuture<V> future)
- Specified by:
get
in interfaceCommandAsyncExecutor
-
await
public boolean await(RFuture<?> future, long timeout, TimeUnit timeoutUnit) throws InterruptedException
- Specified by:
await
in interfaceCommandAsyncExecutor
- Throws:
InterruptedException
-
createPromise
protected <R> RPromise<R> createPromise()
-
readAsync
public <T,R> RFuture<R> readAsync(RedisClient client, MasterSlaveEntry entry, Codec codec, RedisCommand<T> command, Object... params)
- Specified by:
readAsync
in interfaceCommandAsyncExecutor
-
readAsync
public <T,R> RFuture<R> readAsync(RedisClient client, String name, Codec codec, RedisCommand<T> command, Object... params)
- Specified by:
readAsync
in interfaceCommandAsyncExecutor
-
readAsync
public <T,R> RFuture<R> readAsync(RedisClient client, byte[] key, Codec codec, RedisCommand<T> command, Object... params)
- Specified by:
readAsync
in interfaceCommandAsyncExecutor
-
readAsync
public <T,R> RFuture<R> readAsync(RedisClient client, Codec codec, RedisCommand<T> command, Object... params)
- Specified by:
readAsync
in interfaceCommandAsyncExecutor
-
readAllAsync
public <T,R> RFuture<Collection<R>> readAllAsync(RedisCommand<T> command, Object... params)
- Specified by:
readAllAsync
in interfaceCommandAsyncExecutor
-
readAllAsync
public <T,R> RFuture<Collection<R>> readAllAsync(Collection<R> results, RedisCommand<T> command, Object... params)
- Specified by:
readAllAsync
in interfaceCommandAsyncExecutor
-
readRandomAsync
public <T,R> RFuture<R> readRandomAsync(Codec codec, RedisCommand<T> command, Object... params)
- Specified by:
readRandomAsync
in interfaceCommandAsyncExecutor
-
readRandomAsync
public <T,R> RFuture<R> readRandomAsync(MasterSlaveEntry entry, Codec codec, RedisCommand<T> command, Object... params)
- Specified by:
readRandomAsync
in interfaceCommandAsyncExecutor
-
writeAllAsync
public <T> RFuture<Void> writeAllAsync(RedisCommand<T> command, Object... params)
- Specified by:
writeAllAsync
in interfaceCommandAsyncExecutor
-
writeAllAsync
public <R,T> RFuture<R> writeAllAsync(RedisCommand<T> command, SlotCallback<T,R> callback, Object... params)
- Specified by:
writeAllAsync
in interfaceCommandAsyncExecutor
-
writeAllAsync
public <R,T> RFuture<R> writeAllAsync(Codec codec, RedisCommand<T> command, SlotCallback<T,R> callback, Object... params)
- Specified by:
writeAllAsync
in interfaceCommandAsyncExecutor
-
readAllAsync
public <R,T> RFuture<R> readAllAsync(RedisCommand<T> command, SlotCallback<T,R> callback, Object... params)
- Specified by:
readAllAsync
in interfaceCommandAsyncExecutor
-
convertException
public <V> RedisException convertException(RFuture<V> future)
- Specified by:
convertException
in interfaceCommandAsyncExecutor
-
readAsync
public <T,R> RFuture<R> readAsync(String key, Codec codec, RedisCommand<T> command, Object... params)
- Specified by:
readAsync
in interfaceCommandAsyncExecutor
-
readAsync
public <T,R> RFuture<R> readAsync(byte[] key, Codec codec, RedisCommand<T> command, Object... params)
- Specified by:
readAsync
in interfaceCommandAsyncExecutor
-
readAsync
public <T,R> RFuture<R> readAsync(MasterSlaveEntry entry, Codec codec, RedisCommand<T> command, Object... params)
- Specified by:
readAsync
in interfaceCommandAsyncExecutor
-
writeAsync
public <T,R> RFuture<R> writeAsync(MasterSlaveEntry entry, Codec codec, RedisCommand<T> command, Object... params)
- Specified by:
writeAsync
in interfaceCommandAsyncExecutor
-
readAsync
public <T,R> RFuture<R> readAsync(String key, RedisCommand<T> command, Object... params)
- Specified by:
readAsync
in interfaceCommandAsyncExecutor
-
evalReadAsync
public <T,R> RFuture<R> evalReadAsync(String key, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params)
- Specified by:
evalReadAsync
in interfaceCommandAsyncExecutor
-
evalReadAsync
public <T,R> RFuture<R> evalReadAsync(MasterSlaveEntry entry, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params)
- Specified by:
evalReadAsync
in interfaceCommandAsyncExecutor
-
evalReadAsync
public <T,R> RFuture<R> evalReadAsync(RedisClient client, String name, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params)
- Specified by:
evalReadAsync
in interfaceCommandAsyncExecutor
-
evalWriteAsync
public <T,R> RFuture<R> evalWriteAsync(String key, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params)
- Specified by:
evalWriteAsync
in interfaceCommandAsyncExecutor
-
evalWriteAsync
public <T,R> RFuture<R> evalWriteAsync(MasterSlaveEntry entry, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params)
- Specified by:
evalWriteAsync
in interfaceCommandAsyncExecutor
-
evalWriteAllAsync
public <T,R> RFuture<R> evalWriteAllAsync(RedisCommand<T> command, SlotCallback<T,R> callback, String script, List<Object> keys, Object... params)
- Specified by:
evalWriteAllAsync
in interfaceCommandAsyncExecutor
-
evalAllAsync
public <T,R> RFuture<R> evalAllAsync(boolean readOnlyMode, RedisCommand<T> command, SlotCallback<T,R> callback, String script, List<Object> keys, Object... params)
-
writeAsync
public <T,R> RFuture<R> writeAsync(String key, RedisCommand<T> command, Object... params)
- Specified by:
writeAsync
in interfaceCommandAsyncExecutor
-
writeAsync
public <T,R> RFuture<R> writeAsync(String key, Codec codec, RedisCommand<T> command, Object... params)
- Specified by:
writeAsync
in interfaceCommandAsyncExecutor
-
writeAsync
public <T,R> RFuture<R> writeAsync(byte[] key, Codec codec, RedisCommand<T> command, Object... params)
-
async
protected <V,R> void async(boolean readOnlyMode, NodeSource source, Codec codec, RedisCommand<V> command, Object[] params, RPromise<R> mainPromise, int attempt, boolean ignoreRedirect, RFuture<RedisConnection> connFuture)
-
getConnection
protected <V> RFuture<RedisConnection> getConnection(boolean readOnlyMode, NodeSource source, RedisCommand<V> command)
-
free
protected void free(Object[] params)
-
releaseConnection
protected <V,R> void releaseConnection(NodeSource source, RFuture<RedisConnection> connectionFuture, boolean isReadOnly, RPromise<R> attemptPromise, AsyncDetails<V,R> details)
-
checkAttemptFuture
protected <R,V> void checkAttemptFuture(NodeSource source, AsyncDetails<V,R> details, io.netty.util.concurrent.Future<R> future, boolean ignoreRedirect)
-
handleError
protected <V,R> void handleError(AsyncDetails<V,R> details, RPromise<R> mainPromise, Throwable cause)
-
handleSuccess
protected <V,R> void handleSuccess(AsyncDetails<V,R> details, RPromise<R> promise, RedisCommand<?> command, R res)
-
tryHandleReference
protected <T> T tryHandleReference(T o)
-
sendCommand
protected <R,V> void sendCommand(AsyncDetails<V,R> details, RedisConnection connection)
-
-