dajac commented on a change in pull request #8999:
URL: https://github.com/apache/kafka/pull/8999#discussion_r452393587



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/ClusterConnectionStates.java
##########
@@ -443,13 +444,13 @@ public boolean isConnectionSetupTimeout(String id, long 
now) {
     }
 
     /**
-     * Return the Set of nodes whose connection setup has timed out.
+     * Return the List of nodes whose connection setup has timed out.
      * @param now the current time in ms
      */
-    public Set<String> nodesWithConnectionSetupTimeout(long now) {
+    public List<String> nodesWithConnectionSetupTimeout(long now) {
         return connectingNodes.stream()
             .filter(id -> isConnectionSetupTimeout(id, now))
-            .collect(Collectors.toSet());
+            .collect(Collectors.toCollection(LinkedList::new));

Review comment:
       We only add elements to the List and then iterate over it. A LinkedList 
seems slightly better for this case.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to