Jackie-Jiang commented on a change in pull request #8379: URL: https://github.com/apache/pinot/pull/8379#discussion_r832609370
########## File path: pinot-broker/src/main/java/org/apache/pinot/broker/routing/segmentselector/SegmentSelector.java ########## @@ -61,4 +61,9 @@ * (table) without overlap. */ Set<String> select(BrokerRequest brokerRequest); + + /** + * Selects the segments based on the table name. + */ + Set<String> select(String tableName); Review comment: Revert this and all the changes in the implementation ########## File path: pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java ########## @@ -458,13 +461,32 @@ 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 Map<String, ServerInstance> getEnabledServerInstanceMap() { + return new HashMap<>(_enabledServerInstanceMap); + } + + private String getIdealStatePath(String tableNameWithType) { + return _idealStatePathPrefix + tableNameWithType; + } + + private String getExternalViewPath(String tableNameWithType) { + return _externalViewPathPrefix + tableNameWithType; + } + + private RoutingTable constructRoutingTableFromInstanceSelectionResult(String tableNameWithType, + InstanceSelector.SelectionResult selectionResult) { Review comment: Shall we revert this part of change as they are not related? ########## File path: pinot-broker/src/main/java/org/apache/pinot/broker/routing/BrokerRoutingManager.java ########## @@ -458,13 +461,32 @@ 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 Map<String, ServerInstance> getEnabledServerInstanceMap() { + return new HashMap<>(_enabledServerInstanceMap); Review comment: Directly return the `_enabledServerInstanceMap` to avoid the unnecessary overhead -- 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