Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config hbase.zookeeper.znode.parent for hbase backend #333

Merged
merged 1 commit into from
Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions hugegraph-dist/src/assembly/travis/hbase-site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<name>zookeeper.session.timeout</name>
<value>1200000</value>
</property>
<property>
<name>zookeeper.znode.parent</name>
<value>/hbase</value>
</property>
<property>
<name>hbase.zookeeper.property.tickTime</name>
<value>6000</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ public static synchronized HbaseOptions instance() {
2181
);

public static final ConfigOption<String> HBASE_ZNODE_PARENT =
new ConfigOption<>(
"hbase.znode_parent",
"The znode parent path of HBase zookeeper.",
disallowEmpty(),
"/hbase"
);

public static final ConfigOption<Integer> HBASE_THREADS_MAX =
new ConfigOption<>(
"hbase.threads_max",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.apache.hadoop.hbase.CellScanner;
import org.apache.hadoop.hbase.CellUtil;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.NamespaceDescriptor;
import org.apache.hadoop.hbase.RegionMetrics;
import org.apache.hadoop.hbase.ServerName;
Expand Down Expand Up @@ -93,10 +94,12 @@ private Table table(String table) throws IOException {
public synchronized void open(HugeConfig conf) throws IOException {
String hosts = conf.get(HbaseOptions.HBASE_HOSTS);
int port = conf.get(HbaseOptions.HBASE_PORT);
String znodeParent = conf.get(HbaseOptions.HBASE_ZNODE_PARENT);

Configuration config = HBaseConfiguration.create();
config.set("hbase.zookeeper.quorum", hosts);
config.set("hbase.zookeeper.property.clientPort", String.valueOf(port));
config.set(HConstants.ZOOKEEPER_QUORUM, hosts);
config.set(HConstants.ZOOKEEPER_CLIENT_PORT, String.valueOf(port));
config.set(HConstants.ZOOKEEPER_ZNODE_PARENT, znodeParent);
// Set hbase.hconnection.threads.max 64 to avoid OOM(default value: 256)
config.setInt("hbase.hconnection.threads.max",
conf.get(HbaseOptions.HBASE_THREADS_MAX));
Expand Down
1 change: 1 addition & 0 deletions hugegraph-test/src/main/resources/hugegraph.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ cassandra.read_timeout=120
# hbase backend config
hbase.hosts=localhost
hbase.port=2181
hbase.znode_parent=/hbase

# mysql backend config
jdbc.driver=com.mysql.jdbc.Driver
Expand Down