private static void deleteLocalPath ( MRAsyncDiskService asyncDiskService , LocalFileSystem fs , Path path ) throws IOException { boolean deleted = false ; if ( asyncDiskService != null ) { // Try to delete using asyncDiskService String localPathToDelete = path . toUri ( ) . getPath ( ) ; deleted = asyncDiskService . moveAndDeleteAbsolutePath ( localPathToDelete ) ; if ( ! deleted ) { LOG . warn ( "Cannot find DistributedCache path " + localPathToDelete + " on any of the asyncDiskService volumes!" ) ; } } if ( ! deleted ) { // If no asyncDiskService, we will delete the files synchronously fs . delete ( path , true ) ; } LOG . info ( "Deleted path " + path ) ; }
Delete a local path with asyncDiskService if available or otherwise synchronously with local file system .