geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmil...@apache.org
Subject geode-examples git commit: GEODE-2231 Put 10 pairs into region
Date Thu, 02 Feb 2017 18:03:28 GMT
Repository: geode-examples
Updated Branches:
  refs/heads/feature/GEODE-2231 ced3bedcb -> 717eb02f9


GEODE-2231 Put 10 pairs into region


Project: http://git-wip-us.apache.org/repos/asf/geode-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode-examples/commit/717eb02f
Tree: http://git-wip-us.apache.org/repos/asf/geode-examples/tree/717eb02f
Diff: http://git-wip-us.apache.org/repos/asf/geode-examples/diff/717eb02f

Branch: refs/heads/feature/GEODE-2231
Commit: 717eb02f9340a87411fdda9d8327dd8dc95357ef
Parents: ced3bed
Author: Karen Miller <kmiller@pivotal.io>
Authored: Thu Feb 2 10:02:51 2017 -0800
Committer: Karen Miller <kmiller@pivotal.io>
Committed: Thu Feb 2 10:02:51 2017 -0800

----------------------------------------------------------------------
 .../geode/examples/partitioned/BaseClient.java  |  2 +-
 .../geode/examples/partitioned/Producer.java    | 40 +++++++++++++++++---
 2 files changed, 36 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode-examples/blob/717eb02f/partitioned/src/main/java/org/apache/geode/examples/partitioned/BaseClient.java
----------------------------------------------------------------------
diff --git a/partitioned/src/main/java/org/apache/geode/examples/partitioned/BaseClient.java
b/partitioned/src/main/java/org/apache/geode/examples/partitioned/BaseClient.java
index cdf20e3..3608518 100644
--- a/partitioned/src/main/java/org/apache/geode/examples/partitioned/BaseClient.java
+++ b/partitioned/src/main/java/org/apache/geode/examples/partitioned/BaseClient.java
@@ -35,7 +35,7 @@ public abstract class BaseClient {
   private final String locatorHost = System.getProperty("GEODE_LOCATOR_HOST", "localhost");
   private final int locatorPort = Integer.getInteger("GEODE_LOCATOR_PORT", 10334);
   protected static final String REGION_NAME = "EmployeeRegion";
-  static final int NUM_ENTRIES = 3;
+  static final int NUM_ENTRIES = 10;
 
   public BaseClient() {
     this.clientCache = getClientCache();

http://git-wip-us.apache.org/repos/asf/geode-examples/blob/717eb02f/partitioned/src/main/java/org/apache/geode/examples/partitioned/Producer.java
----------------------------------------------------------------------
diff --git a/partitioned/src/main/java/org/apache/geode/examples/partitioned/Producer.java
b/partitioned/src/main/java/org/apache/geode/examples/partitioned/Producer.java
index d68117d..a9e8f83 100644
--- a/partitioned/src/main/java/org/apache/geode/examples/partitioned/Producer.java
+++ b/partitioned/src/main/java/org/apache/geode/examples/partitioned/Producer.java
@@ -15,6 +15,7 @@
 package org.apache.geode.examples.partitioned;
 
 import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.Region;
 import org.apache.geode.cache.client.ServerOperationException;
 
 public class Producer extends BaseClient {
@@ -31,10 +32,11 @@ public class Producer extends BaseClient {
 
   public void populateRegion() {
 
+    Region r = getRegion();
     EmployeeKey k1 = new EmployeeKey("Alex Able", 160);
     EmployeeData d1 = new EmployeeData(k1, 70000, 40);
     try {
-      getRegion().put(k1, d1);
+      r.put(k1, d1);
     } catch (ServerOperationException e) {
       logger.info("ServerOperationException " + e.getMessage());
       logger.info("ServerOperationException " + e.getCause());
@@ -42,12 +44,40 @@ public class Producer extends BaseClient {
 
     EmployeeKey k2 = new EmployeeKey("Bertie Bell", 170);
     EmployeeData d2 = new EmployeeData(k2, 72000, 40);
-    getRegion().put(k2, d2);
+    r.put(k2, d2);
 
-    EmployeeKey k3 = new EmployeeKey("Chris Call", 180);
+    EmployeeKey k3 = new EmployeeKey("Kris Call", 180);
     EmployeeData d3 = new EmployeeData(k3, 68000, 40);
-    getRegion().put(k3, d3);
+    r.put(k3, d3);
 
-    logger.info("Inserted 3 entries.");
+    EmployeeKey k4 = new EmployeeKey("Dale Driver", 190);
+    EmployeeData d4 = new EmployeeData(k4, 81500, 36);
+    r.put(k4, d4);
+
+    EmployeeKey k5 = new EmployeeKey("Frankie Forth", 201);
+    EmployeeData d5 = new EmployeeData(k5, 45000, 40);
+    r.put(k5, d5);
+
+    EmployeeKey k6 = new EmployeeKey("Jamie Jive", 220);
+    EmployeeData d6 = new EmployeeData(k6, 56500, 40);
+    r.put(k6, d6);
+
+    EmployeeKey k7 = new EmployeeKey("Morgan Minnow", 230);
+    EmployeeData d7 = new EmployeeData(k7, 65000, 36);
+    r.put(k7, d7);
+
+    EmployeeKey k8 = new EmployeeKey("Pat Puts", 240);
+    EmployeeData d8 = new EmployeeData(k8, 67000, 40);
+    r.put(k8, d8);
+
+    EmployeeKey k9 = new EmployeeKey("Ricky Reliable", 2500);
+    EmployeeData d9 = new EmployeeData(k9, 71000, 40);
+    r.put(k9, d9);
+
+    EmployeeKey k10 = new EmployeeKey("Taylor Tack", 260);
+    EmployeeData d10 = new EmployeeData(k10, 70000, 40);
+    r.put(k10, d10);
+
+    logger.info("Inserted 10 entries.");
   }
 }


Mime
View raw message