Skip to content

Commit

Permalink
remove MANTIS_WORKER_JVM_OPTS and MANTIS_WORKER_JVM_OPTS_STAGE since …
Browse files Browse the repository at this point in the history
…no longer used (#658)

Mantis has moved away from mesos/fenzo to pre-allocated Task Executors.
These TEs are already running a JVM and so JVM options can't be set
during job/stage submit phase. Remove these properties.
  • Loading branch information
hmitnflx authored Apr 12, 2024
1 parent 34c4ee8 commit bf2c2ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@ public final class SystemParameters {
public static final String JOB_MASTER_AUTOSCALE_SOURCEJOB_DROP_METRIC_PATTERNS_PARAM = "mantis.jobmaster.autoscale.sourcejob.dropMetricPatterns";
public static final String JOB_WORKER_HEARTBEAT_INTERVAL_SECS = "mantis.job.worker.heartbeat.interval.secs";
public static final String JOB_WORKER_TIMEOUT_SECS = "mantis.job.worker.timeout.secs";
public static final String PER_STAGE_JVM_OPTS_FORMAT = "MANTIS_WORKER_JVM_OPTS_STAGE%d";

@Deprecated
public static final String MANTIS_WORKER_JVM_OPTS_STAGE_PREFIX = "MANTIS_WORKER_JVM_OPTS_STAGE";

@Deprecated
public static final String PER_STAGE_JVM_OPTS_FORMAT = MANTIS_WORKER_JVM_OPTS_STAGE_PREFIX + "%d";
public static final String STAGE_CONCURRENCY = "mantis.stageConcurrency";

@Deprecated
public static final int MAX_NUM_STAGES_FOR_JVM_OPTS_OVERRIDE = 5;

private SystemParameters() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,7 @@

package io.mantisrx.runtime.parameter;

import static io.mantisrx.common.SystemParameters.JOB_MASTER_AUTOSCALE_METRIC_SYSTEM_PARAM;
import static io.mantisrx.common.SystemParameters.JOB_MASTER_AUTOSCALE_SOURCEJOB_DROP_METRIC_PATTERNS_PARAM;
import static io.mantisrx.common.SystemParameters.JOB_MASTER_AUTOSCALE_SOURCEJOB_METRIC_PARAM;
import static io.mantisrx.common.SystemParameters.JOB_MASTER_AUTOSCALE_SOURCEJOB_TARGET_PARAM;
import static io.mantisrx.common.SystemParameters.JOB_MASTER_CLUTCH_EXPERIMENTAL_PARAM;
import static io.mantisrx.common.SystemParameters.JOB_MASTER_CLUTCH_SYSTEM_PARAM;
import static io.mantisrx.common.SystemParameters.JOB_WORKER_HEARTBEAT_INTERVAL_SECS;
import static io.mantisrx.common.SystemParameters.JOB_WORKER_TIMEOUT_SECS;
import static io.mantisrx.common.SystemParameters.MAX_NUM_STAGES_FOR_JVM_OPTS_OVERRIDE;
import static io.mantisrx.common.SystemParameters.PER_STAGE_JVM_OPTS_FORMAT;
import static io.mantisrx.common.SystemParameters.STAGE_CONCURRENCY;
import static io.mantisrx.common.SystemParameters.*;

import com.mantisrx.common.utils.MantisSSEConstants;
import io.mantisrx.common.compression.CompressionUtils;
Expand Down Expand Up @@ -181,15 +171,6 @@ public class ParameterUtils {
.build();
systemParams.put(clutchExperimentalEnabled.getName(), clutchExperimentalEnabled);

// set MantisWorker commandline JVM options for all stages of a job
ParameterDefinition<String> jvmOptions = new StringParameter()
.name("MANTIS_WORKER_JVM_OPTS")
.validator(Validators.alwaysPass())
.defaultValue("")
.description("command line options for the mantis worker JVM, setting this field would override the default GC settings")
.build();
systemParams.put(jvmOptions.getName(), jvmOptions);

ParameterDefinition<Integer> stageConcurrency = new IntParameter()
.name(STAGE_CONCURRENCY)
.validator(Validators.range(-1, 16))
Expand All @@ -198,17 +179,6 @@ public class ParameterUtils {
.build();
systemParams.put(stageConcurrency.getName(), stageConcurrency);

// set per stage mantis worker commandline JVM args, this takes precedence over MANTIS_WORKER_JVM_OPTS
for (int stageNum = 0; stageNum <= MAX_NUM_STAGES_FOR_JVM_OPTS_OVERRIDE; stageNum++) {
final String paramName = String.format(PER_STAGE_JVM_OPTS_FORMAT, stageNum);
systemParams.put(paramName, new StringParameter()
.name(paramName)
.validator(Validators.alwaysPass())
.defaultValue("")
.description("command line options for stage " + stageNum + " mantis worker JVM, setting this field would override the default GC settings")
.build());
}

ParameterDefinition<Boolean> sseBinary = new BooleanParameter()
.name(MantisSSEConstants.MANTIS_ENABLE_COMPRESSION)
.validator(Validators.alwaysPass())
Expand Down Expand Up @@ -351,7 +321,10 @@ public static <T> Map<String, Object> checkThenCreateState(
definition = parameterDefinitions.get(name);

if (definition == null) {
if (name.startsWith("mantis.") || name.startsWith("MANTIS")) {
if (name.equals("MANTIS_WORKER_JVM_OPTS") || name.startsWith(MANTIS_WORKER_JVM_OPTS_STAGE_PREFIX)) {
log.warn("Ignoring invalid parameter definitions with name: {}, will skip parameter", name);
continue;
} else if (name.startsWith("mantis.") || name.startsWith("MANTIS")) {
log.info("mantis runtime parameter {} used, looking up definition >>>", name);
definition = systemParams.get(name);
} else {
Expand Down

0 comments on commit bf2c2ef

Please sign in to comment.