ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [11/50] [abbrv] incubator-ignite git commit: IGNITE-45 - Fixed assertions from example.
Date Fri, 20 Mar 2015 15:48:06 GMT
IGNITE-45 - Fixed assertions from example.


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

Branch: refs/heads/ignite-525
Commit: 074d6dd9ce21cd4628a5543df6582dbf69419f32
Parents: be6cfe3
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Thu Mar 19 13:43:57 2015 -0700
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Thu Mar 19 13:43:57 2015 -0700

----------------------------------------------------------------------
 .../discovery/GridDiscoveryManager.java         | 22 +-------------------
 .../affinity/AffinityTopologyVersion.java       |  7 +++++++
 .../processors/cache/GridCacheProcessor.java    | 10 ++++++---
 .../GridDhtPartitionsExchangeFuture.java        |  2 +-
 4 files changed, 16 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/074d6dd9/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 7585008..934de63 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -928,27 +928,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
     public boolean alive(UUID nodeId) {
         assert nodeId != null;
 
-        boolean alive = getSpi().getNode(nodeId) != null; // Go directly to SPI without checking
disco cache.
-
-        // Refresh disco cache if some node died.
-        if (!alive) {
-            while (true) {
-                Snapshot snap = topSnap.get();
-                DiscoCache c = snap.discoCache;
-
-                if (c == null)
-                    return false;
-
-                if (c.node(nodeId) != null) {
-                    if (topSnap.compareAndSet(snap, null))
-                        break;
-                }
-                else
-                    break;
-            }
-        }
-
-        return alive;
+        return getSpi().getNode(nodeId) != null; // Go directly to SPI without checking disco
cache.
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/074d6dd9/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java
index 9583215..77f3359 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/AffinityTopologyVersion.java
@@ -82,6 +82,13 @@ public class AffinityTopologyVersion implements Comparable<AffinityTopologyVersi
         this.topVer = topVer;
     }
 
+    /**
+     * @return Minor topology version.
+     */
+    public int minorTopologyVersion() {
+        return minorTopVer;
+    }
+
     /** {@inheritDoc} */
     @Override public int compareTo(AffinityTopologyVersion o) {
         int cmp = Long.compare(topVer, o.topVer);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/074d6dd9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index 46fef6b..2ecb96a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -1370,12 +1370,16 @@ public class GridCacheProcessor extends GridProcessorAdapter {
      * @param reqs Change requests.
      */
     @SuppressWarnings("unchecked")
-    public void onExchangeDone(AffinityTopologyVersion topVer, Collection<DynamicCacheChangeRequest>
reqs) {
+    public void onExchangeDone(
+        AffinityTopologyVersion topVer,
+        Collection<DynamicCacheChangeRequest> reqs,
+        Throwable err
+    ) {
         for (GridCacheAdapter<?, ?> cache : caches.values()) {
             GridCacheContext<?, ?> cacheCtx = cache.context();
 
             if (F.eq(cacheCtx.startTopologyVersion(), topVer)) {
-                cacheCtx.preloader().onInitialExchangeComplete(null);
+                cacheCtx.preloader().onInitialExchangeComplete(err);
 
                 String masked = maskNull(cacheCtx.name());
 
@@ -1383,7 +1387,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
             }
         }
 
-        if (!F.isEmpty(reqs)) {
+        if (!F.isEmpty(reqs) && err == null) {
             for (DynamicCacheChangeRequest req : reqs) {
                 String masked = maskNull(req.cacheName());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/074d6dd9/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 73c7418..bab9f57 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
@@ -705,7 +705,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
 
     /** {@inheritDoc} */
     @Override public boolean onDone(AffinityTopologyVersion res, Throwable err) {
-        cctx.cache().onExchangeDone(exchId.topologyVersion(), reqs);
+        cctx.cache().onExchangeDone(exchId.topologyVersion(), reqs, err);
 
         cctx.exchange().onExchangeDone(this, err);
 


Mime
View raw message