question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get appendBlob block number

See original GitHub issue

Hi all,

In http://azure.github.io/azure-storage-node/BlobService.html I find appendFromText(container, blob, text [, options], callback) and appendBlockFromText(container, blob, content [, options], callback)

I know that each blob has at most 50000 blocks(about 200GB?), so I’m wondering:

  1. How can I get current block count for a certain appendBlob? I know blockBlob has listBlock(), and there is something like REST API that can get info from storage, but I just can’t find what I want
  2. If I use appendBlockFromText, it means that I can only call it 50000 times for each appendBlob? What about appendFromText, can I call it as many times as I want until reach the maximum storage limit?

Besides, is there any way I can check whether a blob is being written?

Please give me some suggestions, thanks.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jiacfancommented, Jul 26, 2018

Hi, @frankShih

I think you mean appendBlockFromText and appendFromText.

For appendFromText it will always check the x-ms-blob-condition-appendpos, and should be used with single writer. And for appendBlockFromText, it can be used with multiple writers, when sequence of the data to be appended is not important.

Best Regards, Jiachen

1reaction
jiacfancommented, Jul 25, 2018

Hi, @frankShih

Q; How can I get current block count for a certain appendBlob? A: As the AppendBlock and GetBlob rest api, there is response header x-ms-blob-committed-block-count which can help you to get current block count of a certain appendBlob.

Q: If I use appendBlockFromText, it means that I can only call it 50000 times for each appendBlob? What about appendFromText, can I call it as many times as I want until reach the maximum storage limit? A: Yes, you can only call it 50000 times, as description of AppendBlock:

Each block can be a different size, up to a maximum of 4 MB. A maximum of 50,000 appends are permitted for each append blob. The maximum size of an append blob is therefore slightly more than 195 GB (4 MB X 50,000 blocks). If you attempt to upload a block that is larger than 4 MB, the service returns HTTP status code 413 (Request Entity Too Large). The service also returns additional information about the error in the response, including the maximum block size permitted in bytes. If you attempt to upload more than 50,000 blocks, the service returns the BlockCountExceedsLimit error (HTTP status code 409 – Conflict).

Q: Is there any way I can check whether a blob is being written? A: Please use request header x-ms-blob-condition-appendpos, if the append position is not as expected(i.e. the blob is being written), there would be error returned.

Best Regards, Jiachen

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding block blobs, append blobs, and page blobs
Each block in an append blob can be a different size, up to a maximum of 4 MiB, and an append blob can...
Read more >
Azure AppendBlob number of block/writes - Stack Overflow
Each block in an append blob can be a different size, up to a maximum of 4 MB, and an append blob can...
Read more >
Storing Growing Files Using Azure Blob Storage and Append ...
Our total file size must be less than 195GiB · Each block can be no bigger than 4MiB · There's a hard cap...
Read more >
AppendBlobClient (Azure SDK for Java Reference ... - NET
Commits a new block of data from another blob to the end of this append blob. ... System.out.printf("AppendBlob has %d committed blocks%n", client....
Read more >
Block Blob, Append blob and Page Blob explained with demo
Azure #AzureBasics #AzureFundamentalsAzure blob storage tutorial | Block Blob, Append blob and Page Blob explained with demoHere we have ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found