HBASE-5069 [book] Document how to count rows
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1415733 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
813cd30de5
commit
82faf90366
|
@ -266,8 +266,10 @@ row10 c1 c2
|
|||
</section>
|
||||
<section xml:id="rowcounter">
|
||||
<title>RowCounter</title>
|
||||
<para>RowCounter is a utility that will count all the rows of a table. This is a good utility to use
|
||||
as a sanity check to ensure that HBase can read all the blocks of a table if there are any concerns of metadata inconsistency.
|
||||
<para>RowCounter is a mapreduce job to count all the rows of a table. This is a good utility to use
|
||||
as a sanity check to ensure that HBase can read all the blocks of a table if there are any concerns of metadata inconsistency.
|
||||
It will run the mapreduce all in a single process but it will run faster if you have a MapReduce cluster in place for it to
|
||||
exploit.
|
||||
<programlisting>$ bin/hbase org.apache.hadoop.hbase.mapreduce.RowCounter <tablename> [<column1> <column2>...]
|
||||
</programlisting>
|
||||
</para>
|
||||
|
|
|
@ -104,5 +104,16 @@
|
|||
</para>
|
||||
</section>
|
||||
</section>
|
||||
<section><title>Commands</title>
|
||||
<section><title>count</title>
|
||||
<para>Count command returns the number of rows in a table.
|
||||
It's quite fast when configured with the right CACHE
|
||||
<programlisting>hbase> count '<tablename>', CACHE => 1000</programlisting>
|
||||
The above count fetches 1000 rows at a time. Set CACHE lower if your rows are big.
|
||||
Default is to fetch one row at a time.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
</section>
|
||||
</chapter>
|
||||
|
|
Loading…
Reference in New Issue