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

Add apply methods to s3rangereader #1994

Merged

Conversation

moradology
Copy link
Contributor

A very common use case when using S3 is having to account for URIs and strings. We can use the structure of S3 URIs to make the API for grabbing an S3RangeReader a little less imposing.

@moradology
Copy link
Contributor Author

@jbouffard

Copy link
Contributor

@echeipesh echeipesh left a comment

Choose a reason for hiding this comment

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

Looks sensible and using the URI for s3 keys is something we should integrate more consistently. Would be good to see an example of cleanup in the client code this enables.

@moradology
Copy link
Contributor Author

moradology commented Jan 31, 2017

TiffTags read API comparison

(Assuming that uri is a String and a link to an S3 bucket)

Before:

val s3Uri = new AmazonS3URI(uri)
val s3Client = new AmazonS3Client(new AWSAmazonS3Client(new DefaultAWSCredentialsProviderChain))
val s3RangeReader = S3RangeReader(s3Uri.getBucket, s3Uri.getKey, s3Client)
TiffTagsReader.read(s3RangeReader)

After:

val s3RangeReader = S3RangeReader(uri)
TiffTagsReader.read(s3RangeReader)

@echeipesh echeipesh merged commit e7b6588 into locationtech:master Jan 31, 2017
@lossyrob lossyrob added this to the 1.1 milestone Mar 12, 2017
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.

None yet

4 participants