zhijiangW commented on a change in pull request #8362: [FLINK-11391] Introduce
shuffle master interface
URL: https://github.com/apache/flink/pull/8362#discussion_r289282173
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
##########
@@ -566,6 +619,67 @@ public void setInitialState(@Nullable
JobManagerTaskRestore taskRestore) {
}
}
+ @VisibleForTesting
+ CompletableFuture<Execution>
registerProducedPartitions(TaskManagerLocation location) {
+ assertRunningInJobMasterMainThread();
+
+ return FutureUtils.thenApplyAsyncIfNotDone(
+ registerProducedPartitions(vertex, location, attemptId),
+
vertex.getExecutionGraph().getJobMasterMainThreadExecutor(),
+ producedPartitionsCache -> {
+ producedPartitions = producedPartitionsCache;
+ return this;
+ });
+ }
+
+ @VisibleForTesting
+ static CompletableFuture<Map<IntermediateResultPartitionID,
ResultPartitionDeploymentDescriptor>> registerProducedPartitions(
+ ExecutionVertex vertex,
+ TaskManagerLocation location,
+ ExecutionAttemptID attemptId) {
+ ProducerDescriptor producerDescriptor =
ProducerDescriptor.create(location, attemptId);
+
+ boolean lazyScheduling =
vertex.getExecutionGraph().getScheduleMode().allowLazyDeployment();
+
+ Collection<IntermediateResultPartition> partitions =
vertex.getProducedPartitions().values();
+
Collection<CompletableFuture<ResultPartitionDeploymentDescriptor>>
partitionRegistrations =
+ new ArrayList<>(partitions.size());
+
+ for (IntermediateResultPartition partition : partitions) {
+ PartitionDescriptor partitionDescriptor =
PartitionDescriptor.from(partition);
+ int maxParallelism =
getPartitionMaxParallelism(partition);
+ partitionRegistrations.add(
+ vertex
Review comment:
maybe define a local variable shuffle master before loop to avoid this part
many layers
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services