Murmur3哈什算法用于Cassandra [英] Murmur3 Hash Algorithm Used in Cassandra

查看:214
本文介绍了Murmur3哈什算法用于Cassandra的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Cassandra中重现Murmur3哈希。有没有人知道如何获得在行键使用的实际哈希值?我只需要一些从我的数据的密钥 - 哈希值对,以检查我的哈希的实现是否正确。

I'm trying to reproduce the Murmur3 hashing in Cassandra. Does anyone know how to get at the actual hash values used in the row keys? I just need some key - hash value pairs from my data to check that my implementation of the hashing is correct.

Alex

推荐答案

询问Cassandra!在表格中插入一些数据。之后,您可以在选择查询中使用令牌函数来获取使用的令牌值。例如:

Ask Cassandra! Insert some data in your table. Afterwards, you can use the token function in a select query to get the used token values. For example:

select token(id), id from myTable;

复合分区键序列化为n次一个字节数组指示其长度),其中包含您的键元素的序列化值和结束0.对我来说,这些结束零的含义不清楚。与SuperColumns有关...

A composite partition key is serialized as n-times a byte array (that is always prepended with a short indicating its length) containing the serialized value of your key element and a closing 0. It's unclear to me what these closing zeros are for. Has something to do with SuperColumns...

这篇关于Murmur3哈什算法用于Cassandra的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆