azure - EventHub中的partitionkey映射到partitionid使用什么哈希函数

标签 azure hash partitioning azure-eventhub

我正在使用 Azure EventHub 来处理客户事件。

客户 ID 用作 EventHub 的分区键。该 key 将被散列并用于选择 EventHub 分区。给定客户的所有事件最终都将位于同一分区上。

EventHub documentation提到以下内容:

You can use a partition key to map incoming event data into specific partitions for the purpose of data organization. The partition key is a sender-supplied value passed into an event hub. It is processed through a static hashing function, which creates the partition assignment. If you don't specify a partition key when publishing an event, a round-robin assignment is used.

我的 eventhub 中有 10 个分区,现在我正在尝试映射哪些客户最终使用相同的分区 ID。提供所有客户 ID 的列表。

但是,我找不到有关 EventHub 用于确定匹配的分区 ID 的确切哈希函数的文档

如果这不可用,确定给定分区键的分区 ID 的最佳方法是什么。

最佳答案

该算法没有公开记录,也没有支持的方法来确定给定键的分配分区。强烈建议您的应用程序不要假设它可以可靠地重现服务哈希。

如果您需要了解数据出现在哪些分区中,建议您的应用程序在发布事件时分配特定的分区。

总而言之,所使用的算法不是现成的标准,而是定制的变体。您需要源能够在所有情况下重现其结果。

关于azure - EventHub中的partitionkey映射到partitionid使用什么哈希函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73976998/

相关文章:

azure - Microsoft Graph 按所有者筛选应用程序

Ruby:使用哈希跟踪股票交易

php - 需要帮助用盐制作登录页面

azure - 如何创建 Powershell 脚本来创建 Azure API 管理资源

node.js - 尝试使用 SAS 访问 Azure blob 时收到 "Signature did not match. String to sign used was..."

azure - ServiceName 和 Name 的区别?

MySQL 分区唯一键

java - Base64 编码加密密码哈希

spring - 在 hibernate/spring 中的多个模式之间分区数据

c - 使用分区和交换按字母顺序排序