I’m trying to use cassandra to store view counts that i am parsing from some log files
Is there a way to do views => views + 343 or something along those lines? i don’t want to have to query first because that will slow down my script quite a bit.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Cassandra support native counters; you will need to declare the default validation class (ie the default value type) as CounterColumnType:
create column family counterCF with default_validation_class=CounterColumnType;Then you should be able to do CQL operations like:
UPDATE counterCF SET X = X + N WHERE key = K;