diff --git a/src/main/java/org/arbeitspferde/groningen/config/ProtoBufSearchSpaceBundle.java b/src/main/java/org/arbeitspferde/groningen/config/ProtoBufSearchSpaceBundle.java index fe6057c..355633f 100644 --- a/src/main/java/org/arbeitspferde/groningen/config/ProtoBufSearchSpaceBundle.java +++ b/src/main/java/org/arbeitspferde/groningen/config/ProtoBufSearchSpaceBundle.java @@ -40,13 +40,6 @@ public class ProtoBufSearchSpaceBundle extends GenericSearchSpaceBundle { */ public ProtoBufSearchSpaceBundle(final ProgramConfiguration.JvmSearchSpace protoSpace, final boolean requireAll) throws InvalidConfigurationException { - - // initial param check - the rest of the CommandLineArgs will be checked - // their entry is instantiated - if (protoSpace.getGcModeCount() == 0 && requireAll) { - throw new InvalidConfigurationException("no gc mode specified"); - } - /* * Run through all the different enums * @@ -139,34 +132,17 @@ public ProtoBufSearchSpaceBundle(final ProgramConfiguration.JvmSearchSpace proto protoSpace.hasSoftRefLruPolicyMsPerMb(), protoSpace.getSoftRefLruPolicyMsPerMb(), requireAll); - /* - * Finally deal with GC Mode - * - * We have a repeated list here so that we can select multiple gc modes over which to search. - * However, squashing these down to boolean values seems wrong. - * - * TODO(team): Really, we want to return a set of the available gc modes but need to - * understand implications on hypothesizer and the GA in general to see if that makes sense. - * Not for mach1. - */ - if (protoSpace.getGcModeCount() == 0) { - // use the 'full' (it is boolean) search step to look over each gcmode - for (JvmFlag gcModeArg : JvmFlag.getGcModeArguments()) { - makeBoolEntry(gcModeArg, false, false, false); - } - } else { - /* - * this list is puny so we can do contains() searches on it even if we have a dumb user who - * puts lots of duplicates in their config.... - * - * Essentially, we say we have a value to pin to - true if it is present, false otherwise. - */ - List gcModes = protoSpace.getGcModeList(); - for (ProgramConfiguration.JvmSearchSpace.GcMode mode : - ProgramConfiguration.JvmSearchSpace.GcMode.values()) { - makeBoolEntry(JvmFlag.getGcModeArgument(mode), true, gcModes.contains(mode), false); - } - } + makeBoolEntry(JvmFlag.USE_SERIAL_GC, + protoSpace.hasUseSerialGc(), protoSpace.getUseSerialGc(), requireAll); + makeBoolEntry(JvmFlag.USE_PARALLEL_GC, + protoSpace.hasUseParallelGc(), protoSpace.getUseParallelGc(), requireAll); + makeBoolEntry(JvmFlag.USE_PARALLEL_OLD_GC, + protoSpace.hasUseParallelOldGc(), protoSpace.getUseParallelOldGc(), requireAll); + makeBoolEntry(JvmFlag.USE_PAR_NEW_GC, + protoSpace.hasUseParNewGc(), protoSpace.getUseParNewGc(), requireAll); + makeBoolEntry(JvmFlag.USE_CONC_MARK_SWEEP_GC, + protoSpace.hasUseConcurrentMarkSweepGc(), protoSpace.getUseConcurrentMarkSweepGc(), + requireAll); } /** diff --git a/src/main/java/org/arbeitspferde/groningen/experimentdb/CommandLine.java b/src/main/java/org/arbeitspferde/groningen/experimentdb/CommandLine.java index 6b8b62f..4fe308e 100644 --- a/src/main/java/org/arbeitspferde/groningen/experimentdb/CommandLine.java +++ b/src/main/java/org/arbeitspferde/groningen/experimentdb/CommandLine.java @@ -20,7 +20,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList.Builder; -import org.arbeitspferde.groningen.experimentdb.jvmflags.GcMode; import org.arbeitspferde.groningen.experimentdb.jvmflags.JvmFlag; import org.arbeitspferde.groningen.experimentdb.jvmflags.JvmFlagSet; @@ -218,27 +217,6 @@ public boolean getUseSerialGC() { return getValue(JvmFlag.USE_SERIAL_GC) == 1; } - /** - * Returns the garbage collection mode chosen in this command line. - * - * @return GC mode. - * @throws RuntimeException If no GC mode is chosen. - */ - public GcMode getGcMode() { - if (getUseConcMarkSweepGC()) { - return GcMode.CMS; - } else if (getUseParallelGC()) { - return GcMode.PARALLEL; - } else if (getUseParallelOldGC()) { - return GcMode.PARALLEL_OLD; - } else if (getUseSerialGC()) { - return GcMode.SERIAL; - } else { - // TODO(team): more debug info. - throw new IllegalStateException("No GC mode found."); - } - } - /** * Convert this command line object into a JVM settings string. * diff --git a/src/main/java/org/arbeitspferde/groningen/experimentdb/jvmflags/GcMode.java b/src/main/java/org/arbeitspferde/groningen/experimentdb/jvmflags/GcMode.java deleted file mode 100644 index a4ff28e..0000000 --- a/src/main/java/org/arbeitspferde/groningen/experimentdb/jvmflags/GcMode.java +++ /dev/null @@ -1,23 +0,0 @@ -/* Copyright 2012 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.arbeitspferde.groningen.experimentdb.jvmflags; - -/** - * Enumeration for the garbage collection modes supported by Groningen. - */ -public enum GcMode { - CMS, PARALLEL, PARALLEL_OLD, SERIAL -} diff --git a/src/main/java/org/arbeitspferde/groningen/experimentdb/jvmflags/JvmFlag.java b/src/main/java/org/arbeitspferde/groningen/experimentdb/jvmflags/JvmFlag.java index b9c2a44..3f66a55 100644 --- a/src/main/java/org/arbeitspferde/groningen/experimentdb/jvmflags/JvmFlag.java +++ b/src/main/java/org/arbeitspferde/groningen/experimentdb/jvmflags/JvmFlag.java @@ -108,7 +108,9 @@ public enum JvmFlag { USE_PARALLEL_OLD_GC("UseParallelOldGC", HotSpotFlagType.UNSTABLE), - USE_SERIAL_GC("UseSerialGC", HotSpotFlagType.UNSTABLE); + USE_SERIAL_GC("UseSerialGC", HotSpotFlagType.UNSTABLE), + + USE_PAR_NEW_GC("UseParNewGC", HotSpotFlagType.UNSTABLE); // XXX: ENSURE LINKED IN EVERYWHERE! /** * The human-readable flag name that excludes the flag-specific argument @@ -156,13 +158,6 @@ public enum JvmFlag { */ private final Range acceptableValueRange; - private static final ImmutableSortedSet GC_MODE_FLAGS = ImmutableSortedSet.naturalOrder() - .add(USE_CONC_MARK_SWEEP_GC) - .add(USE_PARALLEL_GC) - .add(USE_PARALLEL_OLD_GC) - .add(USE_SERIAL_GC) - .build(); - /** * Construct a new boolean flag. * @@ -279,50 +274,4 @@ public String asAcceptableValuesString() { public void validate(final Long proposedValue) throws IllegalArgumentException { getFormatter().validate(this, proposedValue); } - - /** - * Returns the GC mode {@link JvmFlag} instances. - * - * @return List of GC modes. - */ - public static ImmutableSortedSet getGcModeArguments() { - return GC_MODE_FLAGS; - } - - /** - * Returns the GC mode command-line argument for the given GC mode. - */ - public static JvmFlag getGcModeArgument(final GcMode gcMode) { - Preconditions.checkNotNull(gcMode, "gcMode should not be null."); - - switch (gcMode) { - case CMS: - return USE_CONC_MARK_SWEEP_GC; - case PARALLEL: - return USE_PARALLEL_GC; - case PARALLEL_OLD: - return USE_PARALLEL_OLD_GC; - case SERIAL: - return USE_SERIAL_GC; - default: - throw new IllegalArgumentException("Invalid GC mode: " + gcMode); - } - } - - public static JvmFlag getGcModeArgument(final GroningenConfigProto.ProgramConfiguration.JvmSearchSpace.GcMode mode) { - Preconditions.checkNotNull(mode, "mode should not be null."); - // initialize the enum mappings - switch (mode) { - case USE_CONC_MARK_SWEEP: - return USE_CONC_MARK_SWEEP_GC; - case USE_PARALLEL: - return USE_PARALLEL_GC; - case USE_PARALLEL_OLD: - return USE_PARALLEL_OLD_GC; - case USE_SERIAL: - return USE_SERIAL_GC; - default: - throw new IllegalArgumentException("Invalid GC mode: " + mode); - } - } } diff --git a/src/main/java/org/arbeitspferde/groningen/hypothesizer/Hypothesizer.java b/src/main/java/org/arbeitspferde/groningen/hypothesizer/Hypothesizer.java index 2c5da24..977af6d 100644 --- a/src/main/java/org/arbeitspferde/groningen/hypothesizer/Hypothesizer.java +++ b/src/main/java/org/arbeitspferde/groningen/hypothesizer/Hypothesizer.java @@ -74,25 +74,22 @@ public class Hypothesizer extends ProfilingRunnable { /** Contains all non-GC mode arguments */ - @VisibleForTesting - static final List ARGUMENTS; - - // Store non-GC mode arguments in ARGUMENTS - static { - // TODO(team): Reduce level of static initialization. - - Set gcModes = Sets.newHashSet(JvmFlag.getGcModeArguments()); - ARGUMENTS = Lists.newArrayList(); - for (JvmFlag argument : JvmFlag.values()) { - if (!gcModes.contains(argument)) { - ARGUMENTS.add(argument); - } - } - } - - // Chromosome size is the number of arguments plus the GC mode. - @VisibleForTesting - static final int CHROMOSOME_SIZE = ARGUMENTS.size() + 1; +// @VisibleForTesting +// static final List ARGUMENTS; + +// // Store non-GC mode arguments in ARGUMENTS +// static { +// // TODO(team): Reduce level of static initialization. +// +// Set gcModes = Sets.newHashSet(JvmFlag.getGcModeArguments()); +// ARGUMENTS = Lists.newArrayList(); +// for (JvmFlag argument : JvmFlag.values()) { +// if (!gcModes.contains(argument)) { +// ARGUMENTS.add(argument); +// } +// } +// } + private static final int CHROMOSOME_SIZE = JvmFlag.values().length; /** Logger for this class */ private static final Logger logger = Logger.getLogger(Hypothesizer.class.getCanonicalName()); @@ -103,7 +100,7 @@ public class Hypothesizer extends ProfilingRunnable { private GroningenConfig config; - private final List supportedGcModes = Lists.newArrayList(); + // private final List supportedGcModes = Lists.newArrayList(); /** * population size is fixed once we instantiate the ga engine so it makes @@ -211,29 +208,9 @@ private void initialize() { + "checkpoint; starting from scratch ..."); } - initializeSupportedGcModes(); - initializeEvolutionEngine(lastExperiment); } - private void initializeSupportedGcModes() { - SortedSet gcModes = JvmFlag.getGcModeArguments(); - - SearchSpaceBundle bundle = config.getJvmSearchSpaceRestriction(); - for (JvmFlag gcMode : gcModes) { - SearchSpaceEntry entry = bundle.getSearchSpace(gcMode); - // TODO(team): Refactor this into a formal test and extract this baked state logic assumption. - if (entry.getCeiling() > 0) { - supportedGcModes.add(gcMode); - } - } - - if (supportedGcModes.isEmpty()) { - throw new RuntimeException("No GC mode specified in the config."); - } - logger.info(String.format("Allowed GC modes: %s", supportedGcModes)); - } - private void initializeEvolutionEngine(Experiment lastExperiment) { if (gaEngine != null) { logger.severe("First Hypothesizer invocation already has GA engine initialized."); @@ -320,19 +297,14 @@ private List> loadPopulation() { } /** - * Creates an individual from the command-line parameters. The GC mode - * argument is converted to an enum. + * Creates an individual from the command-line parameters. */ private List loadIndividual(CommandLine commandLine) { - List individual = Lists.newArrayList(); - - // Add the GC mode argument value as the first object. - // TODO(team): Swap this to the ordinal position of the flag. - individual.add(supportedGcModes.indexOf(JvmFlag.getGcModeArgument(commandLine.getGcMode()))); - - // Add the rest of the non-GC mode argument values. - for (JvmFlag argument : ARGUMENTS) { + List individual = Lists.newArrayList(CHROMOSOME_SIZE); + for (JvmFlag argument : JvmFlag.values()) { long value = commandLine.getValue(argument); + // TODO(team): Refactor to take advantage of the type system to prevent an illegal state as + // such. if (value > Integer.MAX_VALUE) { logger.log(Level.SEVERE, String.format("Value %s is larger than integer max for %s.", value, argument)); @@ -362,101 +334,10 @@ private Experiment savePopulation(List> population) { final JvmFlagSet.Builder builder = JvmFlagSet.builder(); - // First gene is the GC mode. - switch (supportedGcModes.get(individual.get(0))) { - case USE_CONC_MARK_SWEEP_GC: - builder.withValue(JvmFlag.USE_CONC_MARK_SWEEP_GC, 1L); - break; - case USE_PARALLEL_GC: - builder.withValue(JvmFlag.USE_PARALLEL_GC, 1L); - break; - case USE_PARALLEL_OLD_GC: - builder.withValue(JvmFlag.USE_PARALLEL_OLD_GC, 1L); - break; - case USE_SERIAL_GC: - builder.withValue(JvmFlag.USE_SERIAL_GC, 1L); - break; - default: - throw new RuntimeException("Invalid GC mode."); - } - - for (int i = 1; i < individual.size(); ++i) { + for (int i = 0; i < individual.size(); ++i) { final int value = individual.get(i); - switch (ARGUMENTS.get(i - 1)) { - - case ADAPTIVE_SIZE_DECREMENT_SCALE_FACTOR: - builder.withValue(JvmFlag.ADAPTIVE_SIZE_DECREMENT_SCALE_FACTOR, value); - break; - case CMS_EXP_AVG_FACTOR: - builder.withValue(JvmFlag.CMS_EXP_AVG_FACTOR, value); - break; - case CMS_INCREMENTAL_DUTY_CYCLE: - builder.withValue(JvmFlag.CMS_INCREMENTAL_DUTY_CYCLE, value); - break; - case CMS_INCREMENTAL_DUTY_CYCLE_MIN: - builder.withValue(JvmFlag.CMS_INCREMENTAL_DUTY_CYCLE_MIN, value); - break; - case CMS_INCREMENTAL_OFFSET: - builder.withValue(JvmFlag.CMS_INCREMENTAL_OFFSET, value); - break; - case CMS_INCREMENTAL_SAFETY_FACTOR: - builder.withValue(JvmFlag.CMS_INCREMENTAL_SAFETY_FACTOR, value); - break; - case CMS_INITIATING_OCCUPANCY_FRACTION: - builder.withValue(JvmFlag.CMS_INITIATING_OCCUPANCY_FRACTION, value); - break; - case GC_TIME_RATIO: - builder.withValue(JvmFlag.GC_TIME_RATIO, value); - break; - case HEAP_SIZE: - builder.withValue(JvmFlag.HEAP_SIZE, value); - break; - case MAX_GC_PAUSE_MILLIS: - builder.withValue(JvmFlag.MAX_GC_PAUSE_MILLIS, value); - break; - case MAX_HEAP_FREE_RATIO: - builder.withValue(JvmFlag.MAX_HEAP_FREE_RATIO, value); - break; - case MAX_NEW_SIZE: - builder.withValue(JvmFlag.MAX_NEW_SIZE, value); - break; - case MIN_HEAP_FREE_RATIO: - builder.withValue(JvmFlag.MIN_HEAP_FREE_RATIO, value); - break; - case NEW_RATIO: - builder.withValue(JvmFlag.NEW_RATIO, value); - break; - case NEW_SIZE: - builder.withValue(JvmFlag.NEW_SIZE, value); - break; - case PARALLEL_GC_THREADS: - builder.withValue(JvmFlag.PARALLEL_GC_THREADS, value); - break; - case SURVIVOR_RATIO: - builder.withValue(JvmFlag.SURVIVOR_RATIO, value); - break; - case TENURED_GENERATION_SIZE_INCREMENT: - builder.withValue(JvmFlag.TENURED_GENERATION_SIZE_INCREMENT, value); - break; - case YOUNG_GENERATION_SIZE_INCREMENT: - builder.withValue(JvmFlag.YOUNG_GENERATION_SIZE_INCREMENT, value); - break; - case SOFT_REF_LRU_POLICY_MS_PER_MB: - builder.withValue(JvmFlag.SOFT_REF_LRU_POLICY_MS_PER_MB, value); - break; - case CMS_INCREMENTAL_MODE: - builder.withValue(JvmFlag.CMS_INCREMENTAL_MODE, value); - break; - case CMS_INCREMENTAL_PACING: - builder.withValue(JvmFlag.CMS_INCREMENTAL_PACING, value); - break; - case USE_CMS_INITIATING_OCCUPANCY_ONLY: - builder.withValue(JvmFlag.USE_CMS_INITIATING_OCCUPANCY_ONLY, value); - break; - default: - throw new RuntimeException("Invalid command-line argument."); - } + builder.withValue(JvmFlag.values()[i], value); } final JvmFlagSet jvmFlagSet = builder.build(); @@ -493,13 +374,10 @@ public List generateRandomCandidate(final Random rng) { } final List individual = Lists.newArrayListWithExpectedSize(CHROMOSOME_SIZE); - // Pick a GC mode at random, and add it as the first object. - individual.add(rng.nextInt(supportedGcModes.size())); - final SearchSpaceBundle bundle = config.getJvmSearchSpaceRestriction(); // Add values for the rest of the arguments. - for (final JvmFlag argument : ARGUMENTS) { + for (final JvmFlag argument : JvmFlag.values()) { final SearchSpaceEntry entry = bundle.getSearchSpace(argument); final int value = generateRandomNumber(entry, rng); logger.info(String.format("Search space for %s: floor=%s; ceiling=%s; step=%s; value=%s", @@ -608,12 +486,8 @@ public List> apply(List> selectedCandidates, Random List mutatedCandidate = Lists.newArrayListWithCapacity(selectedCandidate.size()); for (int i = 0; i < selectedCandidate.size(); ++i) { if (probability.nextValue().nextEvent(rng)) { - if (i == 0) { - mutatedCandidate.add(rng.nextInt(supportedGcModes.size())); - } else { - SearchSpaceEntry entry = bundle.getSearchSpace(ARGUMENTS.get(i - 1)); - mutatedCandidate.add(generateRandomNumber(entry, rng)); - } + SearchSpaceEntry entry = bundle.getSearchSpace(JvmFlag.values()[i]); + mutatedCandidate.add(generateRandomNumber(entry, rng)); } else { mutatedCandidate.add(selectedCandidate.get(i)); } diff --git a/src/main/protobuf/groningen_config.proto b/src/main/protobuf/groningen_config.proto index e011906..09a452e 100644 --- a/src/main/protobuf/groningen_config.proto +++ b/src/main/protobuf/groningen_config.proto @@ -49,12 +49,11 @@ message ProgramConfiguration { // What follows is a uniform structure for describing both. message JvmSearchSpace { - // The GC modes are mutally exclusive, so capture that fact in an enum - enum GcMode { - USE_CONC_MARK_SWEEP = 0; - USE_PARALLEL = 1; - USE_PARALLEL_OLD = 2; - USE_SERIAL = 3; + enum DeprecatedEnumA { + DEPRECATED_A = 0; + DEPRECATED_B = 1; + DEPRECATED_C = 2; + DEPRECATED_D = 3; } // Hold a specific value or a range of int64s. @@ -78,18 +77,7 @@ message ProgramConfiguration { // ignored if included with value } - // At some point in the future, these should be migrated to generic - // MessageSet based arguments which would be completely extensible. - // This was not done in mach 1 as most of the commandline abstraction - // is already built around the CommandLineArg abstraction - redesigning - // this would likely not allow us to finish the prototype within the - // task force. The generic MessageSet can be phased in later - either as - // an additional to existing arguments, or as a complete replacement. - // NOTE: these fields do not follow the same numbering scheme as the - // rest of the file as we expect to burn the range. - repeated GcMode gc_mode = 1; // this is a series so that multiple modes - // can be searched over, though they are - // mutually exclusive on a given cmd line + repeated DeprecatedEnumA deprecated_field_a = 1; optional Int64Range adaptive_size_decrement_scale_factor = 2; optional Int64Range cms_exp_avg_factor = 3; optional Int64Range cms_incremental_duty_cycle = 4; @@ -114,6 +102,13 @@ message ProgramConfiguration { optional bool cms_incremental_pacing = 23; optional bool use_cms_initiating_occupancy_only = 24; optional Int64Range soft_ref_lru_policy_ms_per_mb = 25; + optional bool use_serial_gc = 26; + optional bool use_parallel_gc = 27; + optional bool use_parallel_old_gc = 28; + optional bool use_par_new_gc = 29; + optional bool use_concurrent_mark_sweep_gc = 30; + // http://www.oracle.com/technetwork/tutorials/tutorials-1876574.html + // optional bool use_g1_gc = 31; } message DeprecatedMessageA { diff --git a/src/test/java/org/arbeitspferde/groningen/config/ProtoBufSearchSpaceBundleTest.java b/src/test/java/org/arbeitspferde/groningen/config/ProtoBufSearchSpaceBundleTest.java index 3c97253..dd5c2ba 100644 --- a/src/test/java/org/arbeitspferde/groningen/config/ProtoBufSearchSpaceBundleTest.java +++ b/src/test/java/org/arbeitspferde/groningen/config/ProtoBufSearchSpaceBundleTest.java @@ -33,7 +33,6 @@ public class ProtoBufSearchSpaceBundleTest extends TestCase { public void testConstructionForDefaultWithNoRequireAll() throws Exception { JvmSearchSpace searchSpace = JvmSearchSpace.newBuilder() - .addGcMode(JvmSearchSpace.GcMode.USE_CONC_MARK_SWEEP) .build(); ProtoBufSearchSpaceBundle bundle = new ProtoBufSearchSpaceBundle(searchSpace, false); @@ -54,7 +53,6 @@ public void testConstructionForDefaultWithNoRequireAll() throws Exception { public void testConstructionInt64RangesWithRangesAndNoRequireAll() throws Exception { JvmSearchSpace searchSpace = JvmSearchSpace.newBuilder() - .addGcMode(JvmSearchSpace.GcMode.USE_CONC_MARK_SWEEP) .setGcTimeRatio(JvmSearchSpace.Int64Range.newBuilder() .setFloor(0L) .setCeiling(100L) @@ -95,7 +93,6 @@ public void testConstructionInt64RangesWithRangesAndNoRequireAll() throws Except public void testConstructionInt64RangesWithValueAndNoRequireAll() throws Exception { JvmSearchSpace searchSpace = JvmSearchSpace.newBuilder() - .addGcMode(JvmSearchSpace.GcMode.USE_CONC_MARK_SWEEP) .setGcTimeRatio(JvmSearchSpace.Int64Range.newBuilder() .setValue(50L) .build()) @@ -112,7 +109,6 @@ public void testConstructionInt64RangesWithValueAndNoRequireAll() throws Excepti public void testConstructionBooleanWithValueAndNoRequireAll() throws Exception { JvmSearchSpace searchSpace = JvmSearchSpace.newBuilder() - .addGcMode(JvmSearchSpace.GcMode.USE_CONC_MARK_SWEEP) .setCmsIncrementalPacing(false) .build(); @@ -200,16 +196,16 @@ public void testConstructionWithRequireAll() throws Exception { JvmSearchSpace.USE_CMS_INITIATING_OCCUPANCY_ONLY_FIELD_NUMBER)) .put(JvmFlag.USE_CONC_MARK_SWEEP_GC, JvmSearchSpace.getDescriptor().findFieldByNumber( - JvmSearchSpace.GC_MODE_FIELD_NUMBER)) + JvmSearchSpace.USE_CONCURRENT_MARK_SWEEP_GC_FIELD_NUMBER)) .put(JvmFlag.USE_PARALLEL_GC, JvmSearchSpace.getDescriptor().findFieldByNumber( - JvmSearchSpace.GC_MODE_FIELD_NUMBER)) + JvmSearchSpace.USE_PARALLEL_GC_FIELD_NUMBER)) .put(JvmFlag.USE_PARALLEL_OLD_GC, JvmSearchSpace.getDescriptor().findFieldByNumber( - JvmSearchSpace.GC_MODE_FIELD_NUMBER)) + JvmSearchSpace.USE_PARALLEL_OLD_GC_FIELD_NUMBER)) .put(JvmFlag.USE_SERIAL_GC, JvmSearchSpace.getDescriptor().findFieldByNumber( - JvmSearchSpace.GC_MODE_FIELD_NUMBER)) + JvmSearchSpace.USE_SERIAL_GC_FIELD_NUMBER)) .put(JvmFlag.HEAP_SIZE, JvmSearchSpace.getDescriptor().findFieldByNumber( JvmSearchSpace.HEAP_SIZE_FIELD_NUMBER)) @@ -223,15 +219,6 @@ public void testConstructionWithRequireAll() throws Exception { .add(JvmFlag.USE_CMS_INITIATING_OCCUPANCY_ONLY) .build(); - ImmutableMap gcModeMap = - ImmutableMap.builder() - .put(JvmFlag.USE_CONC_MARK_SWEEP_GC, - JvmSearchSpace.GcMode.USE_CONC_MARK_SWEEP) - .put(JvmFlag.USE_PARALLEL_GC, JvmSearchSpace.GcMode.USE_PARALLEL) - .put(JvmFlag.USE_PARALLEL_OLD_GC, JvmSearchSpace.GcMode.USE_PARALLEL_OLD) - .put(JvmFlag.USE_SERIAL_GC, JvmSearchSpace.GcMode.USE_SERIAL) - .build(); - // all CommandLineArguments start at 0 and go to higher than 2 - this is a little brittle // though JvmSearchSpace.Int64Range intRange = Int64Range.newBuilder() @@ -241,24 +228,12 @@ public void testConstructionWithRequireAll() throws Exception { .build(); for (JvmFlag missingArg : JvmFlag.values()) { - // skip gc mode skip we need to omit them all - if (gcModeMap.containsKey(missingArg)) { - continue; - } JvmSearchSpace.Builder searchSpaceBuilder = JvmSearchSpace.newBuilder(); for (JvmFlag arg : JvmFlag.values()) { if (arg == missingArg) { continue; } - - if (gcModeMap.containsKey(arg)) { - searchSpaceBuilder.addGcMode(gcModeMap.get(arg)); - } else if (boolCmdLineArguments.contains(arg)) { - searchSpaceBuilder.setField(argToProtoFieldMap.get(arg), Boolean.TRUE); - } else { - searchSpaceBuilder.setField(argToProtoFieldMap.get(arg), intRange); - } } try { ProtoBufSearchSpaceBundle bundle = diff --git a/src/test/java/org/arbeitspferde/groningen/experimentdb/jvmflags/JvmFlagTest.java b/src/test/java/org/arbeitspferde/groningen/experimentdb/jvmflags/JvmFlagTest.java index 6e8ebce..f51e97a 100644 --- a/src/test/java/org/arbeitspferde/groningen/experimentdb/jvmflags/JvmFlagTest.java +++ b/src/test/java/org/arbeitspferde/groningen/experimentdb/jvmflags/JvmFlagTest.java @@ -64,13 +64,6 @@ public void test_validate_MAX_NEW_SIZE_ValidValues() { } } - public void test_getGcModeArgument_EmitsExpected() { - assertEquals(JvmFlag.USE_CONC_MARK_SWEEP_GC, JvmFlag.getGcModeArgument(GcMode.CMS)); - assertEquals(JvmFlag.USE_PARALLEL_GC, JvmFlag.getGcModeArgument(GcMode.PARALLEL)); - assertEquals(JvmFlag.USE_PARALLEL_OLD_GC, JvmFlag.getGcModeArgument(GcMode.PARALLEL_OLD)); - assertEquals(JvmFlag.USE_SERIAL_GC, JvmFlag.getGcModeArgument(GcMode.SERIAL)); - } - public void test_asAcceptableValuesString_MAX_NEW_SIZE() { final String actual = JvmFlag.MAX_NEW_SIZE.asAcceptableValuesString();