[ 
https://issues.apache.org/jira/browse/CASSANDRA-5619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13677332#comment-13677332
 ] 

Blair Zajac commented on CASSANDRA-5619:
----------------------------------------

I'm new to Cassandra and haven't looked at the Thrift or CQL2 API, I've been 
doing everything on CQL3 where possible, as suggested by your blogs ;)

Given that the new CAS support returns a Boolean on the success or failure 
where the non-CAS UPDATE returned nothing, couldn't the additional columns be 
added on the return in addition to the Boolean?  I was looking at the CQL3 Java 
Driver, and there, it seems pretty straight forward.
                
> CAS UPDATE for a lost race: save round trip by returning column values
> ----------------------------------------------------------------------
>
>                 Key: CASSANDRA-5619
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5619
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.0
>            Reporter: Blair Zajac
>
> Looking at the new CAS CQL3 support examples [1], if one lost a race for an 
> UPDATE, to save a round trip to get the current values to decide if you need 
> to perform your work, could the columns that were used in the IF clause also 
> be returned to the caller?  Maybe the columns values as part of the SET part 
> could also be returned.
> I don't know if this is generally useful though.
> In the case of creating a new user account with a given username which is the 
> partition key, if one lost the race to another person creating an account 
> with the same username, it doesn't matter to the loser what the column values 
> are, just that they lost.
> I'm new to Cassandra, so maybe there's other use cases, such as doing 
> incremental amount of work on a row.  In pure Java projects I've done while 
> loops around AtomicReference.html#compareAndSet() until the work was done on 
> the referenced object to handle multiple threads each making forward progress 
> in updating the references object.
> [1] https://github.com/riptano/cassandra-dtest/blob/master/cql_tests.py#L3044

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to