CreateMode#CONTAINER
.
Also, all Curator recipes create container parents.@Deprecated public class ChildReaper extends Object implements Closeable
Reaper
Constructor and Description |
---|
ChildReaper(CuratorFramework client,
String path,
Reaper.Mode mode)
Deprecated.
|
ChildReaper(CuratorFramework client,
String path,
Reaper.Mode mode,
int reapingThresholdMs)
Deprecated.
|
ChildReaper(CuratorFramework client,
String path,
Reaper.Mode mode,
ScheduledExecutorService executor,
int reapingThresholdMs)
Deprecated.
|
ChildReaper(CuratorFramework client,
String path,
Reaper.Mode mode,
ScheduledExecutorService executor,
int reapingThresholdMs,
String leaderPath)
Deprecated.
|
ChildReaper(CuratorFramework client,
String path,
Reaper.Mode mode,
ScheduledExecutorService executor,
int reapingThresholdMs,
String leaderPath,
Set<String> lockSchema)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
ChildReaper |
addPath(String path)
Deprecated.
Add a path to reap children from
|
void |
close()
Deprecated.
|
static ScheduledExecutorService |
newExecutorService()
Deprecated.
|
boolean |
removePath(String path)
Deprecated.
Remove a path from reaping
|
void |
setMaxChildren(int maxChildren)
Deprecated.
If a node has so many children that
CuratorFramework.getChildren() will fail
(due to jute.maxbuffer) it can cause connection instability. |
void |
start()
Deprecated.
The reaper must be started
|
protected void |
warnMaxChildren(String path,
org.apache.zookeeper.data.Stat stat)
Deprecated.
|
public ChildReaper(CuratorFramework client, String path, Reaper.Mode mode)
client
- the clientpath
- path to reap children frommode
- reaping modepublic ChildReaper(CuratorFramework client, String path, Reaper.Mode mode, int reapingThresholdMs)
client
- the clientpath
- path to reap children fromreapingThresholdMs
- threshold in milliseconds that determines that a path can be deletedmode
- reaping modepublic ChildReaper(CuratorFramework client, String path, Reaper.Mode mode, ScheduledExecutorService executor, int reapingThresholdMs)
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 modepublic ChildReaper(CuratorFramework client, String path, Reaper.Mode mode, ScheduledExecutorService executor, int reapingThresholdMs, String leaderPath)
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 clusterpublic ChildReaper(CuratorFramework client, String path, Reaper.Mode mode, ScheduledExecutorService executor, int reapingThresholdMs, String leaderPath, Set<String> lockSchema)
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 nodespublic void start() throws Exception
Exception
- errorspublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public ChildReaper addPath(String path)
path
- the pathpublic boolean removePath(String path)
path
- the pathpublic void setMaxChildren(int maxChildren)
CuratorFramework.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/1000000maxChildren
- max childrenpublic static ScheduledExecutorService newExecutorService()
protected void warnMaxChildren(String path, org.apache.zookeeper.data.Stat stat)
Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.