I need to partition my data in the same way Cassandra is partitioning data with Murmur3Partitioner.(in my 64-bit OS)
I tried the following code:
byte[] key="jim".getBytes("UTF-8");
ByteBuffer key=ByteBuffer.wrap(key);
Murmur3Partitioner murmur3Partitioner=new Murmur3Partitioner();
murmur3Partitioner.getToken(key);
But it doesn't give me the exact value in the following link: http://docs.datastax.com/en/cassandra/2.0/cassandra/architecture/architectureDataDistributeHashing_c.html
Is there any other way in Cassandra to find the token generated for a key?
Yes, you can use the
token()
function (FYI-firstname
is my partitioning key below):(9 rows)
Note that case-sensitivity matters, and different tokens are generated for "Jim" and "jim".
I suspect that the document you have linked above was written only as an example, and not with exact values.
Does the value you generated above for "jim" equal 2680261686609811218? If it does, then your code above should work.