maoling commented on a change in pull request #1138: ZOOKEEPER-3546 - Allow 
optional deletion of never used Container Nodes
URL: https://github.com/apache/zookeeper/pull/1138#discussion_r344582558
 
 

 ##########
 File path: 
zookeeper-server/src/main/java/org/apache/zookeeper/server/ContainerManager.java
 ##########
 @@ -58,10 +59,25 @@
      *                     herding of container deletions
      */
     public ContainerManager(ZKDatabase zkDb, RequestProcessor 
requestProcessor, int checkIntervalMs, int maxPerMinute) {
+        this(zkDb, requestProcessor, checkIntervalMs, maxPerMinute, 
Integer.MAX_VALUE);
+    }
+
+    /**
+     * @param zkDb the ZK database
+     * @param requestProcessor request processer - used to inject delete
+     *                         container requests
+     * @param checkIntervalMs how often to check containers in milliseconds
+     * @param maxPerMinute the max containers to delete per second - avoids
+     *                     herding of container deletions
+     * @param maxNeverUsedIntervalMs the max time in milliseconds that a 
container that has never had
+     *                                  any children is retained
+     */
+    public ContainerManager(ZKDatabase zkDb, RequestProcessor 
requestProcessor, int checkIntervalMs, int maxPerMinute, long 
maxNeverUsedIntervalMs) {
         this.zkDb = zkDb;
         this.requestProcessor = requestProcessor;
         this.checkIntervalMs = checkIntervalMs;
         this.maxPerMinute = maxPerMinute;
+        this.maxNeverUsedIntervalMs = maxNeverUsedIntervalMs;
         timer = new Timer("ContainerManagerTask", true);
 
         LOG.info("Using checkIntervalMs={} maxPerMinute={}", checkIntervalMs, 
maxPerMinute);
 
 Review comment:
    `maxNeverUsedIntervalMs` also needs to be logged ?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to