CreateMode#CONTAINER
.
Also, all Curator recipes create container parents.@Deprecated public class Reaper extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
static class |
Reaper.Mode
Deprecated.
|
Constructor and Description |
---|
Reaper(CuratorFramework client)
Deprecated.
Uses the default reaping threshold of 5 minutes and creates an internal thread pool
|
Reaper(CuratorFramework client,
int reapingThresholdMs)
Deprecated.
Uses the given reaping threshold and creates an internal thread pool
|
Reaper(CuratorFramework client,
ScheduledExecutorService executor,
int reapingThresholdMs)
Deprecated.
|
Reaper(CuratorFramework client,
ScheduledExecutorService executor,
int reapingThresholdMs,
LeaderLatch leaderLatch)
Deprecated.
|
Reaper(CuratorFramework client,
ScheduledExecutorService executor,
int reapingThresholdMs,
String leaderPath)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addPath(String path)
Deprecated.
Add a path (using Mode.REAP_INDEFINITELY) to be checked by the reaper.
|
void |
addPath(String path,
Reaper.Mode mode)
Deprecated.
Add a path to be checked by the reaper.
|
void |
close()
Deprecated.
|
static ScheduledExecutorService |
newExecutorService()
Deprecated.
Allocate an executor service for the reaper
|
protected void |
reap(org.apache.curator.framework.recipes.locks.Reaper.PathHolder holder)
Deprecated.
|
boolean |
removePath(String path)
Deprecated.
Stop reaping the given path
|
protected Future<?> |
schedule(org.apache.curator.framework.recipes.locks.Reaper.PathHolder pathHolder,
int reapingThresholdMs)
Deprecated.
|
void |
start()
Deprecated.
The reaper must be started
|
public Reaper(CuratorFramework client)
client
- clientpublic Reaper(CuratorFramework client, int reapingThresholdMs)
client
- clientreapingThresholdMs
- threshold in milliseconds that determines that a path can be deletedpublic Reaper(CuratorFramework client, ScheduledExecutorService executor, int reapingThresholdMs)
client
- clientexecutor
- thread poolreapingThresholdMs
- threshold in milliseconds that determines that a path can be deletedpublic Reaper(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 clusterpublic Reaper(CuratorFramework client, ScheduledExecutorService executor, int reapingThresholdMs, LeaderLatch leaderLatch)
client
- clientexecutor
- thread poolreapingThresholdMs
- threshold in milliseconds that determines that a path can be deletedleaderLatch
- a pre-created leader latch to ensure only 1 reaper is active in the clusterpublic void addPath(String path)
path
- path to checkpublic void addPath(String path, Reaper.Mode mode)
path
- path to checkmode
- reaping modepublic boolean removePath(String path)
path
- path to removepublic void start() throws Exception
Exception
- errorspublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
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()
Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.