You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2018/02/08 23:23:42 UTC

[GitHub] ctubbsii commented on a change in pull request #376: ACCUMULO-4798 optimized stat in ZooCache

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