none
Multi-part downloading of Large Blobs

    Question


  • Could someone help me with a sample code snippet (preferably Java) to multi-part downloading a large blob?

    Something on the lines of uploading large blobs like 

    TimeSpan backOffPeriod = TimeSpan.FromSeconds(2);
    int retryCount = 1;
    BlobRequestOptions bro = new BlobRequestOptions() {
      SingleBlobUploadThresholdInBytes = 1024*1024, //1MB, the minimum
      ParallelOperationThreadCount = 1,
      RetryPolicy = new ExponentialRetry(backOffPeriod,retryCount),
    };
    
    CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(ConnectionString);
    CloudBlobClient cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient();
    cloudBlobClient.DefaultRequestOptions = bro;
    cloudBlobContainer = cloudBlobClient.GetContainerReference(ContainerName);
    CloudBlockBlob blob = cloudBlobContainer.GetBlockBlobReference(Path.GetFileName(fileName));
    blob.StreamWriteSizeInBytes = 256*1024; //256 k
    blob.UploadFromFile(fileName,FileMode.Open);




    Monday, April 24, 2017 1:58 PM

All replies

  • Are you looking to use ParallelOperationThreadCount when downloading a large blob ? Currently parallel download is not supported in the Java SDK.

    As for sample code in Java; check out the samples in GitHub: https://github.com/Azure-Samples/storage-blob-java-getting-started

    Thursday, April 27, 2017 8:41 PM