Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know the size of a keyspace and column family in Cassandra?

Recently I've started working on Grails integration with Cassandra using the Java driver for cassandra(cassandra-driver-core-2.0.2). So I was curious to know how we can find out how much size our table is taking to store the data in cassandra DB.

I have created a keyspace with name Customkeyspace and a column family called Movie in it. So I was curious to know which tool/Command I have to use to know the size of the keyspace/Column family ?

like image 858
JavaRookie Avatar asked Nov 19 '14 08:11

JavaRookie


People also ask

How do I find the size of a Keyspace in Cassandra?

If you need to know informaiton about table or tables you can use Nodetool cfstats command. Syntax: If you will only provide the name of keyspace, it will provide stats for all the tables in that keyspace.

What is column family in Cassandra?

A Cassandra column family consists of a collection of ordered columns in rows which represent a structured version of the stored data. The keyspace holds these Cassandra column families and each keyspace has at least one column family.


1 Answers

To get statistics regarding column families in Cassandra, you can simply run the command:

nodetool cfstats

It reports statistics about tables which include the live data size as well as on disk.

The documentation about this utility for Cassandra 2.1 is available here.

like image 56
Erick Ramirez Avatar answered Oct 05 '22 18:10

Erick Ramirez