Skip to content

Commit

Permalink
[FLINK-12628][Runtime / Coordination] Check test failure if partition…
Browse files Browse the repository at this point in the history
… has no consumers in Execution.getPartitionMaxParallelism
  • Loading branch information
liyafan82 committed Jul 1, 2019
1 parent 9effbab commit df457a4
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -668,18 +668,14 @@ static CompletableFuture<Map<IntermediateResultPartitionID, ResultPartitionDeplo
}

private static int getPartitionMaxParallelism(IntermediateResultPartition partition) {
// TODO consumers.isEmpty() only exists for test, currently there has to be exactly one consumer in real jobs!
final List<List<ExecutionEdge>> consumers = partition.getConsumers();
int maxParallelism = KeyGroupRangeAssignment.UPPER_BOUND_MAX_PARALLELISM;
if (!consumers.isEmpty()) {
List<ExecutionEdge> consumer = consumers.get(0);
ExecutionJobVertex consumerVertex = consumer.get(0).getTarget().getJobVertex();
maxParallelism = consumerVertex.getMaxParallelism();
}
List<ExecutionEdge> consumer = consumers.get(0);
ExecutionJobVertex consumerVertex = consumer.get(0).getTarget().getJobVertex();
int maxParallelism = consumerVertex.getMaxParallelism();
return maxParallelism;
}

/**
/**NettyMessageSerializationTest
* Deploys the execution to the previously assigned resource.
*
* @throws JobException if the execution cannot be deployed to the assigned resource
Expand Down

0 comments on commit df457a4

Please sign in to comment.