You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Lucas Di Pentima <lu...@di-pentima.com.ar> on 2010/04/22 22:06:14 UTC

Cassandra Ruby Library's batch method example?

Hi,

I would like to see example code about the batch() method, I searched for it on Google, but I couldn't find any. Reading the inline comments, this operation could be useful for example to insert some record and update the indexes all at once, am I right?

Best regards
--
Lucas Di Pentima - Santa Fe, Argentina
Jabber: lucas@di-pentima.com.ar
MSN: ldipenti75@hotmail.com





Re: Cassandra Ruby Library's batch method example?

Posted by Lucas Di Pentima <lu...@di-pentima.com.ar>.
So basically the idea behind the batch processing is some performance gain via network usage optimization? Thanks Jonathan!

El 22/04/2010, a las 21:32, Jonathan Ellis escribió:

> nope, there is no guarantee of that.  if the server fails
> mid-operation you have to retry it.
> 
> On Thu, Apr 22, 2010 at 7:23 PM, Lucas Di Pentima
> <lu...@di-pentima.com.ar> wrote:
>> 
>> El 22/04/2010, a las 19:57, Ryan King escribió:
>> 
>>> The batch method in the cassandra gem is still a little crippled (it
>>> doesn't actually batch together everything it can), but you can use it
>>> like this:
>>> 
>>> http://github.com/fauna/cassandra/blob/master/test/cassandra_test.rb#L299
>> 
>> Thanks Ryan! One question about this feature: Ideally it should execute all batched operations or none, is that right? In case one batched operation raise some exception, the previous ops are rolled back?
>> 
>> --
>> Lucas Di Pentima - Santa Fe, Argentina
>> Jabber: lucas@di-pentima.com.ar
>> MSN: ldipenti75@hotmail.com
>> 
>> 
>> 
>> 
>> 

--
Lucas Di Pentima - Santa Fe, Argentina
Jabber: lucas@di-pentima.com.ar
MSN: ldipenti75@hotmail.com





Re: Cassandra Ruby Library's batch method example?

Posted by Jonathan Ellis <jb...@gmail.com>.
nope, there is no guarantee of that.  if the server fails
mid-operation you have to retry it.

On Thu, Apr 22, 2010 at 7:23 PM, Lucas Di Pentima
<lu...@di-pentima.com.ar> wrote:
>
> El 22/04/2010, a las 19:57, Ryan King escribió:
>
>> The batch method in the cassandra gem is still a little crippled (it
>> doesn't actually batch together everything it can), but you can use it
>> like this:
>>
>> http://github.com/fauna/cassandra/blob/master/test/cassandra_test.rb#L299
>
> Thanks Ryan! One question about this feature: Ideally it should execute all batched operations or none, is that right? In case one batched operation raise some exception, the previous ops are rolled back?
>
> --
> Lucas Di Pentima - Santa Fe, Argentina
> Jabber: lucas@di-pentima.com.ar
> MSN: ldipenti75@hotmail.com
>
>
>
>
>

Re: Cassandra Ruby Library's batch method example?

Posted by Lucas Di Pentima <lu...@di-pentima.com.ar>.
El 22/04/2010, a las 19:57, Ryan King escribió:

> The batch method in the cassandra gem is still a little crippled (it
> doesn't actually batch together everything it can), but you can use it
> like this:
> 
> http://github.com/fauna/cassandra/blob/master/test/cassandra_test.rb#L299

Thanks Ryan! One question about this feature: Ideally it should execute all batched operations or none, is that right? In case one batched operation raise some exception, the previous ops are rolled back?

--
Lucas Di Pentima - Santa Fe, Argentina
Jabber: lucas@di-pentima.com.ar
MSN: ldipenti75@hotmail.com





Re: Cassandra Ruby Library's batch method example?

Posted by Ryan King <ry...@twitter.com>.
On Thu, Apr 22, 2010 at 1:06 PM, Lucas Di Pentima
<lu...@di-pentima.com.ar> wrote:
> Hi,
>
> I would like to see example code about the batch() method, I searched for it on Google, but I couldn't find any. Reading the inline comments, this operation could be useful for example to insert some record and update the indexes all at once, am I right?

The batch method in the cassandra gem is still a little crippled (it
doesn't actually batch together everything it can), but you can use it
like this:

http://github.com/fauna/cassandra/blob/master/test/cassandra_test.rb#L299

-ryan