You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Tamar Fraenkel <ta...@tok-media.com> on 2012/03/14 12:32:47 UTC

counter columns question

Hi!

My apologies for the naive question, but I am new to Cassandra and even
more to counter columns.

If I have a counter column, what happens if two threads are trying to
increment it's value at the same time for the same key?

Thanks,

*Tamar Fraenkel *
Senior Software Engineer, TOK Media

[image: Inline image 1]

tamar@tok-media.com
Tel:   +972 2 6409736
Mob:  +972 54 8356490
Fax:   +972 2 5612956

Re: counter columns question

Posted by Tamar Fraenkel <ta...@tok-media.com>.
Thanks, already added a dedicated column family and all works fine!

*Tamar Fraenkel *
Senior Software Engineer, TOK Media

[image: Inline image 1]

tamar@tok-media.com
Tel:   +972 2 6409736
Mob:  +972 54 8356490
Fax:   +972 2 5612956





On Thu, Mar 15, 2012 at 2:58 PM, Rustam Aliyev <ru...@code.az> wrote:

>  No, it's not possible.
>
>
> On 15/03/2012 10:53, Tamar Fraenkel wrote:
>
> Watched the video, really good!
>
>  One question:
> I wonder if it is possible to mix counter columns in Cassandra 1.0.7 with
> regular columns in the same CF.
>
>  Even if it is possible, I am not sure I should mix them as I use Hector,
> and this means I will have to user both Hector and CQL,
> Am I right?
> Thanks,
>
>
>  *Tamar Fraenkel *
> Senior Software Engineer, TOK Media
>
> [image: Inline image 1]
>
> tamar@tok-media.com
> Tel:   +972 2 6409736
> Mob:  +972 54 8356490
> Fax:   +972 2 5612956
>
>
>
>
>
> On Wed, Mar 14, 2012 at 1:52 PM, Alain RODRIGUEZ <ar...@gmail.com>wrote:
>
>> Here you got a good explaination of how the counters work.
>>
>>  Video : http://blip.tv/datastax/counters-in-cassandra-5497678
>> Sildes :
>> http://www.datastax.com/wp-content/uploads/2011/07/cassandra_sf_counters.pdf
>>
>>  I think it will answer your question and help you understanding
>> interesting things about counters.
>>
>>  If you need a short answer, it concurrency will be handled nicely and
>> you'll have the expected result.
>>
>>  Alain
>>
>> 2012/3/14 Tamar Fraenkel <ta...@tok-media.com>
>>
>>> Hi!
>>>
>>>  My apologies for the naive question, but I am new to Cassandra and
>>> even more to counter columns.
>>>
>>>  If I have a counter column, what happens if two threads are trying to
>>> increment it's value at the same time for the same key?
>>>
>>>  Thanks,
>>>
>>>  *Tamar Fraenkel *
>>> Senior Software Engineer, TOK Media
>>>
>>> [image: Inline image 1]
>>>
>>> tamar@tok-media.com
>>> Tel:   +972 2 6409736
>>> Mob:  +972 54 8356490
>>> Fax:   +972 2 5612956
>>>
>>>
>>>
>>>
>>
>

Re: counter columns question

Posted by Rustam Aliyev <ru...@code.az>.
No, it's not possible.

On 15/03/2012 10:53, Tamar Fraenkel wrote:
> Watched the video, really good!
>
> One question:
> I wonder if it is possible to mix counter columns in Cassandra 1.0.7 
> with regular columns in the same CF.
>
> Even if it is possible, I am not sure I should mix them as I use 
> Hector, and this means I will have to user both Hector and CQL,
> Am I right?
> Thanks,
>
>
> *Tamar Fraenkel *
> Senior Software Engineer, TOK Media
>
> Inline image 1
>
> tamar@tok-media.com <ma...@tok-media.com>
> Tel: +972 2 6409736
> Mob: +972 54 8356490
> Fax: +972 2 5612956
>
>
>
>
>
> On Wed, Mar 14, 2012 at 1:52 PM, Alain RODRIGUEZ <arodrime@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     Here you got a good explaination of how the counters work.
>
>     Video : http://blip.tv/datastax/counters-in-cassandra-5497678
>     Sildes :
>     http://www.datastax.com/wp-content/uploads/2011/07/cassandra_sf_counters.pdf
>
>     I think it will answer your question and help you understanding
>     interesting things about counters.
>
>     If you need a short answer, it concurrency will be handled nicely
>     and you'll have the expected result.
>
>     Alain
>
>     2012/3/14 Tamar Fraenkel <tamar@tok-media.com
>     <ma...@tok-media.com>>
>
>         Hi!
>
>         My apologies for the naive question, but I am new to Cassandra
>         and even more to counter columns.
>
>         If I have a counter column, what happens if two threads are
>         trying to increment it's value at the same time for the same key?
>
>         Thanks,
>
>         *Tamar Fraenkel *
>         Senior Software Engineer, TOK Media
>
>         Inline image 1
>
>         tamar@tok-media.com <ma...@tok-media.com>
>         Tel: +972 2 6409736
>         Mob: +972 54 8356490
>         Fax: +972 2 5612956
>
>
>
>
>

Re: counter columns question

Posted by Tamar Fraenkel <ta...@tok-media.com>.
Watched the video, really good!

One question:
I wonder if it is possible to mix counter columns in Cassandra 1.0.7 with
regular columns in the same CF.

Even if it is possible, I am not sure I should mix them as I use Hector,
and this means I will have to user both Hector and CQL,
Am I right?
Thanks,


*Tamar Fraenkel *
Senior Software Engineer, TOK Media

[image: Inline image 1]

tamar@tok-media.com
Tel:   +972 2 6409736
Mob:  +972 54 8356490
Fax:   +972 2 5612956





On Wed, Mar 14, 2012 at 1:52 PM, Alain RODRIGUEZ <ar...@gmail.com> wrote:

> Here you got a good explaination of how the counters work.
>
> Video : http://blip.tv/datastax/counters-in-cassandra-5497678
> Sildes :
> http://www.datastax.com/wp-content/uploads/2011/07/cassandra_sf_counters.pdf
>
> I think it will answer your question and help you understanding
> interesting things about counters.
>
> If you need a short answer, it concurrency will be handled nicely and
> you'll have the expected result.
>
> Alain
>
> 2012/3/14 Tamar Fraenkel <ta...@tok-media.com>
>
>> Hi!
>>
>> My apologies for the naive question, but I am new to Cassandra and even
>> more to counter columns.
>>
>> If I have a counter column, what happens if two threads are trying to
>> increment it's value at the same time for the same key?
>>
>> Thanks,
>>
>> *Tamar Fraenkel *
>> Senior Software Engineer, TOK Media
>>
>> [image: Inline image 1]
>>
>> tamar@tok-media.com
>> Tel:   +972 2 6409736
>> Mob:  +972 54 8356490
>> Fax:   +972 2 5612956
>>
>>
>>
>>
>

Re: counter columns question

Posted by Tamar Fraenkel <ta...@tok-media.com>.
Thanks!
*Tamar Fraenkel *
Senior Software Engineer, TOK Media

[image: Inline image 1]

tamar@tok-media.com
Tel:   +972 2 6409736
Mob:  +972 54 8356490
Fax:   +972 2 5612956





On Wed, Mar 14, 2012 at 1:52 PM, Alain RODRIGUEZ <ar...@gmail.com> wrote:

> Here you got a good explaination of how the counters work.
>
> Video : http://blip.tv/datastax/counters-in-cassandra-5497678
> Sildes :
> http://www.datastax.com/wp-content/uploads/2011/07/cassandra_sf_counters.pdf
>
> I think it will answer your question and help you understanding
> interesting things about counters.
>
> If you need a short answer, it concurrency will be handled nicely and
> you'll have the expected result.
>
> Alain
>
> 2012/3/14 Tamar Fraenkel <ta...@tok-media.com>
>
>> Hi!
>>
>> My apologies for the naive question, but I am new to Cassandra and even
>> more to counter columns.
>>
>> If I have a counter column, what happens if two threads are trying to
>> increment it's value at the same time for the same key?
>>
>> Thanks,
>>
>> *Tamar Fraenkel *
>> Senior Software Engineer, TOK Media
>>
>> [image: Inline image 1]
>>
>> tamar@tok-media.com
>> Tel:   +972 2 6409736
>> Mob:  +972 54 8356490
>> Fax:   +972 2 5612956
>>
>>
>>
>>
>

Re: counter columns question

Posted by Alain RODRIGUEZ <ar...@gmail.com>.
Here you got a good explaination of how the counters work.

Video : http://blip.tv/datastax/counters-in-cassandra-5497678
Sildes :
http://www.datastax.com/wp-content/uploads/2011/07/cassandra_sf_counters.pdf

I think it will answer your question and help you understanding interesting
things about counters.

If you need a short answer, it concurrency will be handled nicely and
you'll have the expected result.

Alain

2012/3/14 Tamar Fraenkel <ta...@tok-media.com>

> Hi!
>
> My apologies for the naive question, but I am new to Cassandra and even
> more to counter columns.
>
> If I have a counter column, what happens if two threads are trying to
> increment it's value at the same time for the same key?
>
> Thanks,
>
> *Tamar Fraenkel *
> Senior Software Engineer, TOK Media
>
> [image: Inline image 1]
>
> tamar@tok-media.com
> Tel:   +972 2 6409736
> Mob:  +972 54 8356490
> Fax:   +972 2 5612956
>
>
>
>