hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Basjes (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-14750) HBaseConfiguration.create() doesn't load properties
Date Tue, 10 Nov 2015 12:26:10 GMT

     [ https://issues.apache.org/jira/browse/HBASE-14750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Niels Basjes updated HBASE-14750:
---------------------------------
    Attachment: HBASE-14750-20151110-1323.patch

I attached a simple patch that shows where I would put the fix I have in mind.
This makes developing, testing and running applications that use HBase a lot easier.
There is no need to add  scripting to set the classpath and you can run it immediately from
within your IDE.


> HBaseConfiguration.create() doesn't load properties
> ---------------------------------------------------
>
>                 Key: HBASE-14750
>                 URL: https://issues.apache.org/jira/browse/HBASE-14750
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Niels Basjes
>         Attachments: HBASE-14750-20151110-1323.patch
>
>
> While writing an application that uses HBase I ran into the problem that although I have
setup the hbase-site.xml in the {{HBASE_CONF_DIR}}; the settings in this file are not picked
up in my application.
> In several places I find instructions to include things like the {{hbase.zookeeper.quorum}}
in a properties file and the explicitly set these value from within the application (I have
actually done this in the past quite a few times).
> Although this works I expect the system to automatically pickup the settings I have installed
already which are picked up by tools like the hbase shell and pig.
> So I ended up writing this helper method:
> {code:java}
>     public static Configuration createConfiguration() {
>         String hbaseConfDir = System.getenv("HBASE_CONF_DIR");
>         if (hbaseConfDir == null) {
>             hbaseConfDir = "/etc/hbase/conf";
>         }
>         Configuration conf = HBaseConfiguration.create();
>         conf.addResource(new Path(hbaseConfDir + "/hbase-site.xml"));
>         return conf;
>     }
> {code}
> I expect HBaseConfiguration.create() to give me a working config in an environment where
everything for all the other HBase clients has already been setup correctly.
> My proposal is to change the HBaseConfiguration.create() to effectively include what
my helper method does.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message