sylph-eu commented on code in PR #10746: URL: https://github.com/apache/pinot/pull/10746#discussion_r1188858089
########## pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java: ########## @@ -2268,10 +2271,28 @@ public void assignTableSegment(String tableNameWithType, String segmentName) { try { TableConfig tableConfig = getTableConfig(tableNameWithType); Preconditions.checkState(tableConfig != null, "Failed to find table config for table: " + tableNameWithType); + + List<Tier> sortedTiers = null; + Map<String, InstancePartitions> tierToInstancePartitionsMap = null; + + // Initialize tier information only in case direct tier assignment is configured + if (_enableTieredSegmentAssignment && CollectionUtils.isNotEmpty(tableConfig.getTierConfigsList())) { + sortedTiers = TierConfigUtils.getSortedTiersForStorageType(tableConfig.getTierConfigsList(), + TierFactory.PINOT_SERVER_STORAGE_TYPE, _helixZkManager); + tierToInstancePartitionsMap = + TierConfigUtils.getTierToInstancePartitionsMap(tableNameWithType, sortedTiers, _helixZkManager); + + // Update segment tier to support direct assignment for multiple data directories + updateSegmentTargetTier(tableNameWithType, segmentName, sortedTiers); Review Comment: Done. Implementation looks a bit different due to different types (instancePartitionsMap is a map), but it follows the idea. -- 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