For #1, the random tokens are 128bits positive bigints. So, you can generate tokens evenly btw [0, 2^127-1] and set them on each node using InitialToken in storage-conf.xml.
IBM Almaden Research Center
K55/B1, 650 Harry Road, San Jose, CA 95120-6099
Igor Katkov <firstname.lastname@example.org> wrote on 10/01/2009 09:26:45 AM:
> [image removed]
> distributing tokens equally along the key distribution space
> Igor Katkov
> 10/01/2009 09:28 AM
> Please respond to cassandra-user
> How to manually select tokens to force equal spacing of tokens
> around the hash space?
> If RandomPartitioner is used a token is a BigInteger, so there are
> no [0, Max value] interval to select token values from.
> If everything is left to defaults, a token is a random number (hash
> of GUID) so these 10 generated tokens will not be evenly spaced on the ring.
> Suppose I have X nodes, what would be correct token values?
> Let's assume that #1 was resolved somehow and key distribution is
> more or less even.
> A new node "C" joins the cluster. It's token falls somewhere between
> two other tokens on the ring (from nodes "A" and "B" clockwise-
> ordered). From now on "C" is responsible for a portion of data that
> used to exclusively belong to "B".
> a. Cassandra v.0.4 will not automatically transfer this data to "C" will it?
> b. Do all reads to these keys fail?
> c. What happens with the data reference by these keys on "B"? It
> will never be accessed there, therefor it becomes garbage. Since
> there are to GC will it stick forever?
> d. What happens to replicas of these keys?