java.io.Closeable, java.lang.AutoCloseableCreateMode.CONTAINER.
Also, all Curator recipes create container parents.@Deprecated
public class ChildReaper
extends java.lang.Object
implements java.io.Closeable
Reaper| 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.
|
| Modifier and Type | Method | Description |
|---|---|---|
ChildReaper |
addPath(java.lang.String path) |
Deprecated.
Add a path to reap children from
|
void |
close() |
Deprecated.
|
static java.util.concurrent.ScheduledExecutorService |
newExecutorService() |
Deprecated.
|
boolean |
removePath(java.lang.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(java.lang.String path,
org.apache.zookeeper.data.Stat stat) |
Deprecated.
|
public ChildReaper(org.apache.curator.framework.CuratorFramework client,
java.lang.String path,
Reaper.Mode mode)
client - the clientpath - path to reap children frommode - reaping modepublic ChildReaper(org.apache.curator.framework.CuratorFramework client,
java.lang.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(org.apache.curator.framework.CuratorFramework client,
java.lang.String path,
Reaper.Mode mode,
java.util.concurrent.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(org.apache.curator.framework.CuratorFramework client,
java.lang.String path,
Reaper.Mode mode,
java.util.concurrent.ScheduledExecutorService executor,
int reapingThresholdMs,
java.lang.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(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)
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 java.lang.Exception
java.lang.Exception - errorspublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOExceptionpublic ChildReaper addPath(java.lang.String path)
path - the pathpublic boolean removePath(java.lang.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 java.util.concurrent.ScheduledExecutorService newExecutorService()
protected void warnMaxChildren(java.lang.String path,
org.apache.zookeeper.data.Stat stat)
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.