This is an automated email from the ASF dual-hosted git repository.

tison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/curator.git

commit 16db9230a95339265f34dce95716aee7a50f73f2
Author: tison <wander4...@gmail.com>
AuthorDate: Sun Jun 26 20:43:20 2022 +0800

    CURATOR-643: Rescue public ctor of PersistentTtlNode
    
    Signed-off-by: tison <wander4...@gmail.com>
---
 .../framework/recipes/nodes/PersistentTtlNode.java        | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git 
a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentTtlNode.java
 
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentTtlNode.java
index 9f019d6e..c8d2562e 100644
--- 
a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentTtlNode.java
+++ 
b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/nodes/PersistentTtlNode.java
@@ -91,6 +91,21 @@ public class PersistentTtlNode implements Closeable
         this(client, 
Executors.newSingleThreadScheduledExecutor(ThreadUtils.newThreadFactory("PersistentTtlNode")),
 path, ttlMs, initData, DEFAULT_CHILD_NODE_NAME, DEFAULT_TOUCH_SCHEDULE_FACTOR, 
useParentCreation);
     }
 
+    /**
+     * @param client the client
+     * @param executorService  ExecutorService to use for background thread. 
This service should be single threaded, otherwise you may see inconsistent 
results.
+     * @param path path for the parent ZNode
+     * @param ttlMs max ttl for the node in milliseconds
+     * @param initData data for the node
+     * @param childNodeName name to use for the child node of the node created 
at <code>path</code>
+     * @param touchScheduleFactor how ofter to set/create the child node as a 
factor of the ttlMs. i.e.
+     *                            the child is touched every <code>(ttlMs / 
touchScheduleFactor)</code>
+     */
+    public PersistentTtlNode(CuratorFramework client, ScheduledExecutorService 
executorService, String path, long ttlMs, byte[] initData, String 
childNodeName, int touchScheduleFactor)
+    {
+        this(client, executorService, path, ttlMs, initData, childNodeName, 
touchScheduleFactor, true);
+    }
+
     /**
      * @param client the client
      * @param executorService  ExecutorService to use for background thread. 
This service should be single threaded, otherwise you may see inconsistent 
results.

Reply via email to