incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Viktor Jevdokimov <Viktor.Jevdoki...@adform.com>
Subject RE: Preventing an update of a CF row
Date Tue, 19 Oct 2010 10:52:13 GMT
Reverse timestamp.

-----Original Message-----
From: Sylvain Lebresne [mailto:sylvain@yakaz.com] 
Sent: Tuesday, October 19, 2010 10:44 AM
To: user@cassandra.apache.org
Subject: Re: Preventing an update of a CF row

> Always specify some constant value for timestamp. Only 1st insertion with that
> timestamp will succeed. Others will be ignored, because will be considered
> duplicates by cassandra.

Well, that's not entirely true. When cassandra 'resolves' two columns
having the
same timestamp, it will compare the values to decide which one to keep
(and it'll
keep the one column whose value is greater for bytes comparison).
Concretely, if you insert Column('foo', 'b', 0) and then Column('foo',
'bar', 0), then
you'll end up with the second column, even though the timestamps are the same
because 'bar' > 'b'.
So constant timestamps doesn't work for preventing updates of a given column.

--
Sylvain



Mime
View raw message