On Mon, Aug 1, 2011 at 8:24 AM, Rafael A= lmeida wrote:
On Saturday, July 30, 2011, Rafael Almeid= a <almeidaraf@yahoo.com> = wrote:
> Hello,
>=A0
> I have computers that are better than others in my cluster. In special= ,
> there's one which is much better and I'd like to give it more = load than the
> others. =A0Is it possible? I'm using RandomPartitioner, should I u= se other?
> Should I select tokens in some particular way? How is load distributio= n
> implemented in RandomPartitioner with respect to tokens?
>=A0

I'm answering myself this time. I think I've got things= figured out, at least
for RandomPartitioner. The token space goes from 0 to 2^217. There are 2^21= 7
tokens possible. The load a node will receive is proportional to the number= of
tokens assigned to it. If you assign 2^217 / 2 tokens to a node, it will be=
responsible for half the load in the system. If you assign 2^217 / 3 tokens= to a
node it will be responsible for 1/3 the load and so on.=A0

But you assign only one token in cassandra's configuration file! True, = but
that's the first token for that node, in a range of tokens it will acce= pt. The
number of tokens actually assigned to it is the range from the value you wr= ote
in intiial_token in cassandra.yaml up to the next token.

I find it hard to explain that without an example. So, let's say the to= ken space
is actually from 0 to 100 and we have 4 nodes (let's do this in order t= o make
things more manageble). In our example, we have the following initial_token= s:

node A =3D 0
node B =3D 20
node C =3D 70
node D =3D 90

Node A would have 0 - 20 tokens assigned to it (20/100 =3D 20% of the load)= . =A0Node
B would have 70 - 20 =3D 50 tokens assigned to it (50% of the load). Node C= would
have 90 - 70 =3D 20 tokens assigned to it (20% of the load) and, finally, n= ode D
would have 10% of the tokens assigned to it. See how that works?=A0
=A0<= /blockquote>
If you mess up in your configuration. Let's say you set up initial_toke= n like
this:

node A =3D 10
node B =3D 20
node C =3D 70
node D =3D 90

That way you'd have 10 unhandled tokens. I think cassandra detects it a= nd set
things up in a way no token is missing. But I'm not sure what it does e= xactly.
I've tested it with two nodes and, when I make such invalid configurati= on, I get
each node handling 50% of the load.

=A0
There would be no missing token, node A= will take care of token range (90, 100] and [0, 10].=A0

I hope I've been clear. Please correct me if I misunderstood something.=

--0016364c6ecfe8e8a304a967d021--