tillrohrmann commented on a change in pull request #17485:
URL: https://github.com/apache/flink/pull/17485#discussion_r791726361



##########
File path: 
flink-kubernetes/src/test/java/org/apache/flink/kubernetes/highavailability/KubernetesHighAvailabilityRecoverFromSavepointITCase.java
##########
@@ -248,5 +229,24 @@ public void run(SourceContext<Integer> ctx) throws 
Exception {
         public void cancel() {
             running = false;
         }
+
+        @Override
+        public void snapshotState(FunctionSnapshotContext context) throws 
Exception {}
+
+        @Override
+        public void initializeState(FunctionInitializationContext context) 
throws Exception {
+            final ListState<Integer> hasExecutedBeforeState =
+                    context.getOperatorStateStore()
+                            
.getUnionListState(hasExecutedBeforeStateDescriptor);
+
+            // if we have state, then we resume from a savepoint --> stop the 
execution then
+            if (hasExecutedBeforeState.get().iterator().hasNext()) {
+                running = false;
+            }
+
+            hasExecutedBeforeState.clear();

Review comment:
       It is to have a clean state into which we insert the subtask index.




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