Package io.lettuce.core.cluster
Class MultiNodeExecution
- 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RedisFuture<Long>
aggregateAsync(Map<?,? extends CompletionStage<Long>> executions)
Aggregate (sum) results of theRedisFuture
s.static RedisFuture<String>
alwaysOkOfAsync(Map<?,? extends CompletionStage<String>> executions)
Returns always OK and guarantee that all futures are finished.static <T> T
execute(Callable<T> function)
static <T> RedisFuture<T>
firstOfAsync(Map<?,? extends CompletionStage<T>> executions)
Returns the result of the firstRedisFuture
and guarantee that all futures are finished.static <T> RedisFuture<T>
lastOfAsync(Map<?,? extends CompletionStage<T>> executions)
Returns the result of the lastRedisFuture
and guarantee that all futures are finished.
-
-
-
Method Detail
-
execute
public static <T> T execute(Callable<T> function)
-
aggregateAsync
public static RedisFuture<Long> aggregateAsync(Map<?,? extends CompletionStage<Long>> executions)
Aggregate (sum) results of theRedisFuture
s.- Parameters:
executions
- mapping of a key to the future- Returns:
- future producing an aggregation result
-
firstOfAsync
public static <T> RedisFuture<T> firstOfAsync(Map<?,? extends CompletionStage<T>> executions)
Returns the result of the firstRedisFuture
and 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
public static <T> RedisFuture<T> lastOfAsync(Map<?,? extends CompletionStage<T>> executions)
Returns the result of the lastRedisFuture
and 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.
-
-