You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/01/02 18:29:21 UTC

[GitHub] drcrallen commented on a change in pull request #6629: Add support parallel combine in brokers

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

 ##########
 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:
   You are adding a new type though, so handling the new type (and architecting the calls to handle any new paradigm) is in scope for 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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org