最后,我找到了解决我的问题的方法:计算复合分区键的令牌的算法:Primary_key((text, int)) -> 因此分区键是复合分区键(文本,整数)。
示例:带有 Composite_partition_key ('hello', 1) 的行
应用算法:
1- 在大端(16 位)表示中布置复合分区键的组件:
first_component = '你好' -> 68 65 6c 6c 6f
sec_component = 1 -> 00 00 00 01
68 65 6c 6c 6f 00 00 00 01
2-在每个组件之前添加两个字节长度的组件
first_component ='你好',长度= 5-> 00 05 68 65 6c 6c 6f
sec_component = 1,因此长度 = 4 -> 00 04 00 00 00 01
00 05 68 65 6c 6c 6f 00 04 00 00 00 01
3-在每个组件后添加零值
first_component ='你好'-> 00 05 68 65 6c 6c 6f 00
sec_component = 1 -> 00 04 00 00 00 01 00
4-结果
00 05 68 65 6c 6c 6f 00 00 04 00 00 00 01 00
现在将结果作为您的 murmur3 函数理解的二进制基数传递(确保它是 cassandra 变体)。