Class DiskCleanupTask

java.lang.Object
com.netflix.genie.web.tasks.node.DiskCleanupTask
All Implemented Interfaces:
Runnable

public class DiskCleanupTask extends Object implements Runnable
This task runs on every Genie node and is responsible for cleaning up the local disk so that space can be recaptured.
Since:
3.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    DiskCleanupTask(@NotNull DiskCleanupProperties properties, @NotNull org.springframework.scheduling.TaskScheduler scheduler, @NotNull org.springframework.core.io.Resource jobsDir, @NotNull DataServices dataServices, @NotNull JobsProperties jobsProperties, @NotNull org.apache.commons.exec.Executor processExecutor, @NotNull io.micrometer.core.instrument.MeterRegistry registry)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    run()
    Checks the disk for jobs on this host.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DiskCleanupTask

      public DiskCleanupTask(@NotNull @NotNull DiskCleanupProperties properties, @NotNull @NotNull org.springframework.scheduling.TaskScheduler scheduler, @NotNull @NotNull org.springframework.core.io.Resource jobsDir, @NotNull @NotNull DataServices dataServices, @NotNull @NotNull JobsProperties jobsProperties, @NotNull @NotNull org.apache.commons.exec.Executor processExecutor, @NotNull @NotNull io.micrometer.core.instrument.MeterRegistry registry) throws IOException
      Constructor. Schedules this task to be run by the task scheduler.
      Parameters:
      properties - The disk cleanup properties to use.
      scheduler - The scheduler to use to schedule the cron trigger.
      jobsDir - The resource representing the location of the job directory
      dataServices - The DataServices instance to use
      jobsProperties - The jobs properties to use
      processExecutor - The process executor to use to delete directories
      registry - The metrics registry
      Throws:
      IOException - When it is unable to open a file reference to the job directory
  • Method Details

    • run

      public void run()
      Checks the disk for jobs on this host. Deletes any job directories that are older than the desired retention and are complete.
      Specified by:
      run in interface Runnable