mirror of https://github.com/apache/druid.git
Merge pull request #595 from metamx/s3-glacier-warn
warn glacier objects cannot be moved
This commit is contained in:
commit
0dbe432646
9
pom.xml
9
pom.xml
|
@ -393,7 +393,14 @@
|
|||
<dependency>
|
||||
<groupId>net.java.dev.jets3t</groupId>
|
||||
<artifactId>jets3t</artifactId>
|
||||
<version>0.9.0</version>
|
||||
<version>0.9.1</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<!-- exclude artifact not available in maven central -->
|
||||
<groupId>com.centerkey.utils</groupId>
|
||||
<artifactId>barebonesbrowserlaunch</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
|
|
|
@ -120,6 +120,10 @@ public class S3DataSegmentMover implements DataSegmentMover
|
|||
if (s3Client.isObjectInBucket(s3Bucket, s3Path)) {
|
||||
if (s3Bucket.equals(targetS3Bucket) && s3Path.equals(targetS3Path)) {
|
||||
log.info("No need to move file[s3://%s/%s] onto itself", s3Bucket, s3Path);
|
||||
} else if (s3Client.getObjectDetails(s3Bucket, s3Path)
|
||||
.getStorageClass()
|
||||
.equals(S3Object.STORAGE_CLASS_GLACIER)) {
|
||||
log.warn("Cannot move file[s3://%s/%s] of storage class glacier.");
|
||||
} else {
|
||||
log.info(
|
||||
"Moving file[s3://%s/%s] to [s3://%s/%s]",
|
||||
|
|
|
@ -73,11 +73,6 @@ public class S3StorageDruidModule implements DruidModule
|
|||
@LazySingleton
|
||||
public RestS3Service getRestS3Service(AWSCredentials credentials)
|
||||
{
|
||||
try {
|
||||
return new RestS3Service(credentials);
|
||||
}
|
||||
catch (S3ServiceException e) {
|
||||
throw new ProvisionException("Unable to create a RestS3Service", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ import io.druid.timeline.partition.NoneShardSpec;
|
|||
import org.jets3t.service.S3ServiceException;
|
||||
import org.jets3t.service.ServiceException;
|
||||
import org.jets3t.service.impl.rest.httpclient.RestS3Service;
|
||||
import org.jets3t.service.model.S3Bucket;
|
||||
import org.jets3t.service.model.S3Object;
|
||||
import org.jets3t.service.model.StorageObject;
|
||||
import org.joda.time.Interval;
|
||||
|
@ -131,6 +132,18 @@ public class S3DataSegmentMoverTest
|
|||
return (objects != null && objects.contains(objectKey));
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageObject getObjectDetails(String bucketName, String objectKey) throws ServiceException
|
||||
{
|
||||
if (isObjectInBucket(bucketName, objectKey)) {
|
||||
final S3Object object = new S3Object(objectKey);
|
||||
object.setStorageClass(S3Object.STORAGE_CLASS_STANDARD);
|
||||
return object;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> moveObject(
|
||||
String sourceBucketName,
|
||||
|
|
Loading…
Reference in New Issue