ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: ignite-6467
Date Sat, 28 Jul 2018 13:23:52 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-6467 21262b9d0 -> 7d0c1a4f0


ignite-6467


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

Branch: refs/heads/ignite-6467
Commit: 7d0c1a4f03d93e6d3c47f1bbce90399c52c72750
Parents: 21262b9
Author: sboikov <sboikov@apache.org>
Authored: Sat Jul 28 16:22:48 2018 +0300
Committer: sboikov <sboikov@apache.org>
Committed: Sat Jul 28 16:22:48 2018 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/TestDebugLog1.java   | 51 +++++++++++++++++++-
 .../dht/GridDhtPartitionTopologyImpl.java       |  3 ++
 2 files changed, 52 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7d0c1a4f/modules/core/src/main/java/org/apache/ignite/TestDebugLog1.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/TestDebugLog1.java b/modules/core/src/main/java/org/apache/ignite/TestDebugLog1.java
index dc59767..38aad97 100644
--- a/modules/core/src/main/java/org/apache/ignite/TestDebugLog1.java
+++ b/modules/core/src/main/java/org/apache/ignite/TestDebugLog1.java
@@ -159,6 +159,44 @@ public class TestDebugLog1 {
         }
     }
 
+    static class CacheMessage extends Message {
+        private final int cacheId;
+        private Object val;
+
+        public CacheMessage(int cacheId, Object val, String msg) {
+            super(msg);
+
+            this.cacheId = cacheId;
+            this.val = val;
+            this.msg = msg;
+        }
+
+        @Override public boolean equals(Object o) {
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+
+            PartMessage partKey = (PartMessage) o;
+
+            if (cacheId != partKey.cacheId) return false;
+            return true;
+
+        }
+
+        @Override public int hashCode() {
+            int result = cacheId;
+            return result;
+        }
+
+        public String toString() {
+            return "CacheMessage [" +
+                    "val=" + val +
+                    ", msg=" + msg +
+                    ", thread=" + thread +
+                    ", time=" + DEBUG_DATE_FMT.format(new Date(ts)) +
+                    ", cacheId=" + cacheId + ']';
+        }
+    }
+
     static final boolean out = false;
 
     public static void addPageMessage(long pageId, String msg) {
@@ -185,6 +223,10 @@ public class TestDebugLog1 {
             System.out.println(msg);
     }
 
+    public static void addCacheMessage(int cacheId, Object val, String msg) {
+        msgs.add(new CacheMessage(cacheId, val, msg));
+    }
+
     public static void addCacheEntryMessage(GridCacheMapEntry e, CacheObject val, String
msg) {
         addEntryMessage(e.context().cacheId(), e.key().value(e.context().cacheObjectContext(),
false),
                 val != null ? val.value(e.context().cacheObjectContext(), false) : null,
msg);
@@ -472,14 +514,19 @@ public class TestDebugLog1 {
                     if (em.cacheId != cacheId || !em.key.equals(key))
                         continue;
                 }
-
-                if (msg instanceof PartMessage) {
+                else if (msg instanceof PartMessage) {
                     PartMessage pm = (PartMessage)msg;
 
                     if (pm.cacheId != cacheId || pm.partId != partId)
                         continue;
+                } else if (msg instanceof CacheMessage) {
+                    CacheMessage em = (CacheMessage)msg;
+
+                    if (em.cacheId != cacheId)
+                        continue;
                 }
 
+
                 System.out.println(msg);
             }
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/7d0c1a4f/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 aa43b2f..2ffd49e 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
@@ -34,6 +34,7 @@ import java.util.stream.Collectors;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.TestDebugLog1;
 import org.apache.ignite.cache.PartitionLossPolicy;
 import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.events.DiscoveryEvent;
@@ -2788,6 +2789,8 @@ public class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
                     return;
             }
 
+            TestDebugLog1.addCacheMessage(grp.groupId(), readyTopVer, "rebalanced");
+
             rebalancedTopVer = readyTopVer;
 
             if (log.isDebugEnabled())


Mime
View raw message