accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ctubbsii commented on a change in pull request #376: ACCUMULO-4798 optimized stat in ZooCache
Date Thu, 01 Jan 1970 00:00:00 GMT
ctubbsii commented on a change in pull request #376: ACCUMULO-4798 optimized stat in ZooCache
URL: https://github.com/apache/accumulo/pull/376#discussion_r167098987
 
 

 ##########
 File path: fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooCache.java
 ##########
 @@ -60,14 +55,39 @@
   private final Lock cacheReadLock = cacheLock.readLock();
 
   private final HashMap<String,byte[]> cache;
-  private final HashMap<String,Stat> statCache;
+  private final HashMap<String,ZcStat> statCache;
   private final HashMap<String,List<String>> childrenCache;
 
   private final ZooReader zReader;
 
+  public static class ZcStat {
+    private long emphemeralOwner;
+
+    public ZcStat() {
+
+    }
+
+    private ZcStat(Stat stat) {
+      this.emphemeralOwner = stat.getEphemeralOwner();
+    }
+
+    public long getEphemeralOwner() {
+      return emphemeralOwner;
+    }
+
+    private void set(ZcStat cachedStat) {
+      this.emphemeralOwner = cachedStat.emphemeralOwner;
+    }
+
+    @VisibleForTesting
 
 Review comment:
   That's great that this is visible only for testing, but I don't understand what the relationship
is between "ephemheralOwner" and "session". Neither the method nor the test which calls it
explains this.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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