astyanax icon indicating copy to clipboard operation
astyanax copied to clipboard

Invalid BigInteger call in TokenPartitionedTopology

Open tstets opened this issue 11 years ago • 3 comments

...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.

tstets avatar Oct 28 '13 09:10 tstets

Can you print the sample code here ?

sagarl avatar Dec 12 '13 07:12 sagarl

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());

ghost avatar Mar 06 '14 17:03 ghost

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.

abhishek-bidgely avatar Jun 26 '16 11:06 abhishek-bidgely