assert !ss.getTokenMetadata().getBootstrapTokens().containsValue(bootstrapSource);
Range range = ss.getPrimaryRangeForEndpoint(bootstrapSource);
Token token = StorageService.getPartitioner().midpoint(range.left, range.right);
assert range.contains(token);
ss.onChange(bootstrapAddrs[i], StorageService.MOVE_STATE, new ApplicationState(StorageService.STATE_BOOTSTRAPPING + StorageService.Delimiter + StorageService.getPartitioner().getTokenFactory().toString(token)));
}
// any further attempt to bootsrtap should fail since every node in the cluster is splitting.
try
{
BootStrapper.getBootstrapSource(ss.getTokenMetadata(), load);
throw new AssertionError("This bootstrap should have failed.");
}
catch (RuntimeException ex)
{
// success!
}
// indicate that one of the nodes is done. see if the node it was bootstrapping from is still available.
Range range = ss.getPrimaryRangeForEndpoint(addrs[2]);
Token token = StorageService.getPartitioner().midpoint(range.left, range.right);
ss.onChange(bootstrapAddrs[2], StorageService.MOVE_STATE, new ApplicationState(StorageService.STATE_NORMAL + StorageService.Delimiter + StorageService.getPartitioner().getTokenFactory().toString(token)));
load.put(bootstrapAddrs[2], 0d);
InetAddress addr = BootStrapper.getBootstrapSource(ss.getTokenMetadata(), load);
assert addr != null && addr.equals(addrs[2]);
}