geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zho...@apache.org
Subject geode git commit: fix-4
Date Tue, 11 Apr 2017 22:22:06 GMT
Repository: geode
Updated Branches:
  refs/heads/feature/GEM-1353 c4e40ce4b -> 45746d6c0


fix-4


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

Branch: refs/heads/feature/GEM-1353
Commit: 45746d6c054106118fa8a57df4ccfeaa7832dbe0
Parents: c4e40ce
Author: zhouxh <gzhou@pivotal.io>
Authored: Tue Apr 11 15:21:34 2017 -0700
Committer: zhouxh <gzhou@pivotal.io>
Committed: Tue Apr 11 15:21:34 2017 -0700

----------------------------------------------------------------------
 .../geode/internal/cache/BucketRegion.java      | 12 +++++-----
 .../geode/internal/cache/DistributedRegion.java | 23 ++++++++++++--------
 .../geode/internal/cache/LocalRegion.java       |  6 +++--
 .../internal/cache/LocalRegionDataView.java     |  4 ++--
 .../geode/internal/cache/PartitionedRegion.java |  6 +++--
 5 files changed, 30 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/45746d6c/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
index 4e68520..136d7b9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
@@ -587,7 +587,7 @@ public class BucketRegion extends DistributedRegion implements Bucket
{
           // since we did not call basicPutPart3(), so we have to explicitly addEntry here
           event.getPutAllOperation().addEntry(event, this.getId());
         } else {
-          // BR's put
+          // before distribute: BR's put
           op = new UpdateOperation(event, lastModified);
           token = op.startOperation();
           if (logger.isDebugEnabled()) {
@@ -646,7 +646,7 @@ public class BucketRegion extends DistributedRegion implements Bucket
{
         if (!event.isBulkOpInProgress()) {
           long start = this.partitionedRegion.getPrStats().startSendReplication();
           try {
-            // PR's put PR
+            // before distribute: PR's put PR
             op = new UpdateOperation(event, modifiedTime);
             token = op.startOperation();
           } finally {
@@ -914,7 +914,7 @@ public class BucketRegion extends DistributedRegion implements Bucket
{
       if (!event.isOriginRemote() && getBucketAdvisor().isPrimary()) {
         // This cache has processed the event, forward operation
         // and event messages to backup buckets
-        // BR.invalidate hasSeenEvent
+        // before distribute: BR.invalidate hasSeenEvent
         op = new InvalidateOperation(event);
         token = op.startOperation();
       }
@@ -950,7 +950,7 @@ public class BucketRegion extends DistributedRegion implements Bucket
{
 
         // This code assumes that this bucket is primary
         // distribute op to bucket secondaries and event to other listeners
-        // BR's invalidate
+        // before distribute: BR's invalidate
         op = new InvalidateOperation(event);
         token = op.startOperation();
       }
@@ -1191,7 +1191,7 @@ public class BucketRegion extends DistributedRegion implements Bucket
{
         } else {
           // This cache has processed the event, forward operation
           // and event messages to backup buckets
-          // BR's destroy, not to trigger callback here
+          // before distribute: BR's destroy, not to trigger callback here
           event.setOldValueFromRegion();
           op = new DestroyOperation(event);
           token = op.startOperation();
@@ -1230,7 +1230,7 @@ public class BucketRegion extends DistributedRegion implements Bucket
{
         // then GII has completed (the region has been completely initialized)
 
         // This code assumes that this bucket is primary
-        // BR.destroy for retain
+        // before distribute: BR.destroy for retain
         op = new DestroyOperation(event);
         token = op.startOperation();
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/45746d6c/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java
index ed1a2fe..96cd0f1 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java
@@ -437,7 +437,7 @@ public class DistributedRegion extends LocalRegion implements CacheDistributionA
         distribute = false;
       }
       if (distribute) {
-        // DR's put, it has notified gateway sender earlier
+        // before distribute: DR's put, it has notified gateway sender earlier
         UpdateOperation op = new UpdateOperation(event, lastModified);
         if (logger.isTraceEnabled()) {
           logger.trace("distributing operation for event : {} : for region : {}", event,
@@ -1658,7 +1658,7 @@ public class DistributedRegion extends LocalRegion implements CacheDistributionA
           event.getRemoveAllOperation().addEntry(event, true);
         }
         if (!getConcurrencyChecksEnabled() || event.hasValidVersionTag()) {
-          // DR.destroy, hasSeenEvent. no to notifyGateway
+          // before distribute: DR.destroy, hasSeenEvent. no to notifyGateway
           distributeDestroy(event, expectedOldValue);
           event.invokeCallbacks(this, true, false);
         }
@@ -1678,7 +1678,7 @@ public class DistributedRegion extends LocalRegion implements CacheDistributionA
     if (event.isDistributed() && !event.isOriginRemote() && !event.isBulkOpInProgress())
{
       boolean distribute = !event.getInhibitDistribution();
       if (distribute) {
-        // DR.destroy, it has notifiedGatewaySender ealier
+        // before distribute: DR.destroy, it has notifiedGatewaySender ealier
         DestroyOperation op = new DestroyOperation(event);
         op.distribute();
       }
@@ -1861,7 +1861,7 @@ public class DistributedRegion extends LocalRegion implements CacheDistributionA
       if (event.isDistributed() && !event.isOriginRemote()) {
         boolean distribute = !event.getInhibitDistribution();
         if (distribute) {
-          // DR.invalidate, it has triggered callback earlier
+          // before distribute: DR.invalidate, it has triggered callback earlier
           InvalidateOperation op = new InvalidateOperation(event);
           op.distribute();
         }
@@ -1894,7 +1894,7 @@ public class DistributedRegion extends LocalRegion implements CacheDistributionA
     if (!this.regionInvalid && event.isDistributed() && !event.isOriginRemote()
         && !isTX() /* only distribute if non-tx */) {
       if (event.isDistributed() && !event.isOriginRemote()) {
-        // DR has sent callback earlier
+        // before distribute: DR has sent callback earlier
         UpdateEntryVersionOperation op = new UpdateEntryVersionOperation(event);
         op.distribute();
       }
@@ -3344,28 +3344,33 @@ public class DistributedRegion extends LocalRegion implements CacheDistributionA
   /**
    * Distribute the PutAllOp. This implementation distributes it to peers.
    * 
+   * @return token >0 means startOperation finished distribution
    * @since GemFire 5.7
    */
   @Override
-  public void postPutAllSend(DistributedPutAllOperation putAllOp,
+  public long postPutAllSend(DistributedPutAllOperation putAllOp,
       VersionedObjectList successfulPuts) {
+    long token = -1;
     if (putAllOp.putAllDataSize > 0) {
-      putAllOp.startOperation();
+      token = putAllOp.startOperation();
     } else {
       if (logger.isDebugEnabled()) {
         logger.debug("DR.postPutAll: no data to distribute");
       }
     }
+    return token;
   }
 
   @Override
-  public void postRemoveAllSend(DistributedRemoveAllOperation op,
+  public long postRemoveAllSend(DistributedRemoveAllOperation op,
       VersionedObjectList successfulOps) {
+    long token = -1;
     if (op.removeAllDataSize > 0) {
-      op.startOperation();
+      token = op.startOperation();
     } else {
       getCache().getLoggerI18n().fine("DR.postRemoveAll: no data to distribute");
     }
+    return token;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/geode/blob/45746d6c/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
index 957038c..dac2f3a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
@@ -10458,14 +10458,16 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
     }
   }
 
-  public void postPutAllSend(DistributedPutAllOperation putallOp,
+  public long postPutAllSend(DistributedPutAllOperation putallOp,
       VersionedObjectList successfulPuts) {
     /* No-op for local region of course */
+    return -1;
   }
 
-  public void postRemoveAllSend(DistributedRemoveAllOperation op,
+  public long postRemoveAllSend(DistributedRemoveAllOperation op,
       VersionedObjectList successfulOps) {
     /* No-op for local region of course */
+    return -1;
   }
 
 

http://git-wip-us.apache.org/repos/asf/geode/blob/45746d6c/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegionDataView.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegionDataView.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegionDataView.java
index 080c15c..b4aa20b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegionDataView.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegionDataView.java
@@ -314,7 +314,7 @@ public class LocalRegionDataView implements InternalDataView {
     // BR & DR's putAll
     long token = -1;
     try {
-      region.postPutAllSend(putallOp, successfulPuts);
+      token = region.postPutAllSend(putallOp, successfulPuts);
       region.postPutAllFireEvents(putallOp, successfulPuts);
     } finally {
       if (region instanceof DistributedRegion) {
@@ -336,7 +336,7 @@ public class LocalRegionDataView implements InternalDataView {
     // BR, DR's removeAll
     long token = -1;
     try {
-      region.postRemoveAllSend(op, successfulOps);
+      token = region.postRemoveAllSend(op, successfulOps);
       region.postRemoveAllFireEvents(op, successfulOps);
     } finally {
       if (region instanceof DistributedRegion) {

http://git-wip-us.apache.org/repos/asf/geode/blob/45746d6c/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
index 0f5e316..614de4d 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
@@ -2077,7 +2077,7 @@ public class PartitionedRegion extends LocalRegion
    * @param successfulPuts not used in PartitionedRegion.
    */
   @Override
-  public void postPutAllSend(DistributedPutAllOperation putallO,
+  public long postPutAllSend(DistributedPutAllOperation putallO,
       VersionedObjectList successfulPuts) {
     final boolean isDebugEnabled = logger.isDebugEnabled();
 
@@ -2174,10 +2174,11 @@ public class PartitionedRegion extends LocalRegion
        * != null) { e.release(); } } }
        */
     }
+    return -1;
   }
 
   @Override
-  public void postRemoveAllSend(DistributedRemoveAllOperation op,
+  public long postRemoveAllSend(DistributedRemoveAllOperation op,
       VersionedObjectList successfulOps) {
     final boolean isDebugEnabled = logger.isDebugEnabled();
 
@@ -2264,6 +2265,7 @@ public class PartitionedRegion extends LocalRegion
         }
       }
     }
+    return -1;
   }
 
   /*


Mime
View raw message