metaswirl commented on a change in pull request #18689:
URL: https://github.com/apache/flink/pull/18689#discussion_r803748090



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/DefaultExecutionGraph.java
##########
@@ -1576,4 +1576,15 @@ public ExecutionDeploymentListener 
getExecutionDeploymentListener() {
     public boolean isDynamic() {
         return isDynamic;
     }
+
+    @Override
+    public Optional<ExecutionVertexID> getExecutionVertexId(ExecutionAttemptID 
id) {
+        Execution execution = this.getRegisteredExecutions().get(id);
+        return 
Optional.ofNullable(execution).map(Execution::getVertex).map(ExecutionVertex::getID);
+    }
+
+    @Override
+    public Optional<ExecutionVertex> getExecutionVertex(final 
ExecutionVertexID executionVertexId) {

Review comment:
       The question is how we want to react, when there is no ExecutionVertex? 
Is this an error case? (It appears at least in the tests.) If it's not an error 
case, do we want to throw an exception here and then catch it and make it an 
Optional  at a later point? Sounds rather complicated. I rather have an 
Optional to start with.
   
   Also, the method `getExecutionVertexOrThrow` is part of 
`InternalExecutionGraphAccessor`. It is not accessible from `ExecutionGraph`. 
(We can of course create a copy of it in the ExecutionGraph.)




-- 
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]


Reply via email to