adarshsanjeev commented on code in PR #17899:
URL: https://github.com/apache/druid/pull/17899#discussion_r2039275089


##########
server/src/main/java/org/apache/druid/client/selector/ServerSelector.java:
##########
@@ -122,12 +122,17 @@
   }
 
   public List<DruidServerMetadata> getCandidates(final int numCandidates)
+  {
+    return getCandidates(numCandidates, HistoricalFilter.IDENTITIY_FILTER);
+  }
+
+  public List<DruidServerMetadata> getCandidates(final int numCandidates, 
HistoricalFilter filter)
   {
     List<DruidServerMetadata> candidates;
     synchronized (this) {
       if (numCandidates > 0) {
         candidates = new ArrayList<>(numCandidates);
-        strategy.pick(historicalServers, segment.get(), numCandidates)
+        strategy.pick(filter.apply(historicalServers), segment.get(), 
numCandidates)

Review Comment:
   There's also one other thing, we also require filtering on `getAllServers()` 
in ServerSelector, which does not call `TierSelectorStrategy.pick()`. We would 
need to filter and create an Int2ObjectRBTreeMap anyway. Since one of the 
places that calls `getAllServers()` is this function, we would need to pass the 
filter here anyway.
   
   Another thing, we do not always have access to query context in 
`AbstractTierSelectorStrategy`, the query parameter is nullable and is not 
always supplied. The default implementation is to pass null.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to