Pomelongan opened a new pull request, #18205: URL: https://github.com/apache/pulsar/pull/18205
### Motivation In `org.apache.bookkeeper.mledger.impl.ManagedCursorImpl`, if `config.isDeletionAtBatchIndexLevelEnabled()` is equal to true, the field `batchDeletedIndexes` will not be null. see line 299,301 https://github.com/apache/pulsar/blob/6cc30c93a05bb16b7ef62ffebc15ceb5e6efb502/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java#L291-L302 so judging `config.isDeletionAtBatchIndexLevelEnabled()` is equal to true can determine that `batchDeletedIndexes` is not null. However, many logics judge whether `batchDeletedIndexes` is not null when `config.isDeletionAtBatchIndexLevelEnabled()` is equal to true, which is redundant. see line 569,1230 https://github.com/apache/pulsar/blob/6cc30c93a05bb16b7ef62ffebc15ceb5e6efb502/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java#L569-L572 https://github.com/apache/pulsar/blob/6cc30c93a05bb16b7ef62ffebc15ceb5e6efb502/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedCursorImpl.java#L1230-L1238 ### Modifications When `config.isDeletionAtBatchIndexLevelEnabled()` is equal to true, it is no longer judged whether `batchDeletedIndexes` is not null. ### Verifying this change - [x] Make sure that the change passes the CI checks. 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* - [ ] Dependencies (add or upgrade a dependency) - [ ] The public API - [ ] The schema - [ ] The default values of configurations - [ ] The binary protocol - [ ] The REST endpoints - [ ] The admin CLI options - [ ] Anything that affects deployment ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> ### Matching PR in forked repository PR in forked repository: https://github.com/Pomelongan/pulsar/pull/10 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
