There’s quite a lot of token generators for the RandomPartitioner implementation which uses the slowest MD5 hashing algorithm, but I haven’t seen any that covers the Murmur3 range. The process for token generation is simple: Cassandra partitions your data based on a hash value for the primary key of the column family; each node will store a range of hashes, so your data will be randomly distributed across your cluster. The Murmur3 algorithm will generate a hash that will range from -263 to 263-1. Assigning an uniform range to each node guarantees that your data will be evenly distributed and that your cluster will not have hot spots. A faster hashing algorithm means finding the corresponding node for a row faster, and Murmur3 is way faster than MD5.
Here’s a simple token generator for the Murmur3Partitioner:
Number of nodes:
Please note one thing: I’m using the Biginteger.js library to manipulate big integers, and it seems to have some rounding issues. It rounds (floors?) the last 3 digits down to 0 for some reason. This should only be an issue if you are creating a cluster with more than a few trillion nodes.