mirror of https://github.com/apache/druid.git
default to archiving segments + docs
This commit is contained in:
parent
1f7a089fa8
commit
e38f2877fb
|
@ -287,6 +287,8 @@ This deep storage is used to interface with Amazon's S3.
|
|||
|`druid.storage.bucket`|S3 bucket name.|none|
|
||||
|`druid.storage.basekey`|S3 base key.|none|
|
||||
|`druid.storage.disableAcl`|Boolean flag for ACL.|false|
|
||||
|`druid.storage.archive`|Boolean flag. Archives killed segments instead of deleting them from S3|true|
|
||||
|`druid.storage.archiveBucket`|S3 bucket name to archive segments to|none|
|
||||
|
||||
#### HDFS Deep Storage
|
||||
|
||||
|
|
|
@ -58,8 +58,14 @@ public class S3DataSegmentKiller implements DataSegmentKiller
|
|||
String s3Bucket = MapUtils.getString(loadSpec, "bucket");
|
||||
String s3Path = MapUtils.getString(loadSpec, "key");
|
||||
String s3DescriptorPath = s3Path.substring(0, s3Path.lastIndexOf("/")) + "/descriptor.json";
|
||||
|
||||
final String s3ArchiveBucket = config.getArchiveBucket();
|
||||
|
||||
if(config.isArchive() && s3ArchiveBucket.isEmpty()) {
|
||||
log.warn("S3 archive bucket not specified, refusing to delete segment [s3://%s/%s]", s3Bucket, s3Path);
|
||||
return;
|
||||
}
|
||||
|
||||
if (s3Client.isObjectInBucket(s3Bucket, s3Path)) {
|
||||
if (config.isArchive()) {
|
||||
log.info("Archiving index file[s3://%s/%s] to [s3://%s/%s]",
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||
public class S3DataSegmentKillerConfig
|
||||
{
|
||||
@JsonProperty
|
||||
public boolean archive = false;
|
||||
public boolean archive = true;
|
||||
|
||||
@JsonProperty
|
||||
public String archiveBucket = "";
|
||||
|
|
Loading…
Reference in New Issue