Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update S3LayerDeleter to consider AWS SDK request limit #3372

Merged
merged 3 commits into from
Apr 7, 2021

Conversation

zacdezgeo
Copy link
Contributor

@zacdezgeo zacdezgeo commented Apr 6, 2021

Overview

Very straightforward fix to deal with the delete request limit of the AWS SDK.

Simply chunks the objectIdentifiers list into lists of length smaller than the requestLimit and iteratively makes the delete call to the AWS SDK.

Checklist

  • ./CHANGELOG.md updated, if necessary. Link to the issue if closed, otherwise the PR.
  • Module Hierarchy updated, if necessary
  • docs guides update, if necessary
  • New user API has useful Scaladoc strings

Demo

TODO

Notes

Unsure of the testing strategies favored for S3 and if the changes should be included in the changelog.

Closes #3371

Copy link
Member

@pomadchin pomadchin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for your (first) contribution! 🎉 🎉 🎉 🎉 I left just a couple of comments to move limit into the API and cleanup the code.

One more thing! Could you sign ECA please to make Eclipse license checker happy?

(Eclipse grabs your name and email from the commit, so doublecheck that you commited under the correct email (that was used to sign ECA), right now the ECA is required for thezachary[at]****.io email).

@zacdezgeo
Copy link
Contributor Author

Wondering if we should be returning the status or even the unsuccessfully deleted objects of the s3Client.deleteObjects request. Something like in the AWS's documentation.

DeleteObjectsResult delObjRes = s3Client.deleteObjects(multiObjectDeleteRequest);
int successfulDeletes = delObjRes.getDeletedObjects().size();

Copy link
Member

@pomadchin pomadchin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🎉 ECA looks good as well.

Could you move that consturctor overload into the companion object?

@pomadchin
Copy link
Member

pomadchin commented Apr 7, 2021

@zacharyDez that's a good move, however, it requires a separate issue I guess. We have LayerDeleters for our other backends so the error encoding should be synchronized with all of them. I agree that it could be a very nice improvement 👍

@zacharyDez would you mind creating an issue to track down this idea?

@zacdezgeo
Copy link
Contributor Author

Opened the new issue #3373 @pomadchin

Copy link
Member

@pomadchin pomadchin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Merging once CI is green 🎉

And thanks for filing the follow up issue!

@pomadchin pomadchin self-assigned this Apr 7, 2021
@zacdezgeo
Copy link
Contributor Author

Thanks for your feedback with the PR! 🙏

@pomadchin pomadchin merged commit cd251b2 into locationtech:master Apr 7, 2021
@pomadchin pomadchin removed their assignment Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

S3LayerDeleter cannot handle over 1000 objects to delete
2 participants