Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Implemented
-
2.0.0
-
None
Description
HDDS-10382 added Java-version specific logic for Netty:
# Get the version string JAVA_VERSION_STRING=$(java -version 2>&1) # Extract the major version number JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION_STRING" | grep -oE '[0-9]+(\.[0-9]+)*' | head -n 1 | awk -F. '{print ($1 == 1 ? $2 : $1)}') # Add JVM parameter for Java 9+ # (org.apache.ratis.thirdparty.io.netty.tryReflectionSetAccessible=true) to allow Netty unsafe memory allocation. # Corresponding issue https://issues.apache.org/jira/browse/HDDS-10382. if [[ "${JAVA_MAJOR_VERSION}" -ge "9" ]]; then NETTY_OPTS="-Dorg.apache.ratis.thirdparty.io.netty.tryReflectionSetAccessible=true ${NETTY_OPTS}" fi
Please move setting of NETTY_OPTS to ozone_java_setup in hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh:
# Get the version string JAVA_VERSION_STRING=$(${JAVA} -version 2>&1 | head -n 1) # Extract the major version number JAVA_MAJOR_VERSION=$(echo "$JAVA_VERSION_STRING" | sed -E -n 's/.* version "([^.-]*).*"/\1/p' | cut -d' ' -f1) ozone_set_module_access_args
Also, since RATIS_OPTS also contains setting for shaded Netty (org.apache.ratis.thirdparty.io.netty...), I think we can merge the two variables, keeping the RATIS_OPTS name for compatibility.
Attachments
Issue Links
- is related to
-
HDDS-10382 Optimize Netty memory allocation by avoiding zero assignment in Java 9+
- Resolved
- links to