On Tuesday, April 14, 2015 at 5:44:40 PM UTC-5, Michael Penick wrote:
> Agreed. That would be extremely useful. .... I think that would be a good addition. I do see how allowing for introspection into the batch (and statements) might allow your program to identify the invalid query or at least allow for easier debugging. I've created a JIRA issue to address that:
https://datastax-oss.atlassian.net/browse/CPP-255. Feedback welcome.
That's fantastic, Michael. I'm glad you agree it'll be valuable. Looks good to me.
> Regarding the performance of batches I would say, "try it". Logged batch are almost certainly going to perform worse because of the extra writes involved, but you might get some performance benefit out of unlogged batches, esp. if all the writes are to the same primary key. However, if all the writes are destined for the same host anyway you'll gain benefit from automatic write batching done in the driver by using a batch of concurrent asynchronous requests. The driver groups requests destined for the same connection and writes them in a single write() call. Here's an example using asynchronous request batches:
https://github.com/datastax/cpp-driver/blob/1.0/examples/perf/perf.c.
Good info, thanks. Yeah casstcl is based a lot on studying the cpp-driver examples, perf.c in particular. In casstcl we support
$::cass async -batch $batch -callback "callback $batch"
The callback is called with an additional argument which is a casstcl future object that can be inspected with various methods for status and errors and have it iterate through results using a "foreach" method. We also rolled in the fractional returns using set_paging_size...
https://github.com/flightaware/casstcl/blob/master/generic/casstcl.c