Package redis.clients.jedis.executors
Class ClusterCommandExecutor
java.lang.Object
redis.clients.jedis.executors.ClusterCommandExecutor
- All Implemented Interfaces:
AutoCloseable,CommandExecutor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.slf4j.Loggerprotected final intprotected final Duration -
Constructor Summary
ConstructorsConstructorDescriptionClusterCommandExecutor(ClusterConnectionProvider provider, int maxAttempts, Duration maxTotalRetriesDuration) -
Method Summary
Modifier and TypeMethodDescriptionfinal <T> TbroadcastCommand(CommandObject<T> commandObject) voidclose()protected <T> Texecute(Connection connection, CommandObject<T> commandObject) WARNING: This method is accessible for the purpose of testing.final <T> TexecuteCommand(CommandObject<T> commandObject) private static longgetBackoffSleepMillis(int attemptsLeft, Instant deadline) private booleanhandleConnectionProblem(int attemptsLeft, int consecutiveConnectionFailures, Instant doneDeadline) Related values should be reset ifTRUEis returned.protected voidsleep(long sleepMillis) WARNING: This method is accessible for the purpose of testing.
-
Field Details
-
log
private final org.slf4j.Logger log -
provider
-
maxAttempts
protected final int maxAttempts -
maxTotalRetriesDuration
-
-
Constructor Details
-
ClusterCommandExecutor
public ClusterCommandExecutor(ClusterConnectionProvider provider, int maxAttempts, Duration maxTotalRetriesDuration)
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
broadcastCommand
- Specified by:
broadcastCommandin interfaceCommandExecutor
-
executeCommand
- Specified by:
executeCommandin interfaceCommandExecutor
-
execute
WARNING: This method is accessible for the purpose of testing. This should not be used or overriden. -
handleConnectionProblem
private boolean handleConnectionProblem(int attemptsLeft, int consecutiveConnectionFailures, Instant doneDeadline) Related values should be reset ifTRUEis returned.- Parameters:
attemptsLeft-consecutiveConnectionFailures-doneDeadline-- Returns:
- true - if some actions are taken
false - if no actions are taken
-
getBackoffSleepMillis
-
sleep
protected void sleep(long sleepMillis) WARNING: This method is accessible for the purpose of testing. This should not be used or overriden.
-