You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2019/11/23 13:48:40 UTC

[GitHub] [zookeeper] Randgalt commented on a change in pull request #1010: ZOOKEEPER-3425: ranking the ttl by expireTime asc for the performance

Randgalt commented on a change in pull request #1010: ZOOKEEPER-3425: ranking the ttl by expireTime asc for the performance
URL: https://github.com/apache/zookeeper/pull/1010#discussion_r349873521
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java
 ##########
 @@ -156,10 +158,18 @@
      */
     private final Set<String> containers = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());
 
+    private final Map<String, TTLNode> ttlMap = new HashMap<>();
     /**
-     * This set contains the paths of all ttl nodes
+     * This set contains the paths of all ttl nodes, ranking by expireTime asc.
      */
-    private final Set<String> ttls = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());
+    public final Set<TTLNode> ttls = new TreeSet<>(
 
 Review comment:
   Did you consider using a `PriorityQueue` instead of a TreeSet? It seems like a more appropriate data structure.

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