astyanax
astyanax copied to clipboard
Invalid BigInteger call in TokenPartitionedTopology
...astyanax.connectionpool.impl.TokenPartitionedTopology Line 148 a BigInteger is created with an (implied) base 10 from a token string which is base 16. This results in a NumberFormatException, which in turn basically makes Astyanax unable to function.
Can you print the sample code here ?
The issue is actual for ByteOrderedPartitioner. It fails when tries to convert token into BigInteger because tokens for BOP should be specified as hex-strings (http://wiki.apache.org/cassandra/ByteOrderedPartitioner).
Note, astyanax (1.56.26) supresses this exception and continues to function, but without proper TokenAware routing. Code snippet: BigInteger endToken = new BigInteger(range.getEndToken());
Found this issue in our code also, should I raise a PR to create a new method in IPartitioner to return big integer token for a String,we can have the radix check there. I was able to solve my local issue using this.