[improve][ml] Optimization method getNumberOfEntries
Motivation
Currently, when readPosition== lastPosition‘next, getNumberOfEntries will be entered. However, this is meaningless and may affect performance.
For example, readPosition=3:0, lastPosition=3:-1, will enter the getNumberOfEntries method
Modifications
When readPosition is greater than lastPosition, return 0 directly.
Documentation
- [ ]
doc - [ ]
doc-required - [x]
doc-not-needed - [ ]
doc-complete
/pulsarbot rerun-failure-checks
/pulsarbot rerun-failure-checks
/pulsarbot rerun-failure-checks
close & reopen to trigger CI
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 75.49%. Comparing base (
bbc6224) to head (815e3b5). Report is 794 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #23576 +/- ##
============================================
+ Coverage 73.57% 75.49% +1.91%
- Complexity 32624 37348 +4724
============================================
Files 1877 1946 +69
Lines 139502 155026 +15524
Branches 15299 17834 +2535
============================================
+ Hits 102638 117030 +14392
- Misses 28908 29383 +475
- Partials 7956 8613 +657
| Flag | Coverage Δ | |
|---|---|---|
| inttests | 27.35% <100.00%> (+2.76%) |
:arrow_up: |
| systests | 24.38% <100.00%> (+0.05%) |
:arrow_up: |
| unittests | 74.92% <100.00%> (+2.08%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| ...che/bookkeeper/mledger/impl/ManagedCursorImpl.java | 82.08% <100.00%> (+2.78%) |
:arrow_up: |
@hanmz Please rebase master branch.
reopen to trigger CI
@hanmz Please rebase master branch.
Done, please help me review again