HoustonPutman commented on code in PR #3341:
URL: https://github.com/apache/solr/pull/3341#discussion_r2070463670
##########
solr/modules/s3-repository/src/java/org/apache/solr/s3/S3StorageClient.java:
##########
@@ -374,8 +377,23 @@ InputStream pullStream(String path) throws S3Exception {
final String s3Path = sanitizedFilePath(path);
try {
+ GetObjectRequest.Builder getBuilder =
+ GetObjectRequest.builder().bucket(bucketName).key(s3Path);
// This InputStream instance needs to be closed by the caller
- return s3Client.getObject(b -> b.bucket(bucketName).key(s3Path));
+ return s3Client.getObject(
+ getBuilder.build(),
+ ResponseTransformer.unmanaged(
+ (response, inputStream) ->
+ new ResumableInputStream(
+ inputStream,
+ response.contentLength(),
+ (bytesRead, contentLength) -> {
+ if (bytesRead > 0) {
+ getBuilder.range(
+ String.format(Locale.ROOT, "bytes=%d-%d",
bytesRead, contentLength));
Review Comment:
So it's exclusive on the ending, so even though it's 0 based it should be
safe. I checked other usages of this, and it's consistent with what I've done.
Oh I didn't know `"%s-"` was an option. If so, then yeah, no need to use
Content Length either...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]