letaoj commented on code in PR #138:
URL: https://github.com/apache/flink-agents/pull/138#discussion_r2357363345


##########
runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperator.java:
##########
@@ -392,6 +447,71 @@ public void close() throws Exception {
         super.close();
     }
 
+    @Override
+    public void initializeState(StateInitializationContext context) throws 
Exception {
+        super.initializeState(context);
+
+        if (actionStateStore != null) {
+            Object recoveryMarker = null;
+            ListState<Object> recoveryMarkerOpState =
+                    getOperatorStateBackend()
+                            .getListState(
+                                    new ListStateDescriptor<>(
+                                            "recoveryMarker", 
TypeInformation.of(Object.class)));
+            Iterable<Object> recoveryMarkers = recoveryMarkerOpState.get();
+            if (recoveryMarkers != null) {
+                for (Object marker : recoveryMarkers) {
+                    // there should be only one recovery marker
+                    recoveryMarker = marker;
+                    break;
+                }
+            }
+            actionStateStore.rebuildState(recoveryMarker);
+        }
+        ListState<Long> msgSequenceNumberOpState =

Review Comment:
   Yeah, I think I was having trouble to get the keyed state work when I used 
ValueState and then I switched to ListState. However, the issue isn't because 
the ValueState vs ListState, it is because I was calling the value() on the 
ValueState out of a keyed context. Updated the logic.



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