zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] eolivelli commented on a change in pull request #1098: ZOOKEEPER-3560: Add response cache to serve get children (2) requests.
Date Thu, 03 Oct 2019 05:34:42 GMT
eolivelli commented on a change in pull request #1098: ZOOKEEPER-3560: Add response cache to
serve get children (2) requests.
URL: https://github.com/apache/zookeeper/pull/1098#discussion_r330868785
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/ResponseCache.java
 ##########
 @@ -22,23 +22,31 @@
 import java.util.LinkedHashMap;
 import java.util.Map;
 import org.apache.zookeeper.data.Stat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @SuppressWarnings("serial")
 public class ResponseCache {
+    private static final Logger LOG = LoggerFactory.getLogger(ResponseCache.class);
 
     // Magic number chosen to be "big enough but not too big"
-    private static final int DEFAULT_RESPONSE_CACHE_SIZE = 400;
-
+    public static final int DEFAULT_RESPONSE_CACHE_SIZE = 400;
+    private final int cacheSize;
     private static class Entry {
-
         public Stat stat;
         public byte[] data;
-
     }
 
-    private Map<String, Entry> cache = Collections.synchronizedMap(new LRUCache<String,
Entry>(getResponseCacheSize()));
+    private Map<String, Entry> cache;
 
 Review comment:
   nit: final?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message