It is possible to method of getting a row count (key count) of merely one column family in Cassandra? get_count are only able to be employed to obtain the column count.
For example, if I've got a column family that contains customers and wanted to find the quantity of customers. How could I actually do it? Each user is it's own row.
If you work with a purchase-protecting partitioner, this can be done with get_range_slice or get_key_range.
If you're not, you will have to store your user ids inside a special row.
I am a new comer to Cassandra, however i have screwed around a great deal with Google's Application Engine. If not one other solution comes up, you might consider keeping another counter inside a platform that supports atomic increment procedures like memcached. I understand that Cassandra is focusing on atomic counter increment/decrement functionality, but it is not ready for prime time.
I'm able to only publish one hyperlink because I am new, so for progress on counter support begin to see the link during my comment below.
Observe that this thread indicates ZooKeeper, memcached, and redis as you possibly can solutions. My own preference could be memcached.
I've been obtaining the counts such as this once i convert the information right into a hash in PHP.
There's always map/reduce but that most likely is obvious. For those who have by using hive or pig, then it can be done for just about any table over the cluster though I don't know tasktrackers learn about cassandra locality so it might have to stream the entire table over the network which means you get task trackers on cassandra nodes however the data they receive might be from another cassandra node :(. I would like to hear if anybody knows without a doubt though.
NOTE: We're establishing map/reduce on cassandra due to the fact as we want a catalog later, we are able to map/reduce one into cassandra.