rdhabalia commented on a change in pull request #13073:
URL: https://github.com/apache/pulsar/pull/13073#discussion_r761302707



##########
File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
##########
@@ -4012,4 +4018,12 @@ private void cancelScheduledTasks() {
         }
     }
 
+    private void checkInactiveLedgerAndRollOver(final long lastAddEntryTimeMs) 
{
+        long currentTimeMs = System.currentTimeMillis();
+        if (inactiveLedgerRollOverTimeMs > 0 && currentTimeMs > 
(lastAddEntryTimeMs + inactiveLedgerRollOverTimeMs)) {
+            log.info("[{}| Closing inactive ledger, last-add entry {}", name, 
lastAddEntryTimeMs);

Review comment:
       done

##########
File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
##########
@@ -705,7 +709,9 @@ public void asyncAddEntry(ByteBuf buffer, AddEntryCallback 
callback, Object ctx)
         // Jump to specific thread to avoid contention from writers writing 
from different threads
         executor.executeOrdered(name, safeRun(() -> {
             OpAddEntry addOperation = OpAddEntry.createNoRetainBuffer(this, 
buffer, callback, ctx);
+            checkInactiveLedgerAndRollOver(lastAddEntryTimeMs);

Review comment:
       done




-- 
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]


Reply via email to