You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2020/04/08 13:56:15 UTC

[GitHub] [cassandra] blerer commented on a change in pull request #497: Cassandra 15666 trunk

blerer commented on a change in pull request #497: Cassandra 15666 trunk
URL: https://github.com/apache/cassandra/pull/497#discussion_r405523757
 
 

 ##########
 File path: src/java/org/apache/cassandra/utils/FBUtilities.java
 ##########
 @@ -486,6 +486,81 @@ public static int nowInSeconds()
             Uninterruptibles.sleepUninterruptibly(delay, TimeUnit.MILLISECONDS);
         }
     }
+
+    /**
+     * Returns a new {@link Future} wrapping the given list of futures and returning a list of their results.
+     */
+    public static Future<List> allOf(Collection<Future> futures)
+    {
+        if (futures.isEmpty())
+            return CompletableFuture.completedFuture(null);
+
+        return new Future<List>()
+        {
+            @Override
+            @SuppressWarnings("unchecked")
+            public List get() throws InterruptedException, ExecutionException
+            {
+                List result = new LinkedList<>();
 
 Review comment:
   Is there a reason for choosing a `LinkedList` over an `ArrayList` ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org