com.netflix.curator.framework.recipes.locks
Class ChildReaper

java.lang.Object
  extended by com.netflix.curator.framework.recipes.locks.ChildReaper
All Implemented Interfaces:
java.io.Closeable

public class ChildReaper
extends java.lang.Object
implements java.io.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(com.netflix.curator.framework.CuratorFramework client, java.lang.String path, Reaper.Mode mode)
           
ChildReaper(com.netflix.curator.framework.CuratorFramework client, java.lang.String path, Reaper.Mode mode, int reapingThresholdMs)
           
ChildReaper(com.netflix.curator.framework.CuratorFramework client, java.lang.String path, Reaper.Mode mode, java.util.concurrent.ScheduledExecutorService executor, int reapingThresholdMs)
           
 
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
 

Constructor Detail

ChildReaper

public ChildReaper(com.netflix.curator.framework.CuratorFramework client,
                   java.lang.String path,
                   Reaper.Mode mode)
Parameters:
client - the client
path - path to reap children from
mode - reaping mode

ChildReaper

public ChildReaper(com.netflix.curator.framework.CuratorFramework client,
                   java.lang.String path,
                   Reaper.Mode mode,
                   int reapingThresholdMs)
Parameters:
client - the client
path - path to reap children from
reapingThresholdMs - threshold in milliseconds that determines that a path can be deleted
mode - reaping mode

ChildReaper

public ChildReaper(com.netflix.curator.framework.CuratorFramework client,
                   java.lang.String path,
                   Reaper.Mode mode,
                   java.util.concurrent.ScheduledExecutorService executor,
                   int reapingThresholdMs)
Parameters:
client - the client
path - path to reap children from
executor - executor to use for background tasks
reapingThresholdMs - threshold in milliseconds that determines that a path can be deleted
mode - reaping mode
Method Detail

start

public void start()
           throws java.lang.Exception
The reaper must be started

Throws:
java.lang.Exception - errors

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException