You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ga...@apache.org on 2016/06/01 23:56:49 UTC

[1/3] jclouds git commit: Ensure MPU has a minimum size

Repository: jclouds
Updated Branches:
  refs/heads/master 209152e30 -> 421764dfd


Ensure MPU has a minimum size


Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/1ac73d30
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/1ac73d30
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/1ac73d30

Branch: refs/heads/master
Commit: 1ac73d3093df1b302e705095bffaaf634052b37f
Parents: 209152e
Author: Andrew Gaul <ga...@apache.org>
Authored: Wed Jun 1 16:14:58 2016 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Wed Jun 1 16:14:58 2016 -0700

----------------------------------------------------------------------
 .../strategy/internal/MultipartUploadSlicingAlgorithm.java      | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/1ac73d30/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/MultipartUploadSlicingAlgorithm.java
----------------------------------------------------------------------
diff --git a/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/MultipartUploadSlicingAlgorithm.java b/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/MultipartUploadSlicingAlgorithm.java
index 5cd68a0..0da3bf6 100644
--- a/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/MultipartUploadSlicingAlgorithm.java
+++ b/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/MultipartUploadSlicingAlgorithm.java
@@ -93,6 +93,11 @@ public final class MultipartUploadSlicingAlgorithm {
             parts = (int)(length / partSize);
          }
       }
+      if (partSize < minimumPartSize) {
+         partSize = minimumPartSize;
+         unitPartSize = minimumPartSize;
+         parts = (int)(length / unitPartSize);
+      }
       if (partSize > maximumPartSize) {
          partSize = maximumPartSize;
          unitPartSize = maximumPartSize;


[2/3] jclouds git commit: Use provided minimum part size in MPU tests

Posted by ga...@apache.org.
Use provided minimum part size in MPU tests


Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/5a85f5b5
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/5a85f5b5
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/5a85f5b5

Branch: refs/heads/master
Commit: 5a85f5b5f9df6425275fa5fcb1c746962d0ca73f
Parents: 1ac73d3
Author: Andrew Gaul <ga...@apache.org>
Authored: Wed Jun 1 16:15:15 2016 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Wed Jun 1 16:15:15 2016 -0700

----------------------------------------------------------------------
 .../integration/internal/BaseBlobIntegrationTest.java       | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/5a85f5b5/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
----------------------------------------------------------------------
diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
index 369f98e..6d5a5cb 100644
--- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
+++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
@@ -637,7 +637,7 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
 
    @Test(groups = { "integration", "live" })
    public void testPutMultipartByteSource() throws Exception {
-      long length = 32 * 1024 * 1024 + 1; // MultipartUploadSlicingAlgorithm.DEFAULT_PART_SIZE + 1
+      long length = getMinimumMultipartBlobSize();
       BlobStore blobStore = view.getBlobStore();
       MultipartUploadSlicingAlgorithm algorithm = new MultipartUploadSlicingAlgorithm(
               blobStore.getMinimumMultipartPartSize(), blobStore.getMaximumMultipartPartSize(),
@@ -707,14 +707,17 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
    public void testPutBlobAccessMultipart() throws Exception {
       BlobStore blobStore = view.getBlobStore();
       String containerName = getContainerName();
+      ByteSource byteSource = TestUtils.randomByteSource().slice(0, getMinimumMultipartBlobSize());
+      Payload payload = Payloads.newByteSourcePayload(byteSource);
+      payload.getContentMetadata().setContentLength(byteSource.size());
       try {
          String blobNamePrivate = "put-access-blob-name-private";
-         Blob blobPrivate = blobStore.blobBuilder(blobNamePrivate).payload(new byte[1]).build();
+         Blob blobPrivate = blobStore.blobBuilder(blobNamePrivate).payload(payload).build();
          blobStore.putBlob(containerName, blobPrivate, new PutOptions().setBlobAccess(BlobAccess.PRIVATE).multipart(true));
          assertThat(blobStore.getBlobAccess(containerName, blobNamePrivate)).isEqualTo(BlobAccess.PRIVATE);
 
          String blobNamePublic = "put-access-blob-name-public";
-         Blob blobPublic = blobStore.blobBuilder(blobNamePublic).payload(new byte[1]).build();
+         Blob blobPublic = blobStore.blobBuilder(blobNamePublic).payload(payload).build();
          blobStore.putBlob(containerName, blobPublic, new PutOptions().setBlobAccess(BlobAccess.PUBLIC_READ).multipart(true));
          assertThat(blobStore.getBlobAccess(containerName, blobNamePublic)).isEqualTo(BlobAccess.PUBLIC_READ);
       } finally {


[3/3] jclouds git commit: Remove disposition checks from testFileGetParallel

Posted by ga...@apache.org.
Remove disposition checks from testFileGetParallel

Some providers like B2 do not support Content-Disposition and other
tests exercise this functionality.


Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/421764df
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/421764df
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/421764df

Branch: refs/heads/master
Commit: 421764dfd1866409332f4cec5874646323157b63
Parents: 5a85f5b
Author: Andrew Gaul <ga...@apache.org>
Authored: Wed Jun 1 16:15:47 2016 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Wed Jun 1 16:15:47 2016 -0700

----------------------------------------------------------------------
 .../integration/internal/BaseBlobIntegrationTest.java        | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds/blob/421764df/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
----------------------------------------------------------------------
diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
index 6d5a5cb..cb3477d 100644
--- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
+++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java
@@ -167,12 +167,11 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
    @Test(groups = { "integration", "live" })
    public void testFileGetParallel() throws Exception {
       final ByteSource supplier = createTestInput(32 * 1024);
-      final String expectedContentDisposition = "attachment; filename=constit.txt";
       final String container = getContainerName();
       try {
          final String name = "constitution.txt";
 
-         uploadByteSource(container, name, expectedContentDisposition, supplier);
+         uploadByteSource(container, name, supplier);
          Map<Integer, ListenableFuture<?>> responses = Maps.newHashMap();
          for (int i = 0; i < 10; i++) {
             responses.put(i, this.exec.submit(new Callable<Void>() {
@@ -181,7 +180,6 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
                      Blob blob = view.getBlobStore().getBlob(container, name);
                      validateMetadata(blob.getMetadata(), container, name);
                      assertEquals(hashAndClose(blob.getPayload().openStream(), md5()), supplier.hash(md5()));
-                     checkContentDisposition(blob, expectedContentDisposition);
                   } catch (IOException e) {
                      Throwables.propagate(e);
                   }
@@ -201,15 +199,13 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
 
    }
 
-   private void uploadByteSource(String container, String name, String contentDisposition,
-         ByteSource byteSource) throws IOException {
+   private void uploadByteSource(String container, String name, ByteSource byteSource) throws IOException {
       BlobStore blobStore = view.getBlobStore();
       blobStore.putBlob(container, blobStore.blobBuilder(name)
             .payload(new ByteSourcePayload(byteSource))
             .contentType("text/plain")
             .contentMD5(byteSource.hash(md5()))
             .contentLength(byteSource.size())
-            .contentDisposition(contentDisposition)
             .build());
    }