|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.curator.framework.recipes.locks.Reaper
public class Reaper
Utility to clean up parent lock nodes so that they don't stay around as garbage
| Nested Class Summary | |
|---|---|
static class |
Reaper.Mode
|
| Constructor Summary | |
|---|---|
Reaper(org.apache.curator.framework.CuratorFramework client)
Uses the default reaping threshold of 5 minutes and creates an internal thread pool |
|
Reaper(org.apache.curator.framework.CuratorFramework client,
int reapingThresholdMs)
Uses the given reaping threshold and creates an internal thread pool |
|
Reaper(org.apache.curator.framework.CuratorFramework client,
ScheduledExecutorService executor,
int reapingThresholdMs)
|
|
Reaper(org.apache.curator.framework.CuratorFramework client,
ScheduledExecutorService executor,
int reapingThresholdMs,
String leaderPath)
|
|
| Method Summary | |
|---|---|
void |
addPath(String path)
Add a path (using Mode.REAP_INDEFINITELY) to be checked by the reaper. |
void |
addPath(String path,
Reaper.Mode mode)
Add a path to be checked by the reaper. |
void |
close()
|
static ScheduledExecutorService |
newExecutorService()
Allocate an executor service for the reaper |
protected void |
reap(org.apache.curator.framework.recipes.locks.Reaper.PathHolder holder)
|
boolean |
removePath(String path)
Stop reaping the given path |
protected Future<?> |
schedule(org.apache.curator.framework.recipes.locks.Reaper.PathHolder pathHolder,
int reapingThresholdMs)
|
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 |
| Constructor Detail |
|---|
public Reaper(org.apache.curator.framework.CuratorFramework client)
client - client
public Reaper(org.apache.curator.framework.CuratorFramework client,
int reapingThresholdMs)
client - clientreapingThresholdMs - threshold in milliseconds that determines that a path can be deleted
public Reaper(org.apache.curator.framework.CuratorFramework client,
ScheduledExecutorService executor,
int reapingThresholdMs)
client - clientexecutor - thread poolreapingThresholdMs - threshold in milliseconds that determines that a path can be deleted
public Reaper(org.apache.curator.framework.CuratorFramework client,
ScheduledExecutorService executor,
int reapingThresholdMs,
String leaderPath)
client - clientexecutor - thread poolreapingThresholdMs - threshold in milliseconds that determines that a path can be deletedleaderPath - if not null, uses a leader selection so that only 1 reaper is active in the cluster| Method Detail |
|---|
public void addPath(String path)
path - path to check
public void addPath(String path,
Reaper.Mode mode)
path - path to checkmode - reaping modepublic boolean removePath(String path)
path - path to remove
public void start()
throws Exception
Exception - errors
public void close()
throws IOException
close in interface CloseableIOException
protected Future<?> schedule(org.apache.curator.framework.recipes.locks.Reaper.PathHolder pathHolder,
int reapingThresholdMs)
protected void reap(org.apache.curator.framework.recipes.locks.Reaper.PathHolder holder)
public static ScheduledExecutorService newExecutorService()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||