Package org.redisson.command
Class CommandAsyncService
- java.lang.Object
-
- org.redisson.command.CommandAsyncService
-
- All Implemented Interfaces:
CommandAsyncExecutor
- Direct Known Subclasses:
CommandBatchService
,CommandReactiveService
,CommandRxService
,CommandSyncService
public class CommandAsyncService extends Object implements CommandAsyncExecutor
- Author:
- Nikita Koksharov
-
-
Constructor Summary
Constructors Constructor Description CommandAsyncService(ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder, RedissonObjectBuilder.ReferenceType referenceType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V,R>
RFuture<R>async(boolean readOnlyMode, NodeSource source, Codec codec, RedisCommand<V> command, Object[] params, boolean ignoreRedirect, boolean noRetry)
RedisException
convertException(ExecutionException e)
protected <R> CompletableFuture<R>
createPromise()
io.netty.buffer.ByteBuf
encode(Codec codec, Object value)
io.netty.buffer.ByteBuf
encodeMapKey(Codec codec, Object value)
io.netty.buffer.ByteBuf
encodeMapValue(Codec codec, Object value)
<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>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)
<T,R>
RFuture<R>evalWriteNoRetryAsync(String key, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params)
<R> List<CompletableFuture<R>>
executeAll(RedisCommand<?> command, Object... params)
<R> List<CompletableFuture<R>>
executeMasters(RedisCommand<?> command, Object... params)
<V> V
get(CompletableFuture<V> future)
<V> V
get(RFuture<V> future)
ConnectionManager
getConnectionManager()
<V> V
getInterrupted(CompletableFuture<V> future)
<V> V
getInterrupted(RFuture<V> future)
<V> V
getNow(CompletableFuture<V> future)
RedissonObjectBuilder
getObjectBuilder()
protected boolean
isEvalCacheActive()
boolean
isEvalShaROSupported()
<V> RFuture<V>
pollFromAnyAsync(String name, Codec codec, RedisCommand<?> command, long secondsTimeout, String... queueNames)
<T,R>
RFuture<Collection<R>>readAllAsync(Codec codec, 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>readBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T,R> callback, String... keys)
<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)
void
setEvalShaROSupported(boolean value)
<V> void
transfer(CompletableFuture<V> future1, CompletableFuture<V> future2)
<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(RedisClient client, Codec codec, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>writeAsync(MasterSlaveEntry entry, Codec codec, RedisCommand<T> command, Object... params)
<T,R>
RFuture<R>writeBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T,R> callback, String... keys)
-
-
-
Constructor Detail
-
CommandAsyncService
public CommandAsyncService(ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder, RedissonObjectBuilder.ReferenceType referenceType)
-
-
Method Detail
-
getConnectionManager
public ConnectionManager getConnectionManager()
- Specified by:
getConnectionManager
in interfaceCommandAsyncExecutor
-
getNow
public <V> V getNow(CompletableFuture<V> future)
- Specified by:
getNow
in interfaceCommandAsyncExecutor
-
transfer
public <V> void transfer(CompletableFuture<V> future1, CompletableFuture<V> future2)
- Specified by:
transfer
in interfaceCommandAsyncExecutor
-
get
public <V> V get(RFuture<V> future)
- Specified by:
get
in interfaceCommandAsyncExecutor
-
get
public <V> V get(CompletableFuture<V> future)
- Specified by:
get
in interfaceCommandAsyncExecutor
-
getInterrupted
public <V> V getInterrupted(RFuture<V> future) throws InterruptedException
- Specified by:
getInterrupted
in interfaceCommandAsyncExecutor
- Throws:
InterruptedException
-
getInterrupted
public <V> V getInterrupted(CompletableFuture<V> future) throws InterruptedException
- Specified by:
getInterrupted
in interfaceCommandAsyncExecutor
- Throws:
InterruptedException
-
createPromise
protected <R> CompletableFuture<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(Codec codec, 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
-
executeMasters
public <R> List<CompletableFuture<R>> executeMasters(RedisCommand<?> command, Object... params)
- Specified by:
executeMasters
in interfaceCommandAsyncExecutor
-
executeAll
public <R> List<CompletableFuture<R>> executeAll(RedisCommand<?> command, Object... params)
- Specified by:
executeAll
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 RedisException convertException(ExecutionException e)
- 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(RedisClient client, Codec codec, RedisCommand<T> command, Object... params)
- Specified by:
writeAsync
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
-
evalWriteNoRetryAsync
public <T,R> RFuture<R> evalWriteNoRetryAsync(String key, Codec codec, RedisCommand<T> evalCommandType, String script, List<Object> keys, Object... params)
- Specified by:
evalWriteNoRetryAsync
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
-
isEvalCacheActive
protected boolean isEvalCacheActive()
-
isEvalShaROSupported
public boolean isEvalShaROSupported()
- Specified by:
isEvalShaROSupported
in interfaceCommandAsyncExecutor
-
setEvalShaROSupported
public void setEvalShaROSupported(boolean value)
- Specified by:
setEvalShaROSupported
in interfaceCommandAsyncExecutor
-
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)
- Specified by:
writeAsync
in interfaceCommandAsyncExecutor
-
async
public <V,R> RFuture<R> async(boolean readOnlyMode, NodeSource source, Codec codec, RedisCommand<V> command, Object[] params, boolean ignoreRedirect, boolean noRetry)
- Specified by:
async
in interfaceCommandAsyncExecutor
-
readBatchedAsync
public <T,R> RFuture<R> readBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T,R> callback, String... keys)
- Specified by:
readBatchedAsync
in interfaceCommandAsyncExecutor
-
writeBatchedAsync
public <T,R> RFuture<R> writeBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T,R> callback, String... keys)
- Specified by:
writeBatchedAsync
in interfaceCommandAsyncExecutor
-
getObjectBuilder
public RedissonObjectBuilder getObjectBuilder()
- Specified by:
getObjectBuilder
in interfaceCommandAsyncExecutor
-
encode
public io.netty.buffer.ByteBuf encode(Codec codec, Object value)
- Specified by:
encode
in interfaceCommandAsyncExecutor
-
encodeMapKey
public io.netty.buffer.ByteBuf encodeMapKey(Codec codec, Object value)
- Specified by:
encodeMapKey
in interfaceCommandAsyncExecutor
-
encodeMapValue
public io.netty.buffer.ByteBuf encodeMapValue(Codec codec, Object value)
- Specified by:
encodeMapValue
in interfaceCommandAsyncExecutor
-
pollFromAnyAsync
public <V> RFuture<V> pollFromAnyAsync(String name, Codec codec, RedisCommand<?> command, long secondsTimeout, String... queueNames)
- Specified by:
pollFromAnyAsync
in interfaceCommandAsyncExecutor
-
-