da-daken commented on code in PR #1024:
URL: https://github.com/apache/flink-agents/pull/1024#discussion_r3827876325
##########
runtime/src/main/java/org/apache/flink/agents/runtime/actionstate/ActionStateUtil.java:
##########
@@ -62,6 +68,25 @@ public static List<String> parseKey(String key) {
return List.of(parts);
}
+ /**
+ * Returns {@code true} if the composite {@code stateKey}'s business key
should be retained in a
+ * subtask's in-memory cache under the given ownership filter. A {@code
null} filter retains
+ * every key (the default for in-memory and test backends). If the key
cannot be parsed, it is
+ * retained as a fail-safe: prefer keeping a valid key over dropping it on
a parse error.
+ */
+ public static boolean isKeyRetained(
+ @Nullable Predicate<String> ownershipFilter, String stateKey) {
+ if (ownershipFilter == null) {
+ return true;
+ }
+ try {
+ return ownershipFilter.test(parseKey(stateKey).get(0));
Review Comment:
I think it can be kept. To avoid re‑running, the subsequent GET path will
also need to be compatible with the 4‑segment key. I'm not sure if adding a
fallback logic in the code is acceptable.
--
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]