You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/01/28 11:56:14 UTC
[GitHub] [flink] wanglijie95 commented on a change in pull request #18462: [FLINK-25045][runtime] Introduce AdaptiveBatchScheduler
wanglijie95 commented on a change in pull request #18462:
URL: https://github.com/apache/flink/pull/18462#discussion_r794441542
##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptivebatch/forwardgroup/ForwardGroupComputeUtilTest.java
##########
@@ -162,20 +171,35 @@ public void testOneInputSplitsIntoTwo() {
v2.getProducedDataSets().get(0).getConsumer().setForward(true);
v2.getProducedDataSets().get(1).getConsumer().setForward(true);
- Set<ForwardRegion> regions = computePipelinedRegions(v1, v2, v3, v4);
+ Set<ForwardGroup> groups = computeForwardGroups(v1, v2, v3, v4);
- checkRegionSize(regions, 2, 3, 1);
+ checkGroupSize(groups, 1, 3);
}
- private static Set<ForwardRegion> computePipelinedRegions(JobVertex... vertices) {
+ private static Set<ForwardGroup> computeForwardGroups(JobVertex... vertices) throws Exception {
+ Arrays.asList(vertices).forEach(vertex -> vertex.setInvokableClass(NoOpInvokable.class));
+ ExecutionGraph executionGraph = createDynamicGraph(vertices);
return new HashSet<>(
- ForwardRegionComputeUtil.computeForwardRegions(Arrays.asList(vertices)).values());
+ ForwardGroupComputeUtil.computeForwardGroups(
+ Arrays.asList(vertices), executionGraph::getJobVertex)
+ .values());
}
- private static void checkRegionSize(
- Set<ForwardRegion> regions, int numOfRegions, int... sizes) {
- assertEquals(numOfRegions, regions.size());
+ private static void checkGroupSize(Set<ForwardGroup> groups, int numOfGroups, int... sizes) {
+ assertEquals(numOfGroups, groups.size());
containsInAnyOrder(
- regions.stream().map(ForwardRegion::size).collect(Collectors.toList()), sizes);
+ groups.stream().map(ForwardGroup::size).collect(Collectors.toList()), sizes);
+ }
+
+ private static DefaultExecutionGraph createDynamicGraph(JobVertex... vertices)
Review comment:
Yes, but the forward groups will only be used in AdaptiveBatchScheduler(dynamic graph)
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org