Class ChildReaper
- java.lang.Object
-
- org.apache.curator.framework.recipes.locks.ChildReaper
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
@Deprecated public class ChildReaper extends java.lang.Object implements java.io.CloseableDeprecated.Since 2.9.0 - Reaper/ChildReaper are no longer needed. UseCreateMode.CONTAINER. Also, all Curator recipes create container parents.Utility to reap empty child nodes of a parent node. Periodically calls getChildren on the node and adds empty nodes to an internally managedReaper
-
-
Constructor Summary
Constructors Constructor Description ChildReaper(org.apache.curator.framework.CuratorFramework client, java.lang.String path, Reaper.Mode mode)Deprecated.ChildReaper(org.apache.curator.framework.CuratorFramework client, java.lang.String path, Reaper.Mode mode, int reapingThresholdMs)Deprecated.ChildReaper(org.apache.curator.framework.CuratorFramework client, java.lang.String path, Reaper.Mode mode, java.util.concurrent.ScheduledExecutorService executor, int reapingThresholdMs)Deprecated.ChildReaper(org.apache.curator.framework.CuratorFramework client, java.lang.String path, Reaper.Mode mode, java.util.concurrent.ScheduledExecutorService executor, int reapingThresholdMs, java.lang.String leaderPath)Deprecated.ChildReaper(org.apache.curator.framework.CuratorFramework client, java.lang.String path, Reaper.Mode mode, java.util.concurrent.ScheduledExecutorService executor, int reapingThresholdMs, java.lang.String leaderPath, java.util.Set<java.lang.String> lockSchema)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ChildReaperaddPath(java.lang.String path)Deprecated.Add a path to reap children fromvoidclose()Deprecated.static java.util.concurrent.ScheduledExecutorServicenewExecutorService()Deprecated.booleanremovePath(java.lang.String path)Deprecated.Remove a path from reapingvoidsetMaxChildren(int maxChildren)Deprecated.If a node has so many children thatCuratorFramework.getChildren()will fail (due to jute.maxbuffer) it can cause connection instability.voidstart()Deprecated.The reaper must be startedprotected voidwarnMaxChildren(java.lang.String path, org.apache.zookeeper.data.Stat stat)Deprecated.
-
-
-
Constructor Detail
-
ChildReaper
public ChildReaper(org.apache.curator.framework.CuratorFramework client, java.lang.String path, Reaper.Mode mode)Deprecated.- Parameters:
client- the clientpath- path to reap children frommode- reaping mode
-
ChildReaper
public ChildReaper(org.apache.curator.framework.CuratorFramework client, java.lang.String path, Reaper.Mode mode, int reapingThresholdMs)Deprecated.- Parameters:
client- the clientpath- path to reap children fromreapingThresholdMs- threshold in milliseconds that determines that a path can be deletedmode- reaping mode
-
ChildReaper
public ChildReaper(org.apache.curator.framework.CuratorFramework client, java.lang.String path, Reaper.Mode mode, java.util.concurrent.ScheduledExecutorService executor, int reapingThresholdMs)Deprecated.- Parameters:
client- the clientpath- path to reap children fromexecutor- executor to use for background tasksreapingThresholdMs- threshold in milliseconds that determines that a path can be deletedmode- reaping mode
-
ChildReaper
public ChildReaper(org.apache.curator.framework.CuratorFramework client, java.lang.String path, Reaper.Mode mode, java.util.concurrent.ScheduledExecutorService executor, int reapingThresholdMs, java.lang.String leaderPath)Deprecated.- Parameters:
client- the clientpath- path to reap children fromexecutor- executor to use for background tasksreapingThresholdMs- threshold in milliseconds that determines that a path can be deletedmode- reaping modeleaderPath- if not null, uses a leader selection so that only 1 reaper is active in the cluster
-
ChildReaper
public ChildReaper(org.apache.curator.framework.CuratorFramework client, java.lang.String path, Reaper.Mode mode, java.util.concurrent.ScheduledExecutorService executor, int reapingThresholdMs, java.lang.String leaderPath, java.util.Set<java.lang.String> lockSchema)Deprecated.- Parameters:
client- the clientpath- path to reap children fromexecutor- executor to use for background tasksreapingThresholdMs- threshold in milliseconds that determines that a path can be deletedmode- reaping modeleaderPath- if not null, uses a leader selection so that only 1 reaper is active in the clusterlockSchema- a set of the possible subnodes of the children of path that must be reaped in addition to the child nodes
-
-
Method Detail
-
start
public void start() throws java.lang.ExceptionDeprecated.The reaper must be started- Throws:
java.lang.Exception- errors
-
close
public void close() throws java.io.IOExceptionDeprecated.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
addPath
public ChildReaper addPath(java.lang.String path)
Deprecated.Add a path to reap children from- Parameters:
path- the path- Returns:
- this for chaining
-
removePath
public boolean removePath(java.lang.String path)
Deprecated.Remove a path from reaping- Parameters:
path- the path- Returns:
- true if the path existed and was removed
-
setMaxChildren
public void setMaxChildren(int maxChildren)
Deprecated.If a node has so many children thatCuratorFramework.getChildren()will fail (due to jute.maxbuffer) it can cause connection instability. Set the max number of children here to prevent the path from being queried in these cases. The number should usually be: average-node-name-length/1000000- Parameters:
maxChildren- max children
-
newExecutorService
public static java.util.concurrent.ScheduledExecutorService newExecutorService()
Deprecated.
-
warnMaxChildren
protected void warnMaxChildren(java.lang.String path, org.apache.zookeeper.data.Stat stat)Deprecated.
-
-