Repository navigation
[improve][ml] Remove the redundant judgment logic of ManagedCursorImpl - #18205
Merged
Merged
Conversation
AnonHxy
approved these changes
Oct 26, 2022
Contributor
|
LGTM |
gaozhangmin
approved these changes
Oct 26, 2022
nodece
approved these changes
Oct 26, 2022
Member
|
@Pomelongan Could you rebase the master branch to your branch? |
Pomelongan
force-pushed
the
update_ManagedCursorImpl
branch
from
October 26, 2022 11:38
70b35e9 to
8952a5c
Compare
Contributor
Author
I have updated.PTAL @nodece |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18205 +/- ##
============================================
+ Coverage 34.91% 38.52% +3.61%
- Complexity 5707 14357 +8650
============================================
Files 607 1579 +972
Lines 53396 128708 +75312
Branches 5712 14150 +8438
============================================
+ Hits 18644 49589 +30945
- Misses 32119 73536 +41417
- Partials 2633 5583 +2950
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
codelipenghui
approved these changes
Oct 27, 2022
Technoboy-
pushed a commit
that referenced
this pull request
Oct 31, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
In
org.apache.bookkeeper.mledger.impl.ManagedCursorImpl, ifconfig.isDeletionAtBatchIndexLevelEnabled()is equal to true, the fieldbatchDeletedIndexeswill not be null. see line 299,301pulsar/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Lines 291 to 302 in 6cc30c9
so judging
config.isDeletionAtBatchIndexLevelEnabled()is equal to true can determine thatbatchDeletedIndexesis not null.However, many logics judge whether
batchDeletedIndexesis not null whenconfig.isDeletionAtBatchIndexLevelEnabled()is equal to true, which is redundant. see line 569,1230pulsar/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Lines 569 to 572 in 6cc30c9
pulsar/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java
Lines 1230 to 1238 in 6cc30c9
Modifications
When
config.isDeletionAtBatchIndexLevelEnabled()is equal to true, it is no longer judged whetherbatchDeletedIndexesis not null.Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: Pomelongan#10