Database Reference
In-Depth Information
Random
The RandomPartitioner was the default partitioner in Cassandra prior to 1.2. It
should not be confused with the concept of a random partitioner. The RandomPar-
titioner uses an MD5 hash value of the row to evenly distribute data across the
cluster. The possible range of values for the hash is from 0 to (2 127 - 1). If you
are using virtual nodes in Cassandra 1.2, you won't need to worry about calculat-
ing tokens. If you are not using vnodes, you will have to properly calculate token
ranges in order to have a balanced cluster. In almost all cases, you will want to
use the Murmur3Partitioner if you are using Cassandra 1.2. When using the Ran-
domPartitioner, you can page through all rows using the token function in CQL
3.
Murmur3
As of Cassandra 1.2, the Murmur3Partitioner is the new default partitioner when
creating a Cassandra cluster. It provides a faster hashing function called the Mur-
murHash. This function creates a 64-bit hash value of the row key. Its values range
from -2 63 to (+2 63 -1). The other major added benefit to using the Murmur3Parti-
tioner is that you can page through all rows using the token function in CQL 3.
Node Layout
Prior to Cassandra 1.2, one token was assigned to each node. This ensured that
within the ring, each node was responsible for one contiguous range of data. Virtu-
al nodes, or vnodes, provide a Cassandra node with the ability to be responsible for
many token ranges. Within the cluster, they can be noncontiguous and selected at
random. This provides a greater distribution of data than the non-vnode paradigm.
Search WWH ::




Custom Search