How to provide the complete path of the container in AzureStorageCheckpointLeaseManager class

∥☆過路亽.° 提交于 2019-12-13 02:50:56

问题


I am using EPH ( EventProcessorHost) class of Azure python SDK to receive events from the eventhub. It actually uses AzureStorageCheckpointLeaseManager for checkpointing and partitioning in the storage account. But I cannot see where I can write the full path of the storage account. Like it directly create files inside the specified container in the storage account. I would like to give the full path inside the container. Where can I do that?


回答1:


Here is my research:

In AzureStorageCheckpointLeaseManager, there is a parameter storage_blob_prefix, which should be used to set blob prefix(means directory for the checkpoint blob). But actually it does not work.

After going through the source code of azure_storage_checkpoint_manager.py, I can see storage_blob_prefix is actually assigned to consumer_group_directory, but consumer_group_directory is never used to create the blob for checkpoint. Instead, it just creates the blob directly inside the container.

So the fix is that we can modify the azure_storage_checkpoint_manager.py, by using lease_container_name + consumer_group_directory to create the checkpoint blob. I modified it and uploaded it github. It can work well to create a directory for the checkpoint blob as expected.



来源:https://stackoverflow.com/questions/59207767/how-to-provide-the-complete-path-of-the-container-in-azurestoragecheckpointlease

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!