[improve][txn]Clean up redundant logic in transaction client#19345
Merged
Technoboy- merged 1 commit intoapache:masterfrom Jan 29, 2023
liangyepianzhou:xiangying/txn/op/clientCleanUp-1
Merged
[improve][txn]Clean up redundant logic in transaction client#19345Technoboy- merged 1 commit intoapache:masterfrom liangyepianzhou:xiangying/txn/op/clientCleanUp-1
Technoboy- merged 1 commit intoapache:masterfrom
liangyepianzhou:xiangying/txn/op/clientCleanUp-1
Conversation
### Motivation The parameter 'i' passed to 'getTCAssignTopicName' cannot be lower than 0. Therefore, the method "getTCAssignTopicName" does not need to consider the `partition` < 0. https://github.com/apache/pulsar/blob/ad8d2dfc261b54551d657092165a5b6803b6f4d4/pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/TransactionCoordinatorClientImpl.java#L88-L108 https://github.com/apache/pulsar/blob/ad8d2dfc261b54551d657092165a5b6803b6f4d4/pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/TransactionCoordinatorClientImpl.java#L115-L122
Technoboy-
approved these changes
Jan 29, 2023
...rc/main/java/org/apache/pulsar/client/impl/transaction/TransactionCoordinatorClientImpl.java
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #19345 +/- ##
=============================================
+ Coverage 32.45% 62.52% +30.06%
- Complexity 6348 25428 +19080
=============================================
Files 1644 1818 +174
Lines 123737 133107 +9370
Branches 13494 14644 +1150
=============================================
+ Hits 40162 83225 +43063
+ Misses 77654 42195 -35459
- Partials 5921 7687 +1766
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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
The parameter
ipassed togetTCAssignTopicNamecannot be lower than 0.Therefore, the method
getTCAssignTopicNamedoes not need to consider thepartition< 0.pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/TransactionCoordinatorClientImpl.java
Lines 88 to 108 in ad8d2df
pulsar/pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/TransactionCoordinatorClientImpl.java
Lines 115 to 122 in ad8d2df
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
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-complete