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

Switch to Plain View
HBase, mail # user - Problems Loading RegionObserver Coprocessor


+
Kevin 2012-05-25, 13:55
+
shashwat shriparv 2012-05-25, 14:00
+
Kevin 2012-05-25, 14:31
+
Andrew Purtell 2012-05-25, 18:31
+
Kevin 2012-05-25, 20:58
+
highpointe 2012-05-27, 04:53
Copy link to this message
-
RE: Problems Loading RegionObserver Coprocessor
Anoop Sam John 2012-05-26, 06:16
Hi Kevin

  <property>
    <name>hbase.coprocessor.region.classes</name>

<value>com.hbase.example.region.coprocessors.MyCustomRegionObserver</value>
  </property>

Instead of configuring the FQCN of your region observer against "hbase.coprocessor.region.classes", you can go with configuring the same against the config param "hbase.coprocessor.user.region.classes"

 <property>
    <name>hbase.coprocessor.user.region.classes</name>
    <value>com.hbase.example.region.coprocessors.MyCustomRegionObserver</value>
  </property>

This observer will not got called while dealing with ROOT and META table then...

-Anoop-
________________________________________
From: Kevin [[EMAIL PROTECTED]]
Sent: Friday, May 25, 2012 7:25 PM
To: [EMAIL PROTECTED]
Subject: Problems Loading RegionObserver Coprocessor

Hi,

I'm starting to give coprocessors a try, but I'm having trouble getting the
HBase cluster to start up properly after deploying the new configuration.
My coprocessor is trivial, but it is only to get my feet wet. I override
the prePut method to add the row being put into a table into another table
as well.

public class MyCustomRegionObserver extends BaseRegionObserver {

    public void prePut(final ObserverContext<RegionCoprocessorEnvironment>
e,
            final Put put, final WALEdit edit, boolean writeToWAL)
            throws IOException {
        HTableInterface hti e.getEnvironment().getTable(Bytes.toBytes("accesses"));
        try {
            hti.put(new Put(put.getRow()).add(Bytes.toBytes("num"),
                    Bytes.toBytes("value"), Bytes.toBytes(0)));
        } finally {
            hti.close();
        }
    }

}

I updated hbase-site.xml to reflect this coprocessor.

  <property>
    <name>hbase.coprocessor.region.classes</name>

<value>com.hbase.example.region.coprocessors.MyCustomRegionObserver</value>
  </property>

I update all the machines with the new configuration and I added the
coprocessor jar to /usr/lib/hbase/lib on each machine (I don't change the
default HBase classpath in hbase-env.sh)

When I restart my HBase cluster the cluster does not ever finish assigning
META region. In the master's log there are a lot of
NotServingRegionExceptions: Region is not online: .META.,,1. Other than
that I can't see any log messages that indicate any specific about loading
the coprocessor. If I then comment out the coprocessor property in
hbase-site.xml and restart the cluster, then HBase starts up fine.

I am new to coprocessors so any help is great.

Thanks.