lordcheng10 commented on a change in pull request #13679:
URL: https://github.com/apache/pulsar/pull/13679#discussion_r825446758



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
##########
@@ -2132,6 +2133,35 @@ private void updateConfigurationAndRegisterListeners() {
                 }
             });
         });
+
+        //  add listener to notify broker managedLedgerCacheSizeMB dynamic 
config
+        registerConfigurationListener("managedLedgerCacheSizeMB", 
(managedLedgerCacheSizeMB) -> {
+            ManagedLedgerFactoryImpl managedLedgerFactory =
+                    (ManagedLedgerFactoryImpl) 
pulsar().getManagedLedgerFactory();
+            long maxSize = (long) managedLedgerCacheSizeMB * 1024L * 1024L;
+
+            updateCacheSizeAndThreshold(maxSize);
+        });
+
+        //  add listener to notify broker managedLedgerCacheEvictionWatermark 
dynamic config
+        registerConfigurationListener(
+                "managedLedgerCacheEvictionWatermark", 
(cacheEvictionWatermark) -> {
+            ManagedLedgerFactoryImpl managedLedgerFactory =
+                    (ManagedLedgerFactoryImpl) 
pulsar().getManagedLedgerFactory();
+            managedLedgerFactory.getEntryCacheManager()
+                    .setCacheEvictionWatermark((double) 
cacheEvictionWatermark);
+        });
+
+        //  add listener to notify broker 
managedLedgerCacheEvictionTimeThresholdMillis dynamic config
+        registerConfigurationListener(
+                "managedLedgerCacheEvictionTimeThresholdMillis", 
(cacheEvictionTimeThresholdNanos) -> {

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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to