Package org.apache.hadoop.fs.impl
Class DefaultBulkDeleteOperation
java.lang.Object
org.apache.hadoop.fs.impl.DefaultBulkDeleteOperation
- All Implemented Interfaces:
Closeable,AutoCloseable,BulkDelete,IOStatisticsSource
Default implementation of the
BulkDelete interface.-
Constructor Details
-
DefaultBulkDeleteOperation
-
-
Method Details
-
pageSize
public int pageSize()Description copied from interface:BulkDeleteThe maximum number of objects/files to delete in a single request.- Specified by:
pageSizein interfaceBulkDelete- Returns:
- a number greater than zero.
-
basePath
Description copied from interface:BulkDeleteBase path of a bulk delete operation. All paths submitted inBulkDelete.bulkDelete(Collection)must be under this path.- Specified by:
basePathin interfaceBulkDelete- Returns:
- base path of a bulk delete operation.
-
bulkDelete
public List<Map.Entry<Path,String>> bulkDelete(Collection<Path> paths) throws IOException, IllegalArgumentException Delete a list of files/objects.- Files must be under the path provided in
BulkDelete.basePath(). - The size of the list must be equal to or less than the page size
declared in
BulkDelete.pageSize(). - Directories are not supported; the outcome of attempting to delete directories is undefined (ignored; undetected, listed as failures...).
- The operation is not atomic.
- The operation is treated as idempotent: network failures may trigger resubmission of the request -any new objects created under a path in the list may then be deleted.
- There is no guarantee that any parent directories exist after this call.
FileSystem.delete(path, false)on the single path in the list.- Specified by:
bulkDeletein interfaceBulkDelete- Parameters:
paths- list of paths which must be absolute and under the base path. provided inBulkDelete.basePath().- Returns:
- a list of paths which failed to delete, with the exception message.
- Throws:
IOException- IO problems including networking, authentication and more.IllegalArgumentException- if a path argument is invalid.
- Files must be under the path provided in
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-