java-driver
java-driver copied to clipboard
Expose API for calculating shard ID from token
As reported by a user: https://forum.scylladb.com/t/how-to-get-node-sharding-information-using-scylla-java-driver/696, the driver should offer an easy way to calculate the shard ID from a token. This can be useful for applications that want to do some more complex access patterns in a performant way.
In Java Driver 3.x, most of the API is public (except Token subclasses), so it's relatively easy to calculate it. In Java Driver 4.x, ShardingInfo class is not public, so it's hard to calculate it for a user.