Skip to content

Instantly share code, notes, and snippets.

@joshrotenberg
Created January 27, 2012 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshrotenberg/1690622 to your computer and use it in GitHub Desktop.
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