datastax/csharp-driver — pull request #15 by teddymaef (2014-03-10 03:50:08+00:00)
Title: To allow custom policy and consistency level

This pullrequest is based on the previous bug fix, so please review the following bug fix pullrequest first (to avoid conflicts):
https://github.com/datastax/csharp-driver/pull/14

The goal of this pull request is for adding two quite necessary features to CqlConnection and CqlCommand class to allow to specify custom Builder policies for building a Custer, and to specify consistency level for executing a CqlCommand.

Without this flexibility, it's kind of impossible to meet most of our enterprise requirements.

For example, we have datacenters in both US and China, and there are multiple nodes configured in each datacenter. The network latency for one of the hosts in US datacenter to connect to a China node is unacceptable, and vise versa. This is why the DCAwareRoundRobinPolicy class is designed for, which is really necessary for us. So my suggestion, as in this pullrequest, is to expose the Builder instance through a protected virtual OnBuildingCluster() method of CqlConnection, so that custom policies could be applied to it in child classes if necessary.

And for consistency level, it is similar, I think most users do need the flexibility to set the consistency level for each CqlCommand to optimize read/write performance. So it is necessary to have a ConsistencyLevel property on the CqlCommand class.

It'll be appreciated if you guys could seriously consider to accept this pullrequest or if you could implement something else equivalent.

Please feel free to reach me by skype: teddy.ma.ef or Email: teddy.ma(at)ef.com, if you want.