Package org.redisson.command
Class RedisExecutor<V,R>
- java.lang.Object
-
- org.redisson.command.RedisExecutor<V,R>
-
- Type Parameters:
V- type of valueR- type of returned value
- Direct Known Subclasses:
BaseRedisBatchExecutor,RedisCommonBatchExecutor
public class RedisExecutor<V,R> extends Object
- Author:
- Nikita Koksharov
-
-
Constructor Summary
Constructors Constructor Description RedisExecutor(boolean readOnlyMode, NodeSource source, Codec codec, RedisCommand<V> command, Object[] params, RPromise<R> mainPromise, boolean ignoreRedirect, ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder, RedissonObjectBuilder.ReferenceType referenceType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckAttemptPromise(RPromise<R> attemptFuture, RFuture<RedisConnection> connectionFuture)protected <T> RedisExceptionconvertException(RFuture<T> future)voidexecute()protected voidfree()protected voidfree(Object[] params)protected CodecgetCodec(Codec codec)protected RFuture<RedisConnection>getConnection()RedisClientgetRedisClient()protected voidhandleError(RFuture<RedisConnection> connectionFuture, Throwable cause)protected voidhandleResult(RPromise<R> attemptPromise, RFuture<RedisConnection> connectionFuture)protected voidhandleSuccess(RPromise<R> promise, RFuture<RedisConnection> connectionFuture, R res)protected booleanisResendAllowed(int attempt, int attempts)protected voidonException()protected voidreleaseConnection(RPromise<R> attemptPromise, RFuture<RedisConnection> connectionFuture)protected voidsendCommand(RPromise<R> attemptPromise, RedisConnection connection)
-
-
-
Constructor Detail
-
RedisExecutor
public RedisExecutor(boolean readOnlyMode, NodeSource source, Codec codec, RedisCommand<V> command, Object[] params, RPromise<R> mainPromise, boolean ignoreRedirect, ConnectionManager connectionManager, RedissonObjectBuilder objectBuilder, RedissonObjectBuilder.ReferenceType referenceType)
-
-
Method Detail
-
execute
public void execute()
-
free
protected void free()
-
free
protected void free(Object[] params)
-
isResendAllowed
protected boolean isResendAllowed(int attempt, int attempts)
-
checkAttemptPromise
protected void checkAttemptPromise(RPromise<R> attemptFuture, RFuture<RedisConnection> connectionFuture)
-
handleResult
protected void handleResult(RPromise<R> attemptPromise, RFuture<RedisConnection> connectionFuture) throws ReflectiveOperationException
- Throws:
ReflectiveOperationException
-
onException
protected void onException()
-
handleError
protected void handleError(RFuture<RedisConnection> connectionFuture, Throwable cause)
-
handleSuccess
protected void handleSuccess(RPromise<R> promise, RFuture<RedisConnection> connectionFuture, R res) throws ReflectiveOperationException
- Throws:
ReflectiveOperationException
-
sendCommand
protected void sendCommand(RPromise<R> attemptPromise, RedisConnection connection)
-
releaseConnection
protected void releaseConnection(RPromise<R> attemptPromise, RFuture<RedisConnection> connectionFuture)
-
getRedisClient
public RedisClient getRedisClient()
-
getConnection
protected RFuture<RedisConnection> getConnection()
-
convertException
protected <T> RedisException convertException(RFuture<T> future)
-
-