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

Use S3's range Object to fetch a chunk of bytes #127

Closed
HenryCaiHaiying opened this issue Mar 14, 2023 · 2 comments
Closed

Use S3's range Object to fetch a chunk of bytes #127

HenryCaiHaiying opened this issue Mar 14, 2023 · 2 comments

Comments

@HenryCaiHaiying
Copy link

Related to #126

You can use S3's range API to fetch a chunk of bytes from S3 object instead of the whole object/file:

            // Get a range of bytes from an object and print the bytes.
            GetObjectRequest rangeObjectRequest = new GetObjectRequest(bucketName, key)
                    .withRange(0, 9);

https://docs.aws.amazon.com/AmazonS3/latest/userguide/download-objects.html

This can be applied to S3ClientWrapper.fetchLogFile: https://github.com/aiven/tiered-storage-for-apache-kafka/blob/main/s3/src/main/java/io/aiven/kafka/tiered/storage/s3/S3ClientWrapper.java#L75

@AnatolyPopov
Copy link
Contributor

Please read the comment in #126

@ivanyu
Copy link
Contributor

ivanyu commented Jun 5, 2023

@ivanyu ivanyu closed this as completed Jun 5, 2023
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

No branches or pull requests

3 participants