Class FileDeletionTask
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
DeletionTask handling the removal of files (and directories).-
Field Summary
Fields inherited from class org.apache.hadoop.yarn.server.nodemanager.containermanager.deletion.task.DeletionTask
INVALID_TASK_ID -
Constructor Summary
ConstructorsConstructorDescriptionFileDeletionTask(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.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. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.yarn.proto.YarnServerNodemanagerRecoveryProtos.DeletionServiceDeleteTaskProtoConvert the FileDeletionTask to the Protobuf representation for storing in the state store and recovery.List<org.apache.hadoop.fs.Path>Get the base directories containing the subdirectory.org.apache.hadoop.fs.PathGet the subdirectory to delete.voidrun()Delete the specified file/directory as the specified user.toString()Convert the FileDeletionTask to a String representation.Methods inherited from class org.apache.hadoop.yarn.server.nodemanager.containermanager.deletion.task.DeletionTask
addDeletionTaskDependency, decrementAndGetPendingPredecessorTasks, getDeletionService, getDeletionTaskType, getSuccessorTasks, getSucess, getTaskId, getUser, incrementAndGetPendingPredecessorTasks, setSuccess, setTaskId
-
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- theDeletionService.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- theDeletionService.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
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. -
toString
Convert the FileDeletionTask to a String representation. -
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:
convertDeletionTaskToProtoin classDeletionTask- Returns:
- the protobuf representation of the FileDeletionTask.
-