ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: debug
Date Tue, 01 Aug 2017 15:32:44 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-5578-debug 3ec06329d -> b52359dc4


debug


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

Branch: refs/heads/ignite-5578-debug
Commit: b52359dc495ae23d5cce1da35a185a9d90f08484
Parents: 3ec0632
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Aug 1 18:32:33 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Aug 1 18:32:33 2017 +0300

----------------------------------------------------------------------
 .../dht/GridDhtPartitionTopologyImpl.java       | 51 +++++++++++++++++++-
 1 file changed, 50 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b52359dc/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index 222ab91..3baa88e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -1279,6 +1279,17 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
 
             node2part = partMap;
 
+            if ("default".equals(grp.cacheOrGroupName())) {
+                for (Map.Entry<UUID, GridDhtPartitionMap> e : node2part.entrySet())
{
+                    GridDhtPartitionMap parts = e.getValue();
+
+                    String msg = "update full " + parts.nodeId() + " " + exchangeResVer;
+
+                    for (Integer p : parts.keySet())
+                        TestDebugLog.addPartMessage(p, parts.get(p), msg);
+                }
+            }
+
             if (readyTopVer.initialized() && readyTopVer.compareTo(diffFromAffinityVer)
>= 0) {
                 AffinityAssignment affAssignment = grp.affinity().readyAffinity(readyTopVer);
 
@@ -1306,6 +1317,8 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
                 }
 
                 diffFromAffinityVer = readyTopVer;
+
+                debugDiff("updateFull");
             }
 
             boolean changed = false;
@@ -1538,6 +1551,13 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
 
             node2part.put(parts.nodeId(), parts);
 
+            if ("default".equals(grp.cacheOrGroupName())) {
+                String msg = "update single " + parts.nodeId() + " " + exchId;
+
+                for (Integer p : parts.keySet())
+                    TestDebugLog.addPartMessage(p, parts.get(p), msg);
+            }
+
             // During exchange calculate diff after all messages are received and affinity
initialized.
             if (exchId == null) {
                 if (readyTopVer.initialized() && readyTopVer.compareTo(diffFromAffinityVer)
>= 0) {
@@ -1582,6 +1602,8 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
                     }
 
                     diffFromAffinityVer = readyTopVer;
+
+                    debugDiff("updateSingle");
                 }
             }
 
@@ -1699,9 +1721,28 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
                     }
                 }
             }
+
+
         }
 
         diffFromAffinityVer = affAssignment.topologyVersion();
+
+        debugDiff("rebuildDiff");
+    }
+
+    private void debugDiff(String msg) {
+        if ("default".equals(grp.cacheOrGroupName())) {
+            if (F.isEmpty(diffFromAffinity)) {
+                TestDebugLog.addMessage("Update diff, empty " + msg + " " + diffFromAffinityVer);
+            }
+            else {
+                TestDebugLog.addMessage("Update diff " + msg + " " + diffFromAffinityVer);
+
+                for (Map.Entry<Integer, Set<UUID>> e : diffFromAffinity.entrySet())
{
+                    TestDebugLog.addPartMessage(e.getKey(), e.getValue(), msg);
+                }
+            }
+        }
     }
 
     /** {@inheritDoc} */
@@ -2028,6 +2069,8 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
             }
         }
 
+        boolean diff = false;
+
         if (node2part != null) {
             UUID locNodeId = ctx.localNodeId();
 
@@ -2053,14 +2096,20 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
                 if (!assignment.getIds(p).contains(ctx.localNodeId())) {
                     Set<UUID> diffIds = diffFromAffinity.get(p);
 
-                    if (diffIds == null)
+                    if (diffIds == null) {
+                        diff = true;
+
                         diffFromAffinity.put(p, diffIds = U.newHashSet(3));
+                    }
 
                     diffIds.add(ctx.localNodeId());
                 }
             }
         }
 
+        if (diff)
+            debugDiff("updateLocal");
+
         return updateSeq;
     }
 


Mime
View raw message