codelipenghui commented on a change in pull request #11517:
URL: https://github.com/apache/pulsar/pull/11517#discussion_r689199271



##########
File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
##########
@@ -472,8 +485,107 @@ void close(ManagedLedger ledger) {
         entryCacheManager.removeEntryCache(ledger.getName());
     }
 
+    public CompletableFuture<Void> shutdownAsync() throws 
ManagedLedgerException {
+        if (closed) {
+            throw new 
ManagedLedgerException.ManagedLedgerFactoryClosedException();
+        }
+        closed = true;
+
+        statsTask.cancel(true);
+        flushCursorsTask.cancel(true);
+
+        List<CompletableFuture<Void>> futures = new ArrayList<>();

Review comment:
       ```suggestion
           List<CompletableFuture<Void>> futures = new ArrayList<>(numLedgers);
   ```




-- 
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: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to