Skip to content

S3RangeReader totalLength Improvment - #3025

Merged
pomadchin merged 4 commits into
locationtech:masterfrom
jbouffard:improvement/s3-header
Jul 19, 2019
Merged

pomadchin merged 4 commits into
locationtech:masterfrom
jbouffard:improvement/s3-header

Conversation

@jbouffard

@jbouffard jbouffard commented Jul 16, 2019 •

Copy link
Copy Markdown
Contributor

Overview

This PR changes how the totalLength value of S3RangeReader is computed. It will now use a GetObjectResponse instead of a GetHeaderResponse. This will allow users to read these files even if they don't have permission to access its HEADER.

Checklist

  • docs/CHANGELOG.rst updated, if necessary
  • Check it on a real S3 bucket with permission limits

Closes #2889

@jbouffard

Copy link
Copy Markdown
Contributor Author

I'm not really sure there are any unit tests that can be created for this PR. It might be good to test this branch on a real world example.

Comment thread s3/src/main/scala/geotrellis/store/s3/util/S3RangeReader.scala Outdated
Comment thread s3/src/main/scala/geotrellis/store/s3/util/S3RangeReader.scala Outdated
Comment thread s3/src/main/scala/geotrellis/store/s3/util/S3RangeReader.scala
@jbouffard

Copy link
Copy Markdown
Contributor Author

@echeipesh @pomadchin After mentioning my results yesterday, @moradology looked into it as well and found that using a responseStream worked fine for finding the contentLength. I ran the code again this morning and observed similar speeds as Nathan. I'm not sure what happened yesterday 😕 As everything was so much slower. Regardless, this PR should be good to merge now.

@pomadchin pomadchin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

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.

S3RangeReader will always produce HEAD request

3 participants