geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmil...@apache.org
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 README.md to address review comments
- remove unneeded comments


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

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

----------------------------------------------------------------------
 partitioned/README.md                              | 17 ++++++++++-------
 .../geode/examples/partitioned/Producer.java       |  1 -
 .../examples/partitioned/PartitionedTest.java      |  1 -
 3 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode-examples/blob/912f7b8d/partitioned/README.md
----------------------------------------------------------------------
diff --git a/partitioned/README.md b/partitioned/README.md
index 9ae80fa..75be8b5 100644
--- a/partitioned/README.md
+++ b/partitioned/README.md
@@ -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/stopAll.sh
     ```
 
-## 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.

http://git-wip-us.apache.org/repos/asf/geode-examples/blob/912f7b8d/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 5d22360..9fc87e8 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
@@ -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);

http://git-wip-us.apache.org/repos/asf/geode-examples/blob/912f7b8d/partitioned/src/test/java/org/apache/geode/examples/partitioned/PartitionedTest.java
----------------------------------------------------------------------
diff --git a/partitioned/src/test/java/org/apache/geode/examples/partitioned/PartitionedTest.java
b/partitioned/src/test/java/org/apache/geode/examples/partitioned/PartitionedTest.java
index 4d41a5b..d2a1288 100644
--- a/partitioned/src/test/java/org/apache/geode/examples/partitioned/PartitionedTest.java
+++ b/partitioned/src/test/java/org/apache/geode/examples/partitioned/PartitionedTest.java
@@ -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 = "startAll.sh";
   private static final String stopScriptFileName = "stopAll.sh";


Mime
View raw message