2010-10-06 160 views
3

我在我的日誌文件WARN hbase.HBaseConfiguration: instantiating HBaseConfiguration() is deprecated. Please use HBaseConfiguration#create() to construct a plain Configuration中收到此錯誤消息我該如何擺脫這種情況?擺脫Hbase配置棄用警告

我的類擴展Configured.class,和我實例化配置是這樣的:

HBaseConfiguration hBaseConfiguration = new HBaseConfiguration(getConf()); 

有沒有人有類似的問題?如何解決它?

編輯

我怎樣才能得到這個版本HbaseConfiguration的:

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

我從網上下載HBase的網站的最新版本(0.20.6版本),但類是從不同這個,它缺少的create()方法和其他一些。

回答

1

引述的Javadoc:

Instantinating HBaseConfiguration()被 棄用。請使用 HBaseConfiguration#創建(CONF)以 構建一個簡單的配置

而不是做:

HBaseConfiguration hBaseConfiguration = new HBaseConfiguration(getConf()); 

你應該這樣做:

Configuration configuration = HBaseConfiguration.create(getConf()); 
+0

謝謝你,我可以讀,但我不明白他們的意思,如果你理解了這個javadoc,你能給我一個例子嗎? – London 2010-10-06 09:15:24

+0

現在我得到這個編譯信息'方法create()對於HBaseConfiguration類型是未定義的 – London 2010-10-06 09:33:11

+0

getConf()返回什麼?創建(...)期望一個'配置'對象你可以發佈一些代碼,我不知道你在做什麼。 – Guillaume 2010-10-06 09:43:00