Sxnan commented on code in PR #19653: URL: https://github.com/apache/flink/pull/19653#discussion_r889924764
########## flink-runtime/src/main/java/org/apache/flink/runtime/deployment/TaskDeploymentDescriptorFactory.java: ########## @@ -244,7 +266,50 @@ public static TaskDeploymentDescriptorFactory fromExecutionVertex( internalExecutionGraphAccessor.getPartitionLocationConstraint(), executionVertex.getAllConsumedPartitionGroups(), internalExecutionGraphAccessor::getResultPartitionOrThrow, - internalExecutionGraphAccessor.getBlobWriter()); + internalExecutionGraphAccessor.getBlobWriter(), + clusterPartitionShuffleDescriptors); + } + + private static Map<IntermediateDataSetID, ShuffleDescriptor[]> + getClusterPartitionShuffleDescriptors(ExecutionVertex executionVertex) { + final InternalExecutionGraphAccessor internalExecutionGraphAccessor = + executionVertex.getExecutionGraphAccessor(); + final List<IntermediateDataSetID> consumedClusterDataSetIds = + executionVertex.getJobVertex().getJobVertex().getIntermediateDataSetIdToConsume(); + Map<IntermediateDataSetID, ShuffleDescriptor[]> clusterPartitionShuffleDescriptors = + new HashMap<>(); + + for (IntermediateDataSetID consumedClusterDataSetId : consumedClusterDataSetIds) { + Collection<? extends ShuffleDescriptor> shuffleDescriptors = + internalExecutionGraphAccessor.getClusterPartitionShuffleDescriptors( + consumedClusterDataSetId); + + Preconditions.checkState( + executionVertex.getTotalNumberOfParallelSubtasks() == shuffleDescriptors.size(), + "The parallelism (%s) of the cache consuming job vertex is " + + "different from the number of shuffle descriptors (%s) of the intermediate data set", + executionVertex.getTotalNumberOfParallelSubtasks(), + shuffleDescriptors.size()); + + shuffleDescriptors = Review Comment: The list of the shuffle descriptors is returned from the ResourceManagerPartitionTracker. And change is made so that it returns the shuffle descriptors ordered by the partition number. [e41dfb8](https://github.com/apache/flink/pull/19653/commits/e41dfb8dc3078fa14cb94443c78e5cd18355a4ee) -- 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-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org