[improve][broker] Pin executor to managed ledger instance to cache the string hashing
Motivation
In many operations we're hashing on the managed ledger name to ensure all the callbacks are triggered from same thread. Instead of hashing the string each, let's pin the thread and always use the same, for a given managed ledger instance.
This will avoid the hashing overhead.
Tests in https://github.com/merlimat/pulsar/pull/3
- [ ]
doc - [ ]
doc-required - [X]
doc-not-needed - [ ]
doc-complete
@merlimat Please add the following content to your PR description and select a checkbox:
- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
Codecov Report
Merging #18078 (66fc80a) into master (cee697b) will decrease coverage by
0.49%. The diff coverage is19.42%.
@@ Coverage Diff @@
## master #18078 +/- ##
============================================
- Coverage 47.06% 46.56% -0.50%
- Complexity 8956 10342 +1386
============================================
Files 592 698 +106
Lines 56313 68326 +12013
Branches 5844 7332 +1488
============================================
+ Hits 26503 31817 +5314
- Misses 26946 32886 +5940
- Partials 2864 3623 +759
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 46.56% <19.42%> (-0.50%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...apache/bookkeeper/mledger/ManagedLedgerConfig.java | 71.60% <0.00%> (ø) |
|
| .../org/apache/bookkeeper/mledger/impl/MetaStore.java | 100.00% <ø> (ø) |
|
| ...okkeeper/mledger/impl/ShadowManagedLedgerImpl.java | 0.00% <0.00%> (ø) |
|
| ...kkeeper/mledger/impl/cache/EntryCacheDisabled.java | 10.86% <0.00%> (ø) |
|
| ...ava/org/apache/pulsar/broker/service/Consumer.java | 70.28% <0.00%> (+8.18%) |
:arrow_up: |
| ...ker/stats/prometheus/NamespaceStatsAggregator.java | 0.00% <0.00%> (ø) |
|
| ...va/org/apache/pulsar/client/impl/ProducerImpl.java | 17.00% <0.00%> (-0.02%) |
:arrow_down: |
| ...rg/apache/pulsar/broker/service/BrokerService.java | 57.50% <20.00%> (+0.31%) |
:arrow_up: |
| ...sar/broker/service/persistent/PersistentTopic.java | 61.12% <20.00%> (-1.16%) |
:arrow_down: |
| ...ava/org/apache/pulsar/broker/service/Producer.java | 61.75% <27.27%> (-2.15%) |
:arrow_down: |
| ... and 191 more |
/pulsarbot rerun-failure-checks
/pulsarbot rerun-failure-checks