zhuzhurk commented on a change in pull request #7255: [FLINK-10945] Use
InputDependencyConstraint to avoid resource dead…
URL: https://github.com/apache/flink/pull/7255#discussion_r240655589
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ExecutionVertex.java
##########
@@ -726,6 +728,56 @@ void sendPartitionInfos() {
}
}
+ /**
+ * Check whether the InputDependencyConstraint is satisfied for this
vertex.
+ *
+ * @return whether the input constraint is satisfied
+ */
+ public boolean checkInputDependencyConstraints() {
Review comment:
Thanks for the suggestion. I made it more concise, but a bit different from
your sample code:
For PIPELINED input consumable check, only the partitions related with the
input edges are checked.
I'm not sure why you think the behavior is changed?
I'd agree if you have concerns that this check could be heavy(O(N)
complexity)) for large parallelism vertex. So I'm considering whether to add a
short cut check for `InputDependencyConstraint.ANY` in
`Execution.scheduleOrUpdateConsumers`, i.e. change `if
(consumerVertex.checkInputDependencyConstraints()) ` to `if
(getVertex().getExecutionGraph().getInputDependencyConstraint() ==
InputDependencyConstraint.ANY ||
consumerVertex.checkInputDependencyConstraints())`. It's not elegant but can be
as efficient as current scheduling.
The input state is not used in EAGER scheduling. So the
InputDependencyConstraint is not a matter in EAGER mode. It is used in
scheduleOrUpdateConsumers, which is only invoked in LAZY_FROM_SOURCES
scheduling.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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