HADOOP-19801. Allow to skip recursive file deletion for non-empty dir…#8306
Open
deepujain wants to merge 6 commits intoapache:trunkfrom
Open
HADOOP-19801. Allow to skip recursive file deletion for non-empty dir…#8306deepujain wants to merge 6 commits intoapache:trunkfrom
deepujain wants to merge 6 commits intoapache:trunkfrom
Conversation
…ectory. Add fs.s3a.delete.non-empty-directory.enabled. When true, recursive delete uses a single delete request for the directory key (for S3-compatible endpoints that support it, e.g. VAST).
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
Contributor
|
Thanks for looking into this feature! Let's merge my PR into yours: deepujain#1 |
Contributor
Author
|
@EnricoMi Sure. Once you’re done, please let me know if anything is pending from my side. I’m not familiar with the process or timeline yet, as this is my first time contributing to the Hadoop projects. I currently have a few pending PRs awaiting merge. |
Contributor
Author
|
My JIRA id is deepujain |
Contributor
|
Great! If you are happy with my proposed changes to your PR, merge deepujain#1. |
…ectory Document capability to delete non-empty directories
Contributor
Author
|
Merged your PR, thanks for the docs and rephrase. @EnricoMi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds option
fs.s3a.delete.non-empty-directory.enabled. When true, recursive delete of a non-empty directory sends a single delete request for the directory key (prefix) instead of listing and bulk-deleting contained objects. Only enable for S3-compatible endpoints that support deleting a non-empty directory in one request (e.g. VAST).Change
DELETE_NON_EMPTY_DIRECTORY_ENABLED(fs.s3a.delete.non-empty-directory.enabled), defaultfalse.S3A_DYNAMIC_CAPABILITIESfor path capability probing.initialize(), pass toDeleteOperation, expose viahasPathCapability(DELETE_NON_EMPTY_DIRECTORY_ENABLED).deleteNonEmptyDirectoryEnabled. When true and directory is non-empty, calldeleteObjectAtPath(path, key, false)once instead ofdeleteDirectoryTree(path, key).Why no new tests
New tests would require an S3-compatible endpoint that supports prefix delete (e.g. VAST); we don't run such backends in CI. The change is a guarded code path (config off by default). Manual verification: enabled the option against a VAST endpoint and confirmed recursive delete uses a single delete request.
JIRA
Fixes HADOOP-19801