Azure AppendBlob块/写入数 [英] Azure AppendBlob number of block/writes

查看:49
本文介绍了Azure AppendBlob块/写入数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Azure中使用 AppendBlob 进行日志记录.一段时间后,我遇到了 409冲突错误.我的猜测是达到了块/写入的最大数量(50.000).

有什么方法可以获取blob中的块数/写入数吗?

解决方案

有关 AppendBlob 最大值的详细信息,您可以参考参考页 附加块 ,则可以获取该块通过获取响应标头 x-ms-blob-committed-block-count 来计数 AppendBlob ,这是Blob中存在的已提交块的数量,可用于控制可以完成多少个追加.

对于C#,通过属性 AppendBlobCommittedBlockCount 从对象 CloudAppendBlob BlobProperties 获取块计数,请参阅参考资料 BlobProperties.AppendBlobCommittedBlockCount属性.

I am using AppendBlob in Azure for logging. After some time I experienced 409 Conflict Error. My guess is the maximal amount of block/writes (50.000) was reached.

Is there any way to get count of blocks/writes in the blob?

解决方案

In Azure Reference, you can find the table of Blob Service Error Codes which list the error codes may be returned by an operation against the Blob service includes Conflict 409, please see below.

The details for the maximums of AppendBlob, you can refer to the section About Append Blobs of the reference page Understanding Block Blobs, Append Blobs, and Page Blobs as below.

Each block in an append blob can be a different size, up to a maximum of 4 MB, and an append blob can include up to 50,000 blocks. The maximum size of an append blob is therefore slightly more than 195 GB (4 MB X 50,000 blocks).

As @yonisha said, if using REST API Append Block, you can get the block count for AppendBlob via get the response header x-ms-blob-committed-block-count which is the number of committed blocks present in the blob and can be used to control how many more appends can be done.

For C#, getting the block count via the property AppendBlobCommittedBlockCount form the BlobProperties for the object CloudAppendBlob, please see the reference BlobProperties.AppendBlobCommittedBlockCount Property.

这篇关于Azure AppendBlob块/写入数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆