hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Nichols <tmnich...@gmail.com>
Subject NPE from HConnectionManager
Date Mon, 02 Feb 2009 17:07:14 GMT
Hi,

I am using the HBase client API in from a Groovy script:

import org.apache.hadoop.hbase.HBaseConfiguration
import org.apache.hadoop.hbase.client.HBaseAdmin
println new HBaseAdmin( new HBaseConfiguration() )

The script works fine if run standalone, but if I run it as an embeded
ant task, I get the following exception:

java.lang.NullPointerException
        at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
        at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:90)
        at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:66)
        at com.enernoc.rnd.shredder.core.groovy.HBaseBuilder.getAdmin(HBaseBuilder.java:530)
        at com.enernoc.rnd.shredder.core.groovy.HBaseBuilder.create(HBaseBuilder.java:229)


Looking into the code:
86 : 	  	  	 public static HConnection getConnection(HBaseConfiguration conf) {
87 : 	  	  	TableServers connection;
88 : 	  	  	synchronized (HBASE_INSTANCES) {
89 : 	  	  	String instanceName = conf.get(HBASE_DIR);
90 : 	  	  	connection = HBASE_INSTANCES.get(instanceName);

It means that either "instanceName" is null, or HBASE_INSTANCES is
null.  I am guessing it is the former since the previous line is
retrieving that value.   So can anyone guess why this would fail?  The
HBase JAR is on my classpath, which contains the hbase-default.xml
config file (which has the hbase.rootdir value).

Furthermore, it appears that the value "hbase.rootdir" is a server
configuration to tell the HBase server where the data is stored --
correct?  So if I am just using the client api (i.e. to connect to a
running HBase server instance,) why would the client be attempting to
directly access the data files rather than going through the server
connection?  Or am I confused about how the HBase API works?

Thanks in advance for the help.

-Tom

Mime
View raw message