何在AzureStorageCheckpointLeaseMan

何在AzureStorageCheckpointLeaseMan

本文介绍了如何在AzureStorageCheckpointLeaseManager类中提供容器的完整路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Azure python SDK的EPH(EventProcessorHost)类从eventhub接收事件.实际上,它使用AzureStorageCheckpointLeaseManager在存储帐户中进行检查点和分区.但是我看不到在哪里可以写存储帐户的完整路径.像它一样直接在存储帐户的指定容器内创建文件.我想提供容器内的完整路径.我在哪里可以做?

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?

推荐答案

这是我的研究

AzureStorageCheckpointLeaseManager中,有一个参数storage_blob_prefix,该参数应用于设置blob前缀(检查点blob的目录).但实际上它不起作用.

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.

查看azure_storage_checkpoint_manager.py的源代码之后,我可以看到 storage_blob_prefix 实际上已分配给 consumer_group_directory ,但从未使用过 consumer_group_directory 为检查点创建Blob.相反,它只是在容器内部直接创建Blob.

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.

因此,解决方法是我们可以使用 lease_container_name + consumer_group_directory 创建检查点blob来修改azure_storage_checkpoint_manager.py.我对其进行了修改并上传 github .按预期方式为检查点blob创建目录可以很好地工作.

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.

这篇关于如何在AzureStorageCheckpointLeaseManager类中提供容器的完整路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 02:52