You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Sagar Agrawal <sn...@gmail.com> on 2010/07/09 14:16:21 UTC

manual InitialToken assignemnt

I have a 2 node cluster
node1 - <InitialToken>5</InitialToken>
node2 - <InitialToken>9</InitialToken>

If I insert a row with key="a", which node should it go and why?

It is going to node1, but I think it should go to node2, since token value
of node is closer to "a" (using java string compareTo method)

someone please clarify

Thanks

Re: InitialToken assignemnt

Posted by Jonathan Ellis <jb...@gmail.com>.
Short answer: yes.

Longer answer: http://wiki.apache.org/cassandra/Operations

On Fri, Jul 9, 2010 at 1:19 PM, Claire Chang <cl...@merchantcircle.com> wrote:
> my keys are sequential integers and i use random partitioner in a multi-node
> cluster. In this case, do I still have to specify  initialToken?
>
> thanks,
> claire
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com

InitialToken assignemnt

Posted by Claire Chang <cl...@merchantcircle.com>.
my keys are sequential integers and i use random partitioner in a multi-node 
cluster. In this case, do I still have to specify  initialToken?

thanks,
claire

Re: manual InitialToken assignemnt

Posted by Sagar Agrawal <sn...@gmail.com>.
got it, thanks

On Fri, Jul 9, 2010 at 6:21 PM, Per Olesen <po...@trifork.com> wrote:

> Are you using OrderPreservingPartitioner or RandomPartitioner?
>
> Cause if you are using RandomPartitioner, a hash is calculated from "a" and
> that hash is used to determine where the data for "a" key goes, not "a".
>
>
> On Jul 9, 2010, at 2:16 PM, Sagar Agrawal wrote:
>
> > I have a 2 node cluster
> > node1 - <InitialToken>5</InitialToken>
> > node2 - <InitialToken>9</InitialToken>
> >
> > If I insert a row with key="a", which node should it go and why?
> >
> > It is going to node1, but I think it should go to node2, since token
> value of node is closer to "a" (using java string compareTo method)
> >
> > someone please clarify
> >
> > Thanks
>
> Med venlig hilsen/Best regards
>
> Per Olesen, Developer
> Trifork A/S
>
> Spotorno Alle 4, DK-2630 Taastrup
> Mobile: +45 23389581 - Mail: pol@trifork.com<ma...@trifork.com>
>
>

Re: manual InitialToken assignemnt

Posted by Per Olesen <po...@trifork.com>.
Are you using OrderPreservingPartitioner or RandomPartitioner?

Cause if you are using RandomPartitioner, a hash is calculated from "a" and that hash is used to determine where the data for "a" key goes, not "a".


On Jul 9, 2010, at 2:16 PM, Sagar Agrawal wrote:

> I have a 2 node cluster
> node1 - <InitialToken>5</InitialToken>
> node2 - <InitialToken>9</InitialToken>
> 
> If I insert a row with key="a", which node should it go and why?
> 
> It is going to node1, but I think it should go to node2, since token value of node is closer to "a" (using java string compareTo method)
> 
> someone please clarify
> 
> Thanks

Med venlig hilsen/Best regards

Per Olesen, Developer
Trifork A/S

Spotorno Alle 4, DK-2630 Taastrup
Mobile: +45 23389581 - Mail: pol@trifork.com<ma...@trifork.com>


Re: manual InitialToken assignemnt

Posted by Jonathan Ellis <jb...@gmail.com>.
see the beginning of http://wiki.apache.org/cassandra/Operations

On Fri, Jul 9, 2010 at 7:16 AM, Sagar Agrawal <sn...@gmail.com> wrote:
> I have a 2 node cluster
> node1 - <InitialToken>5</InitialToken>
> node2 - <InitialToken>9</InitialToken>
>
> If I insert a row with key="a", which node should it go and why?
>
> It is going to node1, but I think it should go to node2, since token value
> of node is closer to "a" (using java string compareTo method)
>
> someone please clarify
>
> Thanks
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com