Created
August 28, 2012 00:43
-
-
Save nanha/3493897 to your computer and use it in GitHub Desktop.
카싼드라는 멀티 데이타 센터는 물론이고 멀티 rack 에서 중요한 부분은 토큰입니다. 가장 기본적인 토큰 계산 소스에요 . 토큰계산은 alternative 라는거
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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