ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [2/2] ignite git commit: debug info
Date Wed, 03 May 2017 17:32:00 GMT
debug info


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

Branch: refs/heads/ignite-gg-8.0.3.ea6-clients-test
Commit: 7ed97f4fc694c6b3fe831ec8b34863c8e71f4647
Parents: a81d2f5
Author: sboikov <sboikov@gridgain.com>
Authored: Wed May 3 20:17:03 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed May 3 20:17:03 2017 +0300

----------------------------------------------------------------------
 .../internal/IgniteDiagnosticMessage.java       | 27 ++++++++++++++++++++
 .../GridDhtPartitionsExchangeFuture.java        |  4 +--
 .../processors/cluster/ClusterProcessor.java    |  7 +++++
 3 files changed, 36 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7ed97f4f/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java
index 7419520..4aef04e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteDiagnosticMessage.java
@@ -18,11 +18,13 @@
 package org.apache.ignite.internal;
 
 import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.GridCacheMapEntry;
 import org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager;
 import org.apache.ignite.internal.processors.cache.KeyCacheObject;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtTopologyFuture;
+import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -37,6 +39,7 @@ import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 import java.util.UUID;
 
 /**
@@ -284,6 +287,30 @@ public class IgniteDiagnosticMessage implements Message {
             return sb.toString();
         }
     }
+    public static class ExchangeInfoClosure extends BaseClosure {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** */
+        private final AffinityTopologyVersion topVer;
+
+        public ExchangeInfoClosure(GridKernalContext ctx, AffinityTopologyVersion topVer)
{
+            super(ctx);
+
+            this.topVer = topVer;
+        }
+
+        @Override protected String dumpInfo(GridKernalContext ctx) {
+            List<GridDhtPartitionsExchangeFuture> futs = ctx.cache().context().exchange().exchangeFutures();
+
+            for (GridDhtPartitionsExchangeFuture fut : futs) {
+                if (topVer.equals(fut.topologyVersion()))
+                    return "Exchange future: " + fut;
+            }
+
+            return "Failed to find exchange future: " + topVer;
+        }
+    }
 
     public static String dumpNodeBasicInfo(GridKernalContext ctx) {
         StringBuilder sb = new StringBuilder("General node info [id=").append(ctx.localNodeId());

http://git-wip-us.apache.org/repos/asf/ignite/blob/7ed97f4f/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 afb0bcf..78399b2 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
@@ -2337,13 +2337,13 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
 
             if (crd != null) {
                 if (!crd.isLocal()) {
-                    cctx.kernalContext().cluster().dumpBasicInfo(crd.id(), "Exchange future
waiting for coordinator " +
+                    cctx.kernalContext().cluster().dumpExchangeInfo(crd.id(), topologyVersion(),
"Exchange future waiting for coordinator " +
                         "response [crd=" + crd.id() + ", topVer=" + topologyVersion() + ']');
                 }
                 else if (!remaining.isEmpty()){
                     UUID nodeId = remaining.iterator().next();
 
-                    cctx.kernalContext().cluster().dumpBasicInfo(crd.id(), "Exchange future
waiting for server " +
+                    cctx.kernalContext().cluster().dumpExchangeInfo(crd.id(), topologyVersion(),
"Exchange future waiting for server " +
                         "response [node=" + nodeId + ", topVer=" + topologyVersion() + ']');
                 }
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7ed97f4f/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
index 813b039..5fcf38d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
@@ -46,6 +46,7 @@ import org.apache.ignite.internal.managers.communication.GridIoPolicy;
 import org.apache.ignite.internal.managers.communication.GridMessageListener;
 import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener;
 import org.apache.ignite.internal.processors.GridProcessorAdapter;
+import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.KeyCacheObject;
 import org.apache.ignite.internal.util.GridTimerTask;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
@@ -302,6 +303,12 @@ public class ClusterProcessor extends GridProcessorAdapter {
         listenAndLog(fut);
     }
 
+    public void dumpExchangeInfo(final UUID nodeId, AffinityTopologyVersion topVer, final
String msg) {
+        IgniteInternalFuture<String> fut = diagnosticInfo(nodeId, new IgniteDiagnosticMessage.ExchangeInfoClosure(ctx,
topVer), msg);
+
+        listenAndLog(fut);
+    }
+
     private void listenAndLog(IgniteInternalFuture<String> fut) {
         fut.listen(new CI1<IgniteInternalFuture<String>>() {
             @Override public void apply(IgniteInternalFuture<String> msgFut) {


Mime
View raw message