You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/10/10 21:36:29 UTC

[GitHub] [druid] hnakamor commented on a diff in pull request #13195: Support to read task logs from some S3 compatible cloud storage

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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org