Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Got org.apache.hadoop.hbase.PleaseHoldException: Master is initializing when modified the hbase.coprocessor.region.classes

Got org.apache.hadoop.hbase.PleaseHoldException: Master is initializing when modified the hbase.coprocessor.region.classes

New Contributor

Hi, Guys, I am trying to add a region observer to hbase, the code is like:

public class TestAddColumnBaseRegionObserver extends BaseRegionObserver{

@Override

public void prePut(ObserverContext<RegionCoprocessorEnvironment> e, Put put, WALEdit edit, Durability durability) throws IOException {

putUUIDColumnIfMissing(e, put, edit, durability);

}

private void putUUIDColumnIfMissing(ObserverContext<RegionCoprocessorEnvironment> e, Put put, WALEdit edit, Durability durability) {

try {

if(!put.has(Bytes.toBytes("cf1"), Bytes.toBytes("uuid"))) {

String uuid = put.toString(); // md5

put.add(Bytes.toBytes("cf1"), Bytes.toBytes("uuid"), Bytes.toBytes(uuid));

}

} catch (Exception e1) {

e1.printStackTrace();

}

}

}

so this code would add a new column "uuid" to the table if there is no "cf1:uuid" column in the table.

it works when I manually added the .jar in the hbase shell, but when doing another way: modify the hbase-site.xml, by modifying the hbase.coprocessor.region.classes to the TestAddColumnBaseRegionObserver class

<property>

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

<value>com.hbase.hook.TestAddColumnBaseRegionObserver</value>

</property>

and restart the hbase, I got an error reported when logged into the hbase shell and tred to do a hbase command

ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing at org.apache.hadoop.hbase.master.HMaster.checkInitialized(HMaster.java:2177) at org.apache.hadoop.hbase.master.HMaster.checkNamespaceManagerReady(HMaster.java:2182) at org.apache.hadoop.hbase.master.HMaster.ensureNamespaceExists(HMaster.java:2375) at org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:1444) at org.apache.hadoop.hbase.master.MasterRpcServices.createTable(MasterRpcServices.java:422) at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java:48502) at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2114) at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:101) at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:130) at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:107) at java.lang.Thread.run(Thread.java:745)

Did anyone meet similar problems before? Or do you know what causes this problem?

4 REPLIES 4

Re: Got org.apache.hadoop.hbase.PleaseHoldException: Master is initializing when modified the hbase.coprocessor.region.classes

Super Guru

did you put the jar in the hbase server classpath?

Re: Got org.apache.hadoop.hbase.PleaseHoldException: Master is initializing when modified the hbase.coprocessor.region.classes

New Contributor

yes, I put the jar in the hbase lib directory and also add a line "export HBASE_CLASSPATH=%HBASE_CLASSPATH%:corprocessor.jar" in the hbase-env file

Re: Got org.apache.hadoop.hbase.PleaseHoldException: Master is initializing when modified the hbase.coprocessor.region.classes

New Contributor

I read the log and found a java.lang.ClassNotFoundException: com.hbase.hook.TestAddColumnBaseRegionObserver, I think this causes the problem

Highlighted

Re: Got org.apache.hadoop.hbase.PleaseHoldException: Master is initializing when modified the hbase.coprocessor.region.classes

Guru

Also, deploying the region observer like this is not the correct way to go. It will make it so that ALL tables in HBase are deployed with this coprocessor (including the system tables). Since they do not have the "cf1" column, operations will fail for system table and you cannot get a cluster up and running.

Please use the table property for the coproccessor for selectively enabling the coprocessor only for the tables that you need. See https://hbase.apache.org/book.html#_guidelines_for_deploying_a_coprocessor