Package org.apache.storm.daemon.logviewer.utils

## Class LogCleaner

- java.lang.Object
- - org.apache.storm.daemon.logviewer.utils.LogCleaner

- All Implemented Interfaces:
    `Closeable`, `AutoCloseable`, `Runnable`

      public class LogCleaner
      extends Object
      implements Runnable, Closeable

  Cleans dead workers logs and directories.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `LogCleaner​(Map<String,​Object> stormConf, WorkerLogs workerLogs, DirectoryCleaner directoryCleaner, Path logRootDir, StormMetricsRegistry metricsRegistry)` | Constuctor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `close()` |
    `void` | `run()` | Delete old log dirs for which the workers are no longer alive.
    `void` | `start()` | Start log cleanup thread.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LogCleaner

          public LogCleaner​(Map<String,​Object> stormConf,
                            WorkerLogs workerLogs,
                            DirectoryCleaner directoryCleaner,
                            Path logRootDir,
                            StormMetricsRegistry metricsRegistry)

      Constuctor.
      Parameters:
        `stormConf` - configuration map for Storm cluster
        `workerLogs` - `WorkerLogs` instance
        `directoryCleaner` - `DirectoryCleaner` instance
        `logRootDir` - root log directory
        `metricsRegistry` - The logviewer metrics registry

  - ### Method Detail

    - #### start

          public void start()

      Start log cleanup thread.

    - #### close

          public void close()

      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `Closeable`

    - #### run

          public void run()

      Delete old log dirs for which the workers are no longer alive.
      Specified by:
        `run` in interface `Runnable`