ivankelly commented on a change in pull request #2602: ManagedLedger should
share BK worker pool threads
URL: https://github.com/apache/incubator-pulsar/pull/2602#discussion_r219433843
##########
File path:
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
##########
@@ -126,10 +127,18 @@ private ManagedLedgerFactoryImpl(BookKeeper bookKeeper,
boolean isBookkeeperMana
.numThreads(config.getNumManagedLedgerSchedulerThreads())
.name("bookkeeper-ml-scheduler")
.build();
- orderedExecutor = OrderedExecutor.newBuilder()
- .numThreads(config.getNumManagedLedgerWorkerThreads())
- .name("bookkeeper-ml-workers")
- .build();
+
+ if (bookKeeper.getMainWorkerPool() != null) {
Review comment:
This is a public interface, but not a good one. And ownership is all messed
up.
Does this even give a real performance benefit? The managed ledger selects
the thread based on ml name, the ledger by the ledger id. There's no guarantee
these will be the same. A better approach would be to allow the managed ledger
to pass in its executor to the ledger on creation.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services