public class ChildReaper extends Object implements Closeable
Reaper| Constructor and Description |
|---|
ChildReaper(org.apache.curator.framework.CuratorFramework client,
String path,
org.apache.curator.framework.recipes.locks.Reaper.Mode mode) |
ChildReaper(org.apache.curator.framework.CuratorFramework client,
String path,
org.apache.curator.framework.recipes.locks.Reaper.Mode mode,
int reapingThresholdMs) |
ChildReaper(org.apache.curator.framework.CuratorFramework client,
String path,
org.apache.curator.framework.recipes.locks.Reaper.Mode mode,
ScheduledExecutorService executor,
int reapingThresholdMs) |
ChildReaper(org.apache.curator.framework.CuratorFramework client,
String path,
org.apache.curator.framework.recipes.locks.Reaper.Mode mode,
ScheduledExecutorService executor,
int reapingThresholdMs,
String leaderPath) |
| Modifier and Type | Method and Description |
|---|---|
ChildReaper |
addPath(String path)
Add a path to reap children from
|
void |
close() |
static <E> Set<E> |
newConcurrentHashSet()
Creates a thread-safe set backed by a hash map.
|
boolean |
removePath(String path)
Remove a path from reaping
|
void |
start()
The reaper must be started
|
public ChildReaper(org.apache.curator.framework.CuratorFramework client, String path, org.apache.curator.framework.recipes.locks.Reaper.Mode mode)
client - the clientpath - path to reap children frommode - reaping modepublic ChildReaper(org.apache.curator.framework.CuratorFramework client, String path, org.apache.curator.framework.recipes.locks.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, String path, org.apache.curator.framework.recipes.locks.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(org.apache.curator.framework.CuratorFramework client, String path, org.apache.curator.framework.recipes.locks.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 static <E> Set<E> newConcurrentHashSet()
ConcurrentHashMap instance, and thus carries the same concurrency
guarantees.
Unlike HashSet, this class does NOT allow null to be
used as an element. The set is serializable.
Setpublic void close() throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic ChildReaper addPath(String path)
path - the pathpublic boolean removePath(String path)
path - the pathCopyright © 2016 Apache Software Foundation. All Rights Reserved.