Class Reaper

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    @Deprecated
    public class Reaper
    extends java.lang.Object
    implements java.io.Closeable
    Deprecated.
    Since 2.9.0 - Reaper/ChildReaper are no longer needed. Use CreateMode.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 class  Reaper.Mode
      Deprecated.
       
    • 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 pool
      Reaper​(org.apache.curator.framework.CuratorFramework client, int reapingThresholdMs)
      Deprecated.
      Uses the given reaping threshold and creates an internal thread pool
      Reaper​(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
      void addPath​(java.lang.String path)
      Deprecated.
      Add a path (using Mode.REAP_INDEFINITELY) to be checked by the reaper.
      void addPath​(java.lang.String path, Reaper.Mode mode)
      Deprecated.
      Add a path to be checked by the reaper.
      void close()
      Deprecated.
       
      static java.util.concurrent.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​(java.lang.String path)
      Deprecated.
      Stop reaping the given path
      protected java.util.concurrent.Future<?> schedule​(org.apache.curator.framework.recipes.locks.Reaper.PathHolder pathHolder, int reapingThresholdMs)
      Deprecated.
       
      void start()
      Deprecated.
      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

      • 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 - client
        reapingThresholdMs - 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 - client
        executor - thread pool
        reapingThresholdMs - 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 - client
        executor - thread pool
        reapingThresholdMs - threshold in milliseconds that determines that a path can be deleted
        leaderPath - 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 - client
        executor - thread pool
        reapingThresholdMs - threshold in milliseconds that determines that a path can be deleted
        leaderLatch - 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 check
        mode - 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.Exception
        Deprecated.
        The reaper must be started
        Throws:
        java.lang.Exception - errors
      • close

        public void close()
                   throws java.io.IOException
        Deprecated.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.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