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_r240882381
##########
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:
All I did in this PR is changing the type of `COMPARATOR`. The suggestion
sounds good, but I don't think this should be part 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]