From 1534e4ff37fca523af3cbf1b06b3153000857c8a Mon Sep 17 00:00:00 2001 From: Roman Bogorodskiy Date: Wed, 18 Apr 2012 12:41:09 +0400 Subject: [PATCH] Remove deub prints and fall back to traditional upload if file is not large enough. --- .../internal/SequentialMultipartUploadStrategy.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/internal/SequentialMultipartUploadStrategy.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/internal/SequentialMultipartUploadStrategy.java index d77012661b..c723a51742 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/internal/SequentialMultipartUploadStrategy.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/internal/SequentialMultipartUploadStrategy.java @@ -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 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; } - + } else { + return ablobstore.putBlob(container, blob, PutOptions.NONE); } - return "NOT IMPLEMENTED"; } }