locked
Put Block and Put Block List RRS feed

  • Question

  • 1.I try below code, why do I get all blobs(including committedBlobs which upload by Put Block and Put Block List) except UncommittedBlobs (do not call Put Block List),

    protected void GetBlobsWithRequestOptions(String containerName)
    {
     CloudStorageAccount cloudStorageAccount = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");
     CloudBlobClient cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient();

     CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference(containerName);

     BlobRequestOptions blobRequestOptions = new BlobRequestOptions();
     blobRequestOptions.UseFlatBlobListing = true;
     blobRequestOptions.BlobListingDetails = BlobListingDetails.UncommittedBlobs;

     IEnumerable<IListBlobItem> blobList = cloudBlobContainer.ListBlobs(blobRequestOptions);
     foreach (var item in blobList)
     {
      var uri = item.Uri;
     }
    }

    2. If I call Put Block and don't call Put Block List (when putting blocks, but net interrupted), and I call Put Block or Put Block List again after a week later, what exception I will get?

    Thursday, September 2, 2010 2:13 AM

Answers

  • I see. So you mean you want to return only uncommitted blobs, right? This is not supported today. The behavior you're seeing is expected. Maybe the storage client API's name is a bit confusing. But in the end, BlobListingDetails.UncommittedBlobs is translated to the include={uncommittedblobs} query string. So it includes both committed and uncommitted blobs.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, September 2, 2010 5:51 AM

All replies

  • 1. Do you mean even if you specify BlobListingDetails.UncommittedBlobs, you still cannot get uncommited blobs in your response? I can't reproduce this issue here. Are you using development storage or cloud storage? If you use Fiddler to inspect the request, can you see include={uncommittedblobs} in the request URI?

    2. You will get status code 400, and error message: InvalidBlockList.


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, September 2, 2010 3:47 AM
  • Thanks reply.

    1. I mean I specify BlobListingDetails.UncommittedBlobs, I get commited blobs and uncommited blobs. I used cloud storage.

    2. Thanks for the information:  error message: InvalidBlockList.

    Thursday, September 2, 2010 5:47 AM
  • I see. So you mean you want to return only uncommitted blobs, right? This is not supported today. The behavior you're seeing is expected. Maybe the storage client API's name is a bit confusing. But in the end, BlobListingDetails.UncommittedBlobs is translated to the include={uncommittedblobs} query string. So it includes both committed and uncommitted blobs.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, September 2, 2010 5:51 AM
  • Thanks. I will try another solution.

     

    Thursday, September 2, 2010 6:09 AM