-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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-13034] Introduce isEmpty method for MapState #9255
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 3a929e8 (Wed Dec 04 14:59:46 UTC 2019) ✅no 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 pull request @Myasuka . The flink-table side looks good to me.
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.
Changes LGTM, but could you add a micro benchmark for checking whether a map state is empty in our MapStateBenchmark and post the comparison result before and after the change here @Myasuka ? Thanks.
@carp84 thanks for your review. Actually, I have created FLINK-13846 to track this. If we want to know the improvement after introducing |
That's fine @Myasuka , just attach the patch here if anyone would like to try reproducing the result. Since this one claims to be a performance enhancement, I believe it's better to show some detailed data. |
@carp84, I have compare the new API
|
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.
The benchmark data looks good, thanks for the testing @Myasuka .
Regarding the commit, my main concern is about unit test. The existing added tests are scattered and I think it's better to add a formal test case in StateBackendTestBase.testMapState
.
What's more, since this adds a method in MapState
interface which is PublicEvolving
, we will need a release note.
flink-libraries/flink-cep/src/test/java/org/apache/flink/cep/utils/TestSharedBuffer.java
Outdated
Show resolved
Hide resolved
There have been some tests for |
I meant to add an explicit |
What's more, I think we should split the |
@flinkbot run travis |
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.
The latest change LGTM, +1.
Checked the CI build, the failure on python should be irrelative, but we still need a green build.
And don't forget about the release note. |
@flinkbot run travis |
Thanks for addressing the comments. |
@StephanEwen It seems |
ca4f7d2
to
7a533f9
Compare
Rebase with latest master branch to re-trigger new CI build. |
Failed due to FLINK-14445 @flinkbot run travis |
7a533f9
to
53539a3
Compare
It seems |
CI failed due to known issue FLINK-14370 , but the CI which triggered on my branch succeed. @StephanEwen |
What is the purpose of the change
Introduce
#isEmpty()
method forMapState
, this aims to improve the performance when we useMapState.iterator().hasNext()
to judge whether the map is empty for RocksDB.Brief change log
#isEmpty()
method forMapState
.#isEmpty()
method forMapView
.MapState.iterator().hasNext()
toMapState.isEmpty()
.Verifying this change
This change added tests and can be verified as follows:
StateBackendTestBase#testMapState()
.Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: yesDocumentation