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-24741]Deprecate FileRecordFormat #17656

Merged
merged 1 commit into from
Nov 11, 2021

Conversation

JingGe
Copy link
Contributor

@JingGe JingGe commented Nov 3, 2021

What is the purpose of the change

The FileRecordFormat and StreamFormat have too much commons. This makes user confused. The main motivation for removing it is the inherent design flaw in the batching of FileRecordFormat: StreamFormat can guarantee that only a certain amount of memory is being used (unless a single record exceeds that already), but FileRecordFormat can only batch by the number of records. By removing FileRecordFormat, we relay the responsibility of implementing the batching to the format developer; they need to use BulkFormat and find a better way than batch by number of records.

Brief change log

  • marked FileRecordFormat and FileRecordFormatAdapter as @deprecated.
  • refactored the relevant usages.
  • updated javadoc.

Verifying this change

This change only marked some classes as deprecated and update relevant comments without any test coverage.

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)

@JingGe JingGe force-pushed the FLINK-24741-FileRecordFormat branch from c0f269d to 81def1e Compare November 3, 2021 08:37
@flinkbot
Copy link
Collaborator

flinkbot commented Nov 3, 2021

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 377613c (Wed Nov 03 08:38:35 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 Nov 3, 2021

CI report:

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

@JingGe JingGe changed the title [FLINK-24741][connectors/filesystem] Deprecate FileRecordFormat [FLINK-24741]Deprecate FileRecordFormat Nov 3, 2021
Copy link

@fapaul fapaul 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 working on this effort. I will definitely, help future format developers to have an easier time when trying to choose the right interface.

I agree with @slinkydeveloper that the @deprecated keyword should be used inside the docstrings.

@JingGe JingGe force-pushed the FLINK-24741-FileRecordFormat branch from dde8eab to 82a491e Compare November 8, 2021 14:04
@JingGe
Copy link
Contributor Author

JingGe commented Nov 8, 2021

fixed all issues, @AHeise would you please help merging the PR, thanks.

Copy link

@fapaul fapaul 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 changes the code looks good to me now, only one nitty suggestion.

/**
* The FormatReaderAdapter turns a {@link FileRecordFormat} into a {@link BulkFormat}.
*
* @deprecated Please use {@link StreamFormatAdapter} instead.
Copy link

Choose a reason for hiding this comment

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

Nit: I guess this hint is not entirely correct because users cannot use the StreamFormatAdapter without migrating to StreamFormat. In general, I am not sure whether it is strictly necessary to deprecate internal classes.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd go for internal classes as well so that we will not forget to remove them when we remove the public class. Ofc, the link to StreamFormatAdapter is debatable but I also don't see that it's hurting anyone.

@AHeise
Copy link
Contributor

AHeise commented Nov 10, 2021

@flinkbot run azure

Copy link
Contributor

@AHeise AHeise left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@AHeise AHeise merged commit 1dac395 into apache:master Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants