This is an automated email from the ASF dual-hosted git repository.
pvillard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 39edaaedb2 NIFI-14318 Add support for uploading files larger than
200GB to Azure Blob Storage
39edaaedb2 is described below
commit 39edaaedb2b48f22635b2841ac3212bc6dec9c63
Author: pkelly-nifi <[email protected]>
AuthorDate: Fri Nov 14 10:37:40 2025 -0500
NIFI-14318 Add support for uploading files larger than 200GB to Azure Blob
Storage
Signed-off-by: Pierre Villard <[email protected]>
This closes #10533.
---
.../apache/nifi/processors/azure/storage/PutAzureBlobStorage_v12.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git
a/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/PutAzureBlobStorage_v12.java
b/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/PutAzureBlobStorage_v12.java
index a0c65f0ccc..c984a727c8 100644
---
a/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/PutAzureBlobStorage_v12.java
+++
b/nifi-extension-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/storage/PutAzureBlobStorage_v12.java
@@ -26,6 +26,7 @@ import com.azure.storage.blob.models.BlobRequestConditions;
import com.azure.storage.blob.models.BlobStorageException;
import com.azure.storage.blob.models.BlobType;
import com.azure.storage.blob.models.BlockBlobItem;
+import com.azure.storage.blob.models.ParallelTransferOptions;
import com.azure.storage.blob.options.BlobParallelUploadOptions;
import org.apache.nifi.annotation.behavior.InputRequirement;
import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
@@ -171,12 +172,15 @@ public class PutAzureBlobStorage_v12 extends
AbstractAzureBlobProcessor_v12 impl
}
final long transferSize =
fileResourceFound.map(FileResource::getSize).orElse(flowFile.getSize());
+ final long blockSize = Math.max(Math.ceilDiv(transferSize,
50000), BlobClient.BLOB_DEFAULT_UPLOAD_BLOCK_SIZE);
final FlowFile sourceFlowFile = flowFile;
try (InputStream sourceInputStream = fileResourceFound
.map(FileResource::getInputStream)
.orElseGet(() -> session.read(sourceFlowFile))
) {
final BlobParallelUploadOptions blobParallelUploadOptions
= new BlobParallelUploadOptions(toFluxByteBuffer(sourceInputStream,
BlobClient.BLOB_DEFAULT_UPLOAD_BLOCK_SIZE));
+ final ParallelTransferOptions parallelTransferOptions =
new ParallelTransferOptions().setBlockSizeLong(blockSize);
+
blobParallelUploadOptions.setParallelTransferOptions(parallelTransferOptions);
blobParallelUploadOptions.setRequestConditions(blobRequestConditions);
Response<BlockBlobItem> response =
blobClient.uploadWithResponse(blobParallelUploadOptions, null, Context.NONE);
BlockBlobItem blob = response.getValue();