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/26 11:53:36 UTC

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

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


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -2839,4 +2845,10 @@ public int getMetadataStoreOperationTimeoutSeconds() {
     public int getMetadataStoreCacheExpirySeconds() {
         return zooKeeperCacheExpirySeconds > 0 ? zooKeeperCacheExpirySeconds : metadataStoreCacheExpirySeconds;
     }
+
+    public long getManagedLedgerCacheEvictionIntervalMs() {
+        return managedLedgerCacheEvictionFrequency > 0
+                ? (long) (1000 / Math.max(Math.min(managedLedgerCacheEvictionFrequency, 1000.0), 0.001))
+                : Math.min(1000000, managedLedgerCacheEvictionIntervalMs);

Review Comment:
   the min value of managedLedgerCacheEvictionFrequency is  0.001 time per second, 
   ```
   double evictionFrequency = Math.max(Math.min(config.getCacheEvictionFrequency(), 1000.0), 0.001);
   ```
   So, it's 1000,000 if we transfer to 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