radito3 commented on a change in pull request #89:
URL: https://github.com/apache/jclouds/pull/89#discussion_r533368106



##########
File path: 
blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobStore.java
##########
@@ -354,48 +350,22 @@ protected String putMultipartBlob(String container, Blob 
blob, PutOptions overri
    protected String putMultipartBlob(String container, Blob blob, PutOptions 
overrides, ListeningExecutorService executor) {
       ArrayList<ListenableFuture<MultipartPart>> parts = new 
ArrayList<ListenableFuture<MultipartPart>>();
       MultipartUpload mpu = initiateMultipartUpload(container, 
blob.getMetadata(), overrides);
-      // Cannot slice InputStream Payload since slice and close mutate the
-      // underlying stream.  Also issue synchronous uploads to avoid buffering
-      // arbitrary amounts of data in-memory.
       Payload payload = blob.getPayload();
-      boolean repeatable = blob.getPayload().isRepeatable();
-      if (!repeatable) {
-         payload = Payloads.newInputStreamPayload(new 
FilterInputStream((InputStream) payload.getRawContent()) {
-            @Override
-            public long skip(long offset) throws IOException {
-               // intentionally not implemented
-               return offset;
-            }
-
-            @Override
-            public void close() throws IOException {
-               // intentionally not implemented
-            }
-         });
-      }
-
-      try {
-         long contentLength = 
blob.getMetadata().getContentMetadata().getContentLength();
-         // TODO: inject MultipartUploadSlicingAlgorithm to override default 
part size
-         MultipartUploadSlicingAlgorithm algorithm = new 
MultipartUploadSlicingAlgorithm(
-               getMinimumMultipartPartSize(), getMaximumMultipartPartSize(), 
getMaximumNumberOfParts());
-         long partSize = algorithm.calculateChunkSize(contentLength);
-         int partNumber = 1;
-         while (partNumber <= algorithm.getParts()) {
-            Payload slice = slicer.slice(payload, algorithm.getCopied(), 
partSize);
+      boolean repeatable = payload.isRepeatable();
+      int partSize = (int) (getMinimumMultipartPartSize() + 
getMaximumMultipartPartSize()) / 2;

Review comment:
       Thanks for pointing it out, I'll try to do as per your suggestion.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to