Skip to content

Instantly share code, notes, and snippets.

@joshrotenberg
Created January 27, 2012 19:57
Show Gist options
  • Select an option

  • Save joshrotenberg/1690622 to your computer and use it in GitHub Desktop.

Select an option

Save joshrotenberg/1690622 to your computer and use it in GitHub Desktop.
clojure function to generate cassandra node tokens for a cluster
(use 'clojure.contrib.math)
(defn cassandra-token [number-nodes]
(dotimes [n number-nodes]
(println (format "token: %d %d" n (* n (quot (expt 2 127) number-nodes))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment