Jackie-Jiang commented on code in PR #19530:
URL: https://github.com/apache/pinot/pull/19530#discussion_r4009500683
##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/instanceselector/BalancedInstanceSelector.java:
##########
@@ -72,20 +76,24 @@ public InstanceMapping select(List<String> segments, int
requestId,
} else {
selectedCandidate = candidates.get(requestId++ % candidates.size());
}
- poolToSegmentCount.merge(selectedCandidate.getPool(), 1, Integer::sum);
+ poolToSegmentCount.addTo(selectedCandidate.getPool(), 1);
// This can only be offline when it is a new segment. And such segment
is marked as optional segment so that
// broker or server can skip it upon any issue to process it.
if (selectedCandidate.isOnline()) {
+ if (segmentToSelectedInstanceMap == null) {
+ segmentToSelectedInstanceMap = new
Object2ObjectOpenHashMap<>(segments.size());
Review Comment:
From past experience, Object2Object map has worse performance than HashMap,
and probably not really save memory
--
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]