Skip to content

Commit

Permalink
HBASE-28252 Add sun.net.dns and sun.net.util to the JDK11+ module exp…
Browse files Browse the repository at this point in the history
…orts in the hbase script (#5571)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Balazs Meszaros <meszibalu@apache.org>
  • Loading branch information
stoty committed Dec 12, 2023
1 parent 78c5ac3 commit 5503962
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions bin/hbase
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ add_jdk11_deps_to_classpath() {
}

add_jdk11_jvm_flags() {
HBASE_OPTS="$HBASE_OPTS -Dorg.apache.hbase.thirdparty.io.netty.tryReflectionSetAccessible=true --add-modules jdk.unsupported --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-exports java.base/jdk.internal.misc=ALL-UNNAMED --add-exports java.security.jgss/sun.security.krb5=ALL-UNNAMED"
HBASE_OPTS="$HBASE_OPTS -Dorg.apache.hbase.thirdparty.io.netty.tryReflectionSetAccessible=true --add-modules jdk.unsupported --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-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"
}

add_opentelemetry_agent() {
Expand Down Expand Up @@ -786,7 +786,7 @@ fi
# Add lib/jdk11 jars to the classpath

if [ "${DEBUG}" = "true" ]; then
echo "Deciding on addition of lib/jdk11 jars to the classpath"
echo "Deciding on addition of lib/jdk11 jars to the classpath and setting JVM module flags"
fi

addJDK11Jars=false
Expand Down Expand Up @@ -879,6 +879,7 @@ export CLASSPATH
if [ "${DEBUG}" = "true" ]; then
echo "classpath=${CLASSPATH}" >&2
HBASE_OPTS="${HBASE_OPTS} -Xdiag"
echo "HBASE_OPTS=${HBASE_OPTS}"
fi

# resolve the command arguments
Expand Down
8 changes: 6 additions & 2 deletions bin/hbase-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,12 @@ EOF
fi

function read_java_version() {
properties="$("${JAVA_HOME}/bin/java" -XshowSettings:properties -version 2>&1)"
echo "${properties}" | "${GREP}" java.runtime.version | head -1 | "${SED}" -e 's/.* = \([^ ]*\)/\1/'
# Avoid calling java repeatedly
if [ -z "$read_java_version_cached" ]; then
properties="$("${JAVA_HOME}/bin/java" -XshowSettings:properties -version 2>&1)"
read_java_version_cached="$(echo "${properties}" | "${GREP}" java.runtime.version | head -1 | "${SED}" -e 's/.* = \([^ ]*\)/\1/')"
fi
echo "$read_java_version_cached"
}

# Inspect the system properties exposed by this JVM to identify the major
Expand Down

0 comments on commit 5503962

Please sign in to comment.