poorbarcode commented on code in PR #16931:
URL: https://github.com/apache/pulsar/pull/16931#discussion_r1000839228
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java:
##########
@@ -420,7 +420,29 @@ public void closeFailed(ManagedLedgerException exception,
Object ctx) {
});
}
+ @Override
+ public void asyncOpenReadOnlyManagedLedger(String managedLedgerName,
Review Comment:
Can we write this method like this( Remove the new class `AsyncCallbacks
.OpenReadOnlyManagedLedgerCallback` )?
```
@Override
public CompletableFuture<ReadOnlyManagedLedgerImpl>
asyncOpenReadOnlyManagedLedger(String managedLedgerName,
ManagedLedgerConfig config, Object ctx) {
if (closed) {
return FutureUtil.failedFuture(new
ManagedLedgerException.ManagedLedgerFactoryClosedException());
}
ReadOnlyManagedLedgerImpl roManagedLedger = new
ReadOnlyManagedLedgerImpl(this,
bookkeeperFactory
.get(new
EnsemblePlacementPolicyConfig(config.getBookKeeperEnsemblePlacementPolicyClassName(),
config.getBookKeeperEnsemblePlacementPolicyProperties())),
store, config, scheduledExecutor, managedLedgerName);
return roManagedLedger.initialize().thenApply(ignore -> roManagedLedger);
}
```
--
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]