dmvk commented on a change in pull request #18445:
URL: https://github.com/apache/flink/pull/18445#discussion_r802743707



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/StateTransitions.java
##########
@@ -0,0 +1,149 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.scheduler.adaptive;
+
+import org.apache.flink.runtime.checkpoint.CheckpointScheduling;
+import org.apache.flink.runtime.executiongraph.ArchivedExecutionGraph;
+import org.apache.flink.runtime.executiongraph.ExecutionGraph;
+import org.apache.flink.runtime.scheduler.ExecutionGraphHandler;
+import org.apache.flink.runtime.scheduler.OperatorCoordinatorHandler;
+
+import java.time.Duration;
+import java.util.concurrent.CompletableFuture;
+
+/**
+ * An interface covering all possible {@link State} transitions. The main 
purpose is to align the
+ * transition methods between different contexts.
+ */
+public interface StateTransitions {
+
+    interface ToCancelling extends StateTransitions {

Review comment:
       👍 fixed

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java
##########
@@ -271,18 +264,17 @@ public AdaptiveScheduler(
 
         this.executionGraphFactory = executionGraphFactory;
 
+        final JobStatusStore jobStatusStore = new 
JobStatusStore(initializationTimestamp);
         final Collection<JobStatusListener> tmpJobStatusListeners = new 
ArrayList<>();
         
tmpJobStatusListeners.add(Preconditions.checkNotNull(jobStatusListener));
         tmpJobStatusListeners.add(jobStatusStore);
-

Review comment:
       removed

##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/CreatingExecutionGraphTest.java
##########
@@ -227,6 +237,16 @@ public void goToWaitingForResources() {
             hadStateTransitionHappened = true;
         }
 
+        @Override
+        public Executor getIOExecutor() {
+            return MoreExecutors.directExecutor();

Review comment:
       👍 

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/StateWithExecutionGraph.java
##########
@@ -346,14 +346,6 @@ abstract boolean updateTaskExecutionState(
          *
          * @return the main thread executor
          */
-        Executor getMainThreadExecutor();
-
-        /**
-         * Transitions into the {@link Finished} state.
-         *
-         * @param archivedExecutionGraph archivedExecutionGraph which is 
passed to the {@link
-         *     Finished} state
-         */
-        void goToFinished(ArchivedExecutionGraph archivedExecutionGraph);
+        ComponentMainThreadExecutor getMainThreadExecutor();

Review comment:
       The intuition was to be able to use the method in 
`CreatingExecutionGraph`. This was necessary to unify goToExecuting methods.
   
   But you're right that `StateWithExecutionGraph` can still have more strict 
interface.

##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/StateWithExecutionGraph.java
##########
@@ -346,14 +346,6 @@ abstract boolean updateTaskExecutionState(
          *
          * @return the main thread executor
          */
-        Executor getMainThreadExecutor();
-
-        /**
-         * Transitions into the {@link Finished} state.
-         *
-         * @param archivedExecutionGraph archivedExecutionGraph which is 
passed to the {@link
-         *     Finished} state
-         */
-        void goToFinished(ArchivedExecutionGraph archivedExecutionGraph);
+        ComponentMainThreadExecutor getMainThreadExecutor();

Review comment:
       I'll revert this.




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