ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [08/21] incubator-ignite git commit: ignite-446
Date Thu, 23 Apr 2015 10:40:29 GMT
ignite-446


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

Branch: refs/heads/ignite-sprint-4
Commit: 921a40c5235cf5e7c96e1051a4dd9650f8f0ff0e
Parents: d41b19d
Author: avinogradov <avinogradov@gridgain.com>
Authored: Wed Apr 15 17:20:51 2015 +0300
Committer: avinogradov <avinogradov@gridgain.com>
Committed: Wed Apr 15 17:20:51 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/cluster/ClusterNode.java    |  1 -
 .../dht/atomic/GridNearAtomicUpdateFuture.java    |  1 +
 .../dht/colocated/GridDhtColocatedLockFuture.java |  2 ++
 .../GridDhtPartitionsExchangeFuture.java          |  2 +-
 .../distributed/near/GridNearLockFuture.java      |  1 +
 .../distributed/near/GridNearTxPrepareFuture.java |  1 +
 .../IgniteTopologyValidatorAbstractCacheTest.java | 18 ++++++++++++++----
 ...gniteTopologyValidatorAbstractTxCacheTest.java |  2 +-
 8 files changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java b/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java
index 9de59a3..9cb5d3d 100644
--- a/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java
+++ b/modules/core/src/main/java/org/apache/ignite/cluster/ClusterNode.java
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
 import org.apache.ignite.lang.*;
 import org.jetbrains.annotations.*;
 
-import java.io.Serializable;
 import java.util.*;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 0ed625a..72fb346 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -431,6 +431,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
                 if (!fut.isCacheTopologyValid(cctx))   {
                     onDone(new IgniteCheckedException("Failed to perform cache operation
(cache topology is not valid): " +
                         cctx.name()));
+
                     return;
                 }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index 0a54e07..fdb9505 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@ -554,6 +554,7 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
             if (cctx.topology().stopping()) {
                 onDone(new IgniteCheckedException("Failed to perform cache operation (cache
is stopped): " +
                     cctx.name()));
+
                 return;
             }
 
@@ -563,6 +564,7 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
                 if (!fut.isCacheTopologyValid(cctx))   {
                     onDone(new IgniteCheckedException("Failed to perform cache operation
(cache topology is not valid): " +
                         cctx.name()));
+
                     return;
                 }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/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 5288ae5..6633b5c 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
@@ -839,7 +839,7 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
         Map<Integer, Boolean> m = new HashMap<>();
 
         for (GridCacheContext cacheCtx : cctx.cacheContexts()) {
-            if (!CU.isSystemCache(cacheCtx.name()) && (cacheCtx.config().getTopologyValidator()
!= null))
+            if (cacheCtx.config().getTopologyValidator() != null && !CU.isSystemCache(cacheCtx.name()))
                 m.put(cacheCtx.cacheId(), cacheCtx.config().getTopologyValidator().validate(discoEvt.topologyNodes()));
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
index 8f3e476..39820b6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearLockFuture.java
@@ -696,6 +696,7 @@ public final class GridNearLockFuture<K, V> extends GridCompoundIdentityFuture<B
                 if (!fut.isCacheTopologyValid(cctx))   {
                     onDone(new IgniteCheckedException("Failed to perform cache operation
(cache topology is not valid): " +
                         cctx.name()));
+
                     return;
                 }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
index 5791df5..20330f6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxPrepareFuture.java
@@ -345,6 +345,7 @@ public final class GridNearTxPrepareFuture<K, V> extends GridCompoundIdentityFut
                     if (!topFut.isCacheTopologyValid(ctx)) {
                         onDone(new IgniteCheckedException("Failed to perform cache operation
(cache topology is not valid): " +
                             ctx.name()));
+
                         return;
                     }
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractCacheTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractCacheTest.java
index b3b1d7e..55e3c1b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractCacheTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractCacheTest.java
@@ -30,6 +30,9 @@ import java.util.*;
  * Topology validator test
  */
 public abstract class IgniteTopologyValidatorAbstractCacheTest extends IgniteCacheAbstractTest
implements Serializable {
+    /** key-value used at test */
+    protected static String KEY_VALUE = "1";
+
     /** {@inheritDoc} */
     @Override protected int gridCount() {
         return 1;
@@ -51,13 +54,15 @@ public abstract class IgniteTopologyValidatorAbstractCacheTest extends
IgniteCac
     }
 
     /**
-     * Puts before validator passed.
+     * Puts before topology is valid.
      */
     protected void putBefore(Transaction tx) {
         try {
-            jcache().put("1", "1");
+            jcache().put(KEY_VALUE, KEY_VALUE);
+
             if (tx != null)
                 tx.commit();
+
             assert false : "topology validation broken";
         }
         catch (IgniteException | CacheException ex) {
@@ -66,13 +71,18 @@ public abstract class IgniteTopologyValidatorAbstractCacheTest extends
IgniteCac
     }
 
     /**
-     * Puts when validator passed.
+     * Puts when topology is valid.
      */
     protected void putAfter(Transaction tx) {
         try {
-            jcache().put("1", "1");
+            assert jcache().get(KEY_VALUE) == null;
+
+            jcache().put(KEY_VALUE, KEY_VALUE);
+
             if (tx != null)
                 tx.commit();
+
+            assert jcache().get(KEY_VALUE).equals(KEY_VALUE);
         }
         catch (IgniteException | CacheException ex) {
             assert false : "topology validation broken";

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/921a40c5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractTxCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractTxCacheTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractTxCacheTest.java
index 7fe91b8..eee4d5e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractTxCacheTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTopologyValidatorAbstractTxCacheTest.java
@@ -55,7 +55,7 @@ public abstract class IgniteTopologyValidatorAbstractTxCacheTest extends
IgniteT
             putAfter(tx);
         }
 
-        jcache().remove("1");
+        jcache().remove(KEY_VALUE);
 
         try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC,
TransactionIsolation.REPEATABLE_READ)) {
             putAfter(tx);


Mime
View raw message