From 204324b1fb9bea4c2ed1c39da38f680e586a7130 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Tue, 5 Feb 2019 10:16:37 -0800 Subject: [PATCH] Increase Azure maximum single part upload size Enabled by Azure API version 2017-04-17 and jclouds 2.1.1. Also tweak Azure multipart comments. --- src/main/java/org/gaul/s3proxy/S3ProxyHandler.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java b/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java index 2c255d2..d5f5c25 100644 --- a/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java +++ b/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java @@ -1859,7 +1859,7 @@ public class S3ProxyHandler { String blobStoreType = getBlobStoreType(blobStore); if (blobStoreType.equals("azureblob") && - contentLength > 64 * 1024 * 1024) { + contentLength > 256 * 1024 * 1024) { options.multipart(true); } @@ -2464,9 +2464,8 @@ public class S3ProxyHandler { String blobStoreType = getBlobStoreType(blobStore); try (InputStream is = blob.getPayload().openStream()) { if (blobStoreType.equals("azureblob")) { - // Azure has a maximum part size of 4 MB while S3 has a minimum - // part size of 5 MB and a maximum of 5 GB. Split a single S3 - // part multiple Azure parts. + // Azure has a smaller maximum part size than S3. Split a + // single S3 part multiple Azure parts. long azureMaximumMultipartPartSize = blobStore.getMaximumMultipartPartSize(); HashingInputStream his = new HashingInputStream(MD5, is); @@ -2600,9 +2599,8 @@ public class S3ProxyHandler { blobName, uploadId, blobMetadata, new PutOptions()); if (getBlobStoreType(blobStore).equals("azureblob")) { - // Azure has a maximum part size of 4 MB while S3 has a minimum - // part size of 5 MB and a maximum of 5 GB. Split a single S3 - // part multiple Azure parts. + // Azure has a smaller maximum part size than S3. Split a single + // S3 part multiple Azure parts. long azureMaximumMultipartPartSize = blobStore.getMaximumMultipartPartSize(); HashingInputStream his = new HashingInputStream(MD5, is);