zhuzhurk commented on a change in pull request #11770: [FLINK-17014][runtime] Implement PipelinedRegionSchedulingStrategy URL: https://github.com/apache/flink/pull/11770#discussion_r409982245
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/strategy/SchedulingStrategyUtils.java ########## @@ -60,4 +61,18 @@ deploymentOptionRetriever.apply(executionVertexID))) .collect(Collectors.toList()); } + + static List<SchedulingPipelinedRegion<?, ?>> sortPipelinedRegionsInTopologicalOrder( + final SchedulingTopology<?, ?> topology, + final Set<SchedulingPipelinedRegion<?, ?>> regions) { + + final Set<SchedulingPipelinedRegion<?, ?>> deduplicator = new HashSet<>(); + return IterableUtils.toStream(topology.getVertices()) + .map(SchedulingExecutionVertex::getId) + .map(topology::getPipelinedRegionOfVertex) + .filter(regions::contains) + .filter(region -> !deduplicator.contains(region)) + .filter(deduplicator::add) Review comment: Good idea! Will use `distinct()`. ---------------------------------------------------------------- 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 With regards, Apache Git Services