Get appendBlob block numberSee original GitHub issue
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:
- 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
- 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.
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
I think you mean
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
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