generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 15
Add support for readFully at the S3SeekableInputStream level #293
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
Merged
SanjayMarreddi
merged 1 commit into
awslabs:main
from
SanjayMarreddi:support_read_fully
Jun 25, 2025
Merged
Add support for readFully at the S3SeekableInputStream level #293
SanjayMarreddi
merged 1 commit into
awslabs:main
from
SanjayMarreddi:support_read_fully
Jun 25, 2025
Conversation
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
da8237a to
0977e95
Compare
rajdchak
reviewed
Jun 23, 2025
input-stream/src/main/java/software/amazon/s3/analyticsaccelerator/RandomAccessReadable.java
Outdated
Show resolved
Hide resolved
stubz151
previously approved these changes
Jun 23, 2025
rajdchak
requested changes
Jun 25, 2025
Contributor
rajdchak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, let's reuse the read methods we already have.
0977e95 to
d675ce8
Compare
rajdchak
reviewed
Jun 25, 2025
input-stream/src/main/java/software/amazon/s3/analyticsaccelerator/S3SeekableInputStream.java
Show resolved
Hide resolved
rajdchak
reviewed
Jun 25, 2025
...-stream/src/test/java/software/amazon/s3/analyticsaccelerator/S3SeekableInputStreamTest.java
Show resolved
Hide resolved
d675ce8 to
cd36363
Compare
rajdchak
approved these changes
Jun 25, 2025
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @SanjayMarreddi looks good to me!
stubz151
approved these changes
Jun 25, 2025
ozkoca
pushed a commit
that referenced
this pull request
Jun 26, 2025
## Description of change We want to support `readFully` as a part of our ongoing effort to integrate with Iceberg S3FileIO by default. [RangeReadable in Iceberg](https://github.com/apache/iceberg/blob/main/api/src/main/java/org/apache/iceberg/io/RangeReadable.java#L47) **Note:** Here's the comparison with existing read method: | Aspect | `read(byte[] buffer, int offset, int length)` | `readFully(long position, byte[] buffer, int offset, int length)` | |--------|----------------------------------------------|-------------------------------------------------------------------| | Method Signature | Reads from current stream position | Reads from specified position | | Position Behavior | Advances the stream position by the number of bytes actually read | Does not modify the stream position (position-independent read) | | Return & Error Handling | Returns `int` indicating bytes read; returns -1 at end of stream; may return fewer bytes than requested | Returns `void`; throws `IOException` if unable to read exact number of requested bytes | #### Relevant issues Once this feature is released as `1.2.0`, we will update this [Iceberg PR](apache/iceberg#13361) #### Does this contribution introduce any breaking changes to the existing APIs or behaviors? No #### Does this contribution introduce any new public APIs or behaviors? Yes #### How was the contribution tested? Ran existing and new tests locally #### Does this contribution need a changelog entry? - [x] I have updated the CHANGELOG or README if appropriate --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the [Developer Certificate of Origin (DCO)](https://developercertificate.org/).
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.
Description of change
We want to support
readFullyas a part of our ongoing effort to integrate with Iceberg S3FileIO by default. RangeReadable in IcebergNote: Here's the comparison with existing read method:
read(byte[] buffer, int offset, int length)readFully(long position, byte[] buffer, int offset, int length)intindicating bytes read; returns -1 at end of stream; may return fewer bytes than requestedvoid; throwsIOExceptionif unable to read exact number of requested bytesRelevant issues
Once this feature is released as
1.2.0, we will update this Iceberg PRDoes this contribution introduce any breaking changes to the existing APIs or behaviors?
No
Does this contribution introduce any new public APIs or behaviors?
Yes
How was the contribution tested?
Ran existing and new tests locally
Does this contribution need a changelog entry?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).