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

Switch to Threaded View
HBase, mail # user - Schedule major compaction programmatically


Copy link to this message
-
Re: Schedule major compaction programmatically
Jimmy Xiang 2012-05-17, 20:28
That's why you can't use it. :)  You can hack it around if you want.  Even
better, you can
start to contribute and work on HBASE-6033.

Cheers,
Jimmy

On Thu, May 17, 2012 at 1:23 PM, Chen Song <[EMAIL PROTECTED]> wrote:

> Sorry for another dump question. As I am querying such information in
> client code, how to get a HRegionServer from a HRegionInfo,
> or HServerAddress?
>
> I found a way to get HRegionInterface shown below.
>
> HConnection.getHRegionConnection(HServerAddress)
>
> But getMetrics method is not exposed on HRegionInterface and only on
> HRegionServer.
> Thanks
> Chen
>
> On Thu, May 17, 2012 at 3:03 PM, Jimmy Xiang <[EMAIL PROTECTED]> wrote:
>
> > HRegionServer.java:
> >
> >    this.metrics.compactionQueueSize.set(compactSplitThread
> >        .getCompactionQueueSize());
> >
> > On Thu, May 17, 2012 at 12:00 PM, Chen Song <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Can you direct me to the API call to get the queue size metrics?
> > >
> > > On Thu, May 17, 2012 at 2:58 PM, Jimmy Xiang <[EMAIL PROTECTED]>
> > wrote:
> > >
> > > > It is an async call to the region server to request a compaction.
>  Once
> > > the
> > > > request is accepted,
> > > > the call returned.  There is no sync call here.  The request is
> queued
> > > and
> > > > processed by a pool
> > > > of threads.
> > > >
> > > > Currently, there is a metric to show the queue size.  But it doesn't
> > tell
> > > > how many are for major,
> > > > and how many are for minor.  The queue size is the number of store
> > files
> > > > pending compact.
> > > >
> > > > As I know, there is no work around for now.
> > > >
> > > > Jimmy
> > > >
> > > >
> > > > On Thu, May 17, 2012 at 11:42 AM, Chen Song <[EMAIL PROTECTED]>
> > > > wrote:
> > > >
> > > > > Thanks Jimmy. Meanwhile, is there a work around for this?
> > > > >
> > > > > How does compact/major_compact issued from hbase shell handles this
> > > under
> > > > > the hood? Is it eventually calling HBaseAdmin API or HRegion
> > > synchronous
> > > > > API call?
> > > > >
> > > > > Thanks
> > > > > Chen
> > > > >
> > > > > On Thu, May 17, 2012 at 2:24 PM, Jimmy Xiang <[EMAIL PROTECTED]>
> > > > wrote:
> > > > >
> > > > > > I am thinking to add a function to check if a table or region in
> > > > > compaction
> > > > > > (major or minor).
> > > > > >
> > > > > > I filed HBASE-6033. It won't show status of a specific compaction
> > > > > request.
> > > > > > Will this help?
> > > > > >
> > > > > > Thanks,
> > > > > > Jimmy
> > > > > >
> > > > > > On Thu, May 17, 2012 at 11:11 AM, Chen Song <
> > [EMAIL PROTECTED]>
> > > > > > wrote:
> > > > > >
> > > > > > > I would like to schedule major compaction on a region
> > > > > programmatically. I
> > > > > > > found the API call below which can properly achieve my goal.
> > > > > > >
> > > > > > > HBaseAdmin.majorCompact(String tableOrRegionName)
> > > > > > >
> > > > > > > It turns out to be an asynchronous call and there seems no call
> > > back
> > > > > > > parameter that can be specified. How can I validate the
> > compaction
> > > > > result
> > > > > > > (e.g., success or failure) ?
> > > > > > >
> > > > > > > Thanks
> > > > > > > Chen
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Chen Song
> > > > > Mobile: 518-445-5096
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Chen Song
> > > Mobile: 518-445-5096
> > >
> >
>
>
>
> --
> Chen Song
> Mobile: 518-445-5096
>