geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [3/4] geode-examples git commit: GEODE-2231 tweak partitioned geode-examples per reviews
Date Fri, 31 Mar 2017 20:05:22 GMT
GEODE-2231 tweak partitioned geode-examples per reviews

- revise to address review comments
- remove unneeded comments


Branch: refs/heads/develop
Commit: 912f7b8ddca82ded1b67456d9c70f3179639cb30
Parents: e3e9f75
Author: Karen Miller <>
Authored: Fri Mar 31 10:01:58 2017 -0700
Committer: Karen Miller <>
Committed: Fri Mar 31 10:01:58 2017 -0700

 partitioned/                              | 17 ++++++++++-------
 .../geode/examples/partitioned/       |  1 -
 .../examples/partitioned/      |  1 -
 3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/partitioned/ b/partitioned/
index 9ae80fa..75be8b5 100644
--- a/partitioned/
+++ b/partitioned/
@@ -21,8 +21,7 @@ This example demonstrates the basic property of partitioning.
 The basic property of partitioning is that data entries are distributed 
 across all servers that host a region.
 The distribution is like database sharding, except that the distribution
-occurs automatically. It is also similar to data striping on disks,
-except that the distribution is not based on hardware.
+occurs automatically. 
 In this example,
 two servers host a single partitioned region. 
@@ -34,7 +33,8 @@ Because the region is partitioned,
 its entries are distributed among the two servers hosting the region.
 Since there is no redundancy of the data within the region,
 when one of the servers goes away,
-the entries hosted within that server are also gone.
+the entries hosted within that server are also gone;
+the example demonstrates this.
 ## Demonstration of Partitioning
 1. Set directory ```geode-examples/partitioned``` to be the
@@ -112,6 +112,9 @@ Run the consumer to get and print all 10 entries in the `EmployeeRegion`.
     Within the output, the result for `totalBucketSize` identifies
     the number of entries hosted on the specified server.
     Vary the command to see statistics for both `server1` and `server2`.
+    Note that approximately half the entries will be on each server.
+    And, the quantity on each server may vary if the example is started
+    over and run again.
 1. The region entries are distributed across both servers.
 Kill one of the servers:
@@ -143,7 +146,7 @@ Those hosted by the server that was stopped were lost.
     $ scripts/
-## Things to get Right (TM) for Partitioned Regions
+## Things to Get Right for Partitioned Regions
 - Hashing distributes entries among buckets that reside on servers.
 A good hash code is important in order to spread the entries among buckets
@@ -151,6 +154,6 @@ A good hash code is important in order to spread the entries among buckets
 - Besides the hash code, equals() needs to be defined.
-- A robust system will use redundancy in conjunction with partitioning
-in production systems,
-so that data is not lost if a server goes down.
+- A system that ought to not lose data if a system member goes down
+will use redundancy in conjunction with partitioning
+in production systems.
diff --git a/partitioned/src/main/java/org/apache/geode/examples/partitioned/
index 5d22360..9fc87e8 100644
--- a/partitioned/src/main/java/org/apache/geode/examples/partitioned/
+++ b/partitioned/src/main/java/org/apache/geode/examples/partitioned/
@@ -24,7 +24,6 @@ import java.util.logging.Logger;
 public class Producer {
   static final Logger logger = Logger.getAnonymousLogger();
-  // protected ClientCache clientCache;
   private Region region1;
   private final String locatorHost = System.getProperty("GEODE_LOCATOR_HOST", "localhost");
   private final int locatorPort = Integer.getInteger("GEODE_LOCATOR_PORT", 10334);
diff --git a/partitioned/src/test/java/org/apache/geode/examples/partitioned/
index 4d41a5b..d2a1288 100644
--- a/partitioned/src/test/java/org/apache/geode/examples/partitioned/
+++ b/partitioned/src/test/java/org/apache/geode/examples/partitioned/
@@ -41,7 +41,6 @@ import org.junit.rules.TemporaryFolder;
 public class PartitionedTest {
-  // TODO: parameterize
   public static final String GEODE_LOCATOR_PORT = "GEODE_LOCATOR_PORT=";
   private static final String startScriptFileName = "";
   private static final String stopScriptFileName = "";

View raw message