snleee commented on a change in pull request #6094: URL: https://github.com/apache/incubator-pinot/pull/6094#discussion_r513758152
########## File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/generator/TaskGeneratorUtils.java ########## @@ -68,4 +73,30 @@ } return runningSegments; } + + public static Map<String, List<String>> getScheduledSegmentsMap(@Nonnull String taskType, + @Nonnull ClusterInfoProvider clusterInfoProvider) { + Map<String, List<String>> scheduledSegments = new HashMap<>(); + Map<String, TaskState> taskStates = clusterInfoProvider.getTaskStates(taskType); + for (Map.Entry<String, TaskState> entry : taskStates.entrySet()) { + // Skip COMPLETED tasks + if (entry.getValue() == TaskState.COMPLETED) { + continue; + } + for (PinotTaskConfig pinotTaskConfig : clusterInfoProvider.getTaskConfigs(entry.getKey())) { + Map<String, String> configs = pinotTaskConfig.getConfigs(); + List<String> scheduledSegmentsForTable = + scheduledSegments.computeIfAbsent(configs.get(MinionConstants.TABLE_NAME_KEY), v -> new ArrayList<>()); + String segmentName = configs.get(MinionConstants.SEGMENT_NAME_KEY); + if (taskType.equals(MinionConstants.MergeRollupTask.TASK_TYPE)) { Review comment: fixed ---------------------------------------------------------------- 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. 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