This is an automated email from the ASF dual-hosted git repository.

heybales pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git


The following commit(s) were added to refs/heads/develop by this push:
     new bffbb22  Add *LongBenchmark (#110)
bffbb22 is described below

commit bffbb225038e838413b4a7218668d249f0404c55
Author: Kamilla Aslami <kasl...@pivotal.io>
AuthorDate: Thu Sep 12 10:52:13 2019 -0700

    Add *LongBenchmark (#110)
    
    Add prefill and benchmarks using Longs
---
 .../benchmark/tasks/PrePopulateRegionLong.java     | 114 +++++++++++++++++++++
 .../tests/PartitionedGetLongBenchmark.java         |  65 ++++++++++++
 .../tests/PartitionedPutAllLongBenchmark.java      |  66 ++++++++++++
 .../tests/PartitionedPutLongBenchmark.java         |  64 ++++++++++++
 .../tests/ReplicatedGetLongBenchmark.java          |  65 ++++++++++++
 .../tests/ReplicatedPutAllLongBenchmark.java       |  66 ++++++++++++
 .../tests/ReplicatedPutLongBenchmark.java          |  64 ++++++++++++
 .../benchmark/tasks/PrePopulateRegionLongTest.java |  66 ++++++++++++
 .../tests/PartitionedGetLongBenchmarkTest.java     |  47 +++++++++
 .../tests/PartitionedPutAllBenchmarkTest.java      |  51 +++++++++
 .../tests/PartitionedPutAllLongBenchmarkTest.java  |  51 +++++++++
 .../tests/PartitionedPutLongBenchmarkTest.java     |  51 +++++++++
 .../tests/ReplicatedGetLongBenchmarkTest.java      |  47 +++++++++
 .../tests/ReplicatedPutLongBenchmarkTest.java      |  49 +++++++++
 14 files changed, 866 insertions(+)

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
new file mode 100644
index 0000000..7d6564b
--- /dev/null
+++ 
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/PrePopulateRegionLong.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.geode.benchmark.tasks;
+
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.CLIENT;
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.LOCATOR;
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.SERVER;
+
+import java.time.Duration;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.geode.benchmark.LongRange;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ClientCacheFactory;
+import org.apache.geode.perftest.Task;
+import org.apache.geode.perftest.TestContext;
+
+
+public class PrePopulateRegionLong implements Task {
+  private static final Logger logger = 
LoggerFactory.getLogger(PrePopulateRegionLong.class);
+
+  private LongRange keyRangeToPrepopulate = new LongRange(0, 10000);
+  private int batchSize = 1000;
+
+  public PrePopulateRegionLong() {}
+
+  public PrePopulateRegionLong(LongRange keyRangeToPrepopulate) {
+    this.keyRangeToPrepopulate = keyRangeToPrepopulate;
+  }
+
+  /**
+   * This method prepopulates the region before the actual benchmark starts.
+   */
+  @Override
+  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 jvmID = context.getJvmID();
+    final int clientIndex = jvmID - numLocators - numServers;
+
+    run(region, keyRangeToPrepopulate.sliceFor(numClient, clientIndex));
+  }
+
+  void run(final Map<Long, Long> region, final LongRange range) throws 
InterruptedException {
+    logger.info("*******************************************");
+    logger.info("      Prepopulating the region ");
+    logger.info("*******************************************");
+    final Instant start = Instant.now();
+
+    final int numThreads = Runtime.getRuntime().availableProcessors();
+    final ExecutorService threadPool = 
Executors.newFixedThreadPool(numThreads);
+    final List<CompletableFuture<Void>> futures = new ArrayList<>();
+
+    for (final LongRange slice : range.slice(numThreads)) {
+      futures.add(CompletableFuture.runAsync(() -> doPuts(region, slice), 
threadPool));
+    }
+
+    futures.forEach(CompletableFuture::join);
+
+    final Instant finish = Instant.now();
+    logger.info("*******************************************");
+    logger.info("    Prepopulating the region completed");
+    logger.info("    Duration = " + Duration.between(start, finish).toMillis() 
+ "ms.");
+    logger.info("*******************************************");
+
+    threadPool.shutdownNow();
+    threadPool.awaitTermination(5, TimeUnit.MINUTES);
+  }
+
+  private void doPuts(final Map<Long, Long> region, final LongRange range) {
+    for (final LongRange slice : range.slicesOfSize(batchSize)) {
+      final Map<Long, Long> valueMap = new HashMap<>();
+      slice.forEach(i -> valueMap.put(i, i));
+      region.putAll(valueMap);
+    }
+  }
+
+  public int getBatchSize() {
+    return batchSize;
+  }
+
+  public void setBatchSize(int batchSize) {
+    this.batchSize = batchSize;
+  }
+}
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
new file mode 100644
index 0000000..5b52fda
--- /dev/null
+++ 
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedGetLongBenchmark.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.geode.benchmark.tests;
+
+
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.CLIENT;
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.SERVER;
+
+import org.junit.jupiter.api.Test;
+
+import org.apache.geode.benchmark.LongRange;
+import org.apache.geode.benchmark.tasks.CreateClientProxyRegion;
+import org.apache.geode.benchmark.tasks.CreatePartitionedRegion;
+import org.apache.geode.benchmark.tasks.GetTask;
+import org.apache.geode.benchmark.tasks.PrePopulateRegionLong;
+import org.apache.geode.benchmark.topology.ClientServerTopology;
+import org.apache.geode.perftest.PerformanceTest;
+import org.apache.geode.perftest.TestConfig;
+import org.apache.geode.perftest.TestRunners;
+
+/**
+ * Benchmark of gets on a partitioned region.
+ */
+public class PartitionedGetLongBenchmark implements PerformanceTest {
+
+  private LongRange keyRange = new LongRange(0, 1000000);
+
+  @Test
+  public void run() throws Exception {
+    TestRunners.defaultRunner().runTest(this);
+  }
+
+  public PartitionedGetLongBenchmark() {}
+
+  public void setKeyRange(final LongRange keyRange) {
+    this.keyRange = keyRange;
+  }
+
+  @Override
+  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);
+    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
new file mode 100644
index 0000000..507eece
--- /dev/null
+++ 
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutAllLongBenchmark.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.geode.benchmark.tests;
+
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.CLIENT;
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.SERVER;
+
+import org.junit.jupiter.api.Test;
+
+import org.apache.geode.benchmark.LongRange;
+import org.apache.geode.benchmark.tasks.CreateClientProxyRegion;
+import org.apache.geode.benchmark.tasks.CreatePartitionedRegion;
+import org.apache.geode.benchmark.tasks.PrePopulateRegionLong;
+import org.apache.geode.benchmark.tasks.PutAllTask;
+import org.apache.geode.benchmark.topology.ClientServerTopology;
+import org.apache.geode.perftest.PerformanceTest;
+import org.apache.geode.perftest.TestConfig;
+import org.apache.geode.perftest.TestRunners;
+
+/**
+ * Benchmark of putAlls on a partitioned region.
+ */
+public class PartitionedPutAllLongBenchmark implements PerformanceTest {
+
+  private LongRange keyRange = new LongRange(0, 1000000);
+
+  private int batchSize = 1000;
+
+  public PartitionedPutAllLongBenchmark() {}
+
+  public void setKeyRange(final LongRange keyRange) {
+    this.keyRange = keyRange;
+  }
+
+  @Test
+  public void run() throws Exception {
+    TestRunners.defaultRunner().runTest(this);
+  }
+
+  @Override
+  public TestConfig configure() {
+    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);
+    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
new file mode 100644
index 0000000..c368071
--- /dev/null
+++ 
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/PartitionedPutLongBenchmark.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.geode.benchmark.tests;
+
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.CLIENT;
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.SERVER;
+
+import org.junit.jupiter.api.Test;
+
+import org.apache.geode.benchmark.LongRange;
+import org.apache.geode.benchmark.tasks.CreateClientProxyRegion;
+import org.apache.geode.benchmark.tasks.CreatePartitionedRegion;
+import org.apache.geode.benchmark.tasks.PrePopulateRegionLong;
+import org.apache.geode.benchmark.tasks.PutTask;
+import org.apache.geode.benchmark.topology.ClientServerTopology;
+import org.apache.geode.perftest.PerformanceTest;
+import org.apache.geode.perftest.TestConfig;
+import org.apache.geode.perftest.TestRunners;
+
+/**
+ * Benchmark of puts on a partitioned region.
+ */
+public class PartitionedPutLongBenchmark implements PerformanceTest {
+
+  private LongRange keyRange = new LongRange(0, 1000000);
+
+  public PartitionedPutLongBenchmark() {}
+
+  public void setKeyRange(final LongRange keyRange) {
+    this.keyRange = keyRange;
+  }
+
+  @Test
+  public void run() throws Exception {
+    TestRunners.defaultRunner().runTest(this);
+  }
+
+  @Override
+  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);
+    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
new file mode 100644
index 0000000..32be10b
--- /dev/null
+++ 
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedGetLongBenchmark.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.geode.benchmark.tests;
+
+
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.CLIENT;
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.SERVER;
+
+import org.junit.jupiter.api.Test;
+
+import org.apache.geode.benchmark.LongRange;
+import org.apache.geode.benchmark.tasks.CreateClientProxyRegion;
+import org.apache.geode.benchmark.tasks.CreateReplicatedRegion;
+import org.apache.geode.benchmark.tasks.GetTask;
+import org.apache.geode.benchmark.tasks.PrePopulateRegionLong;
+import org.apache.geode.benchmark.topology.ClientServerTopology;
+import org.apache.geode.perftest.PerformanceTest;
+import org.apache.geode.perftest.TestConfig;
+import org.apache.geode.perftest.TestRunners;
+
+/**
+ * Benchmark of gets on a replicated region.
+ */
+public class ReplicatedGetLongBenchmark implements PerformanceTest {
+
+  private LongRange keyRange = new LongRange(0, 1000000);
+
+  @Test
+  public void run() throws Exception {
+    TestRunners.defaultRunner().runTest(this);
+  }
+
+  public ReplicatedGetLongBenchmark() {}
+
+  public void setKeyRange(final LongRange keyRange) {
+    this.keyRange = keyRange;
+  }
+
+  @Override
+  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);
+    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
new file mode 100644
index 0000000..19e0a1f
--- /dev/null
+++ 
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutAllLongBenchmark.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.geode.benchmark.tests;
+
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.CLIENT;
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.SERVER;
+
+import org.junit.jupiter.api.Test;
+
+import org.apache.geode.benchmark.LongRange;
+import org.apache.geode.benchmark.tasks.CreateClientProxyRegion;
+import org.apache.geode.benchmark.tasks.CreateReplicatedRegion;
+import org.apache.geode.benchmark.tasks.PrePopulateRegionLong;
+import org.apache.geode.benchmark.tasks.PutAllTask;
+import org.apache.geode.benchmark.topology.ClientServerTopology;
+import org.apache.geode.perftest.PerformanceTest;
+import org.apache.geode.perftest.TestConfig;
+import org.apache.geode.perftest.TestRunners;
+
+/**
+ * Benchmark of putAlls on a replicated region.
+ */
+public class ReplicatedPutAllLongBenchmark implements PerformanceTest {
+
+  private LongRange keyRange = new LongRange(0, 1000000);
+
+  private int batchSize = 1000;
+
+  public ReplicatedPutAllLongBenchmark() {}
+
+  public void setKeyRange(final LongRange keyRange) {
+    this.keyRange = keyRange;
+  }
+
+  @Test
+  public void run() throws Exception {
+    TestRunners.defaultRunner().runTest(this);
+  }
+
+  @Override
+  public TestConfig configure() {
+    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);
+    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
new file mode 100644
index 0000000..776e2c1
--- /dev/null
+++ 
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tests/ReplicatedPutLongBenchmark.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.geode.benchmark.tests;
+
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.CLIENT;
+import static 
org.apache.geode.benchmark.topology.ClientServerTopology.Roles.SERVER;
+
+import org.junit.jupiter.api.Test;
+
+import org.apache.geode.benchmark.LongRange;
+import org.apache.geode.benchmark.tasks.CreateClientProxyRegion;
+import org.apache.geode.benchmark.tasks.CreateReplicatedRegion;
+import org.apache.geode.benchmark.tasks.PrePopulateRegionLong;
+import org.apache.geode.benchmark.tasks.PutTask;
+import org.apache.geode.benchmark.topology.ClientServerTopology;
+import org.apache.geode.perftest.PerformanceTest;
+import org.apache.geode.perftest.TestConfig;
+import org.apache.geode.perftest.TestRunners;
+
+/**
+ * Benchmark of puts on a replicated region.
+ */
+public class ReplicatedPutLongBenchmark implements PerformanceTest {
+
+  private LongRange keyRange = new LongRange(0, 1000000);
+
+  public ReplicatedPutLongBenchmark() {}
+
+  public void setKeyRange(LongRange keyRange) {
+    this.keyRange = keyRange;
+  }
+
+  @Test
+  public void run() throws Exception {
+    TestRunners.defaultRunner().runTest(this);
+  }
+
+  @Override
+  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);
+    return config;
+
+  }
+}
diff --git 
a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tasks/PrePopulateRegionLongTest.java
 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tasks/PrePopulateRegionLongTest.java
new file mode 100644
index 0000000..3c89c2d
--- /dev/null
+++ 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tasks/PrePopulateRegionLongTest.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You 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.apache.geode.benchmark.tasks;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.stream.Collectors;
+import java.util.stream.LongStream;
+
+import org.junit.jupiter.api.Test;
+
+import org.apache.geode.benchmark.LongRange;
+
+class PrePopulateRegionLongTest {
+
+  @Test
+  public void putsEntriesForServer() throws InterruptedException {
+    final LongRange range = new LongRange(0, 100);
+    PrePopulateRegionLong prePopulateRegionLong = new 
PrePopulateRegionLong(range);
+
+    Map<Long, Long> region = new ConcurrentHashMap<>();
+
+    prePopulateRegionLong.run(region, range.sliceFor(2, 1));
+
+    // verify that we put the last 50 keys
+    verifyKeys(region, 50, 100);
+  }
+
+  @Test
+  public void putsEntriesForServerWithSmallBatches() throws 
InterruptedException {
+    final LongRange range = new LongRange(0, 100);
+    PrePopulateRegionLong prePopulateRegionLong = new 
PrePopulateRegionLong(range);
+    prePopulateRegionLong.setBatchSize(2);
+
+    Map<Long, Long> region = new ConcurrentHashMap<>();
+
+    prePopulateRegionLong.run(region, range.sliceFor(2, 1));
+
+    // verify that we put the last 50 keys
+    verifyKeys(region, 50, 100);
+  }
+
+  private void verifyKeys(Map<Long, Long> region, int startInclusive, int 
endExclusive) {
+    List<Long> expectedKeys = LongStream.range(startInclusive, endExclusive)
+        .mapToObj(Long::new)
+        .collect(Collectors.toList());
+
+    
assertThat(region.keySet()).containsExactlyInAnyOrderElementsOf(expectedKeys);
+  }
+
+}
diff --git 
a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedGetLongBenchmarkTest.java
 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedGetLongBenchmarkTest.java
new file mode 100644
index 0000000..75fd261
--- /dev/null
+++ 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedGetLongBenchmarkTest.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You 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.apache.geode.benchmark.tests;
+
+
+import java.io.File;
+import java.nio.file.Path;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junitpioneer.jupiter.TempDirectory;
+
+import org.apache.geode.benchmark.LongRange;
+import org.apache.geode.perftest.TestRunners;
+
+@ExtendWith(TempDirectory.class)
+public class PartitionedGetLongBenchmarkTest {
+
+  private File folder;
+
+  @BeforeEach
+  void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) {
+    folder = tempFolder.toFile();
+  }
+
+  @Test
+  public void benchmarkRunsSuccessfully()
+      throws Exception {
+    PartitionedGetLongBenchmark test = new PartitionedGetLongBenchmark();
+    test.setKeyRange(new LongRange(0, 100));
+    TestRunners.minimalRunner(folder)
+        .runTest(test);
+  }
+}
diff --git 
a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedPutAllBenchmarkTest.java
 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedPutAllBenchmarkTest.java
new file mode 100644
index 0000000..c6670c0
--- /dev/null
+++ 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedPutAllBenchmarkTest.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.geode.benchmark.tests;
+
+
+
+import java.io.File;
+import java.nio.file.Path;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junitpioneer.jupiter.TempDirectory;
+
+import org.apache.geode.benchmark.LongRange;
+import org.apache.geode.perftest.TestRunners;
+
+@ExtendWith(TempDirectory.class)
+public class PartitionedPutAllBenchmarkTest {
+
+  private File folder;
+
+  @BeforeEach
+  void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) {
+    folder = tempFolder.toFile();
+  }
+
+  @Test
+  public void benchmarkRunsSuccessfully()
+      throws Exception {
+    PartitionedPutAllBenchmark test = new PartitionedPutAllBenchmark();
+    test.setKeyRange(new LongRange(0, 100));
+    TestRunners.minimalRunner(folder)
+        .runTest(test);
+  }
+}
diff --git 
a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedPutAllLongBenchmarkTest.java
 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedPutAllLongBenchmarkTest.java
new file mode 100644
index 0000000..701c043
--- /dev/null
+++ 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedPutAllLongBenchmarkTest.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.geode.benchmark.tests;
+
+
+
+import java.io.File;
+import java.nio.file.Path;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junitpioneer.jupiter.TempDirectory;
+
+import org.apache.geode.benchmark.LongRange;
+import org.apache.geode.perftest.TestRunners;
+
+@ExtendWith(TempDirectory.class)
+public class PartitionedPutAllLongBenchmarkTest {
+
+  private File folder;
+
+  @BeforeEach
+  void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) {
+    folder = tempFolder.toFile();
+  }
+
+  @Test
+  public void benchmarkRunsSuccessfully()
+      throws Exception {
+    PartitionedPutAllLongBenchmark test = new PartitionedPutAllLongBenchmark();
+    test.setKeyRange(new LongRange(0, 100));
+    TestRunners.minimalRunner(folder)
+        .runTest(test);
+  }
+}
diff --git 
a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedPutLongBenchmarkTest.java
 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedPutLongBenchmarkTest.java
new file mode 100644
index 0000000..5f5e6de
--- /dev/null
+++ 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/PartitionedPutLongBenchmarkTest.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.geode.benchmark.tests;
+
+
+
+import java.io.File;
+import java.nio.file.Path;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junitpioneer.jupiter.TempDirectory;
+
+import org.apache.geode.benchmark.LongRange;
+import org.apache.geode.perftest.TestRunners;
+
+@ExtendWith(TempDirectory.class)
+public class PartitionedPutLongBenchmarkTest {
+
+  private File folder;
+
+  @BeforeEach
+  void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) {
+    folder = tempFolder.toFile();
+  }
+
+  @Test
+  public void benchmarkRunsSuccessfully()
+      throws Exception {
+    PartitionedPutLongBenchmark test = new PartitionedPutLongBenchmark();
+    test.setKeyRange(new LongRange(0, 100));
+    TestRunners.minimalRunner(folder)
+        .runTest(test);
+  }
+}
diff --git 
a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedGetLongBenchmarkTest.java
 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedGetLongBenchmarkTest.java
new file mode 100644
index 0000000..96e3b9c
--- /dev/null
+++ 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedGetLongBenchmarkTest.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You 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.apache.geode.benchmark.tests;
+
+
+import java.io.File;
+import java.nio.file.Path;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junitpioneer.jupiter.TempDirectory;
+
+import org.apache.geode.benchmark.LongRange;
+import org.apache.geode.perftest.TestRunners;
+
+@ExtendWith(TempDirectory.class)
+public class ReplicatedGetLongBenchmarkTest {
+
+  private File folder;
+
+  @BeforeEach
+  void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) {
+    folder = tempFolder.toFile();
+  }
+
+  @Test
+  public void benchmarkRunsSuccessfully()
+      throws Exception {
+    ReplicatedGetLongBenchmark test = new ReplicatedGetLongBenchmark();
+    test.setKeyRange(new LongRange(0, 100));
+    TestRunners.minimalRunner(folder)
+        .runTest(test);
+  }
+}
diff --git 
a/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedPutLongBenchmarkTest.java
 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedPutLongBenchmarkTest.java
new file mode 100644
index 0000000..779d07f
--- /dev/null
+++ 
b/geode-benchmarks/src/test/java/org/apache/geode/benchmark/tests/ReplicatedPutLongBenchmarkTest.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.apache.geode.benchmark.tests;
+
+import java.io.File;
+import java.nio.file.Path;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junitpioneer.jupiter.TempDirectory;
+
+import org.apache.geode.benchmark.LongRange;
+import org.apache.geode.perftest.TestRunners;
+
+@ExtendWith(TempDirectory.class)
+public class ReplicatedPutLongBenchmarkTest {
+
+  private File folder;
+
+  @BeforeEach
+  void createTemporaryFolder(@TempDirectory.TempDir Path tempFolder) {
+    folder = tempFolder.toFile();
+  }
+
+  @Test
+  public void benchmarkRunsSuccessfully()
+      throws Exception {
+    ReplicatedPutLongBenchmark test = new ReplicatedPutLongBenchmark();
+    test.setKeyRange(new LongRange(0, 100));
+    TestRunners.minimalRunner(folder)
+        .runTest(test);
+  }
+}

Reply via email to