ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject ignite git commit: Fixed method GridDhtPartitionTopologyImpl.updateCounters (counters were not sent to joining node).
Date Mon, 09 Jan 2017 14:08:39 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-3477 5c6fb554c -> 025e6ee10


Fixed method GridDhtPartitionTopologyImpl.updateCounters (counters were not sent to joining
node).


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

Branch: refs/heads/ignite-3477
Commit: 025e6ee10e459883fb660f1c31bdfdb61f3ca124
Parents: 5c6fb55
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Jan 9 17:08:42 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Jan 9 17:08:42 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/IgniteCacheOffheapManager.java      |  2 +-
 .../processors/cache/IgniteCacheOffheapManagerImpl.java  |  4 ++--
 .../cache/distributed/dht/GridDhtLocalPartition.java     |  4 +++-
 .../distributed/dht/GridDhtPartitionTopologyImpl.java    | 11 ++++-------
 .../CacheContinuousQueryFailoverAbstractSelfTest.java    |  2 +-
 5 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/025e6ee1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
index c1d8299..f01f0ff 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManager.java
@@ -291,7 +291,7 @@ public interface IgniteCacheOffheapManager extends GridCacheManager {
         /**
          * @return Initial update counter.
          */
-        public long initialUpdateCounter();
+        public Long initialUpdateCounter();
 
         /**
          * @param key Key.

http://git-wip-us.apache.org/repos/asf/ignite/blob/025e6ee1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
index 6f37511..a72f946 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheOffheapManagerImpl.java
@@ -818,7 +818,7 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
         protected final AtomicLong storageSize = new AtomicLong();
 
         /** Initialized update counter. */
-        protected long initCntr;
+        protected Long initCntr = 0L;
 
         /**
          * @param name Name.
@@ -1009,7 +1009,7 @@ public class IgniteCacheOffheapManagerImpl extends GridCacheManagerAdapter
imple
         }
 
         /** {@inheritDoc} */
-        @Override public long initialUpdateCounter() {
+        @Override public Long initialUpdateCounter() {
             return initCntr;
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/025e6ee1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index 1b913a3..598e1c2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -847,7 +847,7 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
     /**
      * @return Initial update counter.
      */
-    public long initialUpdateCounter() {
+    public Long initialUpdateCounter() {
         return store.initialUpdateCounter();
     }
 
@@ -864,6 +864,8 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
 
     /**
      * Clears values for this partition.
+     *
+     * @throws NodeStoppingException If node stopping.
      */
     public void clearAll() throws NodeStoppingException {
         GridCacheVersion clearVer = cctx.versions().next();

http://git-wip-us.apache.org/repos/asf/ignite/blob/025e6ee1/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 820d3cd..ae33fa7 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
@@ -1895,17 +1895,14 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology
{
             for (int i = 0; i < locParts.length(); i++) {
                 GridDhtLocalPartition part = locParts.get(i);
 
-                if (part == null)
+                if (part == null || (skipZeros && part.updateCounter() == 0L))
                     continue;
 
                 T2<Long, Long> cntr0 = res.get(part.id());
-                Long cntr1 = part.initialUpdateCounter();
-
-                if (skipZeros && cntr1 == 0L)
-                    continue;
+                Long initCntr = part.initialUpdateCounter();
 
-                if (cntr0 == null || cntr1 > cntr0.get1())
-                    res.put(part.id(), new T2<>(cntr1, part.updateCounter()));
+                if (cntr0 == null || initCntr >= cntr0.get1())
+                    res.put(part.id(), new T2<>(initCntr, part.updateCounter()));
             }
 
             return res;

http://git-wip-us.apache.org/repos/asf/ignite/blob/025e6ee1/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java
index 3890ce2..afa7005 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java
@@ -541,7 +541,7 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends
GridC
 
             for (Map.Entry<Integer, Long> e : updCntrs.entrySet()) {
                 if (aff.mapPartitionToPrimaryAndBackups(e.getKey()).contains(grid(i).localNode()))
-                    assertEquals(e.getValue(), act.get(e.getKey()));
+                    assertEquals(e.getValue(), act.get(e.getKey()).get2());
             }
         }
 


Mime
View raw message