Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any command that I can learn the size of a table at Hbase?

Tags:

hbase

Is there any command that I can learn the size of a table at Hbase? I use Hbase to hold my crawl data from Nutch.

like image 672
kamaci Avatar asked Apr 08 '13 22:04

kamaci


2 Answers

If you are running hbase on hadoop the following command can be used

hadoop fs -du [path]

[path] has to be replaced with the value of hbase.rootdir in hbase-site.xml

the output will look like:

$ hadoop fs -du /hbase

4056        hdfs://127.0.0.1:9000/hbase/-ROOT-

22307       hdfs://127.0.0.1:9000/hbase/.META.

0           hdfs://127.0.0.1:9000/hbase/.corrupt

0           hdfs://127.0.0.1:9000/hbase/.logs

0           hdfs://127.0.0.1:9000/hbase/.oldlogs

1716        hdfs://127.0.0.1:9000/hbase/Table1

1472        hdfs://127.0.0.1:9000/hbase/Table2

1498        hdfs://127.0.0.1:9000/hbase/Table3

1320        hdfs://127.0.0.1:9000/hbase/SampleTable

The size displayed here is in bytes.

If you are running hbase on local filesystem (OS filesystem) then you can use normal du command.

This will give you a rough idea about size of the table in Hbase.

like image 67
Nanda Avatar answered Oct 24 '22 04:10

Nanda


To count rows/columns in a table you need to run a map/reduce program. HBase ships with a m/r that does that see here

like image 27
Arnon Rotem-Gal-Oz Avatar answered Oct 24 '22 03:10

Arnon Rotem-Gal-Oz