JCLOUDS-144: S3 multi-blob delete

This commit is contained in:
Andrew Gaul 2015-02-13 10:22:42 -08:00
parent 9898e99b50
commit ecc8548fbd
1 changed files with 9 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static org.jclouds.util.Predicates2.retry;
import java.util.List;
import java.util.Set;
import javax.inject.Inject;
@ -65,6 +66,7 @@ import com.google.common.base.Predicate;
import com.google.common.base.Supplier;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.Iterables;
@Singleton
public class S3BlobStore extends BaseBlobStore {
@ -283,6 +285,13 @@ public class S3BlobStore extends BaseBlobStore {
sync.deleteObject(container, key);
}
@Override
public void removeBlobs(String container, Iterable<String> keys) {
for (List<String> partition : Iterables.partition(keys, 1000)) {
sync.deleteObjects(container, partition);
}
}
/**
* This implementation invokes {@link S3Utils#deleteAndVerifyContainerGone}
*/