mattisonchao commented on code in PR #14488:
URL: https://github.com/apache/pulsar/pull/14488#discussion_r930720568
##########
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:
@aloyszhang making the `1000000` to be static and adding comments is
better.
Also, works with other numbers such as `1000` and `0.0.1`.
##########
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:
@aloyszhang Maybe making the `1000000` to be static and adding comments is
better.
Also, works with other numbers such as `1000` and `0.0.1`.
--
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]