Skip to content
Draft
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
21 changes: 17 additions & 4 deletions tso-server/bin/omid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ cd $SCRIPTDIR;
# Load Omid environment variables
source omid-env.sh

# Load HBase environent variables
if [ -r "${HBASE_CONF_DIR}/hbase-env.sh" ]; then
echo Loading "${HBASE_CONF_DIR}/hbase-env.sh"
# The main thing here is HBASE_OPTS
source "${HBASE_CONF_DIR}/hbase-env.sh"
fi

# Configure classpath...
CLASSPATH=../conf:${HBASE_CONF_DIR}:${HADOOP_CONF_DIR}

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

if [ -z ${OMID_OPTS+x} ]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if we do something like

OPTS=$OMID_OPTS  
if [ -z ${OMID_OPTS+x} ]; then  
OPTS="$HBASE_OPTS":"$OPTS";  

I am just thinking aloud here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that both may have similar options, like -Xmx, in which case it depends on the JVM version if the first or last one gets used.

That's why I want to make sure that HBASE_OPTS is a fallback to OMID_OPTS rather than using both.

Phoenix currently adds both, but I also want to fix that one, because of the possible conflicting options.

OPTS="$HBASE_OPTS";
else
OPTS="$OMID_OPTS"
fi

#JVM detection and list of JDK11 options copied from HBase with slight modifications

function read_java_version() {
Expand Down Expand Up @@ -70,7 +83,7 @@ function parse_java_major_version() {

add_jdk11_jvm_flags() {
# Keep in sync with omid-surefire.jdk11.flags in the root pom.xml
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"
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"
}

setup_jdk_options() {
Expand Down Expand Up @@ -126,7 +139,7 @@ setup_jdk_options() {
}

tso() {
exec java $JVM_FLAGS $OMID_OPTS -cp $CLASSPATH org.apache.omid.tso.TSOServer $@
exec java $JVM_FLAGS $OPTS -cp $CLASSPATH org.apache.omid.tso.TSOServer $@
}

tsoRelauncher() {
Expand All @@ -137,11 +150,11 @@ tsoRelauncher() {
}

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

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

usage() {
Expand Down