You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Alberto Velandia <be...@gmail.com> on 2010/12/14 16:14:10 UTC

Fauna Questions

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

Re: Fauna Questions

Posted by Ryan King <ry...@twitter.com>.
On Tue, Dec 14, 2010 at 7:14 AM, Alberto Velandia
<be...@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/

http://rdoc.info/gems/cassandra will always have the latest rdocs.

> 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

-ryan

Re: Fauna Questions

Posted by Tyler Hobbs <ty...@riptano.com>.
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 <aa...@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 <be...@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
>

Re: Fauna Questions

Posted by Aaron Morton <aa...@thelastpickle.com>.
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 <be...@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