Proposal to make CassandraContext.Operate()-equivalent method public

Developer
Jun 5, 2012 at 5:55 PM

There are a few APIs in Thrift where Cassandra.Client exposes but Cassandraemon does not support well yet. "remove" for example. We could add them, but some of them do not fit well in the LINQ world, and I think having an escape hatch isn't a bad thing.

ICassandraContext.Client is actually exposed, but it does not support automatic failover. I'd like similar functionality as Operate() method, which is internal today.

I was thinking about naming and signature, here's my proposal to use the same pattern as ExecuteCqlQuery:

 

public void ExecuteClient(Action<Cassandra.Client> action);
public T ExecuteClient<T>(Func<Cassandra.Client, T> action);

 

It passes Cassandra.Client as an argument, because doing so sometimes help to reduce the implicit creation of closure class by the compiler. The argument can be CassandraContext if others prefer.

Thoughts

Coordinator
Jun 6, 2012 at 3:40 PM

I feel good about it.

Please implement it. I defer to you how to implement.

Developer
Jun 7, 2012 at 7:10 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.