@Test public void testComputeInitialTokens() { List<String> result = new CassandraClusterActionHandler().computeInitialTokens(5); assertEquals(result, ImmutableList.of( "0", "34028236692093846346337460743176821145", "68056473384187692692674921486353642290", "102084710076281539039012382229530463435", "136112946768375385385349842972707284580" )); }
protected List<String> computeInitialTokens(int numberOfNodes) { List<String> tokens = Lists.newArrayList(); BigInteger step = new BigInteger("2") .pow(127).divide(BigInteger.valueOf(numberOfNodes)); for (int i = 0; i < numberOfNodes; i++) { tokens.add(step.multiply(BigInteger.valueOf(i)).toString()); } return tokens; }
CassandraClusterActionHandler extends ClusterActionHandlerSupport { protected List<String> computeInitialTokens(int numberOfNodes) { List<String> tokens = Lists.newArrayList(); BigInteger step = new BigInteger("2") .pow(127).divide(BigInteger.valueOf(numberOfNodes)); for (int i = 0; i < numberOfNodes; i++) { tokens.add(step.multiply(BigInteger.valueOf(i)).toString()); } return tokens; } }
CassandraClusterActionHandler extends ClusterActionHandlerSupport { protected List<String> computeInitialTokens(int numberOfNodes) { List<String> tokens = Lists.newArrayList(); BigInteger step = new BigInteger("2") .pow(127).divide(BigInteger.valueOf(numberOfNodes)); for (int i = 0; i < numberOfNodes; i++) { tokens.add(step.multiply(BigInteger.valueOf(i)).toString()); } return tokens; }  }
CassandraClusterActionHandler extends ClusterActionHandlerSupport { protected List<String> computeInitialTokens(int numberOfNodes) { List<String> tokens = Lists.newArrayList(); BigInteger step = new BigInteger("2") .pow(127).divide(BigInteger.valueOf(numberOfNodes)); for (int i = 0; i < numberOfNodes; i++) { tokens.add(step.multiply(BigInteger.valueOf(i)).toString()); } return tokens; }  @Override String getRole(); }
CassandraClusterActionHandler extends ClusterActionHandlerSupport { protected List<String> computeInitialTokens(int numberOfNodes) { List<String> tokens = Lists.newArrayList(); BigInteger step = new BigInteger("2") .pow(127).divide(BigInteger.valueOf(numberOfNodes)); for (int i = 0; i < numberOfNodes; i++) { tokens.add(step.multiply(BigInteger.valueOf(i)).toString()); } return tokens; }  @Override String getRole(); static final String CASSANDRA_ROLE; static final int CLIENT_PORT; static final int JMX_PORT; static final String BIN_TARBALL; static final String MAJOR_VERSION; }