Skip to content

Instantly share code, notes, and snippets.

@nanha
Created August 28, 2012 00:43
Show Gist options
  • Save nanha/3493897 to your computer and use it in GitHub Desktop.
Save nanha/3493897 to your computer and use it in GitHub Desktop.
카싼드라는 멀티 데이타 센터는 물론이고 멀티 rack 에서 중요한 부분은 토큰입니다. 가장 기본적인 토큰 계산 소스에요 . 토큰계산은 alternative 라는거
#! /usr/bin/python
import sys
if (len(sys.argv) > 1):
num=int(sys.argv[1])
else:
num=int(raw_input("How many nodes are in your cluster? "))
for i in range(0, num):
print 'token %d: %d' % (i, (i*(2**127)/num))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment