Is it possible to use batch_mutate for counters in php?
From what I’ve seen, it should be possible to increment counters in general, but I can’t seem to find any working examples in any language.
Thanks
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.
The Mutation objects supplied to batch_mutate contain a ColumnOrSuperColumn (CoSC) object. CoSC, despite it’s name, can also be a CounterColumn or SuperCounterColumn as well as Column and SuperColumn.
Not quite sure how the PHP implementation works, but try constructing a ColumnOrSUperCOlumn as a CounterColumn and that should do what you want.
FWIW, here is an example in Java:
https://github.com/rantav/hector/blob/master/core/src/test/java/me/prettyprint/cassandra/service/BatchMutationTest.java#L135-151