autophagy opened a new pull request, #28296: URL: https://github.com/apache/flink/pull/28296
## What is the purpose of the change Currently, the PTF harness supports state in partitioned PTFs, but ignores state TTL annotations and has no mechanism for simulating the passage of time and the expiration of state entries. This PR adds support for handling state ttl annotations, tracking timestamped mutations to the state based on the harness' internal clock, and adds `advanceSystemClock` methods for advancing system time and triggering state eviction mechanisms. For value state, the mutation tracking works by comparing the object before its passed into the eval, and afterwards. For Map and List view state, I've added TTL aware versions of these views that track the per-element timestamps (backed by timestamp aware implementations of list and map). This forced a change to how the Map/List views were being stored using the internal/external serialisers. Before, the whole map/list was stored in an internal data format, but this would vaporise any internal timestamps attached to the entries. Instead, each element in the list view and each key/value pair in the map view are stored in an internal format (since these are what we really care about validating, we know that List/Map view serialises fine). ## Brief change log - Added State TTL tracking and eviction support to `ProcessTableFunctionTestHarness` ## Verifying this change Please make sure both new and modified tests in this PR follow [the conventions for tests defined in our code quality guide](https://flink.apache.org/how-to-contribute/code-style-and-quality-common/#7-testing). This change added tests and can be verified as follows: - Added new State TTL focused tests in `ProcessTableFunctionTestHarnessTest`. ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): (no) - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no) - The serializers: (no) - The runtime per-record code paths (performance sensitive): (no) - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no) - The S3 file system connector: (no) ## Documentation - Does this pull request introduce a new feature? (yes) - If yes, how is the feature documented? (docs) --- ##### Was generative AI tooling used to co-author this PR? <!-- If generative AI tooling has been used in the process of authoring this PR, please change the checkbox below to `[X]` followed by the name of the tool, and uncomment the "Generated-by" line. See the ASF Generative Tooling Guidance for details: https://www.apache.org/legal/generative-tooling.html You are responsible for the quality and correctness of every change in this PR regardless of the tooling used. Low-effort AI-generated PRs will be closed. See AGENTS.md for the full guidance. --> - [x] Yes (please specify the tool below) 2.1.156 (Claude Code) -- 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]
