Class Reaper
- java.lang.Object
-
- org.apache.curator.framework.recipes.locks.Reaper
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
@Deprecated public class Reaper extends java.lang.Object implements java.io.CloseableDeprecated.Since 2.9.0 - Reaper/ChildReaper are no longer needed. UseCreateMode.CONTAINER. Also, all Curator recipes create container parents.Utility to clean up parent lock nodes so that they don't stay around as garbage
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReaper.ModeDeprecated.
-
Constructor Summary
Constructors Constructor Description Reaper(org.apache.curator.framework.CuratorFramework client)Deprecated.Uses the default reaping threshold of 5 minutes and creates an internal thread poolReaper(org.apache.curator.framework.CuratorFramework client, int reapingThresholdMs)Deprecated.Uses the given reaping threshold and creates an internal thread poolReaper(org.apache.curator.framework.CuratorFramework client, java.util.concurrent.ScheduledExecutorService executor, int reapingThresholdMs)Deprecated.Reaper(org.apache.curator.framework.CuratorFramework client, java.util.concurrent.ScheduledExecutorService executor, int reapingThresholdMs, java.lang.String leaderPath)Deprecated.Reaper(org.apache.curator.framework.CuratorFramework client, java.util.concurrent.ScheduledExecutorService executor, int reapingThresholdMs, LeaderLatch leaderLatch)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddPath(java.lang.String path)Deprecated.Add a path (using Mode.REAP_INDEFINITELY) to be checked by the reaper.voidaddPath(java.lang.String path, Reaper.Mode mode)Deprecated.Add a path to be checked by the reaper.voidclose()Deprecated.static java.util.concurrent.ScheduledExecutorServicenewExecutorService()Deprecated.Allocate an executor service for the reaperprotected voidreap(org.apache.curator.framework.recipes.locks.Reaper.PathHolder holder)Deprecated.booleanremovePath(java.lang.String path)Deprecated.Stop reaping the given pathprotected java.util.concurrent.Future<?>schedule(org.apache.curator.framework.recipes.locks.Reaper.PathHolder pathHolder, int reapingThresholdMs)Deprecated.voidstart()Deprecated.The reaper must be started
-
-
-
Constructor Detail
-
Reaper
public Reaper(org.apache.curator.framework.CuratorFramework client)
Deprecated.Uses the default reaping threshold of 5 minutes and creates an internal thread pool- Parameters:
client- client
-
Reaper
public Reaper(org.apache.curator.framework.CuratorFramework client, int reapingThresholdMs)Deprecated.Uses the given reaping threshold and creates an internal thread pool- Parameters:
client- clientreapingThresholdMs- threshold in milliseconds that determines that a path can be deleted
-
Reaper
public Reaper(org.apache.curator.framework.CuratorFramework client, java.util.concurrent.ScheduledExecutorService executor, int reapingThresholdMs)Deprecated.- Parameters:
client- clientexecutor- thread poolreapingThresholdMs- threshold in milliseconds that determines that a path can be deleted
-
Reaper
public Reaper(org.apache.curator.framework.CuratorFramework client, java.util.concurrent.ScheduledExecutorService executor, int reapingThresholdMs, java.lang.String leaderPath)Deprecated.- Parameters:
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
-
Reaper
public Reaper(org.apache.curator.framework.CuratorFramework client, java.util.concurrent.ScheduledExecutorService executor, int reapingThresholdMs, LeaderLatch leaderLatch)Deprecated.- Parameters:
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 cluster
-
-
Method Detail
-
addPath
public void addPath(java.lang.String path)
Deprecated.Add a path (using Mode.REAP_INDEFINITELY) to be checked by the reaper. The path will be checked periodically until the reaper is closed.- Parameters:
path- path to check
-
addPath
public void addPath(java.lang.String path, Reaper.Mode mode)Deprecated.Add a path to be checked by the reaper. The path will be checked periodically until the reaper is closed, or until the point specified by the Mode- Parameters:
path- path to checkmode- reaping mode
-
removePath
public boolean removePath(java.lang.String path)
Deprecated.Stop reaping the given path- Parameters:
path- path to remove- Returns:
- true if the path was removed
-
start
public void start() throws java.lang.ExceptionDeprecated.The reaper must be started- Throws:
java.lang.Exception- errors
-
close
public void close() throws java.io.IOExceptionDeprecated.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
schedule
protected java.util.concurrent.Future<?> schedule(org.apache.curator.framework.recipes.locks.Reaper.PathHolder pathHolder, int reapingThresholdMs)Deprecated.
-
reap
protected void reap(org.apache.curator.framework.recipes.locks.Reaper.PathHolder holder)
Deprecated.
-
newExecutorService
public static java.util.concurrent.ScheduledExecutorService newExecutorService()
Deprecated.Allocate an executor service for the reaper- Returns:
- service
-
-