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-17587][filesystem] Filesystem streaming sink support commit success file #12062

Merged
merged 2 commits into from May 16, 2020

Conversation

JingsongLi
Copy link
Contributor

What is the purpose of the change

Committing a partition is to notify the downstream application that the partition has finished writing, the partition is ready to be read.
Add “.succes” file to directory (success file name is configurable too)

Brief change log

Verifying this change

StreamFileSystemTestCsvITCase

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): no
  • 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/Mesos, 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

@flinkbot
Copy link
Collaborator

flinkbot commented May 11, 2020

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 e0a38b8 (Fri Oct 16 10:31:47 UTC 2020)

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 May 11, 2020

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

Copy link
Contributor

@lirui-apache lirui-apache left a comment

Choose a reason for hiding this comment

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

@JingsongLi Thanks for the great efforts. I have left some comments.

}

@Override
public void close() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible that there's some pending data between close and the last notifyCheckpointComplete?

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'll modify to endInput and support commit pending data.

@JingsongLi JingsongLi force-pushed the successFile branch 2 times, most recently from 7c0c835 to e7040a4 Compare May 12, 2020 10:10
*
* <p>See {@link StreamingFileCommitter}.
*/
public class StreamingFileWriter extends AbstractStreamOperator<CommitMessage> implements
Copy link
Contributor

Choose a reason for hiding this comment

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

This class is copy pasting quite a bit of code/fields from StreamingFileSink. Can not we extract a common abstraction or re-use one in the another?

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've discussed with @gaoyunhaii offline, mainly because feel that there is too little code, so don't reuse it.
But +1 for abstraction. I've extracted a helper from StreamingFileSink. See
36fa3d2

@JingsongLi JingsongLi force-pushed the successFile branch 5 times, most recently from 0d278fa to e2b2ede Compare May 14, 2020 12:19
Copy link
Contributor

@lirui-apache lirui-apache left a comment

Choose a reason for hiding this comment

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

Thanks @JingsongLi for the update. Left some minor comments.

" 'partition-time': extract time from partition," +
" if 'watermark' > 'partition-time' + 'delay', will commit the partition." +
" 'process-time': use processing time, if 'current processing time' > " +
"'partition creation time' + 'delay', will commit the partition.");
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should explain how "partition creation time" is determined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"partition directory creation time"

key("sink.partition-commit.policy.class")
.stringType()
.noDefaultValue()
.withDescription("The partition commit policy class for implement PartitionCommitPolicy interface.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this only work custom commit policy? If so it should be mentioned in the description and reflected in the config name.

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 will add comment, it is OK, has been mentioned in policy kind.

/**
* Policy for commit a partition.
*
* <p>The implemented commit method needs to be reentrant because the same partition may be
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
* <p>The implemented commit method needs to be reentrant because the same partition may be
* <p>The implemented commit method needs to be idempotent because the same partition may be

.withDescription("Policy to commit a partition is to notify the downstream" +
" application that the partition has finished writing, the partition" +
" is ready to be read." +
" metastore: add partition to metastore." +
Copy link
Contributor

Choose a reason for hiding this comment

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

If users choose metastore policy, don't they need to specify/provide a TableMetaStoreFactory implementation?

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 will add comment: Only work with hive table, it is empty implementation for file system table.

Copy link
Contributor

@lirui-apache lirui-apache left a comment

Choose a reason for hiding this comment

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

LGTM

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