Jackie-Jiang commented on code in PR #13915: URL: https://github.com/apache/pinot/pull/13915#discussion_r1739386183
########## pinot-controller/src/main/java/org/apache/pinot/controller/util/TableMetadataReader.java: ########## @@ -86,6 +86,16 @@ public JsonNode getSegmentsMetadata(String tableNameWithType, List<String> colum return getSegmentsMetadataInternal(tableNameWithType, columns, segmentsToInclude, timeoutMs); } + /** + * This method takes in table name and checks if there exists any mismtach in the segments/table configs + */ + public JsonNode getSegmentsReloadCheckMetadata(String tableNameWithType, int timeoutMs) Review Comment: Suggest changing the signature to: `boolean isReloadNeeded(...)` To reduce the overhead, we can extract this part from `getServerCheckSegmentsReloadMetadata()` into a helper method: ``` TableType tableType = TableNameBuilder.getTableTypeFromTableName(tableNameWithType); List<String> serverInstances = _pinotHelixResourceManager.getServerInstancesForTable(tableNameWithType, tableType); Set<String> serverInstanceSet = new HashSet<>(serverInstances); BiMap<String, String> endpoints = _pinotHelixResourceManager.getDataInstanceAdminEndpoints(serverInstanceSet); ServerSegmentMetadataReader serverSegmentMetadataReader = new ServerSegmentMetadataReader(_executor, _connectionManager); List<String> segmentsMetadata = serverSegmentMetadataReader.getCheckReloadSegmentsFromServer(tableNameWithType, serverInstanceSet, endpoints, timeoutMs); ``` Then process each server response without constructing a map. -- 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