Adding a configuration property to disable setting an ACL on the segment pushed to S3.

This commit is contained in:
Stefán Freyr Stefánsson 2013-07-24 23:37:21 +00:00
parent e3879f0c77
commit b3530fb15d
2 changed files with 10 additions and 2 deletions

View File

@ -80,7 +80,9 @@ public class S3DataSegmentPusher implements DataSegmentPusher
final String outputBucket = config.getBucket(); final String outputBucket = config.getBucket();
toPush.setBucketName(outputBucket); toPush.setBucketName(outputBucket);
toPush.setKey(outputKey + "/index.zip"); toPush.setKey(outputKey + "/index.zip");
toPush.setAcl(GSAccessControlList.REST_CANNED_BUCKET_OWNER_FULL_CONTROL); if (!config.getDisableAcl()) {
toPush.setAcl(GSAccessControlList.REST_CANNED_BUCKET_OWNER_FULL_CONTROL);
}
log.info("Pushing %s.", toPush); log.info("Pushing %s.", toPush);
s3Client.putObject(outputBucket, toPush); s3Client.putObject(outputBucket, toPush);
@ -96,7 +98,9 @@ public class S3DataSegmentPusher implements DataSegmentPusher
S3Object descriptorObject = new S3Object(descriptorFile); S3Object descriptorObject = new S3Object(descriptorFile);
descriptorObject.setBucketName(outputBucket); descriptorObject.setBucketName(outputBucket);
descriptorObject.setKey(outputKey + "/descriptor.json"); descriptorObject.setKey(outputKey + "/descriptor.json");
descriptorObject.setAcl(GSAccessControlList.REST_CANNED_BUCKET_OWNER_FULL_CONTROL); if (!config.getDisableAcl()) {
descriptorObject.setAcl(GSAccessControlList.REST_CANNED_BUCKET_OWNER_FULL_CONTROL);
}
log.info("Pushing %s", descriptorObject); log.info("Pushing %s", descriptorObject);
s3Client.putObject(outputBucket, descriptorObject); s3Client.putObject(outputBucket, descriptorObject);

View File

@ -32,4 +32,8 @@ public abstract class S3DataSegmentPusherConfig
@Config("druid.pusher.s3.baseKey") @Config("druid.pusher.s3.baseKey")
@Default("") @Default("")
public abstract String getBaseKey(); public abstract String getBaseKey();
@Config("druid.pusher.s3.disableAcl")
@Default("false")
public abstract boolean getDisableAcl();
} }