Sxnan commented on code in PR #138:
URL: https://github.com/apache/flink-agents/pull/138#discussion_r2357313522
##########
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:
Could we use the value state here? It can reduce the complexity of the code.
```java
sequenceNumberKState = getRuntimeContext().getState(new
ValueStateDescriptor<>(RECOVERY_MARKER_STATE_NAME, Long.class))
```
--
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]