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



##########
File path: 
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/EntryCacheManager.java
##########
@@ -45,9 +45,9 @@
 @SuppressWarnings("checkstyle:javadoctype")
 public class EntryCacheManager {
 
-    private final long maxSize;
-    private final long evictionTriggerThreshold;
-    private final double cacheEvictionWatermark;
+    private volatile long maxSize;
+    private volatile long evictionTriggerThreshold;
+    private volatile double cacheEvictionWatermark;

Review comment:
       > I am concerned about the cost of this change. These three variables 
are read each time that a message is written to the cache. While I see the 
generic benefit of increasing configurability, I don't think we should do so in 
a way that adds cost (even small costs) to the write path.
   
   Do you have some good ideas? Regarding the need to provide a dynamic 
configuration cache, but also to solve the problems you mentioned.




-- 
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