sylph-eu commented on code in PR #10746: URL: https://github.com/apache/pinot/pull/10746#discussion_r1188473270
########## pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/assignment/segment/OfflineSegmentAssignment.java: ########## @@ -32,19 +32,63 @@ import org.apache.pinot.controller.helix.core.assignment.segment.strategy.SegmentAssignmentStrategyFactory; import org.apache.pinot.spi.config.table.assignment.InstancePartitionsType; import org.apache.pinot.spi.utils.RebalanceConfigConstants; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Segment assignment for offline table. */ public class OfflineSegmentAssignment extends BaseSegmentAssignment { + private final Logger _logger = LoggerFactory.getLogger(getClass()); @Override public List<String> assignSegment(String segmentName, Map<String, Map<String, String>> currentAssignment, Map<InstancePartitionsType, InstancePartitions> instancePartitionsMap) { + // Fallback to default assignment InstancePartitions instancePartitions = instancePartitionsMap.get(InstancePartitionsType.OFFLINE); Preconditions.checkState(instancePartitions != null, "Failed to find OFFLINE instance partitions for table: %s", _tableNameWithType); + return doAssignSegment(segmentName, currentAssignment, instancePartitions); + } + + @Override + public List<String> assignSegment(String segmentName, Map<String, Map<String, String>> currentAssignment, + Map<InstancePartitionsType, InstancePartitions> instancePartitionsMap, @Nullable List<Tier> sortedTiers, + @Nullable Map<String, InstancePartitions> tierInstancePartitionsMap) { Review Comment: I was trying to follow the approach of `rebalanceTable`: method takes all arguments to avoid fetching data from ZK/Helix. The latter is needed for unit testing, to reduce the volume of "testing infrastructure" to build around. I'll try to introduce respective tests in `PinotHelixResourceManagerAssignmentTest` though. -- 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