Cassandra Token Calculator

Number of Nodes:


More info about why you might need this calculator is available here.

I wrote about it here.

I attempted to write this in JavaScript, but my Brother-in-Law, Buddy, popped it out in PHP much cleaner. By the Power of Greyskull, Buddy rocks!

Share
  • Tamil selvan R.S

    How do we calcualte node token value in PHP?

  • Matzumoto

    nice job. 

    how to subscribe to your site via RSS ??!!?!?!?!

  • Bill de hÓra

    This outputs a different set to the python code – is that deliberate? 

    form:

    initial_token: 0
    initial_token: 34028236692093848235284053891034906624
    initial_token: 68056473384187696470568107782069813248
    initial_token: 102084710076281535261119195933814292480
    initial_token: 136112946768375392941136215564139626496

    tokens.py:

    initial_token: 0
    initial_token: 34028236692093846346337460743176821145
    initial_token: 68056473384187692692674921486353642290
    initial_token: 102084710076281539039012382229530463435
    initial_token: 136112946768375385385349842972707284580

  • http://twitter.com/rad_g Rad G

    And in Java:
    0
    42535295865117307932921825928971026432
    85070591730234615865843651857942052864
    127605887595351923798765477786913079296

  • Dean Hiller

    Well, I can’t say this is very accurate since both of these post for 5 nodes come up with the same result that is DIFFERENT than your result for 5 nodes(so I would think yours would be wrong since they implement in two different languages) though I can’t be 100% sure. https://github.com/tjake/Cassandra-Token-Calculator/blob/master/TokenCalulator.java and http://journal.paul.querna.org/articles/2010/09/24/cassandra-token-selection/