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

HBASE-28252 Add sun.net.dns and sun.net.util to the JDK11+ module exports in the hbase script #5571

Merged
merged 1 commit into from
Dec 12, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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