Skip to content

Instantly share code, notes, and snippets.

@memorycraft
Created March 8, 2013 16:44
Show Gist options
  • Select an option

  • Save memorycraft/5117846 to your computer and use it in GitHub Desktop.

Select an option

Save memorycraft/5117846 to your computer and use it in GitHub Desktop.
#RandomPartitionerの場合
def tokens(nodes):
for x in xrange(nodes):
print 2 ** 127 / nodes * x
#Murmur3Partitionerの場合
def tokens(num_nodes):
for i in range(num_nodes):
print ((2**64 / num_nodes) * i) - 2**63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment