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-28417][table] Add interfaces for LookupCache and default implementation #20196

Merged
merged 4 commits into from
Aug 3, 2022

Conversation

PatrickRen
Copy link
Contributor

What is the purpose of the change

This pull request introduces interfaces for LookupCache and CacheMetricGroup, also a default implementation of LookupCache.

Brief change log

  • Add new interfaces LookupCache and CacheMetricGroup
  • Add default implementation for LookupCache as DefaultLookupCache
  • Add an internal implementation for CacheMetricGroup as InternalCacheMetricGroup

Verifying this change

This change added unit tests for the newly added DefaultLookupCache and InternalCacheMetricGroup

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

flinkbot commented Jul 7, 2022

CI report:

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

Copy link
Member

@wuchong wuchong left a comment

Choose a reason for hiding this comment

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

Thank @PatrickRen for the contribution. I left some comments.

@PatrickRen
Copy link
Contributor Author

@wuchong Thanks for the review! I addresses your comments in the latest commit. Please take a look when you are available.

Copy link
Contributor

@SmirAlex SmirAlex left a comment

Choose a reason for hiding this comment

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

@PatrickRen, thanks for your contribution! I've left some minor comments, please check.

code(LookupCacheType.FULL.toString()))
.build());

public static final ConfigOption<Integer> MAX_RETRIES =
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better not to add this new option if we have no migration plan for existing connectors (e.g., hbase & jdbc), and it is not related with caching.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well we do plan to migrate hbase and jdbc to the new framework, so I prefer to keep this option.

1. Change serial ID to 1
2. Sanity check in constructor
3. Always register metrics in DefaultLookupCache#open
4. Change default value of max retries to 3
@PatrickRen
Copy link
Contributor Author

@wuchong @SmirAlex @lincoln-lil Thank you all for the review! I updated the PR to address your comments. Please take another look at your convenience.

2. make error message more descriptive in DefaultLookupCache.fromConfig
3. Add test for builder and fromConfig
Copy link
Member

@wuchong wuchong left a comment

Choose a reason for hiding this comment

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

LGTM.

@PatrickRen PatrickRen merged commit ed8870e into apache:master Aug 3, 2022
snuyanzin pushed a commit to snuyanzin/flink that referenced this pull request Aug 4, 2022
huangxiaofeng10047 pushed a commit to huangxiaofeng10047/flink that referenced this pull request Nov 3, 2022
morozov pushed a commit to morozov/flink that referenced this pull request Apr 26, 2024
…o enable mongodb connector to run with decodable-flink (apache#54)

* [FLINK-28417][table] Add interfaces for LookupCache and default implementation (apache#20196)

* manually add ThreadSafeSimpleCounter, which is the only missing dependency of LookupCache/DefaultLookupCache that is not in flink 1.15

---------

Co-authored-by: Qingsheng Ren <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants