klsince commented on code in PR #11978:
URL: https://github.com/apache/pinot/pull/11978#discussion_r1406615196


##########
pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java:
##########
@@ -610,7 +611,16 @@ public RoutingTable getRoutingTable(BrokerRequest 
brokerRequest, long requestId)
       return null;
     }
     InstanceSelector.SelectionResult selectionResult = 
routingEntry.calculateRouting(brokerRequest, requestId);
-    Map<String, String> segmentToInstanceMap = 
selectionResult.getSegmentToInstanceMap();
+    Map<ServerInstance, List<String>> serverInstanceToSegmentsMap =
+        getServerInstanceToSegmentsMap(tableNameWithType, 
selectionResult.getSegmentToInstanceMap());
+    Map<ServerInstance, List<String>> serverInstanceToOptionalSegmentsMap =
+        getServerInstanceToSegmentsMap(tableNameWithType, 
selectionResult.getOptionalSegmentToInstanceMap());
+    return new RoutingTable(merge(serverInstanceToSegmentsMap, 
serverInstanceToOptionalSegmentsMap),
+        selectionResult.getUnavailableSegments(), 
selectionResult.getNumPrunedSegments());

Review Comment:
   sgtm
   
   well, to be effecient, I'd still need to build a second Map<String, 
List<String>> to track the list of optional segments on each server, so that I 
don't have to loop over the map from optional segment to server repetitively.



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

Reply via email to