hnakamor commented on code in PR #13195:
URL: https://github.com/apache/druid/pull/13195#discussion_r991655096
##########
extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3TaskLogs.java:
##########
@@ -95,9 +96,15 @@ private Optional<InputStream> streamTaskFile(final long
offset, String taskKey)
}
final GetObjectRequest request = new
GetObjectRequest(config.getS3Bucket(), taskKey)
- .withMatchingETagConstraint("\"" + objectMetadata.getETag() + "\"")
+ .withMatchingETagConstraint(objectMetadata.getETag())
.withRange(start, end);
+ if (objectMetadata.getETag() != null) {
+ if (!objectMetadata.getETag().startsWith("\"") &&
!objectMetadata.getETag().endsWith("\"")) {
+ request.setMatchingETagConstraints(Collections.singletonList("\""
+ objectMetadata.getETag() + "\""));
+ }
+ }
Review Comment:
Thanks for the review.
I have added a helper method and test cases as you mentioned.
> For the test cases, we also need a test case that accept a etag without
quotation and check the the etag in the final reuqest has quotation marks.
I may not be able to meet your expectations regarding the above test case.
In that case, I would like to modify it and would be glad if you could
provide the test pattern for my reference.
--
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]