geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [geode] 03/03: Add debug output
Date Mon, 11 Jun 2018 18:12:46 GMT
This is an automated email from the ASF dual-hosted git repository.

klund pushed a commit to branch GEM-1722-1629
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 69cd117ac7c090486d246df986519bff3d9c7386
Author: Kirk Lund <klund@apache.org>
AuthorDate: Mon Jun 11 11:12:04 2018 -0700

    Add debug output
---
 .../geode/internal/cache/AbstractRegionMap.java      | 20 ++++++++++++--------
 .../org/apache/geode/internal/cache/LocalRegion.java |  4 ++--
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
index 2d12e38..efb53bf 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
@@ -21,7 +21,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.Executor;
-import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.logging.log4j.Logger;
 
@@ -203,7 +202,7 @@ public abstract class AbstractRegionMap
     return map;
   }
 
-  @Override
+  @Override // TODO: Map value should be RegionEntry type
   public Map<Object, Object> getEntryMap() {
     return map;
   }
@@ -2225,10 +2224,15 @@ public abstract class AbstractRegionMap
   }
 
   public void dumpMap() {
-    logger.info("dump of concurrent map of size {} for region {}", getEntryMap().size(),
-        this._getOwner());
-    for (Iterator it = getEntryMap().values().iterator(); it.hasNext();) {
-      logger.info("dumpMap:" + it.next().toString());
+    final int tombstoneCount = _getOwner().getTombstoneCount();
+
+    verifyTombstoneCount(tombstoneCount);
+
+    logger.info("GEM-1722: dump of concurrent map of size {} for region {} with tombstoneCount
{}",
+        getEntryMap().size(),
+        _getOwner(), tombstoneCount);
+    for (Object regionEntry : getEntryMap().values()) {
+      logger.info("GEM-1722: dumpMap:" + regionEntry.toString());
     }
   }
 
@@ -2589,7 +2593,7 @@ public abstract class AbstractRegionMap
   }
 
   // method used for debugging tombstone count issues
-  public boolean verifyTombstoneCount(AtomicInteger numTombstones) {
+  public boolean verifyTombstoneCount(int numTombstones) {
     int deadEntries = 0;
     try {
       for (Iterator it = getEntryMap().values().iterator(); it.hasNext();) {
@@ -2598,7 +2602,7 @@ public abstract class AbstractRegionMap
           deadEntries++;
         }
       }
-      if (deadEntries != numTombstones.get()) {
+      if (deadEntries != numTombstones) {
         if (logger.isInfoEnabled()) {
           String message = "GEM-1722: tombstone count (" + numTombstones
               + ") does not match actual number of entries with tombstones (" + deadEntries
+ ")";
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 9cfe1c9..e88393c 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
@@ -3290,7 +3290,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
     }
     if (logger.isInfoEnabled(LogMarker.TOMBSTONE_COUNT_VERBOSE) && validate) {
       if (this.entries instanceof AbstractRegionMap) {
-        ((AbstractRegionMap) this.entries).verifyTombstoneCount(this.tombstoneCount);
+        ((AbstractRegionMap) this.entries).verifyTombstoneCount(this.tombstoneCount.get());
       }
     }
     // we don't have to remove the entry from the sweeper since the version has
@@ -11552,7 +11552,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
   public void dumpBackingMap() {
     synchronized (this.entries) {
       if (this.entries instanceof AbstractRegionMap) {
-        ((AbstractRegionMap) this.entries).verifyTombstoneCount(this.tombstoneCount);
+        ((AbstractRegionMap) this.entries).verifyTombstoneCount(this.tombstoneCount.get());
       }
       logger.info("GEM-1722: Dumping region of size {} tombstones: {}: {}", size(),
           getTombstoneCount(),

-- 
To stop receiving notification emails like this one, please contact
klund@apache.org.

Mime
View raw message