tags:

views:

29

answers:

1

I'm getting this error message in my log file WARN hbase.HBaseConfiguration: instantiating HBaseConfiguration() is deprecated. Please use HBaseConfiguration#create() to construct a plain Configuration how can I get rid of this?

My class extends Configured.class , and I'm instantiating configuration like this :

HBaseConfiguration hBaseConfiguration = new HBaseConfiguration(getConf());

Did anyone have the similar issue? how to fix it ?

EDIT

How can I get this version of HbaseConfiguration :

http://hbase.apache.org/docs/r0.89.20100726/xref/org/apache/hadoop/hbase/HBaseConfiguration.html

I downloaded the latest version from hbase web site(version 0.20.6) but the class is different from this one, its missing create() method and some other too.

+1  A: 

Quoting the Javadoc:

Instantinating HBaseConfiguration() is deprecated. Please use HBaseConfiguration#create(conf) to construct a plain Configuration

Instead of doing:

HBaseConfiguration hBaseConfiguration = new HBaseConfiguration(getConf());

You should do:

Configuration configuration = HBaseConfiguration.create(getConf());
Guillaume
@Guillaume thank you, I can read, but I don't understand what they mean, can you give me an example if you understood this piece of javadoc.
London
@Guillaume I get this compile message now `The method create() is undefined for the type HBaseConfiguration`
London
What does getConf() return? create(...) expects a 'Configuration' object Could you post some code, I'm not sure what you're doing.
Guillaume
@Guillaume This is what getConf() does http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/conf/Configurable.html#getConf() , maybe I'm not using the latest jar, when looking inside http://hbase.apache.org/docs/r0.89.20100726/xref/org/apache/hadoop/hbase/HBaseConfiguration.html create() method is visible and in there (+1)
London
Weird... Make sure you are compiling and running against the same version. Anyway, you should be fine, just be aware that deprecated methods/constructors might be removed in later versions.
Guillaume