java.lang.Object
io.lettuce.core.cluster.MultiNodeExecution
public class MultiNodeExecution extends Object
Utility to perform and synchronize command executions on multiple cluster nodes.
- Author:
- Mark Paluch
-
Constructor Summary
Constructors Constructor Description MultiNodeExecution() -
Method Summary
Modifier and Type Method Description static RedisFuture<Long>aggregateAsync(Map<?,? extends CompletionStage<Long>> executions)Aggregate (sum) results of theRedisFutures.static RedisFuture<String>alwaysOkOfAsync(Map<?,? extends CompletionStage<String>> executions)Returns always OK and guarantee that all futures are finished.static <T> Texecute(Callable<T> function)static <T> RedisFuture<T>firstOfAsync(Map<?,? extends CompletionStage<T>> executions)Returns the result of the firstRedisFutureand guarantee that all futures are finished.static <T> RedisFuture<T>lastOfAsync(Map<?,? extends CompletionStage<T>> executions)Returns the result of the lastRedisFutureand guarantee that all futures are finished.
-
Constructor Details
-
MultiNodeExecution
public MultiNodeExecution()
-
-
Method Details
-
execute
-
aggregateAsync
Aggregate (sum) results of theRedisFutures.- Parameters:
executions- mapping of a key to the future- Returns:
- future producing an aggregation result
-
firstOfAsync
Returns the result of the firstRedisFutureand guarantee that all futures are finished.- Type Parameters:
T- result type- Parameters:
executions- mapping of a key to the future- Returns:
- future returning the first result.
-
lastOfAsync
Returns the result of the lastRedisFutureand guarantee that all futures are finished.- Type Parameters:
T- result type- Parameters:
executions- mapping of a key to the future- Returns:
- future returning the first result.
-
alwaysOkOfAsync
public static RedisFuture<String> alwaysOkOfAsync(Map<?,? extends CompletionStage<String>> executions)Returns always OK and guarantee that all futures are finished.- Parameters:
executions- mapping of a key to the future- Returns:
- future returning the first result.
-