Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-35125][state] Implement ValueState for ForStStateBackend #24671

Closed
wants to merge 2 commits into from

Conversation

ljz2051
Copy link
Contributor

@ljz2051 ljz2051 commented Apr 16, 2024

What is the purpose of the change

This pull request implements the ValueState for ForStStateBackend.

Brief change log

  • Define the InternalSyncState interfaces in flink-runtime layer
  • Implement ForStValueState

Verifying this change

This change added tests and can be verified by ForStValueStateTest.

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

@flinkbot
Copy link
Collaborator

flinkbot commented Apr 16, 2024

CI report:

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

Copy link
Contributor

@fredia fredia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ljz2051 Thanks for the PR, I left some comments, PTAL

* @param <K> Type of the key in the state.
*/
@Internal
public interface InternalSyncState<K> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SyncState is a little bit strange, I'm not sure if InternalUnderlyingState would be better, maybe we can seek other people’s opinions.

*
* @return True if supported, false if not.
*/
default boolean isSupportMultiGet() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, InternalSyncState is a high-level base interface for different state backend, isSupportMultiGet() seems to be bound to a specific implementation. I think supportBatchGet/supportBatchPut may be better, WDYT?


protected final WriteOptions writeOptions;

protected final TypeSerializer<K> keySerializer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IsnamespaceSerializer needed here?


protected final TypeSerializer<V> valueSerializer;

private final ThreadLocal<SerializedCompositeKeyBuilder<K>> serializedKeyBuilder;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will serializedKeyBuilder be accessed concurrently? How about adding some comments about ThreadLocal?

@ljz2051 ljz2051 closed this Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants