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 2019/06/17 11:22:05 UTC
[GitHub] [incubator-druid] sashidhar commented on a change in pull request
#7907: #7875: Setting ACL on S3 task logs on similar lines as that of data
segments pushed to S3
sashidhar commented on a change in pull request #7907: #7875: Setting ACL on S3 task logs on similar lines as that of data segments pushed to S3
URL: https://github.com/apache/incubator-druid/pull/7907#discussion_r294250696
##########
File path: extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3TaskLogs.java
##########
@@ -146,6 +147,17 @@ private void pushTaskFile(final File logFile, String taskKey) throws IOException
}
}
+ private void uploadFileIfPossible(String bucket, String key, File file)
+ {
+ final PutObjectRequest logFilePutRequest = new PutObjectRequest(bucket, key, file);
+
+ if (!config.getDisableAcl()) {
+ logFilePutRequest.setAccessControlList(S3Utils.grantFullControlToBucketOwner(service, bucket));
+ }
+ log.info("Pushing [%s] to bucket[%s] and key[%s].", file, bucket, key);
+ service.putObject(logFilePutRequest);
+ }
+
Review comment:
@dclim, uploadFileIfPossible(..) is now a common method with my change in S3DataSegmentPusher.java and S3TaskLogs.java. Should I extract this method and move it to S3Utils.java. The only worry is the log statement in the method will now be moved to utils class. Is that ok ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org