Remove deub prints and fall back to traditional upload if file is not large enough.

This commit is contained in:
Roman Bogorodskiy 2012-04-18 12:41:09 +04:00
parent 9d76fd1aa4
commit 1534e4ff37
1 changed files with 2 additions and 7 deletions

View File

@ -42,7 +42,6 @@ public class SequentialMultipartUploadStrategy implements MultipartUploadStrateg
@Override
public String execute(String container, Blob blob, PutOptions options, BlobToObject blob2Object) {
System.out.println("here we go");
String key = blob.getMetadata().getName();
Payload payload = blob.getPayload();
MultipartUploadSlicingAlgorithm algorithm = new MultipartUploadSlicingAlgorithm();
@ -57,10 +56,8 @@ public class SequentialMultipartUploadStrategy implements MultipartUploadStrateg
.getProviderSpecificContext().getApi();
try {
SortedMap<Integer, String> etags = Maps.newTreeMap();
int part;
while ((part = algorithm.getNextPart()) <= parts) {
System.out.println("Uploading part " + part);
Payload chunkedPart = slicer.slice(payload,
algorithm.getNextChunkOffset(), chunkSize);
Blob blobPart = ablobstore.blobBuilder(blob.getMetadata().getName() + PART_SEPARATOR +
@ -70,7 +67,6 @@ public class SequentialMultipartUploadStrategy implements MultipartUploadStrateg
}
long remaining = algorithm.getRemaining();
if (remaining > 0) {
System.out.println("Uploading tail.");
Payload chunkedPart = slicer.slice(payload,
algorithm.getNextChunkOffset(), remaining);
Blob blobPart = ablobstore.blobBuilder(blob.getMetadata().getName() + PART_SEPARATOR +
@ -84,11 +80,10 @@ public class SequentialMultipartUploadStrategy implements MultipartUploadStrateg
if (rtex == null) {
rtex = new RuntimeException(ex);
}
//client.abortMultipartUpload(container, key, uploadId);
throw rtex;
}
}
return "NOT IMPLEMENTED";
} else {
return ablobstore.putBlob(container, blob, PutOptions.NONE);
}
}
}