walterddr commented on a change in pull request #8379:
URL: https://github.com/apache/pinot/pull/8379#discussion_r831662264
##########
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:
we have to make a copy since if one is looping over the entry during
which the content of the map is changed due to helix update. we will not be
able to guarantee correctness.
--
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]