wirybeaver commented on code in PR #15203:
URL: https://github.com/apache/pinot/pull/15203#discussion_r2083226548


##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/instanceselector/BalancedInstanceSelector.java:
##########
@@ -69,17 +72,18 @@ Pair<Map<String, String>, Map<String, String>> 
select(List<String> segments, int
         if (candidates == null) {
           continue;
         }
-        List<String> candidateInstances = new ArrayList<>(candidates.size());
-        for (SegmentInstanceCandidate candidate : candidates) {
-          candidateInstances.add(candidate.getInstance());
-        }
-        String selectedInstance = 
_adaptiveServerSelector.select(candidateInstances);
+        SegmentInstanceCandidate candidate = 
_priorityGroupInstanceSelector.select(ctx, candidates);
+        // If candidates is not null, candidates is always non-empty because 
segments with no enabled online servers
+        // are placed in segmentStates.getUnavailableSegments()
+        assert candidate != null;
+        _brokerMetrics.addMeteredValue(BrokerMeter.REPLICA_SEG_QUERIES, 1,

Review Comment:
   Good catch. It will cause high CPU. I will create a hashmap to count the 
result.



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