keith-turner commented on code in PR #2752:
URL: https://github.com/apache/accumulo/pull/2752#discussion_r899635571


##########
core/src/main/java/org/apache/accumulo/core/util/CompletableFutureUtil.java:
##########
@@ -49,4 +51,26 @@ public static <T> CompletableFuture<T> 
merge(List<CompletableFuture<T>> futures,
     return futures.get(0);
   }
 
+  /**
+   * Iterate some function until a given condition is met.
+   *
+   * The step function should always return an asynchronous {@code
+   * CompletableFuture} in order to avoid stack overflows.
+   */
+  public static <T> CompletableFuture<T> 
iterateUntil(Function<T,CompletableFuture<T>> step,

Review Comment:
   A unit test for this would nice.  Could test 0,1,2,3, 1000 iterations and 
ensure the results are correct.  Could maybe also test an exception during 
iteration.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to