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-27767][sql-gateway] Introduce Endpoint API and utils #19849

Merged
merged 6 commits into from
Jul 7, 2022

Conversation

fsk119
Copy link
Member

@fsk119 fsk119 commented May 31, 2022

What is the purpose of the change

Introdue Endpoint API and utils to create endpoint.

Brief change log

  • Introduce the Endpoint API
  • Introduce the Factory to create the endpoint
  • Introduce the FactoryUtils to find the EndpointFactory.

Verifying this change

This change added tests and can be verified as follows:

  • Added tests to create the Mocked endpoint.
  • Added negative tests to create the endpoint.

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 May 31, 2022

CI report:

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

import static org.junit.jupiter.api.Assertions.assertThrows;

/** Test for {@link SessionManager}. */
public class SessionManagerTest {
Copy link
Member

Choose a reason for hiding this comment

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

A small suggestion: I think we should now use Junit5 and assertj in newly introduced tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for your suggestions. I use Junit5 in the current implementation.

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.

I just left some minor comments. Others looks good.

SqlGatewayEndpointFactory.class,
identifier);
Configuration endpointConfig =
new DelegatingConfiguration(
Copy link
Member

Choose a reason for hiding this comment

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

Shall we need to delegate all configurations with the endpoint prefix? This disallows the endpoint to access session configurations, such as options in SqlGatewayServiceConfigOptions which might be helpful in some cases.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. Currently we have getFlinkConfiguration and getEndpointOptionsnow. Users are able to get SqlGatewayService config from getFlinkConfiguration.

Comment on lines 130 to 145
public ReadableConfig getConfiguration() {
return configuration;
}

@Override
public Map<String, String> getOptions() {
return configuration.toMap();
}
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a design flaw that if getConfiguration and getOptions are equivalent, then why do we need to provide both of them?

In DynamicTableFactory, the configuration represents the configs of the session, and options represent the table WITH options. I think we can change the methods to getFlinkConfiguration() and getEndpointOptions() to make it clear.

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.

@fsk119
Copy link
Member Author

fsk119 commented Jul 6, 2022

@flinkbot run azure

@fsk119
Copy link
Member Author

fsk119 commented Jul 6, 2022

@flinkbot run azure

@fsk119 fsk119 merged commit eb39530 into apache:master Jul 7, 2022
ericccarlson pushed a commit to ericccarlson/flink that referenced this pull request Jul 11, 2022
liujiawinds pushed a commit to liujiawinds/flink that referenced this pull request Jul 22, 2022
huangxiaofeng10047 pushed a commit to huangxiaofeng10047/flink that referenced this pull request Nov 3, 2022
@fsk119 fsk119 deleted the endpoint-api branch March 8, 2023 01:23
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