Add interface for FileIO prefix operations and implementations #5096
Merged
Conversation
…doopFileIO and S3FileIO
rdblue
reviewed
Jun 20, 2022
rdblue
reviewed
Jun 20, 2022
rdblue
reviewed
Jun 20, 2022
rdblue
reviewed
Jun 20, 2022
rdblue
reviewed
Jun 20, 2022
rdblue
reviewed
Jun 20, 2022
rdblue
reviewed
Jun 20, 2022
rdblue
reviewed
Jun 20, 2022
rdblue
reviewed
Jun 20, 2022
rdblue
reviewed
Jun 20, 2022
nastra
reviewed
Jun 21, 2022
nastra
left a comment
Contributor
There was a problem hiding this comment.
mostly LGTM once we switch to Tasks.foreach, everything else were just a few nits
rdblue
reviewed
Jun 22, 2022
| /** | ||
| * This method provides a "best-effort" to delete all objects under the | ||
| * given prefix. | ||
| * |
rdblue
reviewed
Jun 22, 2022
| return () -> client().listObjectsV2Paginator(request).stream() | ||
| .flatMap(r -> r.contents().stream()) | ||
| .map(o -> new FileInfo( | ||
| String.format("%s://%s/%s", s3uri.scheme(), s3uri.bucket(), o.key()), |
Contributor
There was a problem hiding this comment.
Minor: The bucket returned by S3URI may actually be an access point reference, which could break URI parsing if this were to embed it in a location.
I think the solution is to move the S3 access point mapping out of S3URI, since that class should remain simple and report what was parsed and avoid this kind of issue. Let's not fix it here, but we should revisit this.
FYI @jackye1995.
rdblue
approved these changes
Jun 22, 2022
namrathamyske
pushed a commit
to namrathamyske/iceberg
that referenced
this pull request
Jul 10, 2022
namrathamyske
pushed a commit
to namrathamyske/iceberg
that referenced
this pull request
Jul 10, 2022
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.
This adds an interface for FileIO implementations to support prefix based operations for listing and deleting.
The primary motivation is to enable supporting maintenance activities (like cleaning path directories or listing table locations) without the need to fall back to Hadoop FileSystem.
There are some notable behavioral differences between directory based and object based storage systems (e.g. for directory based storage, a the prefix must denote a directory).