Use CommonSwiftClient instead of SwiftClient in multipart code.

This commit is contained in:
Roman Bogorodskiy 2012-04-17 15:21:26 +04:00
parent 9d5f242e6c
commit 9e8bc44285
3 changed files with 8 additions and 4 deletions

View File

@ -49,6 +49,7 @@ import org.jclouds.openstack.swift.blobstore.functions.ObjectToBlobMetadata;
import com.google.common.base.Function;
import com.google.common.base.Supplier;
import com.google.common.util.concurrent.ListenableFuture;
import org.jclouds.openstack.swift.blobstore.strategy.internal.AsyncMultipartUploadStrategy;
/**
*
@ -66,10 +67,11 @@ public class CloudFilesAsyncBlobStore extends SwiftAsyncBlobStore {
BlobStoreListContainerOptionsToListContainerOptions container2ContainerListOptions,
ContainerToResourceList container2ResourceList, ObjectToBlob object2Blob, BlobToObject blob2Object,
ObjectToBlobMetadata object2BlobMd, BlobToHttpGetOptions blob2ObjectGetOptions,
Provider<FetchBlobMetadata> fetchBlobMetadataProvider, EnableCDNAndCache enableCDNAndCache) {
Provider<FetchBlobMetadata> fetchBlobMetadataProvider, EnableCDNAndCache enableCDNAndCache,
Provider<AsyncMultipartUploadStrategy> multipartUploadStrategy) {
super(context, blobUtils, service, defaultLocation, locations, sync, async, container2ResourceMd,
container2ContainerListOptions, container2ResourceList, object2Blob, blob2Object, object2BlobMd,
blob2ObjectGetOptions, fetchBlobMetadataProvider, null);
blob2ObjectGetOptions, fetchBlobMetadataProvider, multipartUploadStrategy);
this.enableCDNAndCache = enableCDNAndCache;
}

View File

@ -13,6 +13,7 @@ import org.jclouds.concurrent.Futures;
import org.jclouds.io.Payload;
import org.jclouds.io.PayloadSlicer;
import org.jclouds.logging.Logger;
import org.jclouds.openstack.swift.CommonSwiftAsyncClient;
import org.jclouds.openstack.swift.SwiftAsyncClient;
import org.jclouds.openstack.swift.SwiftClient;
import org.jclouds.openstack.swift.blobstore.SwiftAsyncBlobStore;
@ -91,7 +92,7 @@ public class ParallelMultipartUploadStrategy implements AsyncMultipartUploadStra
latch.countDown();
return;
}
final SwiftAsyncClient client = (SwiftAsyncClient) ablobstore.getContext()
final CommonSwiftAsyncClient client = (CommonSwiftAsyncClient) ablobstore.getContext()
.getProviderSpecificContext().getAsyncApi();
Payload chunkedPart = slicer.slice(payload, offset, size);
logger.debug(String.format("async uploading part %s of %s to container %s", part, key, container));

View File

@ -12,6 +12,7 @@ import org.jclouds.blobstore.reference.BlobStoreConstants;
import org.jclouds.io.Payload;
import org.jclouds.io.PayloadSlicer;
import org.jclouds.logging.Logger;
import org.jclouds.openstack.swift.CommonSwiftClient;
import org.jclouds.openstack.swift.SwiftClient;
import org.jclouds.openstack.swift.blobstore.SwiftBlobStore;
import org.jclouds.openstack.swift.blobstore.functions.BlobToObject;
@ -52,7 +53,7 @@ public class SequentialMultipartUploadStrategy implements MultipartUploadStrateg
int parts = algorithm.getParts();
long chunkSize = algorithm.getChunkSize();
if (parts > 0) {
SwiftClient client = (SwiftClient) ablobstore.getContext()
CommonSwiftClient client = (CommonSwiftClient) ablobstore.getContext()
.getProviderSpecificContext().getApi();
try {