incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tyler Hobbs <ty...@datastax.com>
Subject Re: Question about how DataStax python driver chooses a coordinator
Date Wed, 05 Feb 2014 21:09:42 GMT
On Wed, Feb 5, 2014 at 2:45 PM, Sameer Farooqui <sameer@blueplastic.com>wrote:

> Does the new DataStax Python Driver 1.0.0 intelligently choose a
> coordinator that is also likely to be a replica partner for that row-key
> when using vnodes in C* 2.0? If so, how does it do it... just hash the
> row-key and see which partition range it falls in and which node owns that
> range?
>

Basically, yes.


>
> Here is all the DataStax blog post says on this topic:
>
> "When a query is executed, a list of nodes to attempt the query against is
> generated. If the query fails against the first node in the list, the
> second node may be used, and so on. When sending a query to a node, the
> driver selects the least-utilized connection from that node's connection
> pool and issues the query."
>
> How is that list of nodes generated?
>

It depends on what LoadBalancingPolicy you pick:
http://datastax.github.io/python-driver/api/cassandra/policies.html#load-balancing
.

By default, the driver does not try to use a replica as the coordinator;
you have to wrap the load balancing policy with TokenAwarePolicy to enable
that.


>
>
> Also, does the current version of the DS Java driver also intelligently
> choose a coordinator that is likely to already hold a replica of the row
> key?
>

The Java driver behavior is almost exactly the same.

P.S. There is a mailing list dedicated to the python driver:
https://groups.google.com/a/lists.datastax.com/forum/#!forum/python-driver-user

-- 
Tyler Hobbs
DataStax <http://datastax.com/>

Mime
View raw message