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 2022/07/20 07:59:56 UTC

[GitHub] [pulsar] BewareMyPower commented on a diff in pull request #14488: refactor ManagedLedger cacheEvictionTask implement

BewareMyPower commented on code in PR #14488:
URL: https://github.com/apache/pulsar/pull/14488#discussion_r925283084


##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java:
##########
@@ -203,8 +202,14 @@ private ManagedLedgerFactoryImpl(MetadataStoreExtended metadataStore,
         this.cacheEvictionTimeThresholdNanos = TimeUnit.MILLISECONDS
                 .toNanos(config.getCacheEvictionTimeThresholdMillis());
 
-
-        cacheEvictionExecutor.execute(this::cacheEvictionTask);

Review Comment:
   After this change, the `cacheEvictionTask` method is never used anymore, we should remove it.



##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/ManagedLedgerFactoryConfig.java:
##########
@@ -44,9 +44,16 @@ public class ManagedLedgerFactoryConfig {
 
     /**
      * Frequency of cache eviction triggering. Default is 100 times per second.
+     * @Deprecated Use {@link #cacheEvictionIntervalMs} instead.
      */
+    @Deprecated
     private double cacheEvictionFrequency = 100;
 

Review Comment:
   I think this config should be removed rather than deprecated. Because it's never used and this config cannot be configured directly by user.
   
   If you have concern about the usage from other library, I think you can add a getter like:
   
   ```java
       @Deprecated
       private double cacheEvictionFrequency = 0;
   
       public long getCacheEvictionIntervalMs() {
           return (cacheEvictionFrequency <= 0) ? cacheEvictionIntervalMs : /* ... */;
       }
   ```



-- 
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-unsubscribe@pulsar.apache.org

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