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

Switch to sink interfaces #38

Merged
merged 5 commits into from
Aug 21, 2023
Merged

Switch to sink interfaces #38

merged 5 commits into from
Aug 21, 2023

Conversation

snuyanzin
Copy link
Contributor

@snuyanzin snuyanzin commented Aug 11, 2023

  1. It switches to sink interfaces
  2. Also it generalises retry for both at least once and exactly once
  3. Extracts Flow control settings into BQ connector config options
  4. Extracts retry count into BQ connector option

@snuyanzin snuyanzin changed the title Switch to v2 interfaces Switch to sink interfaces Aug 11, 2023
public static final ConfigOption<Long> MAX_OUTSTANDING_REQUEST_BYTES =
ConfigOptions.key("max-outstanding-request-bytes")
.longType()
.defaultValue(100 * 1024 * 1024L)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

100Mb is a default value from BQ storage api

new EnumMap<>(LogicalTypeRoot.class);
@PublicEvolving
public class BigQuerySink implements Sink<RowData> {
protected BigQueryConnectionOptions options;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
protected BigQueryConnectionOptions options;
final protected BigQueryConnectionOptions options;

@@ -35,4 +35,28 @@ public class BigQueryConfigOptions {
.enumType(DeliveryGuarantee.class)
.defaultValue(DeliveryGuarantee.AT_LEAST_ONCE)
.withDescription("Determines delivery guarantee");

public static final ConfigOption<Long> MAX_OUTSTANDING_ELEMENTS_COUNT =
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a suggestion -- the wording "maxOutstandingElementsCount" is from the Google API, but other Flink sinks sometimes use maxInflightRequests Do you think it's worthwhile aligning to other connectors?

I have some doubts ... the semantics are pretty similar but maybe not entirely the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it's from google api since currently it is for google api

we could think about renaming once we switch to async sink Flink connector interfaces

@snuyanzin snuyanzin merged commit 559aa14 into main Aug 21, 2023
5 checks passed
@snuyanzin snuyanzin deleted the v2 branch August 21, 2023 16:09
@snuyanzin
Copy link
Contributor Author

thanks for having a look @RyanSkraba

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants