Module lettuce.core

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 Details

    • MultiNodeExecution

      public MultiNodeExecution()
  • Method Details

    • execute

      public static <T> T execute​(Callable<T> function)
    • aggregateAsync

      public static RedisFuture<Long> aggregateAsync​(Map<?,​? extends CompletionStage<Long>> executions)
      Aggregate (sum) results of the RedisFutures.
      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 first RedisFuture 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 last RedisFuture 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.