You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by "Mesika, Asaf" <as...@gmail.com> on 2012/12/09 11:55:53 UTC

Checking if a coprocessor was loaded successfully from client

Hi,

I wrote a custom Region Observer.
I'm currently writing an Installer class for it.
In this installer I'm adding the region observer by adding a coprocessor to the HTableDescriptor, and then calling modifyTable by HBaseAdmin.

My question is: How can I check whether region observer was loaded successfully for this table? 

I tried searching for a way to get the Coprocessor.State somehow for my region observer so I'll know it's ACTIVE, but couldn't find a way.


Thank you,

Asaf








Re: Checking if a coprocessor was loaded successfully from client

Posted by Andrew Purtell <ap...@apache.org>.
HBaseAdmin#getClusterStatus

    -> ClusterStatus#getMasterCoprocessors()

    -> for (ServerName sn: ClusterStatus#getServers)
{ ClusterStatus#getLoad(sn).getCoprocessors() }

?

On Wed, Dec 12, 2012 at 11:44 AM, Ted Yu <yu...@gmail.com> wrote:

> Can you log a JIRA so that Coprocessor.State is exposed in Java API ?
>
> Cheers
>

Re: Checking if a coprocessor was loaded successfully from client

Posted by Ted Yu <yu...@gmail.com>.
Can you log a JIRA so that Coprocessor.State is exposed in Java API ?

Cheers

On Tue, Dec 11, 2012 at 11:08 PM, Asaf Mesika <as...@gmail.com> wrote:

> I'm talking about doing this programmatically since my class is an
> Installer for a Region Observer I wrote.
>
> On 11 בדצמ 2012, at 08:47, Ted Yu <yu...@gmail.com> wrote:
>
> > For #1 below, can you check master log and look for the following ?
> >
> >    LOG.info("Reopening " + reRegions.size() + " regions on "
> >        + serverToRegions.size() + " region servers.");
> >
> > this.masterServices.getAssignmentManager().setRegionsToReopen(reRegions);
> >
> > See if the region count in the log is always 0.
> >
> > For #2, there is no easy way to verify on each region server other than
> > scanning region server log.
> >
> > There're several places in (Region)CoprocessorHost where we log exception
> > if loading encounters problem.
> >
> > I hope HBASE-6873 <https://issues.apache.org/jira/browse/HBASE-6873> can
> > get into the next 0.94 release.
> >
> > Cheers
> >
> > On Mon, Dec 10, 2012 at 9:46 PM, Asaf Mesika <as...@gmail.com>
> wrote:
> >
> >> My test on a table that doesn't have any coprocessor. It does loads
> >> successfully, but I want to understand two things:
> >> 1. How should I use getAlterStatus? I'm asking since even placing it
> >> between modifyTable and enable and waiting for getFirst to return
> number of
> >> regions fails (always returns 0)
> >> 2. How should I check they each region server managed to instantiate the
> >> Region Observer class, i.e. managed to access the jar.
> >>
> >> Sent from my iPhone
> >>
> >> On 10 בדצמ 2012, at 18:04, Ted Yu <yu...@gmail.com> wrote:
> >>
> >> Asaf:
> >> Your coprocessor was successfully running prior to the schema change ?
> >>
> >> See HBASE-6873 <https://issues.apache.org/jira/browse/HBASE-6873>
> Clean up
> >> Coprocessor load failure handling.
> >>
> >> Cheers
> >>
> >> On Mon, Dec 10, 2012 at 5:11 AM, Mesika, Asaf <as...@gmail.com>
> >> wrote:
> >>
> >> I guess I'm missing something in the sequence of actions here:
> >>
> >>
> >> 1. I'm disabling the table. This action is synchronous.
> >>
> >> 2. I'm running the method hBaseAdmin.modifyTable(), which is
> *asynchronous*
> >>
> >> 3. I'm supposed to use hBaseAdmin.getAlterStatus() to check every x
> >>
> >> seconds whether all regions have been modified.
> >>
> >> 4. Once that has passed, I can finally enable the table, which is a
> >>
> >> synchronous action. This should signify that the table's region are
> online,
> >>
> >> thus have loaded the region observer class and instantiated it -
> meaning,
> >>
> >> it has found the JAR file specified in its HDFS location.
> >>
> >>
> >> hasCoprocessor just checks whether the metadata object has the
> coprocessor
> >>
> >> attribute and it if has the className you supplied to it.
> >>
> >> How can I know that if a classname is present on a HTableDescriptor,
> then
> >>
> >> al the tables's regions successfully instantiated the region observer?
> >>
> >>
> >>
> >>
> >> On Dec 10, 2012, at 10:01 AM, anil gupta wrote:
> >>
> >>
> >> Hi Asaf,
> >>
> >>
> >> Have a look at the
> >>
> >> *hasCoprocessor<
> >>
> >>
> >>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor%28java.lang.String%29
> >>
> >>
> >> * method of HTD:
> >>
> >>
> >>
> >>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor(java.lang.String)
> >>
> >>
> >> It might be helpful for you. I have used it in past to check whether a
> >>
> >> coprocessors is successfully added or not.
> >>
> >>
> >> HTH,
> >>
> >> Anil
> >>
> >>
> >> On Sun, Dec 9, 2012 at 2:25 PM, Ted Yu <yu...@gmail.com> wrote:
> >>
> >>
> >> On region server web UI, you should see the list of coprocessors loaded.
> >>
> >>
> >> But I guess you're looking for a programmatic way of detecting
> >>
> >> coprocessor
> >>
> >> deployment.
> >>
> >>
> >> Cheers
> >>
> >>
> >> On Sun, Dec 9, 2012 at 12:29 PM, Mesika, Asaf <as...@gmail.com>
> >>
> >> wrote:
> >>
> >>
> >> 0.94.0
> >>
> >> On Dec 9, 2012, at 3:03 PM, yuzhihong@gmail.com wrote:
> >>
> >>
> >> Which hbase version are you targeting ?
> >>
> >>
> >> Thanks
> >>
> >>
> >>
> >>
> >> On Dec 9, 2012, at 2:55 AM, "Mesika, Asaf" <as...@gmail.com>
> >>
> >> wrote:
> >>
> >>
> >> Hi,
> >>
> >>
> >> I wrote a custom Region Observer.
> >>
> >> I'm currently writing an Installer class for it.
> >>
> >> In this installer I'm adding the region observer by adding a
> >>
> >> coprocessor to the HTableDescriptor, and then calling modifyTable by
> >>
> >> HBaseAdmin.
> >>
> >>
> >> My question is: How can I check whether region observer was loaded
> >>
> >> successfully for this table?
> >>
> >>
> >> I tried searching for a way to get the Coprocessor.State somehow for
> >>
> >> my
> >>
> >> region observer so I'll know it's ACTIVE, but couldn't find a way.
> >>
> >>
> >>
> >> Thank you,
> >>
> >>
> >> Asaf
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> --
> >>
> >> Thanks & Regards,
> >>
> >> Anil Gupta
> >>
>
>

Re: Checking if a coprocessor was loaded successfully from client

Posted by Asaf Mesika <as...@gmail.com>.
I'm talking about doing this programmatically since my class is an Installer for a Region Observer I wrote.

On 11 בדצמ 2012, at 08:47, Ted Yu <yu...@gmail.com> wrote:

> For #1 below, can you check master log and look for the following ?
> 
>    LOG.info("Reopening " + reRegions.size() + " regions on "
>        + serverToRegions.size() + " region servers.");
> 
> this.masterServices.getAssignmentManager().setRegionsToReopen(reRegions);
> 
> See if the region count in the log is always 0.
> 
> For #2, there is no easy way to verify on each region server other than
> scanning region server log.
> 
> There're several places in (Region)CoprocessorHost where we log exception
> if loading encounters problem.
> 
> I hope HBASE-6873 <https://issues.apache.org/jira/browse/HBASE-6873> can
> get into the next 0.94 release.
> 
> Cheers
> 
> On Mon, Dec 10, 2012 at 9:46 PM, Asaf Mesika <as...@gmail.com> wrote:
> 
>> My test on a table that doesn't have any coprocessor. It does loads
>> successfully, but I want to understand two things:
>> 1. How should I use getAlterStatus? I'm asking since even placing it
>> between modifyTable and enable and waiting for getFirst to return number of
>> regions fails (always returns 0)
>> 2. How should I check they each region server managed to instantiate the
>> Region Observer class, i.e. managed to access the jar.
>> 
>> Sent from my iPhone
>> 
>> On 10 בדצמ 2012, at 18:04, Ted Yu <yu...@gmail.com> wrote:
>> 
>> Asaf:
>> Your coprocessor was successfully running prior to the schema change ?
>> 
>> See HBASE-6873 <https://issues.apache.org/jira/browse/HBASE-6873> Clean up
>> Coprocessor load failure handling.
>> 
>> Cheers
>> 
>> On Mon, Dec 10, 2012 at 5:11 AM, Mesika, Asaf <as...@gmail.com>
>> wrote:
>> 
>> I guess I'm missing something in the sequence of actions here:
>> 
>> 
>> 1. I'm disabling the table. This action is synchronous.
>> 
>> 2. I'm running the method hBaseAdmin.modifyTable(), which is *asynchronous*
>> 
>> 3. I'm supposed to use hBaseAdmin.getAlterStatus() to check every x
>> 
>> seconds whether all regions have been modified.
>> 
>> 4. Once that has passed, I can finally enable the table, which is a
>> 
>> synchronous action. This should signify that the table's region are online,
>> 
>> thus have loaded the region observer class and instantiated it - meaning,
>> 
>> it has found the JAR file specified in its HDFS location.
>> 
>> 
>> hasCoprocessor just checks whether the metadata object has the coprocessor
>> 
>> attribute and it if has the className you supplied to it.
>> 
>> How can I know that if a classname is present on a HTableDescriptor, then
>> 
>> al the tables's regions successfully instantiated the region observer?
>> 
>> 
>> 
>> 
>> On Dec 10, 2012, at 10:01 AM, anil gupta wrote:
>> 
>> 
>> Hi Asaf,
>> 
>> 
>> Have a look at the
>> 
>> *hasCoprocessor<
>> 
>> 
>> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor%28java.lang.String%29
>> 
>> 
>> * method of HTD:
>> 
>> 
>> 
>> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor(java.lang.String)
>> 
>> 
>> It might be helpful for you. I have used it in past to check whether a
>> 
>> coprocessors is successfully added or not.
>> 
>> 
>> HTH,
>> 
>> Anil
>> 
>> 
>> On Sun, Dec 9, 2012 at 2:25 PM, Ted Yu <yu...@gmail.com> wrote:
>> 
>> 
>> On region server web UI, you should see the list of coprocessors loaded.
>> 
>> 
>> But I guess you're looking for a programmatic way of detecting
>> 
>> coprocessor
>> 
>> deployment.
>> 
>> 
>> Cheers
>> 
>> 
>> On Sun, Dec 9, 2012 at 12:29 PM, Mesika, Asaf <as...@gmail.com>
>> 
>> wrote:
>> 
>> 
>> 0.94.0
>> 
>> On Dec 9, 2012, at 3:03 PM, yuzhihong@gmail.com wrote:
>> 
>> 
>> Which hbase version are you targeting ?
>> 
>> 
>> Thanks
>> 
>> 
>> 
>> 
>> On Dec 9, 2012, at 2:55 AM, "Mesika, Asaf" <as...@gmail.com>
>> 
>> wrote:
>> 
>> 
>> Hi,
>> 
>> 
>> I wrote a custom Region Observer.
>> 
>> I'm currently writing an Installer class for it.
>> 
>> In this installer I'm adding the region observer by adding a
>> 
>> coprocessor to the HTableDescriptor, and then calling modifyTable by
>> 
>> HBaseAdmin.
>> 
>> 
>> My question is: How can I check whether region observer was loaded
>> 
>> successfully for this table?
>> 
>> 
>> I tried searching for a way to get the Coprocessor.State somehow for
>> 
>> my
>> 
>> region observer so I'll know it's ACTIVE, but couldn't find a way.
>> 
>> 
>> 
>> Thank you,
>> 
>> 
>> Asaf
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> --
>> 
>> Thanks & Regards,
>> 
>> Anil Gupta
>> 


Re: Checking if a coprocessor was loaded successfully from client

Posted by Ted Yu <yu...@gmail.com>.
For #1 below, can you check master log and look for the following ?

    LOG.info("Reopening " + reRegions.size() + " regions on "
        + serverToRegions.size() + " region servers.");

this.masterServices.getAssignmentManager().setRegionsToReopen(reRegions);

See if the region count in the log is always 0.

For #2, there is no easy way to verify on each region server other than
scanning region server log.

There're several places in (Region)CoprocessorHost where we log exception
if loading encounters problem.

I hope HBASE-6873 <https://issues.apache.org/jira/browse/HBASE-6873> can
get into the next 0.94 release.

Cheers

On Mon, Dec 10, 2012 at 9:46 PM, Asaf Mesika <as...@gmail.com> wrote:

> My test on a table that doesn't have any coprocessor. It does loads
> successfully, but I want to understand two things:
> 1. How should I use getAlterStatus? I'm asking since even placing it
> between modifyTable and enable and waiting for getFirst to return number of
> regions fails (always returns 0)
> 2. How should I check they each region server managed to instantiate the
> Region Observer class, i.e. managed to access the jar.
>
> Sent from my iPhone
>
> On 10 בדצמ 2012, at 18:04, Ted Yu <yu...@gmail.com> wrote:
>
> Asaf:
> Your coprocessor was successfully running prior to the schema change ?
>
> See HBASE-6873 <https://issues.apache.org/jira/browse/HBASE-6873> Clean up
> Coprocessor load failure handling.
>
> Cheers
>
> On Mon, Dec 10, 2012 at 5:11 AM, Mesika, Asaf <as...@gmail.com>
> wrote:
>
> I guess I'm missing something in the sequence of actions here:
>
>
> 1. I'm disabling the table. This action is synchronous.
>
> 2. I'm running the method hBaseAdmin.modifyTable(), which is *asynchronous*
>
> 3. I'm supposed to use hBaseAdmin.getAlterStatus() to check every x
>
> seconds whether all regions have been modified.
>
> 4. Once that has passed, I can finally enable the table, which is a
>
> synchronous action. This should signify that the table's region are online,
>
> thus have loaded the region observer class and instantiated it - meaning,
>
> it has found the JAR file specified in its HDFS location.
>
>
> hasCoprocessor just checks whether the metadata object has the coprocessor
>
> attribute and it if has the className you supplied to it.
>
> How can I know that if a classname is present on a HTableDescriptor, then
>
> al the tables's regions successfully instantiated the region observer?
>
>
>
>
> On Dec 10, 2012, at 10:01 AM, anil gupta wrote:
>
>
> Hi Asaf,
>
>
> Have a look at the
>
> *hasCoprocessor<
>
>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor%28java.lang.String%29
>
>
> * method of HTD:
>
>
>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor(java.lang.String)
>
>
> It might be helpful for you. I have used it in past to check whether a
>
> coprocessors is successfully added or not.
>
>
> HTH,
>
> Anil
>
>
> On Sun, Dec 9, 2012 at 2:25 PM, Ted Yu <yu...@gmail.com> wrote:
>
>
> On region server web UI, you should see the list of coprocessors loaded.
>
>
> But I guess you're looking for a programmatic way of detecting
>
> coprocessor
>
> deployment.
>
>
> Cheers
>
>
> On Sun, Dec 9, 2012 at 12:29 PM, Mesika, Asaf <as...@gmail.com>
>
> wrote:
>
>
> 0.94.0
>
> On Dec 9, 2012, at 3:03 PM, yuzhihong@gmail.com wrote:
>
>
> Which hbase version are you targeting ?
>
>
> Thanks
>
>
>
>
> On Dec 9, 2012, at 2:55 AM, "Mesika, Asaf" <as...@gmail.com>
>
> wrote:
>
>
> Hi,
>
>
> I wrote a custom Region Observer.
>
> I'm currently writing an Installer class for it.
>
> In this installer I'm adding the region observer by adding a
>
> coprocessor to the HTableDescriptor, and then calling modifyTable by
>
> HBaseAdmin.
>
>
> My question is: How can I check whether region observer was loaded
>
> successfully for this table?
>
>
> I tried searching for a way to get the Coprocessor.State somehow for
>
> my
>
> region observer so I'll know it's ACTIVE, but couldn't find a way.
>
>
>
> Thank you,
>
>
> Asaf
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
>
> Thanks & Regards,
>
> Anil Gupta
>

Re: Checking if a coprocessor was loaded successfully from client

Posted by Asaf Mesika <as...@gmail.com>.
My test on a table that doesn't have any coprocessor. It does loads
successfully, but I want to understand two things:
1. How should I use getAlterStatus? I'm asking since even placing it
between modifyTable and enable and waiting for getFirst to return number of
regions fails (always returns 0)
2. How should I check they each region server managed to instantiate the
Region Observer class, i.e. managed to access the jar.

Sent from my iPhone

On 10 בדצמ 2012, at 18:04, Ted Yu <yu...@gmail.com> wrote:

Asaf:
Your coprocessor was successfully running prior to the schema change ?

See HBASE-6873 <https://issues.apache.org/jira/browse/HBASE-6873> Clean up
Coprocessor load failure handling.

Cheers

On Mon, Dec 10, 2012 at 5:11 AM, Mesika, Asaf <as...@gmail.com> wrote:

I guess I'm missing something in the sequence of actions here:


1. I'm disabling the table. This action is synchronous.

2. I'm running the method hBaseAdmin.modifyTable(), which is *asynchronous*

3. I'm supposed to use hBaseAdmin.getAlterStatus() to check every x

seconds whether all regions have been modified.

4. Once that has passed, I can finally enable the table, which is a

synchronous action. This should signify that the table's region are online,

thus have loaded the region observer class and instantiated it - meaning,

it has found the JAR file specified in its HDFS location.


hasCoprocessor just checks whether the metadata object has the coprocessor

attribute and it if has the className you supplied to it.

How can I know that if a classname is present on a HTableDescriptor, then

al the tables's regions successfully instantiated the region observer?




On Dec 10, 2012, at 10:01 AM, anil gupta wrote:


Hi Asaf,


Have a look at the

*hasCoprocessor<

http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor%28java.lang.String%29


* method of HTD:


http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor(java.lang.String)


It might be helpful for you. I have used it in past to check whether a

coprocessors is successfully added or not.


HTH,

Anil


On Sun, Dec 9, 2012 at 2:25 PM, Ted Yu <yu...@gmail.com> wrote:


On region server web UI, you should see the list of coprocessors loaded.


But I guess you're looking for a programmatic way of detecting

coprocessor

deployment.


Cheers


On Sun, Dec 9, 2012 at 12:29 PM, Mesika, Asaf <as...@gmail.com>

wrote:


0.94.0

On Dec 9, 2012, at 3:03 PM, yuzhihong@gmail.com wrote:


Which hbase version are you targeting ?


Thanks




On Dec 9, 2012, at 2:55 AM, "Mesika, Asaf" <as...@gmail.com>

wrote:


Hi,


I wrote a custom Region Observer.

I'm currently writing an Installer class for it.

In this installer I'm adding the region observer by adding a

coprocessor to the HTableDescriptor, and then calling modifyTable by

HBaseAdmin.


My question is: How can I check whether region observer was loaded

successfully for this table?


I tried searching for a way to get the Coprocessor.State somehow for

my

region observer so I'll know it's ACTIVE, but couldn't find a way.



Thank you,


Asaf














--

Thanks & Regards,

Anil Gupta

Re: Checking if a coprocessor was loaded successfully from client

Posted by Ted Yu <yu...@gmail.com>.
Asaf:
Your coprocessor was successfully running prior to the schema change ?

See HBASE-6873 <https://issues.apache.org/jira/browse/HBASE-6873> Clean up
Coprocessor load failure handling.

Cheers

On Mon, Dec 10, 2012 at 5:11 AM, Mesika, Asaf <as...@gmail.com> wrote:

> I guess I'm missing something in the sequence of actions here:
>
> 1. I'm disabling the table. This action is synchronous.
> 2. I'm running the method hBaseAdmin.modifyTable(), which is *asynchronous*
> 3. I'm supposed to use hBaseAdmin.getAlterStatus() to check every x
> seconds whether all regions have been modified.
> 4. Once that has passed, I can finally enable the table, which is a
> synchronous action. This should signify that the table's region are online,
> thus have loaded the region observer class and instantiated it - meaning,
> it has found the JAR file specified in its HDFS location.
>
> hasCoprocessor just checks whether the metadata object has the coprocessor
> attribute and it if has the className you supplied to it.
> How can I know that if a classname is present on a HTableDescriptor, then
> al the tables's regions successfully instantiated the region observer?
>
>
>
> On Dec 10, 2012, at 10:01 AM, anil gupta wrote:
>
> > Hi Asaf,
> >
> > Have a look at the
> > *hasCoprocessor<
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor%28java.lang.String%29
> >
> > * method of HTD:
> >
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor(java.lang.String)
> >
> > It might be helpful for you. I have used it in past to check whether a
> > coprocessors is successfully added or not.
> >
> > HTH,
> > Anil
> >
> > On Sun, Dec 9, 2012 at 2:25 PM, Ted Yu <yu...@gmail.com> wrote:
> >
> >> On region server web UI, you should see the list of coprocessors loaded.
> >>
> >> But I guess you're looking for a programmatic way of detecting
> coprocessor
> >> deployment.
> >>
> >> Cheers
> >>
> >> On Sun, Dec 9, 2012 at 12:29 PM, Mesika, Asaf <as...@gmail.com>
> >> wrote:
> >>
> >>> 0.94.0
> >>> On Dec 9, 2012, at 3:03 PM, yuzhihong@gmail.com wrote:
> >>>
> >>>> Which hbase version are you targeting ?
> >>>>
> >>>> Thanks
> >>>>
> >>>>
> >>>>
> >>>> On Dec 9, 2012, at 2:55 AM, "Mesika, Asaf" <as...@gmail.com>
> >>> wrote:
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>> I wrote a custom Region Observer.
> >>>>> I'm currently writing an Installer class for it.
> >>>>> In this installer I'm adding the region observer by adding a
> >>> coprocessor to the HTableDescriptor, and then calling modifyTable by
> >>> HBaseAdmin.
> >>>>>
> >>>>> My question is: How can I check whether region observer was loaded
> >>> successfully for this table?
> >>>>>
> >>>>> I tried searching for a way to get the Coprocessor.State somehow for
> >> my
> >>> region observer so I'll know it's ACTIVE, but couldn't find a way.
> >>>>>
> >>>>>
> >>>>> Thank you,
> >>>>>
> >>>>> Asaf
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>
> >>>
> >>
> >
> >
> >
> > --
> > Thanks & Regards,
> > Anil Gupta
>
>

Re: Checking if a coprocessor was loaded successfully from client

Posted by "Mesika, Asaf" <as...@gmail.com>.
I guess I'm missing something in the sequence of actions here:

1. I'm disabling the table. This action is synchronous.
2. I'm running the method hBaseAdmin.modifyTable(), which is *asynchronous*
3. I'm supposed to use hBaseAdmin.getAlterStatus() to check every x seconds whether all regions have been modified.
4. Once that has passed, I can finally enable the table, which is a synchronous action. This should signify that the table's region are online, thus have loaded the region observer class and instantiated it - meaning, it has found the JAR file specified in its HDFS location.

hasCoprocessor just checks whether the metadata object has the coprocessor attribute and it if has the className you supplied to it. 
How can I know that if a classname is present on a HTableDescriptor, then al the tables's regions successfully instantiated the region observer?



On Dec 10, 2012, at 10:01 AM, anil gupta wrote:

> Hi Asaf,
> 
> Have a look at the
> *hasCoprocessor<http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor%28java.lang.String%29>
> * method of HTD:
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor(java.lang.String)
> 
> It might be helpful for you. I have used it in past to check whether a
> coprocessors is successfully added or not.
> 
> HTH,
> Anil
> 
> On Sun, Dec 9, 2012 at 2:25 PM, Ted Yu <yu...@gmail.com> wrote:
> 
>> On region server web UI, you should see the list of coprocessors loaded.
>> 
>> But I guess you're looking for a programmatic way of detecting coprocessor
>> deployment.
>> 
>> Cheers
>> 
>> On Sun, Dec 9, 2012 at 12:29 PM, Mesika, Asaf <as...@gmail.com>
>> wrote:
>> 
>>> 0.94.0
>>> On Dec 9, 2012, at 3:03 PM, yuzhihong@gmail.com wrote:
>>> 
>>>> Which hbase version are you targeting ?
>>>> 
>>>> Thanks
>>>> 
>>>> 
>>>> 
>>>> On Dec 9, 2012, at 2:55 AM, "Mesika, Asaf" <as...@gmail.com>
>>> wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> I wrote a custom Region Observer.
>>>>> I'm currently writing an Installer class for it.
>>>>> In this installer I'm adding the region observer by adding a
>>> coprocessor to the HTableDescriptor, and then calling modifyTable by
>>> HBaseAdmin.
>>>>> 
>>>>> My question is: How can I check whether region observer was loaded
>>> successfully for this table?
>>>>> 
>>>>> I tried searching for a way to get the Coprocessor.State somehow for
>> my
>>> region observer so I'll know it's ACTIVE, but couldn't find a way.
>>>>> 
>>>>> 
>>>>> Thank you,
>>>>> 
>>>>> Asaf
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>> 
>>> 
>> 
> 
> 
> 
> -- 
> Thanks & Regards,
> Anil Gupta


Re: Checking if a coprocessor was loaded successfully from client

Posted by "Mesika, Asaf" <as...@gmail.com>.
What do you mean by "have to think"? Where in the HBase codebase have you seen that?


On Dec 10, 2012, at 10:12 AM, Azury wrote:

> Yes. we have to think Coprocessors are all loaded successfully if table was configured Coprocessors if this method return true.
> 
> 
> At 2012-12-10 16:01:13,"anil gupta" <an...@gmail.com> wrote:
>> Hi Asaf,
>> 
>> Have a look at the
>> *hasCoprocessor<http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor%28java.lang.String%29>
>> * method of HTD:
>> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor(java.lang.String)
>> 
>> It might be helpful for you. I have used it in past to check whether a
>> coprocessors is successfully added or not.
>> 
>> HTH,
>> Anil
>> 
>> On Sun, Dec 9, 2012 at 2:25 PM, Ted Yu <yu...@gmail.com> wrote:
>> 
>>> On region server web UI, you should see the list of coprocessors loaded.
>>> 
>>> But I guess you're looking for a programmatic way of detecting coprocessor
>>> deployment.
>>> 
>>> Cheers
>>> 
>>> On Sun, Dec 9, 2012 at 12:29 PM, Mesika, Asaf <as...@gmail.com>
>>> wrote:
>>> 
>>>> 0.94.0
>>>> On Dec 9, 2012, at 3:03 PM, yuzhihong@gmail.com wrote:
>>>> 
>>>>> Which hbase version are you targeting ?
>>>>> 
>>>>> Thanks
>>>>> 
>>>>> 
>>>>> 
>>>>> On Dec 9, 2012, at 2:55 AM, "Mesika, Asaf" <as...@gmail.com>
>>>> wrote:
>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> I wrote a custom Region Observer.
>>>>>> I'm currently writing an Installer class for it.
>>>>>> In this installer I'm adding the region observer by adding a
>>>> coprocessor to the HTableDescriptor, and then calling modifyTable by
>>>> HBaseAdmin.
>>>>>> 
>>>>>> My question is: How can I check whether region observer was loaded
>>>> successfully for this table?
>>>>>> 
>>>>>> I tried searching for a way to get the Coprocessor.State somehow for
>>> my
>>>> region observer so I'll know it's ACTIVE, but couldn't find a way.
>>>>>> 
>>>>>> 
>>>>>> Thank you,
>>>>>> 
>>>>>> Asaf
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>> 
>>>> 
>>> 
>> 
>> 
>> 
>> -- 
>> Thanks & Regards,
>> Anil Gupta


Re:Re: Checking if a coprocessor was loaded successfully from client

Posted by Azury <zi...@126.com>.
Yes. we have to think Coprocessors are all loaded successfully if table was configured Coprocessors if this method return true.


At 2012-12-10 16:01:13,"anil gupta" <an...@gmail.com> wrote:
>Hi Asaf,
>
>Have a look at the
>*hasCoprocessor<http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor%28java.lang.String%29>
>* method of HTD:
>http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor(java.lang.String)
>
>It might be helpful for you. I have used it in past to check whether a
>coprocessors is successfully added or not.
>
>HTH,
>Anil
>
>On Sun, Dec 9, 2012 at 2:25 PM, Ted Yu <yu...@gmail.com> wrote:
>
>> On region server web UI, you should see the list of coprocessors loaded.
>>
>> But I guess you're looking for a programmatic way of detecting coprocessor
>> deployment.
>>
>> Cheers
>>
>> On Sun, Dec 9, 2012 at 12:29 PM, Mesika, Asaf <as...@gmail.com>
>> wrote:
>>
>> > 0.94.0
>> > On Dec 9, 2012, at 3:03 PM, yuzhihong@gmail.com wrote:
>> >
>> > > Which hbase version are you targeting ?
>> > >
>> > > Thanks
>> > >
>> > >
>> > >
>> > > On Dec 9, 2012, at 2:55 AM, "Mesika, Asaf" <as...@gmail.com>
>> > wrote:
>> > >
>> > >> Hi,
>> > >>
>> > >> I wrote a custom Region Observer.
>> > >> I'm currently writing an Installer class for it.
>> > >> In this installer I'm adding the region observer by adding a
>> > coprocessor to the HTableDescriptor, and then calling modifyTable by
>> > HBaseAdmin.
>> > >>
>> > >> My question is: How can I check whether region observer was loaded
>> > successfully for this table?
>> > >>
>> > >> I tried searching for a way to get the Coprocessor.State somehow for
>> my
>> > region observer so I'll know it's ACTIVE, but couldn't find a way.
>> > >>
>> > >>
>> > >> Thank you,
>> > >>
>> > >> Asaf
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> > >>
>> >
>> >
>>
>
>
>
>-- 
>Thanks & Regards,
>Anil Gupta

Re: Checking if a coprocessor was loaded successfully from client

Posted by anil gupta <an...@gmail.com>.
Hi Asaf,

Have a look at the
*hasCoprocessor<http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor%28java.lang.String%29>
* method of HTD:
http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor.html#hasCoprocessor(java.lang.String)

It might be helpful for you. I have used it in past to check whether a
coprocessors is successfully added or not.

HTH,
Anil

On Sun, Dec 9, 2012 at 2:25 PM, Ted Yu <yu...@gmail.com> wrote:

> On region server web UI, you should see the list of coprocessors loaded.
>
> But I guess you're looking for a programmatic way of detecting coprocessor
> deployment.
>
> Cheers
>
> On Sun, Dec 9, 2012 at 12:29 PM, Mesika, Asaf <as...@gmail.com>
> wrote:
>
> > 0.94.0
> > On Dec 9, 2012, at 3:03 PM, yuzhihong@gmail.com wrote:
> >
> > > Which hbase version are you targeting ?
> > >
> > > Thanks
> > >
> > >
> > >
> > > On Dec 9, 2012, at 2:55 AM, "Mesika, Asaf" <as...@gmail.com>
> > wrote:
> > >
> > >> Hi,
> > >>
> > >> I wrote a custom Region Observer.
> > >> I'm currently writing an Installer class for it.
> > >> In this installer I'm adding the region observer by adding a
> > coprocessor to the HTableDescriptor, and then calling modifyTable by
> > HBaseAdmin.
> > >>
> > >> My question is: How can I check whether region observer was loaded
> > successfully for this table?
> > >>
> > >> I tried searching for a way to get the Coprocessor.State somehow for
> my
> > region observer so I'll know it's ACTIVE, but couldn't find a way.
> > >>
> > >>
> > >> Thank you,
> > >>
> > >> Asaf
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> >
> >
>



-- 
Thanks & Regards,
Anil Gupta

Re: Checking if a coprocessor was loaded successfully from client

Posted by Ted Yu <yu...@gmail.com>.
On region server web UI, you should see the list of coprocessors loaded.

But I guess you're looking for a programmatic way of detecting coprocessor
deployment.

Cheers

On Sun, Dec 9, 2012 at 12:29 PM, Mesika, Asaf <as...@gmail.com> wrote:

> 0.94.0
> On Dec 9, 2012, at 3:03 PM, yuzhihong@gmail.com wrote:
>
> > Which hbase version are you targeting ?
> >
> > Thanks
> >
> >
> >
> > On Dec 9, 2012, at 2:55 AM, "Mesika, Asaf" <as...@gmail.com>
> wrote:
> >
> >> Hi,
> >>
> >> I wrote a custom Region Observer.
> >> I'm currently writing an Installer class for it.
> >> In this installer I'm adding the region observer by adding a
> coprocessor to the HTableDescriptor, and then calling modifyTable by
> HBaseAdmin.
> >>
> >> My question is: How can I check whether region observer was loaded
> successfully for this table?
> >>
> >> I tried searching for a way to get the Coprocessor.State somehow for my
> region observer so I'll know it's ACTIVE, but couldn't find a way.
> >>
> >>
> >> Thank you,
> >>
> >> Asaf
> >>
> >>
> >>
> >>
> >>
> >>
> >>
>
>

Re: Checking if a coprocessor was loaded successfully from client

Posted by "Mesika, Asaf" <as...@gmail.com>.
0.94.0
On Dec 9, 2012, at 3:03 PM, yuzhihong@gmail.com wrote:

> Which hbase version are you targeting ?
> 
> Thanks
> 
> 
> 
> On Dec 9, 2012, at 2:55 AM, "Mesika, Asaf" <as...@gmail.com> wrote:
> 
>> Hi,
>> 
>> I wrote a custom Region Observer.
>> I'm currently writing an Installer class for it.
>> In this installer I'm adding the region observer by adding a coprocessor to the HTableDescriptor, and then calling modifyTable by HBaseAdmin.
>> 
>> My question is: How can I check whether region observer was loaded successfully for this table? 
>> 
>> I tried searching for a way to get the Coprocessor.State somehow for my region observer so I'll know it's ACTIVE, but couldn't find a way.
>> 
>> 
>> Thank you,
>> 
>> Asaf
>> 
>> 
>> 
>> 
>> 
>> 
>> 


Re: Checking if a coprocessor was loaded successfully from client

Posted by yu...@gmail.com.
Which hbase version are you targeting ?

Thanks



On Dec 9, 2012, at 2:55 AM, "Mesika, Asaf" <as...@gmail.com> wrote:

> Hi,
> 
> I wrote a custom Region Observer.
> I'm currently writing an Installer class for it.
> In this installer I'm adding the region observer by adding a coprocessor to the HTableDescriptor, and then calling modifyTable by HBaseAdmin.
> 
> My question is: How can I check whether region observer was loaded successfully for this table? 
> 
> I tried searching for a way to get the Coprocessor.State somehow for my region observer so I'll know it's ACTIVE, but couldn't find a way.
> 
> 
> Thank you,
> 
> Asaf
> 
> 
> 
> 
> 
> 
>