org.apache.curator.framework.recipes.locks
Class ChildReaper
java.lang.Object
org.apache.curator.framework.recipes.locks.ChildReaper
- All Implemented Interfaces:
- Closeable
public class ChildReaper
- extends Object
- implements Closeable
Utility to reap empty child nodes of a parent node. Periodically calls getChildren on
the node and adds empty nodes to an internally managed Reaper
|
Constructor Summary |
ChildReaper(org.apache.curator.framework.CuratorFramework client,
String path,
Reaper.Mode mode)
|
ChildReaper(org.apache.curator.framework.CuratorFramework client,
String path,
Reaper.Mode mode,
int reapingThresholdMs)
|
ChildReaper(org.apache.curator.framework.CuratorFramework client,
String path,
Reaper.Mode mode,
ScheduledExecutorService executor,
int reapingThresholdMs)
|
ChildReaper(org.apache.curator.framework.CuratorFramework client,
String path,
Reaper.Mode mode,
ScheduledExecutorService executor,
int reapingThresholdMs,
String leaderPath)
|
|
Method Summary |
void |
close()
|
void |
start()
The reaper must be started |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ChildReaper
public ChildReaper(org.apache.curator.framework.CuratorFramework client,
String path,
Reaper.Mode mode)
- Parameters:
client - the clientpath - path to reap children frommode - reaping mode
ChildReaper
public ChildReaper(org.apache.curator.framework.CuratorFramework client,
String path,
Reaper.Mode mode,
int reapingThresholdMs)
- 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,
String path,
Reaper.Mode mode,
ScheduledExecutorService executor,
int reapingThresholdMs)
- 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,
String path,
Reaper.Mode mode,
ScheduledExecutorService executor,
int reapingThresholdMs,
String leaderPath)
- 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
start
public void start()
throws Exception
- The reaper must be started
- Throws:
Exception - errors
close
public void close()
throws IOException
- Specified by:
close in interface Closeable
- Throws:
IOException
Copyright © 2011–2014 The Apache Software Foundation. All rights reserved.