jihoonson commented on a change in pull request #6629: Add support parallel 
combine in brokers
URL: https://github.com/apache/incubator-druid/pull/6629#discussion_r244824224
 
 

 ##########
 File path: 
server/src/main/java/org/apache/druid/client/selector/ConnectionCountServerSelectorStrategy.java
 ##########
 @@ -27,16 +27,20 @@
 import java.util.Comparator;
 import java.util.List;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 public class ConnectionCountServerSelectorStrategy implements 
ServerSelectorStrategy
 {
-  private static final Comparator<QueryableDruidServer> COMPARATOR =
-      Comparator.comparingInt(s -> s.getClient().getNumOpenConnections());
+  private static final Comparator<RemoteDruidServer> COMPARATOR =
+      Comparator.comparingInt(s -> s.getQueryRunner().getNumOpenConnections());
 
   @Override
   public QueryableDruidServer pick(Set<QueryableDruidServer> servers, 
DataSegment segment)
   {
-    return Collections.min(servers, COMPARATOR);
+    return Collections.min(
+        servers.stream().map(server -> (RemoteDruidServer) 
server).collect(Collectors.toSet()),
 
 Review comment:
   I think it's better if the PR scope is as narrow as possible because it 
helps reviewers a lot to focus on the main purpose of the PR. Your suggestion 
sounds good so maybe we can do in another PR, but I don't think it's related to 
the purpose of this PR.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to