You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by illuvatar <an...@hotmail.it> on 2012/01/25 20:27:42 UTC

count the rows in a table from java

Hi everyone, i have a problem.
I'm trying to count for java the number of row in a table, but i can't do
it!!
I read about rowCounter, but i can't use it. Some one can tell me the code i
have to write to count the row in a table??
Thanks!!
Andrea.
-- 
View this message in context: http://old.nabble.com/count-the-rows-in-a-table-from-java-tp33203283p33203283.html
Sent from the HBase User mailing list archive at Nabble.com.


Re: count the rows in a table from java

Posted by Jean-Daniel Cryans <jd...@apache.org>.
That, or use the "count" command in the shell if your table is on the
small side.

J-D

On Wed, Jan 25, 2012 at 7:49 PM, shashwat shriparv
<dw...@gmail.com> wrote:
> What i found out are as follows:
>
> 12.1.8. RowCounter
>
> 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.
>
> $ bin/hbase org.apache.hadoop.hbase.mapreduce.RowCounter <tablename>
> [<column1> <column2>...]
>
> Note: caching for the input Scan is configured via
> hbase.client.scanner.caching in the job configuration.
>
>
> ------
>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.html
>
> http://comments.gmane.org/gmane.comp.java.hadoop.hbase.user/18124
>
> On Thu, Jan 26, 2012 at 12:57 AM, illuvatar
> <an...@hotmail.it>wrote:
>
>>
>> Hi everyone, i have a problem.
>> I'm trying to count for java the number of row in a table, but i can't do
>> it!!
>> I read about rowCounter, but i can't use it. Some one can tell me the code
>> i
>> have to write to count the row in a table??
>> Thanks!!
>> Andrea.
>> --
>> View this message in context:
>> http://old.nabble.com/count-the-rows-in-a-table-from-java-tp33203283p33203283.html
>> Sent from the HBase User mailing list archive at Nabble.com.
>>
>>
>
>
> --
> Shashwat Shriparv

Re: count the rows in a table from java

Posted by shashwat shriparv <dw...@gmail.com>.
What i found out are as follows:

12.1.8. RowCounter

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.

$ bin/hbase org.apache.hadoop.hbase.mapreduce.RowCounter <tablename>
[<column1> <column2>...]

Note: caching for the input Scan is configured via
hbase.client.scanner.caching in the job configuration.


------

http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/FirstKeyOnlyFilter.html

http://comments.gmane.org/gmane.comp.java.hadoop.hbase.user/18124

On Thu, Jan 26, 2012 at 12:57 AM, illuvatar
<an...@hotmail.it>wrote:

>
> Hi everyone, i have a problem.
> I'm trying to count for java the number of row in a table, but i can't do
> it!!
> I read about rowCounter, but i can't use it. Some one can tell me the code
> i
> have to write to count the row in a table??
> Thanks!!
> Andrea.
> --
> View this message in context:
> http://old.nabble.com/count-the-rows-in-a-table-from-java-tp33203283p33203283.html
> Sent from the HBase User mailing list archive at Nabble.com.
>
>


-- 
Shashwat Shriparv