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

inject jvm options #1089

Merged
merged 1 commit into from Apr 22, 2024
Merged

inject jvm options #1089

merged 1 commit into from Apr 22, 2024

Conversation

jrwest
Copy link

@jrwest jrwest commented Apr 14, 2024

upsert uses commas as the delimiter between options which doesn't work for a few C* options that use commas in the value.

Inject works by taking the string and adding it to the end of the jvm-server.options file verbatim. While the comments in that file say it expects one option per line there is nothing that actually enforces that rule. The line only needs to start with a '-'

Code that parses the options file:

JVM_OPTS_FILE=$CASSANDRA_CONF/jvm${jvmoptions_variant:--clients}.options if [ $JAVA_VERSION -ge 11 ] ; then
    JVM_DEP_OPTS_FILE=$CASSANDRA_CONF/jvm11${jvmoptions_variant:--clients}.options
else
    JVM_DEP_OPTS_FILE=$CASSANDRA_CONF/jvm8${jvmoptions_variant:--clients}.options
fi

for opt in `grep "^-" $JVM_OPTS_FILE` `grep "^-" $JVM_DEP_OPTS_FILE` do
  JVM_OPTS="$JVM_OPTS $opt"
done

upsert uses commas as the delimiter between options which
doesn't work for a few C* options that use commas in the value.

Inject works by takign the string and adding it to the end of the jvm-server.options
file verbatim. While the comments in that file say it expects one option per line
there is nothign that actually enforces that rule. The line only needs to start with a '-'

Code that parses the options file:
JVM_OPTS_FILE=$CASSANDRA_CONF/jvm${jvmoptions_variant:--clients}.options
if [ $JAVA_VERSION -ge 11 ] ; then
    JVM_DEP_OPTS_FILE=$CASSANDRA_CONF/jvm11${jvmoptions_variant:--clients}.options
else
    JVM_DEP_OPTS_FILE=$CASSANDRA_CONF/jvm8${jvmoptions_variant:--clients}.options
fi

for opt in `grep "^-" $JVM_OPTS_FILE` `grep "^-" $JVM_DEP_OPTS_FILE`
do
  JVM_OPTS="$JVM_OPTS $opt"
done
@jrwest jrwest merged commit 5ce3496 into 4.x Apr 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant