You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/04/23 23:30:26 UTC

[GitHub] [pulsar] merlimat commented on a change in pull request #4066: Allow to configure the managed ledger cache eviction frequency

merlimat commented on a change in pull request #4066: Allow to configure the managed ledger cache eviction frequency
URL: https://github.com/apache/pulsar/pull/4066#discussion_r277909381
 
 

 ##########
 File path: managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java
 ##########
 @@ -147,15 +151,34 @@ private synchronized void refreshStats() {
 
         mbean.refreshStats(period, TimeUnit.NANOSECONDS);
         ledgers.values().forEach(mlfuture -> {
-            ManagedLedgerImpl ml = mlfuture.getNow(null);
-            if (ml != null) {
-                ml.mbean.refreshStats(period, TimeUnit.NANOSECONDS);
+            if (mlfuture.isDone() && !mlfuture.isCompletedExceptionally()) {
+                ManagedLedgerImpl ml = mlfuture.getNow(null);
+                if (ml != null) {
+                    ml.mbean.refreshStats(period, TimeUnit.NANOSECONDS);
+                }
             }
         });
 
         lastStatTimestamp = now;
     }
 
+    private synchronized void cacheEviction() {
+        long now = System.nanoTime();
+        long period = now - lastCacheEvictionTimestamp;
+        long maxTimestamp = now - period;
 
 Review comment:
   Fixed

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services