use of org.apache.cassandra.dht.KeyCollisionTest.BigIntegerToken in project cassandra by apache.
the class LengthPartitioner method midpoint.
public BigIntegerToken midpoint(Token ltoken, Token rtoken) {
// the symbolic MINIMUM token should act as ZERO: the empty bit array
BigInteger left = ltoken.equals(MINIMUM) ? ZERO : ((BigIntegerToken) ltoken).token;
BigInteger right = rtoken.equals(MINIMUM) ? ZERO : ((BigIntegerToken) rtoken).token;
Pair<BigInteger, Boolean> midpair = FBUtilities.midpoint(left, right, 127);
// discard the remainder
return new BigIntegerToken(midpair.left);
}
Aggregations