flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-35268][state] Add ttl interface for Async State API && implement TtlListStateV2/TtlValueStateV2

Open fredia opened this issue 1 year ago • 1 comments

What is the purpose of the change

  • This PR supports ttl for stateV2, which adds ttl interfaces for Async State API, and implements TtlListStateV2/TtlValueStateV2/TtlMapStateV2/TtlAggStateV2/TtlReducingStateV2.

Note: StateV2 does not support FULL_STATE_SCAN_SNAPSHOT and INCREMENTAL_CLEANUP, only ROCKSDB_COMPACTION_FILTER will be supported.

Brief change log

  • Introduce AbstractTtlStateV2 and its subclasses.
  • Wrap states of ForStKeyedStateBackend with TtlFactoryV2 when ttl enabled.
  • Adapt ForStDBTtlCompactFiltersManager to ForStKeyedStateBackend.

Verifying this change

This change added tests and can be verified as follows:

  • StateBackendTestV2Base#testValueStateWorkWithTtl

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? (no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

fredia avatar Oct 15 '24 08:10 fredia

CI report:

  • ac0a6eac2bc0678f3beaf13673591cf266ba402b Azure: SUCCESS
Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

flinkbot avatar Oct 15 '24 08:10 flinkbot

@flinkbot run azure

fredia avatar Oct 28 '24 02:10 fredia

@flinkbot run azure

fredia avatar Oct 28 '24 10:10 fredia

Thanks for the detailed review🚀, merged

fredia avatar Oct 30 '24 03:10 fredia