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.
pull/293/head
Andrew Gaul 2019-02-05 10:16:37 -08:00
rodzic c6b4839d2b
commit 204324b1fb
1 zmienionych plików z 5 dodań i 7 usunięć

Wyświetl plik

@ -1859,7 +1859,7 @@ public class S3ProxyHandler {
String blobStoreType = getBlobStoreType(blobStore); String blobStoreType = getBlobStoreType(blobStore);
if (blobStoreType.equals("azureblob") && if (blobStoreType.equals("azureblob") &&
contentLength > 64 * 1024 * 1024) { contentLength > 256 * 1024 * 1024) {
options.multipart(true); options.multipart(true);
} }
@ -2464,9 +2464,8 @@ public class S3ProxyHandler {
String blobStoreType = getBlobStoreType(blobStore); String blobStoreType = getBlobStoreType(blobStore);
try (InputStream is = blob.getPayload().openStream()) { try (InputStream is = blob.getPayload().openStream()) {
if (blobStoreType.equals("azureblob")) { if (blobStoreType.equals("azureblob")) {
// Azure has a maximum part size of 4 MB while S3 has a minimum // Azure has a smaller maximum part size than S3. Split a
// part size of 5 MB and a maximum of 5 GB. Split a single S3 // single S3 part multiple Azure parts.
// part multiple Azure parts.
long azureMaximumMultipartPartSize = long azureMaximumMultipartPartSize =
blobStore.getMaximumMultipartPartSize(); blobStore.getMaximumMultipartPartSize();
HashingInputStream his = new HashingInputStream(MD5, is); HashingInputStream his = new HashingInputStream(MD5, is);
@ -2600,9 +2599,8 @@ public class S3ProxyHandler {
blobName, uploadId, blobMetadata, new PutOptions()); blobName, uploadId, blobMetadata, new PutOptions());
if (getBlobStoreType(blobStore).equals("azureblob")) { if (getBlobStoreType(blobStore).equals("azureblob")) {
// Azure has a maximum part size of 4 MB while S3 has a minimum // Azure has a smaller maximum part size than S3. Split a single
// part size of 5 MB and a maximum of 5 GB. Split a single S3 // S3 part multiple Azure parts.
// part multiple Azure parts.
long azureMaximumMultipartPartSize = long azureMaximumMultipartPartSize =
blobStore.getMaximumMultipartPartSize(); blobStore.getMaximumMultipartPartSize();
HashingInputStream his = new HashingInputStream(MD5, is); HashingInputStream his = new HashingInputStream(MD5, is);