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


##########
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:
   Actually, to simplify this merging logic, I'll define the contract of the 
Pair<List, List> as using empty list if there is no optional segments.



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