This is an automated email from the ASF dual-hosted git repository. burcham pushed a commit to branch sni in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git
The following commit(s) were added to refs/heads/sni by this push: new a3e7a79 topology roles is an enum now yay typechecking a3e7a79 is described below commit a3e7a790938fb953fe53e5372b15de48857db433 Author: Bill Burcham <bburc...@pivotal.io> AuthorDate: Tue May 5 17:09:35 2020 -0700 topology roles is an enum now yay typechecking --- .../java/org/apache/geode/benchmark/Config.java | 36 +++++++++++++++ .../apache/geode/benchmark/parameters/Utils.java | 9 ++-- .../apache/geode/benchmark/tasks/LocatorUtil.java | 2 +- .../geode/benchmark/tasks/PrePopulateRegion.java | 6 +-- .../benchmark/tasks/PrePopulateRegionLong.java | 6 +-- .../apache/geode/benchmark/tasks/StartClient.java | 2 +- .../geode/benchmark/tasks/StartSniProxy.java | 5 +- .../benchmark/tests/AbstractFunctionBenchmark.java | 7 +-- .../AbstractPartitionedFunctionBenchmark.java | 3 +- .../tests/AbstractReplicatedFunctionBenchmark.java | 3 +- .../geode/benchmark/tests/NoopBenchmark.java | 3 +- .../PartitionedFunctionExecutionBenchmark.java | 3 +- ...nedFunctionExecutionWithArgumentsBenchmark.java | 3 +- ...ionedFunctionExecutionWithFiltersBenchmark.java | 3 +- .../benchmark/tests/PartitionedGetBenchmark.java | 10 ++-- .../tests/PartitionedGetLongBenchmark.java | 10 ++-- .../tests/PartitionedIndexedQueryBenchmark.java | 12 +++-- .../tests/PartitionedNonIndexedQueryBenchmark.java | 10 ++-- .../tests/PartitionedPutAllBenchmark.java | 10 ++-- .../tests/PartitionedPutAllLongBenchmark.java | 10 ++-- .../benchmark/tests/PartitionedPutBenchmark.java | 10 ++-- .../tests/PartitionedPutBenchmarkSNI.java | 10 ++-- .../tests/PartitionedPutLongBenchmark.java | 10 ++-- .../ReplicatedFunctionExecutionBenchmark.java | 3 +- ...tedFunctionExecutionWithArgumentsBenchmark.java | 3 +- ...catedFunctionExecutionWithFiltersBenchmark.java | 3 +- .../benchmark/tests/ReplicatedGetBenchmark.java | 10 ++-- .../tests/ReplicatedGetLongBenchmark.java | 10 ++-- .../tests/ReplicatedIndexedQueryBenchmark.java | 12 +++-- .../tests/ReplicatedNonIndexedQueryBenchmark.java | 12 +++-- .../benchmark/tests/ReplicatedPutAllBenchmark.java | 10 ++-- .../tests/ReplicatedPutAllLongBenchmark.java | 10 ++-- .../benchmark/tests/ReplicatedPutBenchmark.java | 10 ++-- .../tests/ReplicatedPutLongBenchmark.java | 10 ++-- .../benchmark/topology/ClientServerTopology.java | 30 ++++++------ .../topology/ClientServerTopologyWithSNIProxy.java | 44 +++++++++--------- .../org/apache/geode/benchmark/topology/Roles.java | 7 +-- .../parameters/GcLoggingParametersTest.java | 24 +++++----- .../benchmark/parameters/GcParametersTest.java | 54 +++++++++++----------- .../benchmark/parameters/HeapParametersTest.java | 12 ++--- .../topology/ClientServerTopologyTest.java | 12 ++--- .../java/org/apache/geode/perftest/TestConfig.java | 7 --- .../geode/perftest/runner/DefaultTestRunner.java | 1 - 43 files changed, 272 insertions(+), 195 deletions(-) diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/Config.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/Config.java new file mode 100644 index 0000000..ac2e5fc --- /dev/null +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/Config.java @@ -0,0 +1,36 @@ +package org.apache.geode.benchmark; + +import org.yardstickframework.BenchmarkDriver; + +import org.apache.geode.benchmark.tasks.StopSniProxy; +import org.apache.geode.benchmark.topology.Roles; +import org.apache.geode.perftest.Task; +import org.apache.geode.perftest.TestConfig; + +/** + * This is a more strongly-typed interface to the (stringly-typed) TestConfig interface in the + * benchmark driver. This lets callers use the Roles enum instead of strings. + */ +public class Config { + private Config() {} + + public static void role(final TestConfig config, final Roles role, final int numberOfInstances) { + config.role(role.name(), numberOfInstances); + } + + public static void before(final TestConfig config, final Task task, final Roles role) { + config.before(task, role.name()); + } + + public static void workload(final TestConfig config, final BenchmarkDriver task, final Roles role) { + config.workload(task, role.name()); + } + + public static void after(final TestConfig config, final StopSniProxy task, final Roles role) { + config.after(task, role.name()); + } + + public static void jvmArgs(final TestConfig config, final Roles role, final String... jvmArgs) { + config.jvmArgs(role.name(), jvmArgs); + } +} diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/parameters/Utils.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/parameters/Utils.java index f39de39..1dc56d8 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/parameters/Utils.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/parameters/Utils.java @@ -15,6 +15,7 @@ package org.apache.geode.benchmark.parameters; +import static org.apache.geode.benchmark.Config.jvmArgs; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.LOCATOR; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -31,10 +32,10 @@ public class Utils { private Utils() {} - public static void configureJavaRoles(TestConfig testConfig, String... args) { - testConfig.jvmArgs(LOCATOR, args); - testConfig.jvmArgs(SERVER, args); - testConfig.jvmArgs(CLIENT, args); + public static void configureJavaRoles(TestConfig config, String... args) { + jvmArgs(config, LOCATOR, args); + jvmArgs(config, SERVER, args); + jvmArgs(config, CLIENT, args); } public static void addToTestConfig(TestConfig testConfig, String systemPropertyKey, diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/LocatorUtil.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/LocatorUtil.java index 8c9d48d..45f16d7 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/LocatorUtil.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/LocatorUtil.java @@ -29,7 +29,7 @@ import org.apache.geode.perftest.TestContext; */ public class LocatorUtil { static String getLocatorString(TestContext context, int locatorPort) { - Set<InetAddress> locators = context.getHostsForRole(LOCATOR); + Set<InetAddress> locators = context.getHostsForRole(LOCATOR.name()); return locators.iterator().next().getHostAddress() + "[" + locatorPort + "]"; } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/PrePopulateRegion.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/PrePopulateRegion.java index 8fd4405..faae4d7 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/PrePopulateRegion.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/PrePopulateRegion.java @@ -62,9 +62,9 @@ public class PrePopulateRegion implements Task { public void run(TestContext context) throws InterruptedException { final ClientCache cache = ClientCacheFactory.getAnyInstance(); final Region<Long, Portfolio> region = cache.getRegion("region"); - final int numLocators = context.getHostsIDsForRole(LOCATOR).size(); - final int numServers = context.getHostsIDsForRole(SERVER).size(); - final int numClient = context.getHostsIDsForRole(CLIENT).size(); + final int numLocators = context.getHostsIDsForRole(LOCATOR.name()).size(); + final int numServers = context.getHostsIDsForRole(SERVER.name()).size(); + final int numClient = context.getHostsIDsForRole(CLIENT.name()).size(); final int jvmID = context.getJvmID(); final int clientIndex = jvmID - numLocators - numServers; diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/PrePopulateRegionLong.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/PrePopulateRegionLong.java index 189df57..0874835 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/PrePopulateRegionLong.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/PrePopulateRegionLong.java @@ -61,9 +61,9 @@ public class PrePopulateRegionLong implements Task { public void run(TestContext context) throws InterruptedException { final ClientCache cache = ClientCacheFactory.getAnyInstance(); final Region<Long, Long> region = cache.getRegion("region"); - final int numLocators = context.getHostsIDsForRole(LOCATOR).size(); - final int numServers = context.getHostsIDsForRole(SERVER).size(); - final int numClient = context.getHostsIDsForRole(CLIENT).size(); + final int numLocators = context.getHostsIDsForRole(LOCATOR.name()).size(); + final int numServers = context.getHostsIDsForRole(SERVER.name()).size(); + final int numClient = context.getHostsIDsForRole(CLIENT.name()).size(); final int jvmID = context.getJvmID(); final int clientIndex = jvmID - numLocators - numServers; diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartClient.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartClient.java index 0f0c3ea..9543f4c 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartClient.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartClient.java @@ -44,7 +44,7 @@ public class StartClient implements Task { @Override public void run(TestContext context) throws Exception { - InetAddress locator = context.getHostsForRole(LOCATOR).iterator().next(); + InetAddress locator = context.getHostsForRole(LOCATOR.name()).iterator().next(); String statsFile = new File(context.getOutputDir(), "stats.gfs").getAbsolutePath(); Properties properties = clientProperties(); diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartSniProxy.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartSniProxy.java index c0a949a..eda5798 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartSniProxy.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartSniProxy.java @@ -27,6 +27,7 @@ import java.net.InetAddress; import java.util.List; import java.util.stream.Collectors; +import org.apache.geode.benchmark.topology.Roles; import org.apache.geode.perftest.Task; import org.apache.geode.perftest.TestContext; @@ -65,8 +66,8 @@ public class StartSniProxy implements Task { } } - private List<String> hostNamesFor(final TestContext context, final String role) { - return context.getHostsForRole(role).stream().map(InetAddress::getHostName) + private List<String> hostNamesFor(final TestContext context, final Roles role) { + return context.getHostsForRole(role.name()).stream().map(InetAddress::getHostName) .collect(Collectors.toList()); } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractFunctionBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractFunctionBenchmark.java index 9409332..e597179 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractFunctionBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractFunctionBenchmark.java @@ -15,6 +15,7 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -45,9 +46,9 @@ abstract class AbstractFunctionBenchmark implements PerformanceTest { config.threads(Runtime.getRuntime().availableProcessors() * 3); ClientServerTopology.configure(config); configureRegion(config); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegion(getKeyRange()), CLIENT); - config.before(new RegisterFunction(new BenchmarkFunction(getKeyRange())), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegion(getKeyRange()), CLIENT); + before(config, new RegisterFunction(new BenchmarkFunction(getKeyRange())), SERVER); return config; } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractPartitionedFunctionBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractPartitionedFunctionBenchmark.java index 8c495c1..493fc1d 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractPartitionedFunctionBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractPartitionedFunctionBenchmark.java @@ -15,6 +15,7 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; import static org.apache.geode.benchmark.topology.Roles.SERVER; import org.apache.geode.benchmark.tasks.CreatePartitionedRegion; @@ -23,6 +24,6 @@ import org.apache.geode.perftest.TestConfig; abstract class AbstractPartitionedFunctionBenchmark extends AbstractFunctionBenchmark { @Override protected void configureRegion(TestConfig config) { - config.before(new CreatePartitionedRegion(), SERVER); + before(config, new CreatePartitionedRegion(), SERVER); } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractReplicatedFunctionBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractReplicatedFunctionBenchmark.java index 1f04595..0a8ee3a 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractReplicatedFunctionBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/AbstractReplicatedFunctionBenchmark.java @@ -15,6 +15,7 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; import static org.apache.geode.benchmark.topology.Roles.SERVER; import org.apache.geode.benchmark.tasks.CreateReplicatedRegion; @@ -23,6 +24,6 @@ import org.apache.geode.perftest.TestConfig; abstract class AbstractReplicatedFunctionBenchmark extends AbstractFunctionBenchmark { @Override protected void configureRegion(TestConfig config) { - config.before(new CreateReplicatedRegion(), SERVER); + before(config, new CreateReplicatedRegion(), SERVER); } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/NoopBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/NoopBenchmark.java index bf83a44..3bacdb0 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/NoopBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/NoopBenchmark.java @@ -18,6 +18,7 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import org.junit.jupiter.api.Test; @@ -44,7 +45,7 @@ public class NoopBenchmark implements PerformanceTest { public TestConfig configure() { TestConfig config = GeodeBenchmark.createConfig(); ClientServerTopology.configure(config); - config.workload(new NoopTask(), CLIENT); + workload(config, new NoopTask(), CLIENT); return config; } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedFunctionExecutionBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedFunctionExecutionBenchmark.java index 1885426..381d4d6 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedFunctionExecutionBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedFunctionExecutionBenchmark.java @@ -14,6 +14,7 @@ */ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import org.junit.jupiter.api.Test; @@ -32,7 +33,7 @@ public class PartitionedFunctionExecutionBenchmark extends AbstractPartitionedFu @Override public TestConfig configure() { TestConfig config = super.configure(); - config.workload(new ExecuteFunction(), CLIENT); + workload(config, new ExecuteFunction(), CLIENT); return config; } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedFunctionExecutionWithArgumentsBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedFunctionExecutionWithArgumentsBenchmark.java index 513fbad..9de3051 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedFunctionExecutionWithArgumentsBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedFunctionExecutionWithArgumentsBenchmark.java @@ -14,6 +14,7 @@ */ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import org.junit.jupiter.api.Test; @@ -35,7 +36,7 @@ public class PartitionedFunctionExecutionWithArgumentsBenchmark public TestConfig configure() { TestConfig config = super.configure(); config.threads(Runtime.getRuntime().availableProcessors() * 4); - config.workload(new ExecuteParameterizedFunction(getKeyRange()), CLIENT); + workload(config, new ExecuteParameterizedFunction(getKeyRange()), CLIENT); return config; } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedFunctionExecutionWithFiltersBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedFunctionExecutionWithFiltersBenchmark.java index 21e797b..3a3d735 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedFunctionExecutionWithFiltersBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedFunctionExecutionWithFiltersBenchmark.java @@ -14,6 +14,7 @@ */ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import org.junit.jupiter.api.Test; @@ -34,7 +35,7 @@ public class PartitionedFunctionExecutionWithFiltersBenchmark public TestConfig configure() { TestConfig config = super.configure(); config.threads(Runtime.getRuntime().availableProcessors() * 8); - config.workload(new ExecuteFilteredFunction(getKeyRange()), CLIENT); + workload(config, new ExecuteFilteredFunction(getKeyRange()), CLIENT); return config; } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedGetBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedGetBenchmark.java index 93b1b5b..6ed6b4d 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedGetBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedGetBenchmark.java @@ -18,6 +18,8 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -55,10 +57,10 @@ public class PartitionedGetBenchmark implements PerformanceTest { public TestConfig configure() { TestConfig config = GeodeBenchmark.createConfig(); ClientServerTopology.configure(config); - config.before(new CreatePartitionedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new GetTask(keyRange), CLIENT); + before(config, new CreatePartitionedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegion(keyRange), CLIENT); + workload(config, new GetTask(keyRange), CLIENT); return config; } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedGetLongBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedGetLongBenchmark.java index c5174af..bed35fa 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedGetLongBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedGetLongBenchmark.java @@ -18,6 +18,8 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -55,10 +57,10 @@ public class PartitionedGetLongBenchmark implements PerformanceTest { public TestConfig configure() { TestConfig config = GeodeBenchmark.createConfig(); ClientServerTopology.configure(config); - config.before(new CreatePartitionedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegionLong(keyRange), CLIENT); - config.workload(new GetTask(keyRange), CLIENT); + before(config, new CreatePartitionedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegionLong(keyRange), CLIENT); + workload(config, new GetTask(keyRange), CLIENT); return config; } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedQueryBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedQueryBenchmark.java index 157b0e6..886df2c 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedQueryBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedIndexedQueryBenchmark.java @@ -14,6 +14,8 @@ */ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -54,11 +56,11 @@ public class PartitionedIndexedQueryBenchmark implements PerformanceTest { TestConfig config = GeodeBenchmark.createConfig(); config.threads(Runtime.getRuntime().availableProcessors() * 8); ClientServerTopology.configure(config); - config.before(new CreatePartitionedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new CreateIndexOnID(), SERVER); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new OQLQuery(keyRange, queryRange), CLIENT); + before(config, new CreatePartitionedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new CreateIndexOnID(), SERVER); + before(config, new PrePopulateRegion(keyRange), CLIENT); + workload(config, new OQLQuery(keyRange, queryRange), CLIENT); return config; } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedNonIndexedQueryBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedNonIndexedQueryBenchmark.java index 18ac256..75ddfa6 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedNonIndexedQueryBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedNonIndexedQueryBenchmark.java @@ -14,6 +14,8 @@ */ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -53,10 +55,10 @@ public class PartitionedNonIndexedQueryBenchmark implements PerformanceTest { TestConfig config = GeodeBenchmark.createConfig(); config.threads(Runtime.getRuntime().availableProcessors()); ClientServerTopology.configure(config); - config.before(new CreatePartitionedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new OQLQuery(keyRange, queryRange), CLIENT); + before(config, new CreatePartitionedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegion(keyRange), CLIENT); + workload(config, new OQLQuery(keyRange, queryRange), CLIENT); return config; } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutAllBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutAllBenchmark.java index f1ea641..605c7b4 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutAllBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutAllBenchmark.java @@ -17,6 +17,8 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -57,10 +59,10 @@ public class PartitionedPutAllBenchmark implements PerformanceTest { TestConfig config = GeodeBenchmark.createConfig(); config.threads(Runtime.getRuntime().availableProcessors() * 2); ClientServerTopology.configure(config); - config.before(new CreatePartitionedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new PutAllTask(keyRange, batchSize), CLIENT); + before(config, new CreatePartitionedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegion(keyRange), CLIENT); + workload(config, new PutAllTask(keyRange, batchSize), CLIENT); return config; } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutAllLongBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutAllLongBenchmark.java index f2c45ae..3025b73 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutAllLongBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutAllLongBenchmark.java @@ -17,6 +17,8 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -57,10 +59,10 @@ public class PartitionedPutAllLongBenchmark implements PerformanceTest { TestConfig config = GeodeBenchmark.createConfig(); config.threads(Runtime.getRuntime().availableProcessors() * 2); ClientServerTopology.configure(config); - config.before(new CreatePartitionedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegionLong(keyRange), CLIENT); - config.workload(new PutAllTask(keyRange, batchSize), CLIENT); + before(config, new CreatePartitionedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegionLong(keyRange), CLIENT); + workload(config, new PutAllTask(keyRange, batchSize), CLIENT); return config; } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutBenchmark.java index bf4159f..732a422 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutBenchmark.java @@ -17,6 +17,8 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -54,10 +56,10 @@ public class PartitionedPutBenchmark implements PerformanceTest { public TestConfig configure() { TestConfig config = GeodeBenchmark.createConfig(); ClientServerTopology.configure(config); - config.before(new CreatePartitionedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new PutTask(keyRange), CLIENT); + before(config, new CreatePartitionedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegion(keyRange), CLIENT); + workload(config, new PutTask(keyRange), CLIENT); return config; } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutBenchmarkSNI.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutBenchmarkSNI.java index d9b1936..460af78 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutBenchmarkSNI.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutBenchmarkSNI.java @@ -17,6 +17,8 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -55,10 +57,10 @@ public class PartitionedPutBenchmarkSNI implements PerformanceTest { public TestConfig configure() { TestConfig config = GeodeBenchmark.createConfig(); ClientServerTopologyWithSNIProxy.configure(config); - config.before(new CreatePartitionedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new PutTask(keyRange), CLIENT); + before(config, new CreatePartitionedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegion(keyRange), CLIENT); + workload(config, new PutTask(keyRange), CLIENT); return config; } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutLongBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutLongBenchmark.java index 57847f9..bb5d7e5 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutLongBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutLongBenchmark.java @@ -17,6 +17,8 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -54,10 +56,10 @@ public class PartitionedPutLongBenchmark implements PerformanceTest { public TestConfig configure() { TestConfig config = GeodeBenchmark.createConfig(); ClientServerTopology.configure(config); - config.before(new CreatePartitionedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegionLong(keyRange), CLIENT); - config.workload(new PutTask(keyRange), CLIENT); + before(config, new CreatePartitionedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegionLong(keyRange), CLIENT); + workload(config, new PutTask(keyRange), CLIENT); return config; } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedFunctionExecutionBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedFunctionExecutionBenchmark.java index 859551e..0b4e3c1 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedFunctionExecutionBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedFunctionExecutionBenchmark.java @@ -14,6 +14,7 @@ */ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import org.junit.jupiter.api.Test; @@ -32,7 +33,7 @@ public class ReplicatedFunctionExecutionBenchmark extends AbstractReplicatedFunc @Override public TestConfig configure() { TestConfig config = super.configure(); - config.workload(new ExecuteFunction(), CLIENT); + workload(config, new ExecuteFunction(), CLIENT); return config; } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedFunctionExecutionWithArgumentsBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedFunctionExecutionWithArgumentsBenchmark.java index 299c844..595e955 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedFunctionExecutionWithArgumentsBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedFunctionExecutionWithArgumentsBenchmark.java @@ -14,6 +14,7 @@ */ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import org.junit.jupiter.api.Test; @@ -34,7 +35,7 @@ public class ReplicatedFunctionExecutionWithArgumentsBenchmark public TestConfig configure() { TestConfig config = super.configure(); config.threads(Runtime.getRuntime().availableProcessors() * 16); - config.workload(new ExecuteParameterizedFunction(getKeyRange()), CLIENT); + workload(config, new ExecuteParameterizedFunction(getKeyRange()), CLIENT); return config; } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedFunctionExecutionWithFiltersBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedFunctionExecutionWithFiltersBenchmark.java index 446381c..728fbab 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedFunctionExecutionWithFiltersBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedFunctionExecutionWithFiltersBenchmark.java @@ -14,6 +14,7 @@ */ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import org.junit.jupiter.api.Test; @@ -34,7 +35,7 @@ public class ReplicatedFunctionExecutionWithFiltersBenchmark public TestConfig configure() { TestConfig config = super.configure(); config.threads(Runtime.getRuntime().availableProcessors() * 10); - config.workload(new ExecuteFilteredFunction(getKeyRange()), CLIENT); + workload(config, new ExecuteFilteredFunction(getKeyRange()), CLIENT); return config; } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedGetBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedGetBenchmark.java index b56d8d1..d3b8f1e 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedGetBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedGetBenchmark.java @@ -18,6 +18,8 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -55,10 +57,10 @@ public class ReplicatedGetBenchmark implements PerformanceTest { public TestConfig configure() { TestConfig config = GeodeBenchmark.createConfig(); ClientServerTopology.configure(config); - config.before(new CreateReplicatedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new GetTask(keyRange), CLIENT); + before(config, new CreateReplicatedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegion(keyRange), CLIENT); + workload(config, new GetTask(keyRange), CLIENT); return config; } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedGetLongBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedGetLongBenchmark.java index 2c26cbf..b601428 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedGetLongBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedGetLongBenchmark.java @@ -18,6 +18,8 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -55,10 +57,10 @@ public class ReplicatedGetLongBenchmark implements PerformanceTest { public TestConfig configure() { TestConfig config = GeodeBenchmark.createConfig(); ClientServerTopology.configure(config); - config.before(new CreateReplicatedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegionLong(keyRange), CLIENT); - config.workload(new GetTask(keyRange), CLIENT); + before(config, new CreateReplicatedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegionLong(keyRange), CLIENT); + workload(config, new GetTask(keyRange), CLIENT); return config; } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedQueryBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedQueryBenchmark.java index c371823..6dcf708 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedQueryBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedIndexedQueryBenchmark.java @@ -14,6 +14,8 @@ */ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -54,11 +56,11 @@ public class ReplicatedIndexedQueryBenchmark implements PerformanceTest { TestConfig config = GeodeBenchmark.createConfig(); config.threads(Runtime.getRuntime().availableProcessors() * 8); ClientServerTopology.configure(config); - config.before(new CreateReplicatedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new CreateIndexOnID(), SERVER); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new OQLQuery(keyRange, queryRange), CLIENT); + before(config, new CreateReplicatedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new CreateIndexOnID(), SERVER); + before(config, new PrePopulateRegion(keyRange), CLIENT); + workload(config, new OQLQuery(keyRange, queryRange), CLIENT); return config; } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedNonIndexedQueryBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedNonIndexedQueryBenchmark.java index 320e1e6..4d93b96 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedNonIndexedQueryBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedNonIndexedQueryBenchmark.java @@ -14,11 +14,14 @@ */ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.*; +import static org.apache.geode.benchmark.Config.before; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; import org.junit.jupiter.api.Test; +import org.apache.geode.benchmark.Config; import org.apache.geode.benchmark.LongRange; import org.apache.geode.benchmark.tasks.CreateClientProxyRegion; import org.apache.geode.benchmark.tasks.CreateReplicatedRegion; @@ -53,10 +56,11 @@ public class ReplicatedNonIndexedQueryBenchmark implements PerformanceTest { TestConfig config = GeodeBenchmark.createConfig(); config.threads(Runtime.getRuntime().availableProcessors()); ClientServerTopology.configure(config); - config.before(new CreateReplicatedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new OQLQuery(keyRange, queryRange), CLIENT); + before(config, new CreateReplicatedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegion(keyRange), CLIENT); + workload(config, new OQLQuery(keyRange, queryRange), CLIENT); return config; } + } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutAllBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutAllBenchmark.java index 2c3e8aa..cfcdb8b 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutAllBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutAllBenchmark.java @@ -17,6 +17,8 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -57,10 +59,10 @@ public class ReplicatedPutAllBenchmark implements PerformanceTest { TestConfig config = GeodeBenchmark.createConfig(); config.threads(Runtime.getRuntime().availableProcessors() * 2); ClientServerTopology.configure(config); - config.before(new CreateReplicatedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new PutAllTask(keyRange, batchSize), CLIENT); + before(config, new CreateReplicatedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegion(keyRange), CLIENT); + workload(config, new PutAllTask(keyRange, batchSize), CLIENT); return config; } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutAllLongBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutAllLongBenchmark.java index 68149c1..965eb61 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutAllLongBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutAllLongBenchmark.java @@ -17,6 +17,8 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -57,10 +59,10 @@ public class ReplicatedPutAllLongBenchmark implements PerformanceTest { TestConfig config = GeodeBenchmark.createConfig(); config.threads(Runtime.getRuntime().availableProcessors() * 2); ClientServerTopology.configure(config); - config.before(new CreateReplicatedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegionLong(keyRange), CLIENT); - config.workload(new PutAllTask(keyRange, batchSize), CLIENT); + before(config, new CreateReplicatedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegionLong(keyRange), CLIENT); + workload(config, new PutAllTask(keyRange, batchSize), CLIENT); return config; } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutBenchmark.java index a7aee7e..2cfb71f 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutBenchmark.java @@ -17,6 +17,8 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -54,10 +56,10 @@ public class ReplicatedPutBenchmark implements PerformanceTest { public TestConfig configure() { TestConfig config = GeodeBenchmark.createConfig(); ClientServerTopology.configure(config); - config.before(new CreateReplicatedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegion(keyRange), CLIENT); - config.workload(new PutTask(keyRange), CLIENT); + before(config, new CreateReplicatedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegion(keyRange), CLIENT); + workload(config, new PutTask(keyRange), CLIENT); return config; } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutLongBenchmark.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutLongBenchmark.java index 2099dcf..3248255 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutLongBenchmark.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutLongBenchmark.java @@ -17,6 +17,8 @@ package org.apache.geode.benchmark.tests; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.workload; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.SERVER; @@ -54,10 +56,10 @@ public class ReplicatedPutLongBenchmark implements PerformanceTest { public TestConfig configure() { TestConfig config = GeodeBenchmark.createConfig(); ClientServerTopology.configure(config); - config.before(new CreateReplicatedRegion(), SERVER); - config.before(new CreateClientProxyRegion(), CLIENT); - config.before(new PrePopulateRegionLong(keyRange), CLIENT); - config.workload(new PutTask(keyRange), CLIENT); + before(config, new CreateReplicatedRegion(), SERVER); + before(config, new CreateClientProxyRegion(), CLIENT); + before(config, new PrePopulateRegionLong(keyRange), CLIENT); + workload(config, new PutTask(keyRange), CLIENT); return config; } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopology.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopology.java index 8f22953..486e743 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopology.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopology.java @@ -14,6 +14,8 @@ */ package org.apache.geode.benchmark.topology; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.role; import static org.apache.geode.benchmark.parameters.Utils.addToTestConfig; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.LOCATOR; @@ -39,23 +41,23 @@ public class ClientServerTopology { private static final String WITH_SSL_ARGUMENT = "-DwithSsl=true"; private static final String WITH_SECURITY_MANAGER_ARGUMENT = "-DwithSecurityManager=true"; - public static void configure(TestConfig testConfig) { - testConfig.role(LOCATOR, NUM_LOCATORS); - testConfig.role(SERVER, NUM_SERVERS); - testConfig.role(CLIENT, NUM_CLIENTS); + public static void configure(TestConfig config) { + role(config, LOCATOR, NUM_LOCATORS); + role(config, SERVER, NUM_SERVERS); + role(config, CLIENT, NUM_CLIENTS); - JvmParameters.configure(testConfig); - HeapParameters.configure(testConfig); - GcLoggingParameters.configure(testConfig); - GcParameters.configure(testConfig); - ProfilerParameters.configure(testConfig); + JvmParameters.configure(config); + HeapParameters.configure(config); + GcLoggingParameters.configure(config); + GcParameters.configure(config); + ProfilerParameters.configure(config); - addToTestConfig(testConfig, "withSsl", WITH_SSL_ARGUMENT); - addToTestConfig(testConfig, "withSecurityManager", WITH_SECURITY_MANAGER_ARGUMENT); + addToTestConfig(config, "withSsl", WITH_SSL_ARGUMENT); + addToTestConfig(config, "withSecurityManager", WITH_SECURITY_MANAGER_ARGUMENT); - testConfig.before(new StartLocator(Ports.LOCATOR_PORT), LOCATOR); - testConfig.before(new StartServer(Ports.LOCATOR_PORT), SERVER); - testConfig.before(new StartClient(Ports.LOCATOR_PORT), CLIENT); + before(config, new StartLocator(Ports.LOCATOR_PORT), LOCATOR); + before(config, new StartServer(Ports.LOCATOR_PORT), SERVER); + before(config, new StartClient(Ports.LOCATOR_PORT), CLIENT); } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java index 3236a33..1451391 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java @@ -14,6 +14,10 @@ */ package org.apache.geode.benchmark.topology; +import static org.apache.geode.benchmark.Config.after; +import static org.apache.geode.benchmark.Config.before; +import static org.apache.geode.benchmark.Config.jvmArgs; +import static org.apache.geode.benchmark.Config.role; import static org.apache.geode.benchmark.parameters.Utils.addToTestConfig; import static org.apache.geode.benchmark.parameters.Utils.configureJavaRoles; import static org.apache.geode.benchmark.topology.Ports.LOCATOR_PORT; @@ -22,9 +26,7 @@ import static org.apache.geode.benchmark.topology.Roles.LOCATOR; import static org.apache.geode.benchmark.topology.Roles.CLIENT; import static org.apache.geode.benchmark.topology.Roles.PROXY; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - +import org.apache.geode.benchmark.Config; import org.apache.geode.benchmark.parameters.GcLoggingParameters; import org.apache.geode.benchmark.parameters.GcParameters; import org.apache.geode.benchmark.parameters.HeapParameters; @@ -45,31 +47,31 @@ public class ClientServerTopologyWithSNIProxy { private static final String WITH_SSL_ARGUMENT = "-DwithSsl=true"; private static final String WITH_SECURITY_MANAGER_ARGUMENT = "-DwithSecurityManager=true"; - public static void configure(TestConfig testConfig) { - testConfig.role(LOCATOR, NUM_LOCATORS); - testConfig.role(SERVER, NUM_SERVERS); - testConfig.role(CLIENT, NUM_CLIENTS); - testConfig.role(PROXY, NUM_PROXIES); + public static void configure(TestConfig config) { + role(config, LOCATOR, NUM_LOCATORS); + role(config, SERVER, NUM_SERVERS); + role(config, CLIENT, NUM_CLIENTS); + role(config, PROXY, NUM_PROXIES); - JvmParameters.configure(testConfig); - HeapParameters.configure(testConfig); - GcLoggingParameters.configure(testConfig); - GcParameters.configure(testConfig); - ProfilerParameters.configure(testConfig); + JvmParameters.configure(config); + HeapParameters.configure(config); + GcLoggingParameters.configure(config); + GcParameters.configure(config); + ProfilerParameters.configure(config); - configureJavaRoles(testConfig, WITH_SSL_ARGUMENT); - addToTestConfig(testConfig, "withSecurityManager", WITH_SECURITY_MANAGER_ARGUMENT); + configureJavaRoles(config, WITH_SSL_ARGUMENT); + addToTestConfig(config, "withSecurityManager", WITH_SECURITY_MANAGER_ARGUMENT); // pass SNI proxy config to CLIENT role only // TODO: peel it off over in client - testConfig.jvmArgs(CLIENT,"-DwithSniProxy=hostname:port"); + jvmArgs(config, CLIENT, "-DwithSniProxy=hostname:port"); - testConfig.before(new StartLocator(LOCATOR_PORT), LOCATOR); - testConfig.before(new StartServer(LOCATOR_PORT), SERVER); - testConfig.before(new StartClient(LOCATOR_PORT), CLIENT); - testConfig.before(new StartSniProxy(LOCATOR_PORT), PROXY); + before(config, new StartLocator(LOCATOR_PORT), LOCATOR); + before(config, new StartServer(LOCATOR_PORT), SERVER); + before(config, new StartClient(LOCATOR_PORT), CLIENT); + before(config, new StartSniProxy(LOCATOR_PORT), PROXY); - testConfig.after(new StopSniProxy(), PROXY); + after(config, new StopSniProxy(), PROXY); } } diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/Roles.java b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/Roles.java index a47a8bc..c6807da 100644 --- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/Roles.java +++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/Roles.java @@ -3,9 +3,6 @@ package org.apache.geode.benchmark.topology; /** * All roles defined for the JVMs created for the benchmark */ -public class Roles { - public static final String SERVER = "server"; - public static final String CLIENT = "client"; - public static final String LOCATOR = "locator"; - public static final String PROXY = "proxy"; +public enum Roles { + SERVER, CLIENT, LOCATOR, PROXY; } diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/parameters/GcLoggingParametersTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/parameters/GcLoggingParametersTest.java index 67a9909..23e5ea8 100644 --- a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/parameters/GcLoggingParametersTest.java +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/parameters/GcLoggingParametersTest.java @@ -77,21 +77,21 @@ class GcLoggingParametersTest { } private void assertThatJava8GcLog(TestConfig testConfig) { - assertThat(testConfig.getJvmArgs().get(CLIENT)).contains("-Xloggc:OUTPUT_DIR/gc.log"); - assertThat(testConfig.getJvmArgs().get(SERVER)).contains("-Xloggc:OUTPUT_DIR/gc.log"); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).contains("-Xloggc:OUTPUT_DIR/gc.log"); - assertThat(testConfig.getJvmArgs().get(CLIENT)).doesNotContain("-Xlog:gc:OUTPUT_DIR/gc.log"); - assertThat(testConfig.getJvmArgs().get(SERVER)).doesNotContain("-Xlog:gc:OUTPUT_DIR/gc.log"); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).doesNotContain("-Xlog:gc:OUTPUT_DIR/gc.log"); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).contains("-Xloggc:OUTPUT_DIR/gc.log"); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).contains("-Xloggc:OUTPUT_DIR/gc.log"); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).contains("-Xloggc:OUTPUT_DIR/gc.log"); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).doesNotContain("-Xlog:gc:OUTPUT_DIR/gc.log"); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).doesNotContain("-Xlog:gc:OUTPUT_DIR/gc.log"); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).doesNotContain("-Xlog:gc:OUTPUT_DIR/gc.log"); } private void assertThatJava9GcLog(TestConfig testConfig) { - assertThat(testConfig.getJvmArgs().get(CLIENT)).contains("-Xlog:gc*:OUTPUT_DIR/gc.log"); - assertThat(testConfig.getJvmArgs().get(SERVER)).contains("-Xlog:gc*:OUTPUT_DIR/gc.log"); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).contains("-Xlog:gc*:OUTPUT_DIR/gc.log"); - assertThat(testConfig.getJvmArgs().get(CLIENT)).doesNotContain("-Xloggc:OUTPUT_DIR/gc.log"); - assertThat(testConfig.getJvmArgs().get(SERVER)).doesNotContain("-Xloggc:OUTPUT_DIR/gc.log"); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).doesNotContain("-Xloggc:OUTPUT_DIR/gc.log"); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).contains("-Xlog:gc*:OUTPUT_DIR/gc.log"); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).contains("-Xlog:gc*:OUTPUT_DIR/gc.log"); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).contains("-Xlog:gc*:OUTPUT_DIR/gc.log"); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).doesNotContain("-Xloggc:OUTPUT_DIR/gc.log"); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).doesNotContain("-Xloggc:OUTPUT_DIR/gc.log"); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).doesNotContain("-Xloggc:OUTPUT_DIR/gc.log"); } } diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/parameters/GcParametersTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/parameters/GcParametersTest.java index 7e4fb10..b4a1696 100644 --- a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/parameters/GcParametersTest.java +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/parameters/GcParametersTest.java @@ -91,39 +91,39 @@ class GcParametersTest { } private void assertCms(TestConfig testConfig) { - assertThat(testConfig.getJvmArgs().get(CLIENT)).contains(XX_USE_CONC_MARK_SWEEP_GC); - assertThat(testConfig.getJvmArgs().get(SERVER)).contains(XX_USE_CONC_MARK_SWEEP_GC); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).contains(XX_USE_CONC_MARK_SWEEP_GC); - assertThat(testConfig.getJvmArgs().get(CLIENT)).doesNotContain(XX_USE_G_1_GC); - assertThat(testConfig.getJvmArgs().get(SERVER)).doesNotContain(XX_USE_G_1_GC); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).doesNotContain(XX_USE_G_1_GC); - assertThat(testConfig.getJvmArgs().get(CLIENT)).doesNotContain(XX_USE_ZGC); - assertThat(testConfig.getJvmArgs().get(SERVER)).doesNotContain(XX_USE_ZGC); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).doesNotContain(XX_USE_ZGC); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).contains(XX_USE_CONC_MARK_SWEEP_GC); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).contains(XX_USE_CONC_MARK_SWEEP_GC); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).contains(XX_USE_CONC_MARK_SWEEP_GC); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).doesNotContain(XX_USE_G_1_GC); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).doesNotContain(XX_USE_G_1_GC); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).doesNotContain(XX_USE_G_1_GC); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).doesNotContain(XX_USE_ZGC); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).doesNotContain(XX_USE_ZGC); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).doesNotContain(XX_USE_ZGC); } private void assertG1(TestConfig testConfig) { - assertThat(testConfig.getJvmArgs().get(CLIENT)).contains(XX_USE_G_1_GC); - assertThat(testConfig.getJvmArgs().get(SERVER)).contains(XX_USE_G_1_GC); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).contains(XX_USE_G_1_GC); - assertThat(testConfig.getJvmArgs().get(CLIENT)).doesNotContain(XX_USE_CONC_MARK_SWEEP_GC); - assertThat(testConfig.getJvmArgs().get(SERVER)).doesNotContain(XX_USE_CONC_MARK_SWEEP_GC); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).doesNotContain(XX_USE_CONC_MARK_SWEEP_GC); - assertThat(testConfig.getJvmArgs().get(CLIENT)).doesNotContain(XX_USE_ZGC); - assertThat(testConfig.getJvmArgs().get(SERVER)).doesNotContain(XX_USE_ZGC); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).doesNotContain(XX_USE_ZGC); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).contains(XX_USE_G_1_GC); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).contains(XX_USE_G_1_GC); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).contains(XX_USE_G_1_GC); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).doesNotContain(XX_USE_CONC_MARK_SWEEP_GC); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).doesNotContain(XX_USE_CONC_MARK_SWEEP_GC); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).doesNotContain(XX_USE_CONC_MARK_SWEEP_GC); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).doesNotContain(XX_USE_ZGC); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).doesNotContain(XX_USE_ZGC); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).doesNotContain(XX_USE_ZGC); } private void assertZ(TestConfig testConfig) { - assertThat(testConfig.getJvmArgs().get(CLIENT)).contains(XX_USE_ZGC); - assertThat(testConfig.getJvmArgs().get(SERVER)).contains(XX_USE_ZGC); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).contains(XX_USE_ZGC); - assertThat(testConfig.getJvmArgs().get(CLIENT)).doesNotContain(XX_USE_CONC_MARK_SWEEP_GC); - assertThat(testConfig.getJvmArgs().get(SERVER)).doesNotContain(XX_USE_CONC_MARK_SWEEP_GC); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).doesNotContain(XX_USE_CONC_MARK_SWEEP_GC); - assertThat(testConfig.getJvmArgs().get(CLIENT)).doesNotContain(XX_USE_G_1_GC); - assertThat(testConfig.getJvmArgs().get(SERVER)).doesNotContain(XX_USE_G_1_GC); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).doesNotContain(XX_USE_G_1_GC); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).contains(XX_USE_ZGC); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).contains(XX_USE_ZGC); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).contains(XX_USE_ZGC); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).doesNotContain(XX_USE_CONC_MARK_SWEEP_GC); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).doesNotContain(XX_USE_CONC_MARK_SWEEP_GC); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).doesNotContain(XX_USE_CONC_MARK_SWEEP_GC); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).doesNotContain(XX_USE_G_1_GC); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).doesNotContain(XX_USE_G_1_GC); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).doesNotContain(XX_USE_G_1_GC); } } diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/parameters/HeapParametersTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/parameters/HeapParametersTest.java index 8ea9662..4303c6b 100644 --- a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/parameters/HeapParametersTest.java +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/parameters/HeapParametersTest.java @@ -61,11 +61,11 @@ class HeapParametersTest { } private void assertHeap(final TestConfig testConfig, final String heap) { - assertThat(testConfig.getJvmArgs().get(CLIENT)).contains("-Xmx" + heap); - assertThat(testConfig.getJvmArgs().get(SERVER)).contains("-Xmx" + heap); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).contains("-Xmx" + heap); - assertThat(testConfig.getJvmArgs().get(CLIENT)).contains("-Xms" + heap); - assertThat(testConfig.getJvmArgs().get(SERVER)).contains("-Xms" + heap); - assertThat(testConfig.getJvmArgs().get(LOCATOR)).contains("-Xms" + heap); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).contains("-Xmx" + heap); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).contains("-Xmx" + heap); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).contains("-Xmx" + heap); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).contains("-Xms" + heap); + assertThat(testConfig.getJvmArgs().get(SERVER.name())).contains("-Xms" + heap); + assertThat(testConfig.getJvmArgs().get(LOCATOR.name())).contains("-Xms" + heap); } } diff --git a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/topology/ClientServerTopologyTest.java b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/topology/ClientServerTopologyTest.java index f80ac64..2eda6eb 100644 --- a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/topology/ClientServerTopologyTest.java +++ b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/topology/ClientServerTopologyTest.java @@ -46,21 +46,21 @@ public class ClientServerTopologyTest { System.setProperty("withSsl", "true"); TestConfig testConfig = new TestConfig(); ClientServerTopology.configure(testConfig); - assertThat(testConfig.getJvmArgs().get(CLIENT)).contains("-DwithSsl=true"); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).contains("-DwithSsl=true"); } @Test public void configWithNoSsl() { TestConfig testConfig = new TestConfig(); ClientServerTopology.configure(testConfig); - assertThat(testConfig.getJvmArgs().get(CLIENT)).doesNotContain("-DwithSsl=true"); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).doesNotContain("-DwithSsl=true"); } @Test public void configWithoutSecurityManager() { TestConfig testConfig = new TestConfig(); ClientServerTopology.configure(testConfig); - assertThat(testConfig.getJvmArgs().get(CLIENT)).doesNotContain("-DwithSecurityManager=true"); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).doesNotContain("-DwithSecurityManager=true"); } @Test @@ -68,7 +68,7 @@ public class ClientServerTopologyTest { System.setProperty("withSecurityManager", "true"); TestConfig testConfig = new TestConfig(); ClientServerTopology.configure(testConfig); - assertThat(testConfig.getJvmArgs().get(CLIENT)).contains("-DwithSecurityManager=true"); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).contains("-DwithSecurityManager=true"); } @Test @@ -80,7 +80,7 @@ public class ClientServerTopologyTest { ClientServerTopology.configure(testConfig); - assertThat(testConfig.getJvmArgs().get(CLIENT)).contains("-DwithSecurityManager=true"); - assertThat(testConfig.getJvmArgs().get(CLIENT)).contains("-DwithSsl=true"); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).contains("-DwithSecurityManager=true"); + assertThat(testConfig.getJvmArgs().get(CLIENT.name())).contains("-DwithSsl=true"); } } diff --git a/harness/src/main/java/org/apache/geode/perftest/TestConfig.java b/harness/src/main/java/org/apache/geode/perftest/TestConfig.java index 9d66cd6..3868b43 100644 --- a/harness/src/main/java/org/apache/geode/perftest/TestConfig.java +++ b/harness/src/main/java/org/apache/geode/perftest/TestConfig.java @@ -140,13 +140,6 @@ public class TestConfig implements Serializable { } /** - * Return the total number of JVMs required to run this test - */ - public int getTotalJVMs() { - return roles.values().stream().mapToInt(Integer::intValue).sum(); - } - - /** * Add JVM arguments used to launch JVMs for a particular role * * If multiple calls to this method are made for the same role, the new JVM arguments diff --git a/harness/src/main/java/org/apache/geode/perftest/runner/DefaultTestRunner.java b/harness/src/main/java/org/apache/geode/perftest/runner/DefaultTestRunner.java index 841a1c6..322b2e8 100644 --- a/harness/src/main/java/org/apache/geode/perftest/runner/DefaultTestRunner.java +++ b/harness/src/main/java/org/apache/geode/perftest/runner/DefaultTestRunner.java @@ -69,7 +69,6 @@ public class DefaultTestRunner implements TestRunner { protected void runTest(TestConfig config, String testName) throws Exception { - int nodes = config.getTotalJVMs(); File benchmarkOutput = new File(outputDir, testName); if (benchmarkOutput.exists()) { throw new IllegalStateException(