Skip to content

Commit 6f59dd6

Browse files
committed
OMID-309 Load hbase-env.sh and fall back to HBASE_OPT in startup scripts
1 parent 292d0eb commit 6f59dd6

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

tso-server/bin/omid.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ cd $SCRIPTDIR;
2323
# Load Omid environment variables
2424
source omid-env.sh
2525

26+
# Load HBase environent variables
27+
if [ -r "${HBASE_CONF_DIR}/hbase-env.sh" ]; then
28+
echo Loading "${HBASE_CONF_DIR}/hbase-env.sh"
29+
# The main thing here is HBASE_OPTS
30+
source "${HBASE_CONF_DIR}/hbase-env.sh"
31+
fi
32+
2633
# Configure classpath...
2734
CLASSPATH=../conf:${HBASE_CONF_DIR}:${HADOOP_CONF_DIR}
2835

@@ -39,6 +46,12 @@ for j in ../lib/*.jar; do
3946
CLASSPATH=$CLASSPATH:$j
4047
done
4148

49+
if [ -z ${OMID_OPTS+x} ]; then
50+
OPTS="$HBASE_OPTS";
51+
else
52+
OPTS="$OMID_OPTS"
53+
fi
54+
4255
#JVM detection and list of JDK11 options copied from HBase with slight modifications
4356

4457
function read_java_version() {
@@ -70,7 +83,7 @@ function parse_java_major_version() {
7083

7184
add_jdk11_jvm_flags() {
7285
# Keep in sync with omid-surefire.jdk11.flags in the root pom.xml
73-
OMID_OPTS="$OMID_OPTS -Dorg.apache.hbase.thirdparty.io.netty.tryReflectionSetAccessible=true --add-modules jdk.unsupported --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-exports java.base/jdk.internal.misc=ALL-UNNAMED --add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-exports java.base/sun.net.dns=ALL-UNNAMED --add-exports java.base/sun.net.util=ALL-UNNAMED"
86+
OPTS="$OPTS -Dorg.apache.hbase.thirdparty.io.netty.tryReflectionSetAccessible=true --add-modules jdk.unsupported --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-exports java.base/jdk.internal.misc=ALL-UNNAMED --add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-exports java.base/sun.net.dns=ALL-UNNAMED --add-exports java.base/sun.net.util=ALL-UNNAMED"
7487
}
7588

7689
setup_jdk_options() {
@@ -126,7 +139,7 @@ setup_jdk_options() {
126139
}
127140

128141
tso() {
129-
exec java $JVM_FLAGS $OMID_OPTS -cp $CLASSPATH org.apache.omid.tso.TSOServer $@
142+
exec java $JVM_FLAGS $OPTS -cp $CLASSPATH org.apache.omid.tso.TSOServer $@
130143
}
131144

132145
tsoRelauncher() {
@@ -137,11 +150,11 @@ tsoRelauncher() {
137150
}
138151

139152
createHBaseCommitTable() {
140-
exec java $OMID_OPTS -cp $CLASSPATH org.apache.omid.tools.hbase.OmidTableManager commit-table $@
153+
exec java $JVM_FLAGS $OPTS -cp $CLASSPATH org.apache.omid.tools.hbase.OmidTableManager commit-table $@
141154
}
142155

143156
createHBaseTimestampTable() {
144-
exec java $OMID_OPTS -cp $CLASSPATH org.apache.omid.tools.hbase.OmidTableManager timestamp-table $@
157+
exec java $JVM_FLAGS $OPTS -cp $CLASSPATH org.apache.omid.tools.hbase.OmidTableManager timestamp-table $@
145158
}
146159

147160
usage() {

0 commit comments

Comments
 (0)