Skip to content

Conversation

Airblader
Copy link
Contributor

What is the purpose of the change

This introduces Module#getTableSourceFactory and Module#getTableSinkFactory, which allow providing a corresponding factory when sources/sinks are created. The precedence is as follows:

  1. Factory defined by the catalog
  2. Factory defined by the module
  3. Factory discovery

It may seem more appropriate to give modules the higher precedence, but in practice it's more useful to prefer the specificity of the catalog and have the module act as a fallback (that can override the discovery process fallback).

The changes in FactoryUtil have been kept backwards-compatible, but the old methods have been deprecated.

Brief change log

  • Provide ModuleManager in FlinkContext
  • Introduce the new APIs.

Verifying this change

(Please pick either of the following options)

Compatibility is covered through existing tests. A new ModuleITCase has been added to verify the new module APIs.

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): yes
  • 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? JavaDocs

*/
public static DynamicTableSource createTableSource(
@Nullable Catalog catalog,
public static DynamicTableSource createSource(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I shortened the name here because simply adding an overload (replacing the first argument) would be a breaking change when null is passed (as it would cause an ambiguity).

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we name it createDynamicTableSource instead? Source sounds like the core Source abstraction.

@flinkbot
Copy link
Collaborator

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 607bc15 (Wed Sep 29 12:23:54 UTC 2021)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.


The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Sep 29, 2021

CI report:

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

@Airblader Airblader marked this pull request as ready for review September 30, 2021 05:49
Copy link
Contributor

@twalthr twalthr left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @Airblader. I added some comments. Please also update each commit message with a component tag that the commit mostly touches.

*/
public static DynamicTableSource createTableSource(
@Nullable Catalog catalog,
public static DynamicTableSource createSource(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we name it createDynamicTableSource instead? Source sounds like the core Source abstraction.

Copy link
Contributor

@twalthr twalthr left a comment

Choose a reason for hiding this comment

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

More comments ;-)

Copy link
Contributor

@twalthr twalthr left a comment

Choose a reason for hiding this comment

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

LGTM, I had one last minor thing but can do this while merging once the build is green.

boolean upsertMaterialize) {
final DynamicTableSink tableSink = tableSinkSpec.getTableSink();
final DynamicTableSink tableSink = tableSinkSpec.getTableSink(planner);
final ChangelogMode inputChangelogMode = tableSink.getChangelogMode(changelogMode);
Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, but I still fine this confusing. Shouldn't this variable be called changelogMode and the member inputChangelogMode

twalthr pushed a commit to twalthr/flink that referenced this pull request Oct 1, 2021
@twalthr twalthr closed this in aa51c8f Oct 1, 2021
@Airblader Airblader deleted the FLINK-24388 branch October 25, 2021 18:39
niklassemmler pushed a commit to niklassemmler/flink that referenced this pull request Feb 3, 2022
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.

4 participants