hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anoop Sam John <anoo...@huawei.com>
Subject RE: Problems Loading RegionObserver Coprocessor
Date Sat, 26 May 2012 06:16:37 GMT
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 [kevin.macksamie@gmail.com]
Sent: Friday, May 25, 2012 7:25 PM
To: user@hbase.apache.org
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.

Mime
View raw message