[
https://issues.apache.org/jira/browse/HADOOP-19801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18073475#comment-18073475
]
ASF GitHub Bot commented on HADOOP-19801:
-----------------------------------------
EnricoMi commented on code in PR #8306:
URL: https://github.com/apache/hadoop/pull/8306#discussion_r3079802977
##########
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/Constants.java:
##########
@@ -1770,6 +1770,34 @@ private Constants() {
*/
public static final boolean DIRECTORY_OPERATIONS_PURGE_UPLOADS_DEFAULT =
false;
+ /**
+ * When true, recursive deletion of a non-empty directory uses a single
delete
+ * request for the directory key (prefix) instead of listing and deleting
contained
+ * objects first. Only enable this for S3-compatible endpoints that support
+ * deleting non-empty directories (path prefix) in one request (e.g. VAST).
+ * Value: {@value}.
+ */
+ public static final String DELETE_NON_EMPTY_DIRECTORY_ENABLED =
+ "fs.s3a.delete.non-empty-directory.enabled";
+
+ /**
+ * Custom delete header required by some S3-compatible stores to delete a
+ * non-empty directory key (prefix) in one request.
+ * Value: {@value}.
+ */
+ public static final String DELETE_NON_EMPTY_DIRECTORY_HEADER =
+ "x-amz-delete-contents";
Review Comment:
I wouldn't put a proprietary (non AWS S3) header to the project.
Attempt #8417 is more generic and might be reusable for other purposes.
> Allow to skip recursive file deletion for non-empty directory
> -------------------------------------------------------------
>
> Key: HADOOP-19801
> URL: https://issues.apache.org/jira/browse/HADOOP-19801
> Project: Hadoop Common
> Issue Type: New Feature
> Components: fs/s3
> Reporter: Enrico Minack
> Priority: Major
> Labels: pull-request-available
>
> A non-empty directory, as well as a directory where its emptiness is unknown,
> is deleted by listing all contained files (or objects with matching key
> prefix), then deleting those files (objects) in bulk delete requests, and
> finally deleting the (then) empty directory itself.
> The recursive deletion of objects is not needed for S3 endpoints that support
> deleting non-empty directories (or path prefixes).
> For example: The [VAST S3 endpoint supports deleting non-empty
> directories|https://kb.vastdata.com/documentation/docs/using-trash-folder-for-s3-objects-6]
> with a single request. Such a feature can only be fully leveraged if
> {{hadoop-aws}} coupd skip the recursive deletion.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]