Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase >> mail # user >> Row count without iterating over ResultScanner?


+
Wojciech Langiewicz 2011-05-01, 13:44
+
Doug Meil 2011-05-01, 17:55
+
Himanshu Vashishtha 2011-05-01, 18:03
+
Wojciech Langiewicz 2011-05-01, 18:29
+
Himanshu Vashishtha 2011-05-01, 18:42
+
Wojciech Langiewicz 2011-05-01, 18:51
+
Wojciech Langiewicz 2011-05-01, 18:11
+
Doug Meil 2011-05-01, 18:44
+
Wojciech Langiewicz 2011-05-01, 18:49
Copy link to this message
-
Re: Row count without iterating over ResultScanner?
Hi,
There's a row counter app in the hbase release that's a m/r job.

You could also do a dynamic counter too.
Sent from a remote device. Please excuse any typos...

Mike Segel

On May 1, 2011, at 8:44 AM, Wojciech Langiewicz <[EMAIL PROTECTED]> wrote:

> Hi,
> I would like to know if there's a way to quickly count number of rows from scan result?
> Right now I'm iterating over ResultScanner like this:
> int count = 0;
> for (Result rr = scanner.next(); rr != null; rr = scanner.next()) {
>    ++count;
> }
> But with number of rows reaching millions this takes a while.
> I tried to find something in documentation, but I didn't found anything.
> I would like to use HBase API, not MR job (because this cluster only has HDFS and HBase installed).
>
> Thanks for all help.
>
> --
> Wojciech Langiewicz
>