Skip to content

Commit

Permalink
修改hbase.conf.dir优先级
Browse files Browse the repository at this point in the history
  • Loading branch information
dongkelun committed Dec 18, 2023
1 parent c41cfed commit b9db276
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -55,7 +55,7 @@ public class HBaseConnectorOptions {
ConfigOptions.key("hbase.conf.dir")
.stringType()
.defaultValue("/etc/hbase/conf")
.withDescription("Configuration folder path for hbase.");
.withDescription("The configuration folder path for hbase.");

public static final ConfigOption<String> NULL_STRING_LITERAL =
ConfigOptions.key("null-string-literal")
Expand Down
Expand Up @@ -111,6 +111,9 @@ public static Configuration getHBaseConfiguration(ReadableConfig tableOptions) {
// create default configuration from current runtime env (`hbase-site.xml` in classpath)
// first,
Configuration hbaseClientConf = HBaseConfigurationUtil.getHBaseConfiguration();
hbaseClientConf.addResource(
new org.apache.hadoop.fs.Path(
tableOptions.get(HBASE_CONF_DIR) + "/hbase-site.xml"));
hbaseClientConf.set(HConstants.ZOOKEEPER_QUORUM, tableOptions.get(ZOOKEEPER_QUORUM));
hbaseClientConf.set(
HConstants.ZOOKEEPER_ZNODE_PARENT, tableOptions.get(ZOOKEEPER_ZNODE_PARENT));
Expand All @@ -119,9 +122,6 @@ public static Configuration getHBaseConfiguration(ReadableConfig tableOptions) {
getHBaseClientProperties(
((org.apache.flink.configuration.Configuration) tableOptions).toMap());
properties.forEach((k, v) -> hbaseClientConf.set(k.toString(), v.toString()));
hbaseClientConf.addResource(
new org.apache.hadoop.fs.Path(
tableOptions.get(HBASE_CONF_DIR) + "/hbase-site.xml"));
return hbaseClientConf;
}

Expand Down

0 comments on commit b9db276

Please sign in to comment.