Dear Wiki user, You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for change notification.
The "Counters" page has been changed by kelvin. http://wiki.apache.org/cassandra/Counters?action=diff&rev1=3&rev2=4 -------------------------------------------------- Please read the rest of this wiki page, especially Technical limitations and Operational considerations to make sure this actually does what you need. == Interface == + + The interface follows the main API. The main difference is that CounterColumn requires an i64 value and no timestamp. + + {{{ + struct CounterColumn { + 1: required binary name, + 2: required i64 value + } + + struct CounterSuperColumn { + 1: required binary name, + 2: required list<CounterColumn> columns + } + }}} + + {{{ + struct Counter { + 1: optional CounterColumn column, + 2: optional CounterSuperColumn super_column + } + + struct CounterDeletion { + 1: optional binary super_column, + 2: optional SlicePredicate predicate, + } + + /** + A CounterMutation is either an insert, represented by filling counter, or a deletion, represented by filling the deletion attribute. + @param counter. An insert to a counter column or supercolumn + @param deletion. A deletion of a counter column or supercolumn + */ + struct CounterMutation { + 1: optional Counter counter, + 2: optional CounterDeletion deletion, + } + }}} + + {{{ + # counter methods + + /** + * Increment or decrement a counter. + */ + void add(1:required binary key, + 2:required ColumnParent column_parent, + 3:required CounterColumn column, + 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + /** + * Batch increment or decrement a counter. + */ + void batch_add(1:required map<binary, map<string, list<CounterMutation>>> update_map, + 2:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + * Return the counter at the specified column path. + */ + Counter get_counter(1:required binary key, + 2:required ColumnPath path, + 3:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:NotFoundException nfe, 3:UnavailableException ue, 4:TimedOutException te), + + /** + * Get a list of counters from the specified columns. + */ + list<Counter> get_counter_slice(1:required binary key, + 2:required ColumnParent column_parent, + 3:required SlicePredicate predicate, + 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + * Get counter slices from multiple keys. + */ + map<binary,list<Counter>> multiget_counter_slice(1:required list<binary> keys, + 2:required ColumnParent column_parent, + 3:required SlicePredicate predicate, + 4:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + + /** + * Remove a counter at the specified location. + */ + void remove_counter(1:required binary key, + 2:required ColumnPath path, + 3:required ConsistencyLevel consistency_level=ConsistencyLevel.ONE) + throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException te), + }}} + == Technical limitations == == Operational considerations == == Further reading ==
