incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tyler Hobbs <ty...@riptano.com>
Subject Re: Fauna Questions
Date Wed, 15 Dec 2010 01:08:27 GMT
There's an estimateKeys() function exposed via JMX that will give you an
approximate row count for the node.  In jconsole this shows up under
o.a.c.db -> ColumnFamilies -> Keyspace -> CF -> Operations.

There's not a "precise" way to count rows other than to do a
get_range_slices() over the entire CF, and even then, as Aaron mentions, it
won't be exact unless you stop inserting rows during that time.  It's also
really expensive :)

- Tyler

On Tue, Dec 14, 2010 at 6:57 PM, Aaron Morton <aaron@thelastpickle.com>wrote:

> There is a truncate() function on the ruby api if you require Cassandra/0.7
> this can truncate  all the data in a CF. It will call the truncate function
> on the thrift api.
>
> I do not know of a precise way to get a count of rows. There is a function
> to count the number of columns, see count_columns() on the ruby api. But
> that is not precise either as that would require stopping inserts while the
> count is going on.
>
> The fauna client also has some documentation in the code as comments.
>
> Hope that helps
> Aaron
>
>
> On 15/12/2010, at 4:14 AM, Alberto Velandia <betovelandia@gmail.com>
> wrote:
>
> > Hi has anyone noticed that the documentation for the Cassandra Class is
> gone from the website?
> >
> > http://blog.evanweaver.com/2010/12/06/cassandra-0-8/
> >
> > I was wondering if there's a way for me to count how many rows exist
> inside  a Column Family and a way to erase the contents of that Column
> Family
> >
> > Thanks
>

Mime
View raw message