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-19834] Make the TestSink reusable in all the sink related tests. #13808
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 202d1f9 (Tue Oct 27 13:39:55 UTC 2020) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
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 commandsThe @flinkbot bot supports the following commands:
|
There was a problem hiding this 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! The changes look good to me. I added one commit that changes the method names of the builder. I changed most of them to setFoo()
because for me addFoo()
usually indicates that a foo is added to a growing list of foo's, but here we're really just setting one. What do you think?
|
||
testHarness.snapshot(1L, 1L); | ||
testHarness.notifyOfCompletedCheckpoint(1L); | ||
testHarness.close(); | ||
|
||
// TODO:: maybe there is no output at all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's happening here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed. The base committer class uses the output
although it is only needed by the Committer
and not the GlobalCommitter
. This does not seem to be a bug because every operator has an output but if there is no successor, the elements are simply dropped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some comments that have mainly to do with unused methods and base classes that can be made concrete. I have pushed my changes here (to make sure that I do not break anything :) ) https://github.com/kl0u/flink/tree/FLINK-19834.
Let me know what you think @guoweiM
I like the formatting in @guoweiM's code more than Klou's, I think Guowei uses the |
Thanks @kl0u. I would look at it. :-) |
This patch does three things: 1. Change the `Supplier&Function` fields to normal object fields, which makes the sink serializable easily 2. Introduce the TestSink.Builder to create the test sink object. 3. Change the TestSink from a generic class to a normal class, which make extract TypeInformation possible.
Yes @guoweiM , I think it is better to introduce a change with the commit that uses it. It is nice for commits to be self-contained so that if something goes wrong, we can easily find when and why a change was introduced. Splitting the introduction of a change from its use or its tests makes it more difficult to trace back why it was introduced and what are its implications :) |
+1 for merging from me as soon as AZP given green, but I think @aljoscha 's comments are not in the branch. |
Thanks for the work @guoweiM ! |
I merged this, but I renamed all the builder methods to |
Sorry I miss this stuff~~~~ |
What is the purpose of the change
Make the TestSink reusable in all the sink related tests.
Brief change log
Supplier&Function
fields to normal object fields, which makes the sink serializable easilyVerifying this change
This change is already covered by existing tests.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation