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

Switch to Threaded View
HBase, mail # user - HBase Table Row Count Optimization - A Solicitation For Help


Copy link to this message
-
Re: HBase Table Row Count Optimization - A Solicitation For Help
Ted Yu 2013-09-21, 01:32
Please take a look at the javadoc
for src/main/java/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.java

As long as the machine can reach your HBase cluster, you should be able to
run AggregationClient and utilize the AggregateImplementation endpoint in
the region servers.

Cheers
On Fri, Sep 20, 2013 at 6:26 PM, James Birchfield <
[EMAIL PROTECTED]> wrote:

> Thanks Ted.
>
> That was the direction I have been working towards as I am learning today.
>  Much appreciation to all the replies to this thread.
>
> Whether I keep the MapReduce job or utilize the Aggregation coprocessor
> (which is turning out that it should be possible for me here), I need to
> make sure I am running the client in an efficient manner.  Lars may have
> hit upon the core problem.  I am not running the map reduce job on the
> cluster, but rather from a stand alone remote java client executing the job
> in process.  This may very well turn out to be the number one issue.  I
> would love it if this turns out to be true.  Would make this a great
> learning lesson for me as a relative newcomer to working with HBase, and
> potentially allow me to finish this initial task much quicker than I was
> thinking.
>
> So assuming the MapReduce jobs need to be run on the cluster instead of
> locally, does a coprocessor endpoint client need to be run the same, or is
> it safe to run it on a remote machine since the work gets distributed out
> to the region servers?  Just wondering if I would run into the same issues
> if what I said above holds true.
>
> Thanks!
> Birch
> On Sep 20, 2013, at 6:17 PM, Ted Yu <[EMAIL PROTECTED]> wrote:
>
> > In 0.94, we have AggregateImplementation, an endpoint coprocessor, which
> > implements getRowNum().
> >
> > Example is in AggregationClient.java
> >
> > Cheers
> >
> >
> > On Fri, Sep 20, 2013 at 6:09 PM, lars hofhansl <[EMAIL PROTECTED]> wrote:
> >
> >> From your numbers below you have about 26k regions, thus each region is
> >> about 545tb/26k = 20gb. Good.
> >>
> >> How many mappers are you running?
> >> And just to rule out the obvious, the M/R is running on the cluster and
> >> not locally, right? (it will default to a local runner when it cannot
> use
> >> the M/R cluster).
> >>
> >> Some back of the envelope calculations tell me that assuming 1ge network
> >> cards, the best you can expect for 110 machines to map through this
> data is
> >> about 10h. (so way faster than what you see).
> >> (545tb/(110*1/8gb/s) ~ 40ks ~11h)
> >>
> >>
> >> We should really add a rowcounting coprocessor to HBase and allow using
> it
> >> via M/R.
> >>
> >> -- Lars
> >>
> >>
> >>
> >> ________________________________
> >> From: James Birchfield <[EMAIL PROTECTED]>
> >> To: [EMAIL PROTECTED]
> >> Sent: Friday, September 20, 2013 5:09 PM
> >> Subject: Re: HBase Table Row Count Optimization - A Solicitation For
> Help
> >>
> >>
> >> I did not implement accurate timing, but the current table being counted
> >> has been running for about 10 hours, and the log is estimating the map
> >> portion at 10%
> >>
> >> 2013-09-20 23:40:24,099 INFO  [main] Job                            :
>  map
> >> 10% reduce 0%
> >>
> >> So a loooong time.  Like I mentioned, we have billions, if not trillions
> >> of rows potentially.
> >>
> >> Thanks for the feedback on the approaches I mentioned.  I was not sure
> if
> >> they would have any effect overall.
> >>
> >> I will look further into coprocessors.
> >>
> >> Thanks!
> >> Birch
> >> On Sep 20, 2013, at 4:58 PM, Vladimir Rodionov <[EMAIL PROTECTED]
> >
> >> wrote:
> >>
> >>> How long does it take for RowCounter Job for largest table to finish on
> >> your cluster?
> >>>
> >>> Just curious.
> >>>
> >>> On your options:
> >>>
> >>> 1. Not worth it probably - you may overload your cluster
> >>> 2. Not sure this one differs from 1. Looks the same to me but more
> >> complex.
> >>> 3. The same as 1 and 2
> >>>
> >>> Counting rows in efficient way can be done if you sacrifice some