Mark
Mark

Reputation: 863

TokenAware Policy in Cassandra

When using token aware policy as Load Balancing Policy in Cassandra do all the queries are automatically send over the correct node (which contains the replica eg select * from Table where partionkey = something, will automatically get the hash and go to the correct replica) or I have to use token() function with all my queries ?

Upvotes: 6

Views: 4131

Answers (1)

Erick Ramirez
Erick Ramirez

Reputation: 16333

That is correct. The TokenAwarePolicy will allow the driver to prefer a replica for the given partition key as the coordinator for the request if possible.

Additional information about load balancing with the Java driver is available on the LoadBalancingPolicy API page.

Specifically, the API documentation for TokenAwarePolicy is available here.

Upvotes: 6

Related Questions