java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.deletion.task.DeletionTask
org.apache.hadoop.yarn.server.nodemanager.containermanager.deletion.task.FileDeletionTask
All Implemented Interfaces:
Runnable

public class FileDeletionTask extends DeletionTask implements Runnable
DeletionTask handling the removal of files (and directories).
  • Constructor Details

    • FileDeletionTask

      public FileDeletionTask(DeletionService deletionService, String user, org.apache.hadoop.fs.Path subDir, List<org.apache.hadoop.fs.Path> baseDirs)
      Construct a FileDeletionTask with the default INVALID_TASK_ID.
      Parameters:
      deletionService - the DeletionService.
      user - the user deleting the file.
      subDir - the subdirectory to delete.
      baseDirs - the base directories containing the subdir.
    • FileDeletionTask

      public FileDeletionTask(int taskId, DeletionService deletionService, String user, org.apache.hadoop.fs.Path subDir, List<org.apache.hadoop.fs.Path> baseDirs)
      Construct a FileDeletionTask with the default INVALID_TASK_ID.
      Parameters:
      taskId - the ID of the task, if previously set.
      deletionService - the DeletionService.
      user - the user deleting the file.
      subDir - the subdirectory to delete.
      baseDirs - the base directories containing the subdir.
  • Method Details

    • getSubDir

      public org.apache.hadoop.fs.Path getSubDir()
      Get the subdirectory to delete.
      Returns:
      the subDir for the FileDeletionTask.
    • getBaseDirs

      public List<org.apache.hadoop.fs.Path> getBaseDirs()
      Get the base directories containing the subdirectory.
      Returns:
      the base directories for the FileDeletionTask.
    • run

      public void run()
      Delete the specified file/directory as the specified user.
      Specified by:
      run in interface Runnable
    • toString

      public String toString()
      Convert the FileDeletionTask to a String representation.
      Overrides:
      toString in class Object
      Returns:
      String representation of the FileDeletionTask.
    • convertDeletionTaskToProto

      public org.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.DeletionServiceDeleteTaskProto convertDeletionTaskToProto()
      Convert the FileDeletionTask to the Protobuf representation for storing in the state store and recovery.
      Specified by:
      convertDeletionTaskToProto in class DeletionTask
      Returns:
      the protobuf representation of the FileDeletionTask.