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.

Reply via email to