geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sai_boorlaga...@apache.org
Subject incubator-geode git commit: initial fix
Date Tue, 26 Apr 2016 22:10:39 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-92 [created] 43da5d993


initial fix


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

Branch: refs/heads/feature/GEODE-92
Commit: 43da5d993eacb23d4a5262cd84cd5b1bbffb564c
Parents: 44f403d
Author: Sai Boorlagadda <sboorlagadda@pivotal.io>
Authored: Tue Apr 26 13:31:25 2016 -0700
Committer: Sai Boorlagadda <sboorlagadda@pivotal.io>
Committed: Tue Apr 26 13:31:25 2016 -0700

----------------------------------------------------------------------
 .../gemfire/internal/cache/AbstractLRURegionMap.java        | 9 +++------
 .../com/gemstone/gemfire/internal/cache/LocalRegion.java    | 6 ++++++
 .../internal/cache/PartitionedRegionStatsJUnitTest.java     | 6 ++----
 3 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43da5d99/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java
index 2cc7a55..14c431d 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java
@@ -197,17 +197,14 @@ public abstract class AbstractLRURegionMap extends AbstractRegionMap
{
     int delta = le.updateEntrySize(_getCCHelper(), new CDValueWrapper(v));
     if (delta != 0) {
       result = true;
-      boolean needToDisableCallbacks = !getCallbackDisabled();
-      if (needToDisableCallbacks) {
-        setCallbackDisabled(true);
-      }
+      boolean disabledLURCallbacks = disableLruUpdateCallback();
       // by making sure that callbacks are disabled when we call
       // setDelta; it ensures that the setDelta will just inc the delta
       // value and not call lruUpdateCallback which we call in
       // finishChangeValueForm
       setDelta(delta);
-      if (needToDisableCallbacks) {
-        setCallbackDisabled(false);
+      if (disabledLURCallbacks) {
+        enableLruUpdateCallback();
       }
     }
     // fix for bug 42090

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43da5d99/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
index c32a7d2..6b52ec3 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java
@@ -1333,6 +1333,7 @@ public class LocalRegion extends AbstractRegion
   @Retained
   protected final Object getDeserialized(RegionEntry re, boolean updateStats, boolean disableCopyOnRead,
boolean preferCD, boolean retainResult) {
     assert !retainResult || preferCD;
+    boolean disabledLRUCallback = this.entries.disableLruUpdateCallback();
     try {
       @Retained Object v = null;
       try {
@@ -1375,6 +1376,11 @@ public class LocalRegion extends AbstractRegion
       IllegalArgumentException iae = new IllegalArgumentException(LocalizedStrings.DONT_RELEASE.toLocalizedString("Error
while deserializing value for key="+re.getKey()));
       iae.initCause(i);
       throw iae;
+    } finally {
+      if(disabledLRUCallback) {
+        this.entries.enableLruUpdateCallback();
+        this.entries.lruUpdateCallback();
+      }
     }
   }
   

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/43da5d99/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsJUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsJUnitTest.java
index 089d723..25b795a 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/PartitionedRegionStatsJUnitTest.java
@@ -439,8 +439,7 @@ public class PartitionedRegionStatsJUnitTest
     //Workaround for GEODE-92. We are leaving more than 1 entry in memory. To
     //validate that stats, let's confirm the stats match what is actually in
     //memory
-    //int entriesInMem = 1;
-    int entriesInMem = countEntriesInMem(pr);
+    int entriesInMem = 1;
     
     assertEquals(singleEntryMemSize * entriesInMem, stats.getLong("dataStoreBytesInUse"));
     assertEquals(numEntries , stats.getInt("dataStoreEntryCount"));
@@ -479,8 +478,7 @@ public class PartitionedRegionStatsJUnitTest
     //Workaround for GEODE-92. We are leaving more than 1 entry in memory. To
     //validate that stats, let's confirm the stats match what is actually in
     //memory
-    //entriesInMem = 1;
-    entriesInMem = countEntriesInMem(pr);
+    entriesInMem = 1;
     
     assertEquals(singleEntryMemSize * entriesInMem, stats.getLong("dataStoreBytesInUse"));
     assertEquals(numEntries , stats.getInt("dataStoreEntryCount"));


Mime
View raw message