Azure AppendBlob 数量 block/writes
Azure AppendBlob number of block/writes
我在 Azure 中使用 AppendBlob
进行日志记录。一段时间后,我体验了 409 Conflict Error
。我的猜测是达到了 block/writes (50.000) 的最大数量。
有什么方法可以计算 blob 中 blocks/writes 的数量吗?
如 Operations on Append blob documentation 中所写,特定 可用的 Append blob 类型 操作是 'Append Block'运算.
不过,您可以从追加块操作的 x-ms-blob-committed-block-count 响应头 中获取 已提交块计数 。来自文档:
The number of committed blocks present in the blob. This can be used
to control how many more appends can be done.
对于 C#,您可以简单地发出 appendBlob.Properties.AppendBlobCommittedBlockCount。
维萨姆
在 Azure Reference, you can find the table of Blob Service Error Codes 中,针对 Blob 服务的操作可能返回的错误代码列表包括 Conflict 409
,请参见下文。
关于最大值AppendBlob
的详细信息,您可以参考参考页Understanding Block Blobs, Append Blobs, and Page Blobs
的About Append Blobs
部分,如下所示。
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).
正如@yonisha 所说,如果使用 REST API Append Block
,您可以通过获取响应 header x-ms-blob-committed-block-count
获取 AppendBlob
的块计数这是 blob 中存在的已提交块的数量,可用于控制可以完成多少追加。
对于 C#,通过 属性 AppendBlobCommittedBlockCount
形式 BlobProperties
获取块计数 object CloudAppendBlob
,请参阅参考资料 BlobProperties.AppendBlobCommittedBlockCount Property.
我在 Azure 中使用 AppendBlob
进行日志记录。一段时间后,我体验了 409 Conflict Error
。我的猜测是达到了 block/writes (50.000) 的最大数量。
有什么方法可以计算 blob 中 blocks/writes 的数量吗?
如 Operations on Append blob documentation 中所写,特定 可用的 Append blob 类型 操作是 'Append Block'运算.
不过,您可以从追加块操作的 x-ms-blob-committed-block-count 响应头 中获取 已提交块计数 。来自文档:
The number of committed blocks present in the blob. This can be used to control how many more appends can be done.
对于 C#,您可以简单地发出 appendBlob.Properties.AppendBlobCommittedBlockCount。
维萨姆
在 Azure Reference, you can find the table of Blob Service Error Codes 中,针对 Blob 服务的操作可能返回的错误代码列表包括 Conflict 409
,请参见下文。
关于最大值AppendBlob
的详细信息,您可以参考参考页Understanding Block Blobs, Append Blobs, and Page Blobs
的About Append Blobs
部分,如下所示。
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).
正如@yonisha 所说,如果使用 REST API Append Block
,您可以通过获取响应 header x-ms-blob-committed-block-count
获取 AppendBlob
的块计数这是 blob 中存在的已提交块的数量,可用于控制可以完成多少追加。
对于 C#,通过 属性 AppendBlobCommittedBlockCount
形式 BlobProperties
获取块计数 object CloudAppendBlob
,请参阅参考资料 BlobProperties.AppendBlobCommittedBlockCount Property.