ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject incubator-ignite git commit: #IGNITE-80 Debug
Date Tue, 14 Apr 2015 01:40:57 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-80 c46f7e7cf -> 7668bde20


#IGNITE-80 Debug


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7668bde2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7668bde2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7668bde2

Branch: refs/heads/ignite-80
Commit: 7668bde207616c20540e65aabbb327fe8f1edbfb
Parents: c46f7e7
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Mon Apr 13 18:40:51 2015 -0700
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Mon Apr 13 18:40:51 2015 -0700

----------------------------------------------------------------------
 .../processors/cache/GridCacheIoManager.java    |  2 +-
 .../distributed/dht/GridDhtLockFuture.java      |  2 ++
 .../colocated/GridDhtColocatedLockFuture.java   |  3 ++
 .../GridDhtPartitionsExchangeFuture.java        |  4 +++
 .../distributed/near/GridNearLockFuture.java    |  3 ++
 .../apache/ignite/internal/util/GridDebug.java  | 29 ++++++++++++++------
 6 files changed, 33 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7668bde2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 9855283..bedfe55 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -95,7 +95,7 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
                 }
             }
             else {
-                U.debug(log, "Received unordered cache communication message [nodeId=" +
nodeId +
+                GridDebug.debug("Received unordered cache communication message [nodeId="
+ nodeId +
                     ", locId=" + cctx.localNodeId() + ", msg=" + msg + ']');
 
                 AffinityTopologyVersion locAffVer = cctx.exchange().readyAffinityVersion();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7668bde2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
index 82e7f83..e945e44 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLockFuture.java
@@ -690,6 +690,8 @@ public final class GridDhtLockFuture<K, V> extends GridCompoundIdentityFuture<Bo
         if (err.get() == null)
             loadMissingFromStore();
 
+        GridDebug.debug("Completing DHT lock future: " + this);
+
         if (super.onDone(success, err.get())) {
             if (log.isDebugEnabled())
                 log.debug("Completing future: " + this);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7668bde2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index 4c00b3f..ecd81a3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@ -29,6 +29,7 @@ import org.apache.ignite.internal.processors.cache.distributed.near.*;
 import org.apache.ignite.internal.processors.cache.transactions.*;
 import org.apache.ignite.internal.processors.cache.version.*;
 import org.apache.ignite.internal.processors.timeout.*;
+import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.future.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.*;
@@ -474,6 +475,8 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
         if (tx != null)
             cctx.tm().txContext(tx);
 
+        GridDebug.debug("Completing colocated lock future: " + this);
+
         if (super.onDone(success, err.get())) {
             if (log.isDebugEnabled())
                 log.debug("Completing future: " + this);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7668bde2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index a28f69c..0c178fc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -1236,6 +1236,10 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
                         return;
 
                     try {
+                        U.debug(log, "Dumping last messages...");
+
+                        GridDebug.dumpWithReset(log);
+
                         U.warn(log,
                             "Retrying preload partition exchange due to timeout [done=" +
isDone() +
                                 ", dummy=" + dummy + ", exchId=" + exchId + ", rcvdIds="
+ F.id8s(rcvdIds) +

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7668bde2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index 789fd93..84da367 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
@@ -28,6 +28,7 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.*;
 import org.apache.ignite.internal.processors.cache.transactions.*;
 import org.apache.ignite.internal.processors.cache.version.*;
 import org.apache.ignite.internal.processors.timeout.*;
+import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.future.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.*;
@@ -606,6 +607,8 @@ public final class GridNearLockFuture<K, V> extends GridCompoundIdentityFuture<B
         if (tx != null)
             cctx.tm().txContext(tx);
 
+        GridDebug.debug("Completing near lock future: " + this);
+
         if (super.onDone(success, err.get())) {
             if (log.isDebugEnabled())
                 log.debug("Completing future: " + this);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7668bde2/modules/core/src/main/java/org/apache/ignite/internal/util/GridDebug.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridDebug.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridDebug.java
index d686ca6..f782b9b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridDebug.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridDebug.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.util;
 
+import org.apache.ignite.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
@@ -33,6 +34,9 @@ import java.util.concurrent.atomic.*;
  * Utility class for debugging.
  */
 public class GridDebug {
+    /** Max queue size. */
+    public static final int MAX_SIZE = 2_000;
+
     /** */
     private static final AtomicReference<ConcurrentLinkedQueue<Item>> que =
         new AtomicReference<>(new ConcurrentLinkedQueue<Item>());
@@ -124,6 +128,9 @@ public class GridDebug {
 
         if (q != null)
             q.add(new Item(x));
+
+        if (q.size() > MAX_SIZE)
+            q.poll();
     }
 
     /**
@@ -175,8 +182,8 @@ public class GridDebug {
     /**
      * Dump collected data to stdout.
      */
-    public static void dump() {
-        dump(que.get());
+    public static void dump(@Nullable IgniteLogger log) {
+        dump(que.get(), log);
     }
 
     /**
@@ -185,7 +192,7 @@ public class GridDebug {
      * @param que Queue.
      */
     @SuppressWarnings("TypeMayBeWeakened")
-    public static void dump(ConcurrentLinkedQueue<Item> que) {
+    public static void dump(ConcurrentLinkedQueue<Item> que, @Nullable IgniteLogger
log) {
         if (que == null)
             return;
 
@@ -194,8 +201,12 @@ public class GridDebug {
         int x = 0;
 
         for (Item i : que) {
-            if (x++ > start)
-                System.out.println(i);
+            if (x++ > start) {
+                if (log == null)
+                    System.out.println(i);
+                else
+                    log.info(String.valueOf(i));
+            }
         }
     }
 
@@ -215,8 +226,8 @@ public class GridDebug {
      *
      * @return Empty string (useful for assertions like {@code assert x == 0 : D.dumpWithReset();}
).
      */
-    public static String dumpWithReset() {
-        return dumpWithReset(new ConcurrentLinkedQueue<Item>());
+    public static String dumpWithReset(@Nullable IgniteLogger log) {
+        return dumpWithReset(new ConcurrentLinkedQueue<Item>(), log);
     }
 
     /**
@@ -225,7 +236,7 @@ public class GridDebug {
      * @param q2 Queue.
      * @return Empty string.
      */
-    private static String dumpWithReset(@Nullable ConcurrentLinkedQueue<Item> q2) {
+    private static String dumpWithReset(@Nullable ConcurrentLinkedQueue<Item> q2, @Nullable
IgniteLogger log) {
         ConcurrentLinkedQueue<Item> q;
 
         do {
@@ -236,7 +247,7 @@ public class GridDebug {
         }
         while (!que.compareAndSet(q, q2));
 
-        dump(q);
+        dump(q, log);
 
         return "";
     }


Mime
View raw message