Thesharing commented on a change in pull request #18218:
URL: https://github.com/apache/flink/pull/18218#discussion_r776424382
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/EdgeManager.java
##########
@@ -50,14 +50,11 @@ public void connectPartitionWithConsumerVertexGroup(
checkNotNull(consumerVertexGroup);
- final List<ConsumerVertexGroup> consumers =
- getConsumerVertexGroupsForPartitionInternal(resultPartitionId);
-
- // sanity check
checkState(
- consumers.isEmpty(), "Currently there has to be exactly one
consumer in real jobs");
+ getConsumerVertexGroupForPartition(resultPartitionId) == null,
+ "Currently one partition can have at most one consumer group");
- consumers.add(consumerVertexGroup);
+ partitionConsumers.put(resultPartitionId, consumerVertexGroup);
Review comment:
I'm wondering whether
`checkState(partitionConsumers.putIfAbsent(resultPartitionId) == null,
"Currently one partition can have at most one consumer group");` is better here?
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/IntermediateResultPartition.java
##########
@@ -69,8 +71,8 @@ public ResultPartitionType getResultType() {
return totalResult.getResultType();
}
- public List<ConsumerVertexGroup> getConsumerVertexGroups() {
- return
getEdgeManager().getConsumerVertexGroupsForPartition(partitionId);
+ public ConsumerVertexGroup getConsumerVertexGroup() {
+ return
checkNotNull(getEdgeManager().getConsumerVertexGroupForPartition(partitionId));
Review comment:
I'm wondering if there is any case that an IntermediateResultPartition
has no consumers?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]