siddharthteotia commented on a change in pull request #8379: URL: https://github.com/apache/pinot/pull/8379#discussion_r831633502
########## File path: pinot-broker/src/main/java/org/apache/pinot/broker/routing/RoutingManager.java ########## @@ -458,13 +460,42 @@ public boolean routingExists(String tableNameWithType) { * <p>NOTE: The broker request should already have the table suffix (_OFFLINE or _REALTIME) appended. */ @Nullable + @Override public RoutingTable getRoutingTable(BrokerRequest brokerRequest) { String tableNameWithType = brokerRequest.getQuerySource().getTableName(); RoutingEntry routingEntry = _routingEntryMap.get(tableNameWithType); if (routingEntry == null) { return null; } InstanceSelector.SelectionResult selectionResult = routingEntry.calculateRouting(brokerRequest); + return constructRoutingTableFromInstanceSelectionResult(tableNameWithType, selectionResult); + } + + @Override + public RoutingTable getRoutingTable(String tableNameWithType) { + RoutingEntry routingEntry = _routingEntryMap.get(tableNameWithType); + if (routingEntry == null) { + return null; + } + InstanceSelector.SelectionResult selectionResult = routingEntry.calculateRouting(tableNameWithType); + return constructRoutingTableFromInstanceSelectionResult(tableNameWithType, selectionResult); + } + + @Override + public Map<String, ServerInstance> getEnabledServerInstanceMap() { + return new HashMap<>(_enabledServerInstanceMap); Review comment: Can we add a comment to explain why copying the map for readers (or in future whoever changes the code) to be aware of the gotchas ? -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org