adoroszlai commented on code in PR #10021:
URL: https://github.com/apache/ozone/pull/10021#discussion_r3021201190
##########
hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh:
##########
@@ -1520,17 +1520,18 @@ function ozone_translate_cygwin_path
## @replaceable yes
function ozone_add_default_gc_opts
{
+ local gc_opts
+ local java_major_version
java_major_version=$(ozone_get_java_major_version)
Review Comment:
nit: please move this variable assignment into the `if` block to avoid
running it unnecessarily for client commands
##########
hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh:
##########
@@ -1520,17 +1520,18 @@ function ozone_translate_cygwin_path
## @replaceable yes
function ozone_add_default_gc_opts
{
+ local gc_opts
+ local java_major_version
java_major_version=$(ozone_get_java_major_version)
if [[ "${OZONE_SUBCMD_SUPPORTDAEMONIZATION}" == true ]]; then
- if [[ ! "$OZONE_OPTS" =~ "-XX" ]] ; then
- OZONE_OPTS="${OZONE_OPTS} -XX:ParallelGCThreads=8"
- if [[ "$java_major_version" -lt 15 ]]; then
- OZONE_OPTS="${OZONE_OPTS} -XX:+UseConcMarkSweepGC -XX:NewRatio=3
-XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled"
- ozone_error "No '-XX:...' jvm parameters are set. Adding safer GC
settings '-XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC -XX:NewRatio=3
-XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled' to the
OZONE_OPTS"
- else
- ozone_error "No '-XX:...' jvm parameters are set. Adding safer GC
settings '-XX:ParallelGCThreads=8' to the OZONE_OPTS"
- fi
+ gc_opts="-XX:ParallelGCThreads=8"
+ if [[ "$java_major_version" -lt 15 ]]; then
+ gc_opts="${gc_opts} -XX:+UseConcMarkSweepGC -XX:NewRatio=3
-XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled"
+ ozone_debug "No '-XX:...' jvm parameters are set. Adding safer GC
settings '-XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC -XX:NewRatio=3
-XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled' to the
OZONE_OPTS"
+ else
+ ozone_debug "No '-XX:...' jvm parameters are set. Adding safer GC
settings '-XX:ParallelGCThreads=8' to the OZONE_OPTS"
Review Comment:
Please remove these `ozone_debug` messages. Since presence of `-XX` is not
checked beforehand, these would always be printed. `ozone_add_param` already
prints debug message:
https://github.com/apache/ozone/blob/644a018e63a42225307036375c7cf2e7c1178917/hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh#L1137-L1139
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]