You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/06/18 12:16:40 UTC

[01/50] incubator-ignite git commit: # ignite-sprint-6 tests fixes

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-917-review 6a7754335 -> a3616c2da


# ignite-sprint-6 tests fixes


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

Branch: refs/heads/ignite-917-review
Commit: e3750b78c9fa6b50bee2b35506c706ac4b79126e
Parents: f2c4cc8
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 16 16:45:27 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 16 16:52:04 2015 +0300

----------------------------------------------------------------------
 .../GridDiscoveryManagerAliveCacheSelfTest.java | 17 ++++++---
 .../distributed/IgniteCacheManyClientsTest.java | 11 +++---
 .../GridCachePartitionedTxSalvageSelfTest.java  | 37 +++-----------------
 3 files changed, 24 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e3750b78/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
index ba61890..6e199b8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
@@ -195,8 +195,11 @@ public class GridDiscoveryManagerAliveCacheSelfTest extends GridCommonAbstractTe
      */
     @SuppressWarnings("SuspiciousMethodCalls")
     private void validateAlives() {
-        for (Ignite g : alive)
-            assertEquals(PERM_NODES_CNT, g.cluster().nodes().size());
+        for (Ignite g : alive) {
+            log.info("Validate node: " + g.name());
+
+            assertEquals("Unexpected nodes number for node: " + g.name(), PERM_NODES_CNT, g.cluster().nodes().size());
+        }
 
         for (final Ignite g : alive) {
             IgniteKernal k = (IgniteKernal)g;
@@ -222,8 +225,14 @@ public class GridDiscoveryManagerAliveCacheSelfTest extends GridCommonAbstractTe
                         }
                     });
 
-                assertTrue(
-                    currTop.contains(GridCacheUtils.oldestAliveCacheServerNode(k.context().cache().context(), new AffinityTopologyVersion(currVer))));
+                GridCacheSharedContext<?, ?> ctx = k.context().cache().context();
+
+                ClusterNode oldest =
+                    GridCacheUtils.oldestAliveCacheServerNode(ctx, new AffinityTopologyVersion(currVer));
+
+                assertNotNull(oldest);
+
+                assertTrue(currTop.contains(oldest));
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e3750b78/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
index 947ded2..c3223a2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
@@ -160,10 +160,13 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
 
         log.info("All clients started.");
 
-        checkNodes(SRVS + CLIENTS);
-
-        for (Ignite client : clients)
-            client.close();
+        try {
+            checkNodes(SRVS + CLIENTS);
+        }
+        finally {
+            for (Ignite client : clients)
+                client.close();
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e3750b78/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
index 6192f39..c1a19a4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
 import org.apache.ignite.cache.affinity.rendezvous.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.affinity.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.cache.transactions.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
@@ -147,8 +146,7 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
      * Check whether caches has no transactions after salvage timeout.
      *
      * @param mode Transaction mode (PESSIMISTIC, OPTIMISTIC).
-     * @param prepare Whether to prepare transaction state
-     *                (i.e. call {@link IgniteInternalTx#prepare()}).
+     * @param prepare Whether to prepare transaction state (i.e. call {@link IgniteInternalTx#prepare()}).
      * @throws Exception If failed.
      */
     private void checkSalvageAfterTimeout(TransactionConcurrency mode, boolean prepare) throws Exception {
@@ -193,14 +191,13 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
      * Start new transaction on the grid(0) and put some keys to it.
      *
      * @param mode Transaction mode (PESSIMISTIC, OPTIMISTIC).
-     * @param prepare Whether to prepare transaction state
-     *                (i.e. call {@link IgniteInternalTx#prepare()}).
+     * @param prepare Whether to prepare transaction state (i.e. call {@link IgniteInternalTx#prepare()}).
      * @throws Exception If failed.
      */
     private void startTxAndPutKeys(final TransactionConcurrency mode, final boolean prepare) throws Exception {
         Ignite ignite = grid(0);
 
-        final Collection<Integer> keys = nearKeys(ignite);
+        final Collection<Integer> keys = nearKeys(ignite.cache(null), KEY_CNT, 0);
 
         IgniteInternalFuture<?> fut = multithreadedAsync(new Runnable() {
             @Override public void run() {
@@ -239,31 +236,6 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
     }
 
     /**
-     * Gets keys that are not primary nor backup for node.
-     *
-     * @param ignite Grid.
-     * @return Collection of keys.
-     */
-    private Collection<Integer> nearKeys(Ignite ignite) {
-        final Collection<Integer> keys = new ArrayList<>(KEY_CNT);
-
-        IgniteKernal kernal = (IgniteKernal) ignite;
-
-        GridCacheAffinityManager affMgr = kernal.internalCache().context().affinity();
-
-        for (int i = 0; i < KEY_CNT * GRID_CNT * 1.5; i++) {
-            if (!affMgr.localNode((Object)i, new AffinityTopologyVersion(kernal.context().discovery().topologyVersion()))) {
-                keys.add(i);
-
-                if (keys.size() == KEY_CNT)
-                    break;
-            }
-        }
-
-        return keys;
-    }
-
-    /**
      * Checks that transaction manager for cache context does not have any pending transactions.
      *
      * @param ctx Cache context.
@@ -283,7 +255,6 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
     private void checkTxsNotEmpty(GridCacheContext ctx, int exp) {
         int size = ctx.tm().txs().size();
 
-        assert size == exp : "Some transactions were salvaged unexpectedly: " + exp +
-            " expected, but only " + size + " found.";
+        assertEquals("Some transactions were salvaged unexpectedly", exp, size);
     }
 }


[29/50] incubator-ignite git commit: # i-484-1 review

Posted by sb...@apache.org.
# i-484-1 review


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

Branch: refs/heads/ignite-917-review
Commit: 642f1c7a2786fd95a43d97cc5b0d955ad890f0c4
Parents: 0b8587b
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Wed Jun 17 15:14:16 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Wed Jun 17 15:14:16 2015 +0300

----------------------------------------------------------------------
 .../dht/GridDhtPartitionsReservation.java       |  3 +-
 .../cache/query/GridCacheTwoStepQuery.java      | 10 +++----
 .../IgniteCacheQueryNodeRestartSelfTest.java    |  3 +-
 .../IgniteCacheQueryNodeRestartSelfTest2.java   | 30 ++++++++++++++------
 4 files changed, 30 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/642f1c7a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
index aced999..207c7f5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
@@ -218,7 +218,8 @@ public class GridDhtPartitionsReservation implements GridReservable {
 
         // Unregister from partitions.
         if (!F.isEmpty(arr) && parts.compareAndSet(arr, EMPTY)) {
-            // Reverse order makes sure that addReservation on the same topVer reservation will fail on the first partition.
+            // Reverse order makes sure that addReservation on the same topVer
+            // reservation will fail on the first partition.
             for (int i = arr.length - 1; i >= 0; i--) {
                 GridDhtLocalPartition part = arr[i];
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/642f1c7a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java
index 1aa5890..1dacd10 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheTwoStepQuery.java
@@ -117,11 +117,6 @@ public class GridCacheTwoStepQuery {
         return mapQrys.values();
     }
 
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridCacheTwoStepQuery.class, this);
-    }
-
     /**
      * @return Spaces.
      */
@@ -135,4 +130,9 @@ public class GridCacheTwoStepQuery {
     public void spaces(Set<String> spaces) {
         this.spaces = spaces;
     }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridCacheTwoStepQuery.class, this);
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/642f1c7a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java
index d729e4a..5c87603 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest.java
@@ -39,6 +39,7 @@ import java.util.concurrent.atomic.*;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.*;
 import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CacheRebalanceMode.*;
 
 /**
  * Test for distributed queries with node restarts.
@@ -84,7 +85,7 @@ public class IgniteCacheQueryNodeRestartSelfTest extends GridCacheAbstractSelfTe
         cc.setBackups(1);
         cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
         cc.setAtomicityMode(TRANSACTIONAL);
-        cc.setRebalanceMode(CacheRebalanceMode.SYNC);
+        cc.setRebalanceMode(SYNC);
         cc.setAffinity(new RendezvousAffinityFunction(false, 15));
         cc.setIndexedTypes(
             Integer.class, Integer.class

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/642f1c7a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
index 527dfea..93831cc 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.internal.processors.cache.distributed.near;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.affinity.*;
 import org.apache.ignite.cache.affinity.rendezvous.*;
 import org.apache.ignite.cache.query.*;
@@ -40,6 +39,8 @@ import java.util.concurrent.atomic.*;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.*;
 import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CacheRebalanceMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
 
 /**
  * Test for distributed queries with node restarts.
@@ -95,9 +96,9 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
             cc.setName(name);
             cc.setCacheMode(PARTITIONED);
             cc.setBackups(2);
-            cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+            cc.setWriteSynchronizationMode(FULL_SYNC);
             cc.setAtomicityMode(TRANSACTIONAL);
-            cc.setRebalanceMode(CacheRebalanceMode.SYNC);
+            cc.setRebalanceMode(SYNC);
             cc.setAffinity(new RendezvousAffinityFunction(false, 60));
 
             if (name.equals("pe")) {
@@ -119,9 +120,9 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
 
             cc.setName(name);
             cc.setCacheMode(REPLICATED);
-            cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+            cc.setWriteSynchronizationMode(FULL_SYNC);
             cc.setAtomicityMode(TRANSACTIONAL);
-            cc.setRebalanceMode(CacheRebalanceMode.SYNC);
+            cc.setRebalanceMode(SYNC);
             cc.setAffinity(new RendezvousAffinityFunction(false, 50));
 
             if (name.equals("co")) {
@@ -143,6 +144,9 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
         return c;
     }
 
+    /**
+     *
+     */
     private void fillCaches() {
         IgniteCache<Integer, Company> co = grid(0).cache("co");
 
@@ -172,8 +176,6 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
     }
 
     /**
-     * JUnit.
-     *
      * @throws Exception If failed.
      */
     public void testRestarts() throws Exception {
@@ -323,7 +325,9 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
         info("Queries stopped.");
     }
 
-    // Partitioned
+    /**
+     *
+     */
     private static class Person implements Serializable {
         @QuerySqlField(index = true)
         int id;
@@ -333,6 +337,9 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
         }
     }
 
+    /**
+     *
+     */
     private static class Purchase implements Serializable {
         @QuerySqlField(index = true)
         int personId;
@@ -346,7 +353,9 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
         }
     }
 
-    // Replicated
+    /**
+     *
+     */
     private static class Company implements Serializable {
         @QuerySqlField(index = true)
         int id;
@@ -356,6 +365,9 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
         }
     }
 
+    /**
+     *
+     */
     private static class Product implements Serializable {
         @QuerySqlField(index = true)
         int id;


[02/50] incubator-ignite git commit: Minor correction to interop start procedure: add optional pointer to additional data required for startup

Posted by sb...@apache.org.
Minor correction to interop start procedure: add optional pointer to additional data required for startup


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

Branch: refs/heads/ignite-917-review
Commit: ae188c708854d62fcd586994b83726e8d1db93b1
Parents: e3750b7
Author: ptupitsyn <pt...@gridgain.com>
Authored: Tue Jun 16 17:04:45 2015 +0300
Committer: ptupitsyn <pt...@gridgain.com>
Committed: Tue Jun 16 17:04:45 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/interop/InteropBootstrap.java    | 3 ++-
 .../org/apache/ignite/internal/interop/InteropIgnition.java     | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ae188c70/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java
index 820bef9..df5af6c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java
@@ -28,7 +28,8 @@ public interface InteropBootstrap {
      *
      * @param cfg Configuration.
      * @param envPtr Environment pointer.
+     * @param dataPtr Optional pointer to additional data required for startup.
      * @return Ignite node.
      */
-    public InteropProcessor start(IgniteConfiguration cfg, long envPtr);
+    public InteropProcessor start(IgniteConfiguration cfg, long envPtr, long dataPtr);
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ae188c70/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
index 96639cd..fb0d6e1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
@@ -45,10 +45,11 @@ public class InteropIgnition {
      * @param gridName Grid name.
      * @param factoryId Factory ID.
      * @param envPtr Environment pointer.
+     * @param dataPtr Optional pointer to additional data required for startup.
      * @return Ignite instance.
      */
     public static synchronized InteropProcessor start(@Nullable String springCfgPath, @Nullable String gridName,
-        int factoryId, long envPtr) {
+        int factoryId, long envPtr, long dataPtr) {
         IgniteConfiguration cfg = configuration(springCfgPath);
 
         if (gridName != null)
@@ -58,7 +59,7 @@ public class InteropIgnition {
 
         InteropBootstrap bootstrap = bootstrap(factoryId);
 
-        InteropProcessor proc = bootstrap.start(cfg, envPtr);
+        InteropProcessor proc = bootstrap.start(cfg, envPtr, dataPtr);
 
         trackFinalization(proc);
 


[33/50] incubator-ignite git commit: ignite-484-1 - replicated client cache test added

Posted by sb...@apache.org.
ignite-484-1 - replicated client cache test added


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

Branch: refs/heads/ignite-917-review
Commit: 10febf28fdf3966ffcb369c5725792b604be6c18
Parents: 1fe215e
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 17 17:11:00 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 17 17:11:00 2015 +0300

----------------------------------------------------------------------
 ...lientQueryReplicatedNodeRestartSelfTest.java | 381 +++++++++++++++++++
 .../IgniteCacheQuerySelfTestSuite.java          |   1 +
 2 files changed, 382 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/10febf28/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java
new file mode 100644
index 0000000..23f44c0
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java
@@ -0,0 +1,381 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.near;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cache.affinity.rendezvous.*;
+import org.apache.ignite.cache.query.*;
+import org.apache.ignite.cache.query.annotations.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.util.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import javax.cache.*;
+import java.io.*;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CacheRebalanceMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
+
+/**
+ * Test for distributed queries with replicated client cache and node restarts.
+ */
+public class IgniteCacheClientQueryReplicatedNodeRestartSelfTest extends GridCommonAbstractTest {
+    /** */
+    private static final String QRY = "select co.id, count(*) cnt\n" +
+        "from \"pe\".Person pe, \"pr\".Product pr, \"co\".Company co, \"pu\".Purchase pu\n" +
+        "where pe.id = pu.personId and pu.productId = pr.id and pr.companyId = co.id \n" +
+        "group by co.id order by cnt desc, co.id";
+
+    /** */
+    private static final P1<ClusterNode> DATA_NODES_FILTER = new P1<ClusterNode>() {
+            @Override public boolean apply(ClusterNode clusterNode) {
+                String gridName = clusterNode.attribute(IgniteNodeAttributes.ATTR_GRID_NAME);
+
+                return !gridName.endsWith(String.valueOf(GRID_CNT - 1)); // The last one is client only.
+            }
+        };
+
+    /** */
+    private static final int GRID_CNT = 5;
+
+    /** */
+    private static final int PERS_CNT = 600;
+
+    /** */
+    private static final int PURCHASE_CNT = 6000;
+
+    /** */
+    private static final int COMPANY_CNT = 25;
+
+    /** */
+    private static final int PRODUCT_CNT = 100;
+
+    /** */
+    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        X.println("grid name: " + gridName);
+
+        IgniteConfiguration c = super.getConfiguration(gridName);
+
+        TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+        disco.setIpFinder(ipFinder);
+
+        c.setDiscoverySpi(disco);
+
+        int i = 0;
+
+        CacheConfiguration<?, ?>[] ccs = new CacheConfiguration[4];
+
+        for (String name : F.asList("co", "pr", "pe", "pu")) {
+            CacheConfiguration<?, ?> cc = defaultCacheConfiguration();
+
+            cc.setNodeFilter(DATA_NODES_FILTER);
+            cc.setName(name);
+            cc.setCacheMode(REPLICATED);
+            cc.setWriteSynchronizationMode(FULL_SYNC);
+            cc.setAtomicityMode(TRANSACTIONAL);
+            cc.setRebalanceMode(SYNC);
+            cc.setAffinity(new RendezvousAffinityFunction(false, 50));
+
+            switch (name) {
+                case "co":
+                    cc.setIndexedTypes(
+                        Integer.class, Company.class
+                    );
+
+                    break;
+
+                case "pr":
+                    cc.setIndexedTypes(
+                        Integer.class, Product.class
+                    );
+
+                    break;
+
+                case "pe":
+                    cc.setIndexedTypes(
+                        Integer.class, Person.class
+                    );
+
+                    break;
+
+                case "pu":
+                    cc.setIndexedTypes(
+                        AffinityKey.class, Purchase.class
+                    );
+
+                    break;
+            }
+
+            ccs[i++] = cc;
+        }
+
+        c.setCacheConfiguration(ccs);
+
+        return c;
+    }
+
+    /**
+     *
+     */
+    private void fillCaches() {
+        IgniteCache<Integer, Company> co = grid(0).cache("co");
+
+        for (int i = 0; i < COMPANY_CNT; i++)
+            co.put(i, new Company(i));
+
+        IgniteCache<Integer, Product> pr = grid(0).cache("pr");
+
+        Random rnd = new GridRandom();
+
+        for (int i = 0; i < PRODUCT_CNT; i++)
+            pr.put(i, new Product(i, rnd.nextInt(COMPANY_CNT)));
+
+        IgniteCache<Integer, Person> pe = grid(0).cache("pe");
+
+        for (int i = 0; i < PERS_CNT; i++)
+            pe.put(i, new Person(i));
+
+        IgniteCache<AffinityKey<Integer>, Purchase> pu = grid(0).cache("pu");
+
+        for (int i = 0; i < PURCHASE_CNT; i++) {
+            int persId = rnd.nextInt(PERS_CNT);
+            int prodId = rnd.nextInt(PRODUCT_CNT);
+
+            pu.put(new AffinityKey<>(i, persId), new Purchase(persId, prodId));
+        }
+    }
+
+    /**
+     * @param c Cache.
+     * @param client If it must be a client cache.
+     */
+    private void assertClient(IgniteCache<?,?> c, boolean client) {
+        assertTrue(((IgniteCacheProxy)c).context().affinityNode() == !client);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testRestarts() throws Exception {
+        int duration = 90 * 1000;
+        int qryThreadNum = 5;
+        int restartThreadsNum = 2; // 2 of 4 data nodes
+        final int nodeLifeTime = 2 * 1000;
+        final int logFreq = 10;
+
+        startGridsMultiThreaded(GRID_CNT);
+
+        final AtomicIntegerArray locks = new AtomicIntegerArray(GRID_CNT - 1); // The last is client only.
+
+        fillCaches();
+
+        final List<List<?>> pRes = grid(0).cache("pu").query(new SqlFieldsQuery(QRY)).getAll();
+
+        Thread.sleep(3000);
+
+        assertEquals(pRes, grid(0).cache("pu").query(new SqlFieldsQuery(QRY)).getAll());
+
+        assertFalse(pRes.isEmpty());
+
+        final AtomicInteger qryCnt = new AtomicInteger();
+        final AtomicBoolean qrysDone = new AtomicBoolean();
+
+        for (int i = 0; i < GRID_CNT - 1; i++) {
+            for (String cacheName : F.asList("co", "pr", "pe", "pu"))
+                assertClient(grid(i).cache(cacheName), false);
+        }
+
+        for (String cacheName : F.asList("co", "pr", "pe", "pu"))
+            assertClient(grid(GRID_CNT - 1).cache(cacheName), true);
+
+        final IgniteCache<?,?> clientCache = grid(GRID_CNT - 1).cache("pu");
+
+        IgniteInternalFuture<?> fut1 = multithreadedAsync(new CAX() {
+            @Override public void applyx() throws IgniteCheckedException {
+                GridRandom rnd = new GridRandom();
+
+                while (!qrysDone.get()) {
+                    SqlFieldsQuery qry = new SqlFieldsQuery(QRY);
+
+                    boolean smallPageSize = rnd.nextBoolean();
+
+                    if (smallPageSize)
+                        qry.setPageSize(3);
+
+                    try {
+                        assertEquals(pRes, clientCache.query(qry).getAll());
+                    }
+                    catch (CacheException e) {
+                        assertTrue("On large page size must retry.", smallPageSize);
+
+                        boolean failedOnRemoteFetch = false;
+
+                        for (Throwable th = e; th != null; th = th.getCause()) {
+                            if (!(th instanceof CacheException))
+                                continue;
+
+                            if (th.getMessage() != null &&
+                                th.getMessage().startsWith("Failed to fetch data from node:")) {
+                                failedOnRemoteFetch = true;
+
+                                break;
+                            }
+                        }
+
+                        if (!failedOnRemoteFetch) {
+                            e.printStackTrace();
+
+                            fail("Must fail inside of GridResultPage.fetchNextPage or subclass.");
+                        }
+                    }
+
+                    int c = qryCnt.incrementAndGet();
+
+                    if (c % logFreq == 0)
+                        info("Executed queries: " + c);
+                }
+            }
+        }, qryThreadNum);
+
+        final AtomicInteger restartCnt = new AtomicInteger();
+
+        final AtomicBoolean restartsDone = new AtomicBoolean();
+
+        IgniteInternalFuture<?> fut2 = multithreadedAsync(new Callable<Object>() {
+            @SuppressWarnings({"BusyWait"})
+            @Override public Object call() throws Exception {
+                GridRandom rnd = new GridRandom();
+
+                while (!restartsDone.get()) {
+                    int g;
+
+                    do {
+                        g = rnd.nextInt(locks.length());
+                    }
+                    while (!locks.compareAndSet(g, 0, -1));
+
+                    stopGrid(g);
+
+                    Thread.sleep(rnd.nextInt(nodeLifeTime));
+
+                    startGrid(g);
+
+                    Thread.sleep(rnd.nextInt(nodeLifeTime));
+
+                    locks.set(g, 0);
+
+                    int c = restartCnt.incrementAndGet();
+
+                    if (c % logFreq == 0)
+                        info("Node restarts: " + c);
+                }
+
+                return true;
+            }
+        }, restartThreadsNum);
+
+        Thread.sleep(duration);
+
+        info("Stopping..");
+
+        restartsDone.set(true);
+
+        fut2.get();
+
+        info("Restarts stopped.");
+
+        qrysDone.set(true);
+
+        fut1.get();
+
+        info("Queries stopped.");
+    }
+
+    /**
+     *
+     */
+    private static class Person implements Serializable {
+        @QuerySqlField(index = true)
+        int id;
+
+        Person(int id) {
+            this.id = id;
+        }
+    }
+
+    /**
+     *
+     */
+    private static class Purchase implements Serializable {
+        @QuerySqlField(index = true)
+        int personId;
+
+        @QuerySqlField(index = true)
+        int productId;
+
+        Purchase(int personId, int productId) {
+            this.personId = personId;
+            this.productId = productId;
+        }
+    }
+
+    /**
+     *
+     */
+    private static class Company implements Serializable {
+        @QuerySqlField(index = true)
+        int id;
+
+        Company(int id) {
+            this.id = id;
+        }
+    }
+
+    /**
+     *
+     */
+    private static class Product implements Serializable {
+        @QuerySqlField(index = true)
+        int id;
+
+        @QuerySqlField(index = true)
+        int companyId;
+
+        Product(int id, int companyId) {
+            this.id = id;
+            this.companyId = companyId;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/10febf28/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
index c5a2f15..dee3078 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
@@ -67,6 +67,7 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
         suite.addTestSuite(IgniteCacheOffheapTieredMultithreadedSelfTest.class);
         suite.addTestSuite(IgniteCacheQueryNodeRestartSelfTest.class);
         suite.addTestSuite(IgniteCacheQueryNodeRestartSelfTest2.class);
+        suite.addTestSuite(IgniteCacheClientQueryReplicatedNodeRestartSelfTest.class);
         suite.addTestSuite(GridCacheReduceQueryMultithreadedSelfTest.class);
         suite.addTestSuite(GridCacheCrossCacheQuerySelfTest.class);
         suite.addTestSuite(GridCacheQuerySerializationSelfTest.class);


[37/50] incubator-ignite git commit: ignite-484-1 - improved retry

Posted by sb...@apache.org.
ignite-484-1 - improved retry


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

Branch: refs/heads/ignite-917-review
Commit: 94060c9ef41161c7262a28044ddb176f86814b01
Parents: 10febf2
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 17 19:46:42 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 17 19:46:42 2015 +0300

----------------------------------------------------------------------
 .../query/h2/twostep/GridMapQueryExecutor.java  | 26 ++++--
 .../h2/twostep/GridReduceQueryExecutor.java     | 86 ++++++++++++++------
 ...lientQueryReplicatedNodeRestartSelfTest.java | 50 ++++++++++--
 3 files changed, 125 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/94060c9e/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index aaf64ee..2503a87 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -48,6 +48,7 @@ import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
 
 import static org.apache.ignite.events.EventType.*;
+import static org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion.*;
 import static org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionState.*;
 import static org.apache.ignite.internal.processors.query.h2.twostep.msg.GridH2ValueMessageFactory.*;
 
@@ -230,6 +231,15 @@ public class GridMapQueryExecutor {
     }
 
     /**
+     * @param cctx Cache context.
+     * @param p Partition ID.
+     * @return Partition.
+     */
+    private GridDhtLocalPartition partition(GridCacheContext<?, ?> cctx, int p) {
+        return cctx.topology().localPartition(p, NONE, false);
+    }
+
+    /**
      * @param cacheNames Cache names.
      * @param topVer Topology version.
      * @param explicitParts Explicit partitions list.
@@ -263,10 +273,12 @@ public class GridMapQueryExecutor {
             GridReservable r = reservations.get(grpKey);
 
             if (explicitParts == null && r != null) { // Try to reserve group partition if any and no explicits.
-                if (!r.reserve())
-                    return false; // We need explicit partitions here -> retry.
+                if (r != ReplicatedReservation.INSTANCE) {
+                    if (!r.reserve())
+                        return false; // We need explicit partitions here -> retry.
 
-                reserved.add(r);
+                    reserved.add(r);
+                }
             }
             else { // Try to reserve partitions one by one.
                 int partsCnt = cctx.affinity().partitions();
@@ -274,7 +286,7 @@ public class GridMapQueryExecutor {
                 if (cctx.isReplicated()) { // Check all the partitions are in owning state for replicated cache.
                     if (r == null) { // Check only once.
                         for (int p = 0; p < partsCnt; p++) {
-                            GridDhtLocalPartition part = cctx.topology().localPartition(p, topVer, false);
+                            GridDhtLocalPartition part = partition(cctx, p);
 
                             // We don't need to reserve partitions because they will not be evicted in replicated caches.
                             if (part == null || part.state() != OWNING)
@@ -290,7 +302,7 @@ public class GridMapQueryExecutor {
                         partIds = cctx.affinity().primaryPartitions(ctx.localNodeId(), topVer);
 
                     for (int partId : partIds) {
-                        GridDhtLocalPartition part = cctx.topology().localPartition(partId, topVer, false);
+                        GridDhtLocalPartition part = partition(cctx, partId);
 
                         if (part == null || part.state() != OWNING || !part.reserve())
                             return false;
@@ -806,12 +818,12 @@ public class GridMapQueryExecutor {
 
         /** {@inheritDoc} */
         @Override public boolean reserve() {
-            return true;
+            throw new IllegalStateException();
         }
 
         /** {@inheritDoc} */
         @Override public void release() {
-            // No-op.
+            throw new IllegalStateException();
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/94060c9e/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index c570d24..6635dde 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -335,7 +335,7 @@ public class GridReduceQueryExecutor {
     ) {
         String space = cctx.name();
 
-        Set<ClusterNode> nodes = new HashSet<>(ctx.discovery().cacheAffinityNodes(space, topVer));
+        Set<ClusterNode> nodes = new HashSet<>(dataNodes(space, topVer));
 
         if (F.isEmpty(nodes))
             throw new CacheException("No data nodes found for cache: " + space);
@@ -351,7 +351,7 @@ public class GridReduceQueryExecutor {
                     throw new CacheException("Queries running on replicated cache should not contain JOINs " +
                         "with partitioned tables.");
 
-                Collection<ClusterNode> extraNodes = ctx.discovery().cacheAffinityNodes(extraSpace, topVer);
+                Collection<ClusterNode> extraNodes = dataNodes(extraSpace, topVer);
 
                 if (F.isEmpty(extraNodes))
                     throw new CacheException("No data nodes found for cache: " + extraSpace);
@@ -398,7 +398,18 @@ public class GridReduceQueryExecutor {
      * @return Cursor.
      */
     public Iterator<List<?>> query(GridCacheContext<?,?> cctx, GridCacheTwoStepQuery qry, boolean keepPortable) {
-        for (;;) {
+        for (int attempt = 0;; attempt++) {
+            if (attempt != 0) {
+                try {
+                    Thread.sleep(attempt * 10); // Wait for exchange.
+                }
+                catch (InterruptedException e) {
+                    Thread.currentThread().interrupt();
+
+                    throw new CacheException("Query was interrupted.", e);
+                }
+            }
+
             long qryReqId = reqIdGen.incrementAndGet();
 
             QueryRun r = new QueryRun();
@@ -422,9 +433,9 @@ public class GridReduceQueryExecutor {
 
             if (isPreloadingActive(cctx, extraSpaces)) {
                 if (cctx.isReplicated())
-                    nodes = replicatedDataNodes(cctx, extraSpaces);
+                    nodes = replicatedUnstableDataNodes(cctx, extraSpaces);
                 else {
-                    partsMap = partitionLocations(cctx, extraSpaces);
+                    partsMap = partitionedUnstableDataNodes(cctx, extraSpaces);
 
                     nodes = partsMap == null ? null : partsMap.keySet();
                 }
@@ -538,9 +549,6 @@ public class GridReduceQueryExecutor {
             catch (IgniteCheckedException | RuntimeException e) {
                 U.closeQuiet(r.conn);
 
-                if (e instanceof CacheException)
-                    throw (CacheException)e;
-
                 throw new CacheException("Failed to run reduce query locally.", e);
             }
             finally {
@@ -559,10 +567,14 @@ public class GridReduceQueryExecutor {
      * @param extraSpaces Extra spaces.
      * @return Collection of all data nodes owning all the caches or {@code null} for retry.
      */
-    private Collection<ClusterNode> replicatedDataNodes(final GridCacheContext<?,?> cctx, List<String> extraSpaces) {
+    private Collection<ClusterNode> replicatedUnstableDataNodes(final GridCacheContext<?,?> cctx,
+        List<String> extraSpaces) {
         assert cctx.isReplicated() : cctx.name() + " must be replicated";
 
-        Set<ClusterNode> nodes = owningReplicatedDataNodes(cctx);
+        Set<ClusterNode> nodes = replicatedUnstableDataNodes(cctx);
+
+        if (F.isEmpty(nodes))
+            return null; // Retry.
 
         if (!F.isEmpty(extraSpaces)) {
             for (String extraSpace : extraSpaces) {
@@ -575,7 +587,12 @@ public class GridReduceQueryExecutor {
                     throw new CacheException("Queries running on replicated cache should not contain JOINs " +
                         "with partitioned tables.");
 
-                nodes.retainAll(owningReplicatedDataNodes(extraCctx));
+                Set<ClusterNode> extraOwners = replicatedUnstableDataNodes(extraCctx);
+
+                if (F.isEmpty(extraOwners))
+                    return null; // Retry.
+
+                nodes.retainAll(extraOwners);
 
                 if (nodes.isEmpty())
                     return null; // Retry.
@@ -586,34 +603,43 @@ public class GridReduceQueryExecutor {
     }
 
     /**
+     * @param space Cache name.
+     * @param topVer Topology version.
+     * @return Collection of data nodes.
+     */
+    private Collection<ClusterNode> dataNodes(String space, AffinityTopologyVersion topVer) {
+        Collection<ClusterNode> res = ctx.discovery().cacheAffinityNodes(space, topVer);
+
+        return res != null ? res : Collections.<ClusterNode>emptySet();
+    }
+
+    /**
      * Collects all the nodes owning all the partitions for the given replicated cache.
      *
      * @param cctx Cache context.
-     * @return Owning nodes.
+     * @return Owning nodes or {@code null} if we can't find owners for some partitions.
      */
-    private Set<ClusterNode> owningReplicatedDataNodes(GridCacheContext<?,?> cctx) {
+    private Set<ClusterNode> replicatedUnstableDataNodes(GridCacheContext<?,?> cctx) {
         assert cctx.isReplicated() : cctx.name() + " must be replicated";
 
         String space = cctx.name();
 
-        Set<ClusterNode> dataNodes = new HashSet<>(ctx.discovery().cacheAffinityNodes(space, NONE));
+        Set<ClusterNode> dataNodes = new HashSet<>(dataNodes(space, NONE));
 
         if (dataNodes.isEmpty())
             throw new CacheException("No data nodes found for cache '" + space + "'");
 
         // Find all the nodes owning all the partitions for replicated cache.
-        for (int p = 0, extraParts = cctx.affinity().partitions(); p < extraParts; p++) {
+        for (int p = 0, parts = cctx.affinity().partitions(); p < parts; p++) {
             List<ClusterNode> owners = cctx.topology().owners(p);
 
-            if (owners.isEmpty())
-                throw new CacheException("No data nodes found for cache '" + space +
-                    "' for partition " + p);
+            if (F.isEmpty(owners))
+                return null; // Retry.
 
             dataNodes.retainAll(owners);
 
             if (dataNodes.isEmpty())
-                throw new CacheException("No data nodes found for cache '" + space +
-                    "' owning all the partitions.");
+                return null; // Retry.
         }
 
         return dataNodes;
@@ -627,7 +653,8 @@ public class GridReduceQueryExecutor {
      * @return Partition mapping or {@code null} if we can't calculate it due to repartitioning and we need to retry.
      */
     @SuppressWarnings("unchecked")
-    private Map<ClusterNode, IntArray> partitionLocations(final GridCacheContext<?,?> cctx, List<String> extraSpaces) {
+    private Map<ClusterNode, IntArray> partitionedUnstableDataNodes(final GridCacheContext<?,?> cctx,
+        List<String> extraSpaces) {
         assert !cctx.isReplicated() && !cctx.isLocal() : cctx.name() + " must be partitioned";
 
         final int partsCnt = cctx.affinity().partitions();
@@ -653,8 +680,12 @@ public class GridReduceQueryExecutor {
         for (int p = 0, parts =  cctx.affinity().partitions(); p < parts; p++) {
             List<ClusterNode> owners = cctx.topology().owners(p);
 
-            if (F.isEmpty(owners))
+            if (F.isEmpty(owners)) {
+                if (!F.isEmpty(dataNodes(cctx.name(), NONE)))
+                    return null; // Retry.
+
                 throw new CacheException("No data nodes found for cache '" + cctx.name() + "' for partition " + p);
+            }
 
             partLocs[p] = new HashSet<>(owners);
         }
@@ -671,9 +702,13 @@ public class GridReduceQueryExecutor {
                 for (int p = 0, parts =  extraCctx.affinity().partitions(); p < parts; p++) {
                     List<ClusterNode> owners = extraCctx.topology().owners(p);
 
-                    if (F.isEmpty(owners))
+                    if (F.isEmpty(owners)) {
+                        if (!F.isEmpty(dataNodes(extraSpace, NONE)))
+                            return null; // Retry.
+
                         throw new CacheException("No data nodes found for cache '" + extraSpace +
                             "' for partition " + p);
+                    }
 
                     if (partLocs[p] == null)
                         partLocs[p] = new HashSet<>(owners);
@@ -693,7 +728,10 @@ public class GridReduceQueryExecutor {
                 if (!extraCctx.isReplicated())
                     continue;
 
-                Set<ClusterNode> dataNodes = owningReplicatedDataNodes(extraCctx);
+                Set<ClusterNode> dataNodes = replicatedUnstableDataNodes(extraCctx);
+
+                if (F.isEmpty(dataNodes))
+                    return null; // Retry.
 
                 for (Set<ClusterNode> partLoc : partLocs) {
                     partLoc.retainAll(dataNodes);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/94060c9e/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java
index 23f44c0..3f23005 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java
@@ -64,6 +64,9 @@ public class IgniteCacheClientQueryReplicatedNodeRestartSelfTest extends GridCom
         };
 
     /** */
+    private static final List<List<?>> FAKE = new LinkedList<>();
+
+    /** */
     private static final int GRID_CNT = 5;
 
     /** */
@@ -191,7 +194,7 @@ public class IgniteCacheClientQueryReplicatedNodeRestartSelfTest extends GridCom
     public void testRestarts() throws Exception {
         int duration = 90 * 1000;
         int qryThreadNum = 5;
-        int restartThreadsNum = 2; // 2 of 4 data nodes
+        int restartThreadsNum = 3; // 3 of 4 data nodes
         final int nodeLifeTime = 2 * 1000;
         final int logFreq = 10;
 
@@ -212,13 +215,32 @@ public class IgniteCacheClientQueryReplicatedNodeRestartSelfTest extends GridCom
         final AtomicInteger qryCnt = new AtomicInteger();
         final AtomicBoolean qrysDone = new AtomicBoolean();
 
+        final List<Integer> cacheSize = new ArrayList<>(4);
+
         for (int i = 0; i < GRID_CNT - 1; i++) {
-            for (String cacheName : F.asList("co", "pr", "pe", "pu"))
-                assertClient(grid(i).cache(cacheName), false);
+            int j = 0;
+
+            for (String cacheName : F.asList("co", "pr", "pe", "pu")) {
+                IgniteCache<?,?> cache = grid(i).cache(cacheName);
+
+                assertClient(cache, false);
+
+                if (i == 0)
+                    cacheSize.add(cache.size());
+                else
+                    assertEquals(cacheSize.get(j++).intValue(), cache.size());
+            }
         }
 
-        for (String cacheName : F.asList("co", "pr", "pe", "pu"))
-            assertClient(grid(GRID_CNT - 1).cache(cacheName), true);
+        int j = 0;
+
+        for (String cacheName : F.asList("co", "pr", "pe", "pu")) {
+            IgniteCache<?,?> cache = grid(GRID_CNT - 1).cache(cacheName);
+
+            assertClient(cache, true);
+
+            assertEquals(cacheSize.get(j++).intValue(), cache.size());
+        }
 
         final IgniteCache<?,?> clientCache = grid(GRID_CNT - 1).cache("pu");
 
@@ -234,8 +256,10 @@ public class IgniteCacheClientQueryReplicatedNodeRestartSelfTest extends GridCom
                     if (smallPageSize)
                         qry.setPageSize(3);
 
+                    List<List<?>> res;
+
                     try {
-                        assertEquals(pRes, clientCache.query(qry).getAll());
+                        res = clientCache.query(qry).getAll();
                     }
                     catch (CacheException e) {
                         assertTrue("On large page size must retry.", smallPageSize);
@@ -259,6 +283,20 @@ public class IgniteCacheClientQueryReplicatedNodeRestartSelfTest extends GridCom
 
                             fail("Must fail inside of GridResultPage.fetchNextPage or subclass.");
                         }
+
+                        res = FAKE;
+                    }
+
+                    if (res != FAKE && !res.equals(pRes)) {
+                        int j = 0;
+
+                        // Check for data loss.
+                        for (String cacheName : F.asList("co", "pr", "pe", "pu")) {
+                            assertEquals(cacheName, cacheSize.get(j++).intValue(),
+                                grid(GRID_CNT - 1).cache(cacheName).size());
+                        }
+
+                        assertEquals(pRes, res); // Fail with nice message.
                     }
 
                     int c = qryCnt.incrementAndGet();


[08/50] incubator-ignite git commit: # i-960

Posted by sb...@apache.org.
# i-960


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

Branch: refs/heads/ignite-917-review
Commit: 4025ce3c6e36b95086e434e0eaba87069093bd7c
Parents: c909cae
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jun 16 18:00:36 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jun 16 18:00:36 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java    | 3 ---
 1 file changed, 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4025ce3c/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
index da00d95..7b78bda 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
@@ -36,9 +36,6 @@ import java.util.*;
  * This implementation stores objects in underlying database using java beans mapping description via reflection.
  * <p>
  * Use {@link CacheJdbcPojoStoreFactory} factory to pass {@link CacheJdbcPojoStore} to {@link CacheConfiguration}.
- *
- * @param <K> The type of keys handled by this loader.
- * @param <V> The type of values generated by this loader.
  */
 public class CacheJdbcPojoStore<K, V> extends CacheAbstractJdbcStore<K, V> {
     /**


[15/50] incubator-ignite git commit: #IGNITE-GG-10429 Fixed client rest.

Posted by sb...@apache.org.
#IGNITE-GG-10429 Fixed client rest.


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

Branch: refs/heads/ignite-917-review
Commit: 77855440af71299a29aef0b36627044b705724b8
Parents: d1a2150
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Jun 17 09:48:03 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Jun 17 09:48:03 2015 +0300

----------------------------------------------------------------------
 .../GridClientOptimizedMarshaller.java          | 20 ++++++++++++++++++++
 .../rest/protocols/tcp/GridTcpRestProtocol.java |  3 ++-
 2 files changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/77855440/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
index 7c2bd2f..28b129e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
@@ -22,9 +22,11 @@ import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.client.marshaller.*;
 import org.apache.ignite.internal.processors.rest.client.message.*;
 import org.apache.ignite.marshaller.optimized.*;
+import org.apache.ignite.plugin.*;
 
 import java.io.*;
 import java.nio.*;
+import java.util.*;
 
 /**
  * Wrapper, that adapts {@link org.apache.ignite.marshaller.optimized.OptimizedMarshaller} to
@@ -47,6 +49,17 @@ public class GridClientOptimizedMarshaller implements GridClientMarshaller {
     }
 
     /**
+     * Constructor.
+     *
+     * @param plugins Plugins.
+     */
+    public GridClientOptimizedMarshaller(List<PluginProvider> plugins) {
+        opMarsh = new OptimizedMarshaller();
+
+        opMarsh.setContext(new ClientMarshallerContext(plugins));
+    }
+
+    /**
      * Constructs optimized marshaller with specific parameters.
      *
      * @param requireSer Require serializable flag.
@@ -105,6 +118,13 @@ public class GridClientOptimizedMarshaller implements GridClientMarshaller {
             super(null);
         }
 
+        /**
+         * @param plugins Plugins.
+         */
+        public ClientMarshallerContext(List<PluginProvider> plugins) {
+            super(plugins);
+        }
+
         /** {@inheritDoc} */
         @Override protected boolean registerClassName(int id, String clsName) {
             throw new UnsupportedOperationException(clsName);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/77855440/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java
index 5645cf5..9b6f353 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/protocols/tcp/GridTcpRestProtocol.java
@@ -149,7 +149,8 @@ public class GridTcpRestProtocol extends GridRestProtocolAdapter {
 
         Map<Byte, GridClientMarshaller> marshMap = new HashMap<>();
 
-        marshMap.put(GridClientOptimizedMarshaller.ID, new GridClientOptimizedMarshaller());
+        marshMap.put(GridClientOptimizedMarshaller.ID,
+            new GridClientOptimizedMarshaller(new ArrayList<>(ctx.plugins().allProviders())));
         marshMap.put(GridClientJdkMarshaller.ID, new GridClientJdkMarshaller());
 
         lsnr.marshallers(marshMap);


[18/50] incubator-ignite git commit: #IGNITE-GG-10429 Fixed client marshaller.

Posted by sb...@apache.org.
#IGNITE-GG-10429 Fixed client marshaller.


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

Branch: refs/heads/ignite-917-review
Commit: 9142eb7ce1cb0f665c129580a3a611a6ad5dce1e
Parents: 092bb91
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Jun 17 10:30:04 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Jun 17 10:30:04 2015 +0300

----------------------------------------------------------------------
 .../impl/GridTcpRouterNioListenerAdapter.java      | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9142eb7c/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java
index 0bf416c..e60f2aa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java
@@ -25,8 +25,10 @@ import org.apache.ignite.internal.client.marshaller.optimized.*;
 import org.apache.ignite.internal.processors.rest.client.message.*;
 import org.apache.ignite.internal.util.nio.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.plugin.*;
 import org.jetbrains.annotations.*;
 
+import java.security.*;
 import java.util.*;
 
 import static org.apache.ignite.internal.util.nio.GridNioSessionMetaKey.*;
@@ -65,7 +67,20 @@ public abstract class GridTcpRouterNioListenerAdapter implements GridNioServerLi
 
         marshMap = new HashMap<>();
 
-        marshMap.put(GridClientOptimizedMarshaller.ID, new GridClientOptimizedMarshaller());
+        List<PluginProvider> plugins = AccessController.doPrivileged(new PrivilegedAction<List<PluginProvider>>() {
+            @Override public List<PluginProvider> run() {
+                List<PluginProvider> providers = new ArrayList<>();
+
+                ServiceLoader<PluginProvider> ldr = ServiceLoader.load(PluginProvider.class);
+
+                for (PluginProvider provider : ldr)
+                    providers.add(provider);
+
+                return providers;
+            }
+        });
+
+        marshMap.put(GridClientOptimizedMarshaller.ID, new GridClientOptimizedMarshaller(plugins));
         marshMap.put(GridClientJdkMarshaller.ID, new GridClientJdkMarshaller());
 
         init();


[46/50] incubator-ignite git commit: # ignite-sprint-6 fixed test to work in offheap mode

Posted by sb...@apache.org.
# ignite-sprint-6 fixed test to work in offheap mode


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

Branch: refs/heads/ignite-917-review
Commit: cc20ef6adce9bdeea19d37f5817c0693e380cfa5
Parents: de53189
Author: sboikov <sb...@gridgain.com>
Authored: Thu Jun 18 10:30:20 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Jun 18 10:30:20 2015 +0300

----------------------------------------------------------------------
 .../cache/GridCacheAbstractFullApiSelfTest.java | 24 +++++++++++---------
 1 file changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cc20ef6a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 128d452..151c249 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -1020,25 +1020,27 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         throws Exception {
         IgniteCache<String, Integer> cache = jcache();
 
+        final String key = primaryKeysForCache(cache, 1).get(0);
+
         Transaction tx = txEnabled() ? ignite(0).transactions().txStart(concurrency, READ_COMMITTED) : null;
 
         try {
             if (startVal)
-                cache.put("key", 2);
+                cache.put(key, 2);
             else
-                assertEquals(null, cache.get("key"));
+                assertEquals(null, cache.get(key));
 
-            Integer expectedRes = startVal ? 2 : null;
+            Integer expRes = startVal ? 2 : null;
 
-            assertEquals(String.valueOf(expectedRes), cache.invoke("key", INCR_PROCESSOR));
+            assertEquals(String.valueOf(expRes), cache.invoke(key, INCR_PROCESSOR));
 
-            expectedRes = startVal ? 3 : 1;
+            expRes = startVal ? 3 : 1;
 
-            assertEquals(String.valueOf(expectedRes), cache.invoke("key", INCR_PROCESSOR));
+            assertEquals(String.valueOf(expRes), cache.invoke(key, INCR_PROCESSOR));
 
-            expectedRes++;
+            expRes++;
 
-            assertEquals(String.valueOf(expectedRes), cache.invoke("key", INCR_PROCESSOR));
+            assertEquals(String.valueOf(expRes), cache.invoke(key, INCR_PROCESSOR));
 
             if (tx != null)
                 tx.commit();
@@ -1050,11 +1052,11 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         Integer exp = (startVal ? 2 : 0) + 3;
 
-        assertEquals(exp, cache.get("key"));
+        assertEquals(exp, cache.get(key));
 
         for (int i = 0; i < gridCount(); i++) {
-            if (ignite(i).affinity(null).isPrimaryOrBackup(grid(i).localNode(), "key"))
-                assertEquals(exp, peek(jcache(i), "key"));
+            if (ignite(i).affinity(null).isPrimaryOrBackup(grid(i).localNode(), key))
+                assertEquals(exp, peek(jcache(i), key));
         }
     }
 


[39/50] incubator-ignite git commit: ignite-484-1 - error messages

Posted by sb...@apache.org.
ignite-484-1 - error messages


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

Branch: refs/heads/ignite-917-review
Commit: e602ca01e48fd43f4cc33b729078c105d84601f6
Parents: efb4244
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 17 20:15:45 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 17 20:15:45 2015 +0300

----------------------------------------------------------------------
 .../query/h2/twostep/GridMapQueryExecutor.java  |  4 +--
 .../h2/twostep/GridReduceQueryExecutor.java     | 31 ++++++++++----------
 2 files changed, 17 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e602ca01/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index 2503a87..ba95d43 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -401,7 +401,7 @@ public class GridMapQueryExecutor {
                 }
             }
             catch (IgniteCheckedException e) {
-                throw new CacheException(e);
+                throw new CacheException("Failed to unmarshall parameters.", e);
             }
 
             List<String> caches = (List<String>)F.concat(true, req.space(), req.extraSpaces());
@@ -422,7 +422,7 @@ public class GridMapQueryExecutor {
             GridCacheContext<?,?> mainCctx = cacheContext(req.space());
 
             if (mainCctx == null)
-                throw new CacheException("Cache was destroyed: " + req.space());
+                throw new CacheException("Failed to find cache: " + req.space());
 
             qr = new QueryResults(req.requestId(), qrys.size(), mainCctx);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e602ca01/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index b956167..32d1c95 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -338,7 +338,7 @@ public class GridReduceQueryExecutor {
         Set<ClusterNode> nodes = new HashSet<>(dataNodes(space, topVer));
 
         if (F.isEmpty(nodes))
-            throw new CacheException("No data nodes found for cache: " + space);
+            throw new CacheException("Failed to find data nodes for cache: " + space);
 
         if (!F.isEmpty(extraSpaces)) {
             for (String extraSpace : extraSpaces) {
@@ -349,12 +349,12 @@ public class GridReduceQueryExecutor {
 
                 if (cctx.isReplicated() && !extraCctx.isReplicated())
                     throw new CacheException("Queries running on replicated cache should not contain JOINs " +
-                        "with partitioned tables.");
+                        "with partitioned tables [rCache=" + cctx.name() + ", pCache=" + extraSpace + "]");
 
                 Collection<ClusterNode> extraNodes = dataNodes(extraSpace, topVer);
 
                 if (F.isEmpty(extraNodes))
-                    throw new CacheException("No data nodes found for cache: " + extraSpace);
+                    throw new CacheException("Failed to find data nodes for cache: " + extraSpace);
 
                 if (cctx.isReplicated() && extraCctx.isReplicated()) {
                     nodes.retainAll(extraNodes);
@@ -363,8 +363,8 @@ public class GridReduceQueryExecutor {
                         if (isPreloadingActive(cctx, extraSpaces))
                             return null; // Retry.
                         else
-                            throw new CacheException("Caches '" + cctx.name() + "' and '" + extraSpace +
-                                "' have distinct set of data nodes.");
+                            throw new CacheException("Caches have distinct sets of data nodes [cache1=" + cctx.name() +
+                                ", cache2=" + extraSpace + "]");
                     }
                 }
                 else if (!cctx.isReplicated() && extraCctx.isReplicated()) {
@@ -372,16 +372,16 @@ public class GridReduceQueryExecutor {
                         if (isPreloadingActive(cctx, extraSpaces))
                             return null; // Retry.
                         else
-                            throw new CacheException("Caches '" + cctx.name() + "' and '" + extraSpace +
-                                "' have distinct set of data nodes.");
+                            throw new CacheException("Caches have distinct sets of data nodes [cache1=" + cctx.name() +
+                                ", cache2=" + extraSpace + "]");
                 }
                 else if (!cctx.isReplicated() && !extraCctx.isReplicated()) {
                     if (extraNodes.size() != nodes.size() || !nodes.containsAll(extraNodes))
                         if (isPreloadingActive(cctx, extraSpaces))
                             return null; // Retry.
                         else
-                            throw new CacheException("Caches '" + cctx.name() + "' and '" + extraSpace +
-                                "' have distinct set of data nodes.");
+                            throw new CacheException("Caches have distinct sets of data nodes [cache1=" + cctx.name() +
+                                ", cache2=" + extraSpace + "]");
                 }
                 else
                     throw new IllegalStateException();
@@ -586,7 +586,7 @@ public class GridReduceQueryExecutor {
 
                 if (!extraCctx.isReplicated())
                     throw new CacheException("Queries running on replicated cache should not contain JOINs " +
-                        "with partitioned tables.");
+                        "with tables in partitioned caches [rCache=" + cctx.name() + ", pCache=" + extraSpace + "]");
 
                 Set<ClusterNode> extraOwners = replicatedUnstableDataNodes(extraCctx);
 
@@ -628,7 +628,7 @@ public class GridReduceQueryExecutor {
         Set<ClusterNode> dataNodes = new HashSet<>(dataNodes(space, NONE));
 
         if (dataNodes.isEmpty())
-            throw new CacheException("No data nodes found for cache '" + space + "'");
+            throw new CacheException("Failed to find data nodes for cache: " + space);
 
         // Find all the nodes owning all the partitions for replicated cache.
         for (int p = 0, parts = cctx.affinity().partitions(); p < parts; p++) {
@@ -670,8 +670,8 @@ public class GridReduceQueryExecutor {
                 int parts = extraCctx.affinity().partitions();
 
                 if (parts != partsCnt)
-                    throw new CacheException("Number of partitions must be the same for correct collocation in " +
-                        "caches " + cctx.name() + " and " + extraSpace + ".");
+                    throw new CacheException("Number of partitions must be the same for correct collocation [cache1=" +
+                        cctx.name() + ", parts1=" + partsCnt + ", cache2=" + extraSpace + ", parts2=" + parts + "]");
             }
         }
 
@@ -685,7 +685,7 @@ public class GridReduceQueryExecutor {
                 if (!F.isEmpty(dataNodes(cctx.name(), NONE)))
                     return null; // Retry.
 
-                throw new CacheException("No data nodes found for cache '" + cctx.name() + "' for partition " + p);
+                throw new CacheException("Failed to find data nodes [cache=" + cctx.name() + ", part=" + p + "]");
             }
 
             partLocs[p] = new HashSet<>(owners);
@@ -707,8 +707,7 @@ public class GridReduceQueryExecutor {
                         if (!F.isEmpty(dataNodes(extraSpace, NONE)))
                             return null; // Retry.
 
-                        throw new CacheException("No data nodes found for cache '" + extraSpace +
-                            "' for partition " + p);
+                        throw new CacheException("Failed to find data nodes [cache=" + extraSpace + ", part=" + p + "]");
                     }
 
                     if (partLocs[p] == null)


[23/50] incubator-ignite git commit: Merge branches 'ignite-484-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-484-1

Posted by sb...@apache.org.
Merge branches 'ignite-484-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-484-1


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

Branch: refs/heads/ignite-917-review
Commit: ca253a8a845129ece37fca3a12c384d8b9ef3e76
Parents: 8343058 dc05e88
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 17 12:21:53 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 17 12:21:53 2015 +0300

----------------------------------------------------------------------
 RELEASE_NOTES.txt                               |   2 +-
 examples/pom.xml                                |   2 +-
 modules/aop/pom.xml                             |   2 +-
 modules/aws/pom.xml                             |   2 +-
 modules/clients/pom.xml                         |   2 +-
 modules/cloud/pom.xml                           |   2 +-
 modules/codegen/pom.xml                         |   2 +-
 modules/core/pom.xml                            |   2 +-
 .../cache/store/jdbc/CacheJdbcBlobStore.java    |  22 +-
 .../store/jdbc/CacheJdbcBlobStoreFactory.java   | 290 +++++++++++++++++++
 .../cache/store/jdbc/CacheJdbcPojoStore.java    |   6 +-
 .../store/jdbc/CacheJdbcPojoStoreFactory.java   | 148 ++++++++++
 .../configuration/CacheConfiguration.java       |   3 +-
 .../internal/interop/InteropBootstrap.java      |   3 +-
 .../internal/interop/InteropIgnition.java       |   5 +-
 .../processors/cache/GridCacheProcessor.java    |  23 +-
 .../processors/query/GridQueryProcessor.java    | 102 +++++--
 .../util/spring/IgniteSpringHelper.java         |  10 +
 .../SpringApplicationContextResource.java       |   4 +-
 .../apache/ignite/resources/SpringResource.java |   6 +-
 .../ignite/spi/discovery/tcp/ClientImpl.java    |  87 ++++--
 .../core/src/main/resources/ignite.properties   |   2 +-
 .../apache/ignite/internal/GridSelfTest.java    |  12 +-
 .../GridDiscoveryManagerAliveCacheSelfTest.java |  17 +-
 .../GridCacheAbstractFailoverSelfTest.java      |   2 +
 ...ridCacheMultinodeUpdateAbstractSelfTest.java |   9 +
 .../cache/GridCacheVersionMultinodeTest.java    |   8 +-
 ...CacheP2pUnmarshallingRebalanceErrorTest.java |  15 +-
 .../IgniteCacheClientNodeConcurrentStart.java   |  14 +-
 .../distributed/IgniteCacheManyClientsTest.java |  69 ++++-
 .../GridCachePartitionedTxSalvageSelfTest.java  |  37 +--
 .../junits/common/GridCommonAbstractTest.java   |  11 +-
 .../IgniteCacheFailoverTestSuite.java           |   8 -
 .../IgniteCacheFailoverTestSuite2.java          |  47 +++
 modules/extdata/p2p/pom.xml                     |   2 +-
 modules/extdata/uri/pom.xml                     |   2 +-
 modules/gce/pom.xml                             |   2 +-
 modules/geospatial/pom.xml                      |   2 +-
 modules/hadoop/pom.xml                          |   2 +-
 modules/hibernate/pom.xml                       |  16 +-
 .../hibernate/CacheHibernateBlobStore.java      |  87 +-----
 .../CacheHibernateBlobStoreFactory.java         | 235 +++++++++++++++
 .../hibernate/src/test/config/factory-cache.xml |  59 ++++
 .../src/test/config/factory-cache1.xml          |  61 ++++
 .../config/factory-incorrect-store-cache.xml    |  56 ++++
 .../CacheHibernateStoreFactorySelfTest.java     | 273 +++++++++++++++++
 .../testsuites/IgniteHibernateTestSuite.java    |   2 +
 modules/indexing/pom.xml                        |   2 +-
 .../CacheAbstractQueryMetricsSelfTest.java      | 205 +++++++++++++
 .../CachePartitionedQueryMetricsSelfTest.java   |  32 ++
 .../CacheReplicatedQueryMetricsSelfTest.java    |  32 ++
 .../cache/GridCacheQueryMetricsSelfTest.java    | 206 -------------
 .../query/h2/sql/BaseH2CompareQueryTest.java    |   2 +-
 .../IgniteCacheQuerySelfTestSuite.java          |   4 +-
 modules/jcl/pom.xml                             |   2 +-
 modules/jta/pom.xml                             |   2 +-
 modules/log4j/pom.xml                           |   2 +-
 modules/mesos/pom.xml                           |   2 +-
 modules/rest-http/pom.xml                       |   2 +-
 modules/scalar-2.10/pom.xml                     |   2 +-
 modules/scalar/pom.xml                          |   2 +-
 modules/schedule/pom.xml                        |   2 +-
 modules/schema-import/pom.xml                   |   2 +-
 modules/slf4j/pom.xml                           |   2 +-
 modules/spark-2.10/pom.xml                      |   2 +-
 modules/spark/pom.xml                           |   2 +-
 modules/spring/pom.xml                          |   9 +-
 .../GridResourceSpringBeanInjector.java         |   2 +-
 .../util/spring/IgniteSpringHelperImpl.java     |  17 ++
 .../src/test/config/incorrect-store-cache.xml   |  57 ++++
 modules/spring/src/test/config/node.xml         |  43 +++
 modules/spring/src/test/config/node1.xml        |  45 +++
 .../test/config/pojo-incorrect-store-cache.xml  |  56 ++++
 modules/spring/src/test/config/store-cache.xml  |  59 ++++
 modules/spring/src/test/config/store-cache1.xml |  62 ++++
 .../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 172 +++++++++++
 .../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 193 ++++++++++++
 .../testsuites/IgniteSpringTestSuite.java       |   5 +
 modules/ssh/pom.xml                             |   2 +-
 modules/tools/pom.xml                           |   2 +-
 modules/urideploy/pom.xml                       |   2 +-
 modules/visor-console-2.10/pom.xml              |   2 +-
 modules/visor-console/pom.xml                   |   2 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   2 +-
 modules/yardstick/pom.xml                       |   2 +-
 pom.xml                                         |   2 +-
 87 files changed, 2520 insertions(+), 500 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ca253a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 174b7a0,718e6ba..4f2486b
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@@ -687,9 -716,16 +714,9 @@@ public class GridQueryProcessor extend
      }
  
      /**
 -     * @return Message factory for {@link GridIoManager}.
 -     */
 -    public MessageFactory messageFactory() {
 -        return idx == null ? null : idx.messageFactory();
 -    }
 -
 -    /**
       * Closeable iterator.
       */
-     private static interface ClIter<X> extends AutoCloseable, Iterator<X> {
+     private interface ClIter<X> extends AutoCloseable, Iterator<X> {
          // No-op.
      }
  

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ca253a8a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------


[35/50] incubator-ignite git commit: # i-484-1 review

Posted by sb...@apache.org.
# i-484-1 review


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

Branch: refs/heads/ignite-917-review
Commit: 42982382ee92bc12073beac34d72590bf905ed3e
Parents: 10febf2
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Wed Jun 17 18:12:49 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Wed Jun 17 18:12:49 2015 +0300

----------------------------------------------------------------------
 .../processors/query/h2/twostep/GridReduceQueryExecutor.java      | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/42982382/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index c570d24..6c407d9 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -438,7 +438,8 @@ public class GridReduceQueryExecutor {
             assert !nodes.isEmpty();
 
             if (cctx.isReplicated() || qry.explain()) {
-                assert qry.explain() || !nodes.contains(ctx.cluster().get().localNode()) : "We must be on a client node.";
+                assert qry.explain() || !nodes.contains(ctx.cluster().get().localNode()) :
+                    "We must be on a client node.";
 
                 // Select random data node to run query on a replicated data or get EXPLAIN PLAN from a single node.
                 nodes = Collections.singleton(F.rand(nodes));


[44/50] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-sprint-6' into ignite-sprint-6

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-6' into ignite-sprint-6


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

Branch: refs/heads/ignite-917-review
Commit: 4cc376bedd63aee6cb5de434c435b3384431ed63
Parents: fa6615a fffc2ec
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Thu Jun 18 09:45:26 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Thu Jun 18 09:45:26 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      |   4 +
 .../processors/cache/IgniteCacheProxy.java      |   7 +
 .../dht/GridDhtPartitionTopologyImpl.java       |   4 +-
 .../dht/GridDhtTransactionalCacheAdapter.java   |   2 +-
 .../cache/transactions/IgniteTxHandler.java     |   2 +-
 .../transactions/IgniteTxLocalAdapter.java      |  12 +-
 .../dr/IgniteDrDataStreamerCacheUpdater.java    |   7 +-
 .../CacheStoreUsageMultinodeAbstractTest.java   | 305 +++++++++++++++++++
 ...eUsageMultinodeDynamicStartAbstractTest.java | 169 ++++++++++
 ...oreUsageMultinodeDynamicStartAtomicTest.java |  32 ++
 ...heStoreUsageMultinodeDynamicStartTxTest.java |  32 ++
 ...reUsageMultinodeStaticStartAbstractTest.java | 158 ++++++++++
 ...toreUsageMultinodeStaticStartAtomicTest.java |  32 ++
 ...cheStoreUsageMultinodeStaticStartTxTest.java |  32 ++
 .../IgniteCacheP2pUnmarshallingTxErrorTest.java |  19 +-
 .../junits/common/GridCommonAbstractTest.java   |   8 +-
 .../testsuites/IgniteCacheTestSuite4.java       |   4 +
 17 files changed, 810 insertions(+), 19 deletions(-)
----------------------------------------------------------------------



[03/50] incubator-ignite git commit: ignite-1020 create GridDhtTxLocal with storeEnabled=true

Posted by sb...@apache.org.
ignite-1020 create GridDhtTxLocal with storeEnabled=true


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

Branch: refs/heads/ignite-917-review
Commit: 7fd14411c36b6de7b79841c9af81506780279a10
Parents: e3750b7
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 16 17:14:54 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 16 17:14:54 2015 +0300

----------------------------------------------------------------------
 .../cache/distributed/dht/GridDhtTransactionalCacheAdapter.java    | 2 +-
 .../internal/processors/cache/transactions/IgniteTxHandler.java    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7fd14411/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 703daf9..4f081bf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -859,7 +859,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
                                         req.isolation(),
                                         req.timeout(),
                                         req.isInvalidate(),
-                                        false,
+                                        true,
                                         req.txSize(),
                                         null,
                                         req.subjectId(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7fd14411/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index 01662ef..e481e25 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -325,7 +325,7 @@ public class IgniteTxHandler {
                     req.isolation(),
                     req.timeout(),
                     req.isInvalidate(),
-                    false,
+                    true,
                     req.txSize(),
                     req.transactionNodes(),
                     req.subjectId(),


[45/50] incubator-ignite git commit: Merge branches 'ignite-484-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-6

Posted by sb...@apache.org.
Merge branches 'ignite-484-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-6


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

Branch: refs/heads/ignite-917-review
Commit: de53189605c859a6eb9aa09c8181d5720c5dc28b
Parents: 4cc376b eebf9c1
Author: S.Vladykin <sv...@gridgain.com>
Authored: Thu Jun 18 09:51:50 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Thu Jun 18 09:51:50 2015 +0300

----------------------------------------------------------------------
 .../affinity/AffinityTopologyVersion.java       |   7 -
 .../distributed/dht/GridDhtLocalPartition.java  |  56 +-
 .../dht/GridDhtPartitionsReservation.java       | 292 +++++++++
 .../cache/distributed/dht/GridReservable.java   |  35 +
 .../dht/preloader/GridDhtPartitionMap.java      |  26 +-
 .../cache/query/GridCacheQueryManager.java      |  33 -
 .../cache/query/GridCacheTwoStepQuery.java      |  22 +-
 .../processors/query/GridQueryIndexing.java     |  14 +-
 .../processors/query/GridQueryProcessor.java    |  14 +-
 .../messages/GridQueryNextPageResponse.java     |  34 +-
 .../h2/twostep/messages/GridQueryRequest.java   | 111 +++-
 .../apache/ignite/internal/util/GridDebug.java  |  19 +
 .../processors/query/h2/IgniteH2Indexing.java   |  79 ++-
 .../query/h2/sql/GridSqlQuerySplitter.java      |  49 +-
 .../query/h2/twostep/GridMapQueryExecutor.java  | 332 +++++++---
 .../query/h2/twostep/GridMergeIndex.java        |  17 +-
 .../h2/twostep/GridMergeIndexUnsorted.java      |   7 +-
 .../h2/twostep/GridReduceQueryExecutor.java     | 650 ++++++++++++++++---
 .../query/h2/twostep/GridResultPage.java        |  21 +-
 .../cache/GridCacheCrossCacheQuerySelfTest.java |   3 +-
 .../IgniteCacheQueryMultiThreadedSelfTest.java  |   1 -
 ...lientQueryReplicatedNodeRestartSelfTest.java | 419 ++++++++++++
 .../IgniteCacheQueryNodeRestartSelfTest.java    |  36 +-
 .../IgniteCacheQueryNodeRestartSelfTest2.java   | 383 +++++++++++
 .../IgniteCacheQuerySelfTestSuite.java          |   2 +
 25 files changed, 2380 insertions(+), 282 deletions(-)
----------------------------------------------------------------------



[47/50] incubator-ignite git commit: #Fixed aws tests. (Changed bucket name)

Posted by sb...@apache.org.
#Fixed aws tests. (Changed bucket name)


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

Branch: refs/heads/ignite-917-review
Commit: 45939ace51cd081ac1c755ca0b6076a22f00cfb5
Parents: de53189
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Thu Jun 18 10:30:33 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Thu Jun 18 10:31:31 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/checkpoint/s3/S3CheckpointManagerSelfTest.java    | 2 +-
 .../apache/ignite/spi/checkpoint/s3/S3CheckpointSpiSelfTest.java | 4 ++--
 .../spi/checkpoint/s3/S3CheckpointSpiStartStopSelfTest.java      | 2 +-
 .../ignite/spi/checkpoint/s3/S3SessionCheckpointSelfTest.java    | 2 +-
 .../tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSelfTest.java          | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45939ace/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointManagerSelfTest.java b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointManagerSelfTest.java
index a354e67..b01ba81 100644
--- a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointManagerSelfTest.java
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointManagerSelfTest.java
@@ -39,7 +39,7 @@ public class S3CheckpointManagerSelfTest extends GridCheckpointManagerAbstractSe
 
         spi.setAwsCredentials(cred);
 
-        spi.setBucketNameSuffix("test-bucket");
+        spi.setBucketNameSuffix("unit-test-bucket");
 
         cfg.setCheckpointSpi(spi);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45939ace/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiSelfTest.java b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiSelfTest.java
index 5cf0f2e..5894678 100644
--- a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiSelfTest.java
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiSelfTest.java
@@ -48,7 +48,7 @@ public class S3CheckpointSpiSelfTest extends GridSpiAbstractTest<S3CheckpointSpi
 
         spi.setAwsCredentials(cred);
 
-        spi.setBucketNameSuffix("test-bucket");
+        spi.setBucketNameSuffix("unit-test-bucket");
 
         super.spiConfigure(spi);
     }
@@ -62,7 +62,7 @@ public class S3CheckpointSpiSelfTest extends GridSpiAbstractTest<S3CheckpointSpi
 
         AmazonS3 s3 = new AmazonS3Client(cred);
 
-        String bucketName = S3CheckpointSpi.BUCKET_NAME_PREFIX + "test-bucket";
+        String bucketName = S3CheckpointSpi.BUCKET_NAME_PREFIX + "unit-test-bucket";
 
         try {
             ObjectListing list = s3.listObjects(bucketName);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45939ace/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSelfTest.java b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSelfTest.java
index 7de2124..34f25ad 100644
--- a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSelfTest.java
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3CheckpointSpiStartStopSelfTest.java
@@ -34,7 +34,7 @@ public class S3CheckpointSpiStartStopSelfTest extends GridSpiStartStopAbstractTe
 
         spi.setAwsCredentials(cred);
 
-        spi.setBucketNameSuffix("test-bucket");
+        spi.setBucketNameSuffix("unit-test-bucket");
 
         super.spiConfigure(spi);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45939ace/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3SessionCheckpointSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3SessionCheckpointSelfTest.java b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3SessionCheckpointSelfTest.java
index 56f39de..c683cb3 100644
--- a/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3SessionCheckpointSelfTest.java
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/checkpoint/s3/S3SessionCheckpointSelfTest.java
@@ -39,7 +39,7 @@ public class S3SessionCheckpointSelfTest extends GridSessionCheckpointAbstractSe
 
         spi.setAwsCredentials(cred);
 
-        spi.setBucketNameSuffix("test-bucket");
+        spi.setBucketNameSuffix("unit-test-bucket");
 
         cfg.setCheckpointSpi(spi);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45939ace/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSelfTest.java b/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSelfTest.java
index 709145b..8a7b528 100644
--- a/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSelfTest.java
+++ b/modules/aws/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSelfTest.java
@@ -51,7 +51,7 @@ public class TcpDiscoveryS3IpFinderSelfTest
             IgniteS3TestSuite.getSecretKey()));
 
         // Bucket name should be unique for the host to parallel test run on one bucket.
-        finder.setBucketName("ip-finder-test-bucket-" + InetAddress.getLocalHost().getAddress()[3]);
+        finder.setBucketName("ip-finder-unit-test-bucket-" + InetAddress.getLocalHost().getAddress()[3]);
 
         for (int i = 0; i < 5; i++) {
             Collection<InetSocketAddress> addrs = finder.getRegisteredAddresses();


[11/50] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-960' into ignite-960

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-960' into ignite-960


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

Branch: refs/heads/ignite-917-review
Commit: 83abea4afd4fd5d66be111f5af8cf1a0d69a677e
Parents: d530c8c 4025ce3
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 18:48:16 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 18:48:16 2015 +0300

----------------------------------------------------------------------
 .../cache/store/jdbc/CacheJdbcPojoStore.java    |   3 -
 .../internal/interop/InteropBootstrap.java      |   3 +-
 .../internal/interop/InteropIgnition.java       |   5 +-
 .../processors/query/GridQueryProcessor.java    | 102 ++++++---
 .../ignite/spi/discovery/tcp/ClientImpl.java    |  87 +++++---
 .../apache/ignite/internal/GridSelfTest.java    |  12 +-
 .../GridDiscoveryManagerAliveCacheSelfTest.java |  17 +-
 .../GridCacheAbstractFailoverSelfTest.java      |   2 +
 ...ridCacheMultinodeUpdateAbstractSelfTest.java |   9 +
 .../cache/GridCacheVersionMultinodeTest.java    |   8 +-
 ...CacheP2pUnmarshallingRebalanceErrorTest.java |  15 +-
 .../IgniteCacheClientNodeConcurrentStart.java   |  14 +-
 .../distributed/IgniteCacheManyClientsTest.java |  69 +++++--
 .../GridCachePartitionedTxSalvageSelfTest.java  |  37 +---
 .../junits/common/GridCommonAbstractTest.java   |  11 +-
 .../IgniteCacheFailoverTestSuite.java           |   8 -
 .../IgniteCacheFailoverTestSuite2.java          |  47 +++++
 .../CacheAbstractQueryMetricsSelfTest.java      | 205 ++++++++++++++++++
 .../CachePartitionedQueryMetricsSelfTest.java   |  32 +++
 .../CacheReplicatedQueryMetricsSelfTest.java    |  32 +++
 .../cache/GridCacheQueryMetricsSelfTest.java    | 206 -------------------
 .../query/h2/sql/BaseH2CompareQueryTest.java    |   2 +-
 .../IgniteCacheQuerySelfTestSuite.java          |   4 +-
 23 files changed, 581 insertions(+), 349 deletions(-)
----------------------------------------------------------------------



[20/50] incubator-ignite git commit: 1.1.3-SNAPSHOT

Posted by sb...@apache.org.
1.1.3-SNAPSHOT


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

Branch: refs/heads/ignite-917-review
Commit: dc05e88c8a0dd314ebfba6b5baf246e0d00be6a2
Parents: d1a2150
Author: Ignite Teamcity <ig...@apache.org>
Authored: Wed Jun 17 12:04:20 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Wed Jun 17 12:04:20 2015 +0300

----------------------------------------------------------------------
 examples/pom.xml                                  | 2 +-
 modules/aop/pom.xml                               | 2 +-
 modules/aws/pom.xml                               | 2 +-
 modules/clients/pom.xml                           | 2 +-
 modules/cloud/pom.xml                             | 2 +-
 modules/codegen/pom.xml                           | 2 +-
 modules/core/pom.xml                              | 2 +-
 modules/core/src/main/resources/ignite.properties | 2 +-
 modules/extdata/p2p/pom.xml                       | 2 +-
 modules/extdata/uri/pom.xml                       | 2 +-
 modules/gce/pom.xml                               | 2 +-
 modules/geospatial/pom.xml                        | 2 +-
 modules/hadoop/pom.xml                            | 2 +-
 modules/hibernate/pom.xml                         | 2 +-
 modules/indexing/pom.xml                          | 2 +-
 modules/jcl/pom.xml                               | 2 +-
 modules/jta/pom.xml                               | 2 +-
 modules/log4j/pom.xml                             | 2 +-
 modules/mesos/pom.xml                             | 2 +-
 modules/rest-http/pom.xml                         | 2 +-
 modules/scalar-2.10/pom.xml                       | 2 +-
 modules/scalar/pom.xml                            | 2 +-
 modules/schedule/pom.xml                          | 2 +-
 modules/schema-import/pom.xml                     | 2 +-
 modules/slf4j/pom.xml                             | 2 +-
 modules/spark-2.10/pom.xml                        | 2 +-
 modules/spark/pom.xml                             | 2 +-
 modules/spring/pom.xml                            | 2 +-
 modules/ssh/pom.xml                               | 2 +-
 modules/tools/pom.xml                             | 2 +-
 modules/urideploy/pom.xml                         | 2 +-
 modules/visor-console-2.10/pom.xml                | 2 +-
 modules/visor-console/pom.xml                     | 2 +-
 modules/visor-plugins/pom.xml                     | 2 +-
 modules/web/pom.xml                               | 2 +-
 modules/yardstick/pom.xml                         | 2 +-
 pom.xml                                           | 2 +-
 37 files changed, 37 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 016b3ce..8422402 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>ignite-examples</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index e04f183..1119301 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-aop</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index f7fdfbc..3b1f3c6 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-aws</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index 7842c47..dfde946 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-clients</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 579c6a0..b45b503 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
     </parent>
 
     <artifactId>ignite-cloud</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <properties>
         <jcloud.version>1.9.0</jcloud.version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 9d375cc..94154ea 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-codegen</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index a0ee32e..b81cc63 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-core</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index 5171bd6..32d6d1f 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
 # limitations under the License.
 #
 
-ignite.version=1.1.2-SNAPSHOT
+ignite.version=1.1.3-SNAPSHOT
 ignite.build=0
 ignite.revision=DEV
 ignite.rel.date=01011970

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index 4546112..0ee5e75 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-extdata-p2p</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index be0c73b..633df8b 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-extdata-uri</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index e0a5d1d..2da3a6c 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-gce</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index d9bd236..4f71637 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-geospatial</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index dd7c9b7..ef26445 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-hadoop</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index d7e098c..b4da498 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-hibernate</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 18a3579..451e801 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-indexing</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 516df8a..0b0f2a6 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jcl</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index ca5ef52..b4d6a5a 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jta</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index 533f592..2c5e15e 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-log4j</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index 173fe7c..d718a65 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-mesos</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <properties>
         <jetty.version>9.2.10.v20150310</jetty.version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 243ac06..18ec434 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-rest-http</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index 63bfd36..71c1ec9 100644
--- a/modules/scalar-2.10/pom.xml
+++ b/modules/scalar-2.10/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-scalar_2.10</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 3fb2470..635b874 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-scalar</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 049fe65..0c73aa0 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-schedule</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 8523d34..92b9da8 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-schema-import</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 5284182..22f538f 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-slf4j</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index 46cc4e7..5e5d78e 100644
--- a/modules/spark-2.10/pom.xml
+++ b/modules/spark-2.10/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spark_2.10</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index e62ca24..244fa3c 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spark</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index d56cb2b..85f57bb 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spring</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index d65d173..dcd74d8 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-ssh</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 0bb221f..41e4f8a 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-tools</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index 70a23b0..7970f4b 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-urideploy</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/visor-console-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console-2.10/pom.xml b/modules/visor-console-2.10/pom.xml
index bb7aefc..f5116bd 100644
--- a/modules/visor-console-2.10/pom.xml
+++ b/modules/visor-console-2.10/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-visor-console_2.10</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index ef6abc0..885afe1 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-visor-console</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index ef217ed..51680fa 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-visor-plugins</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <!-- Ignite dependencies -->

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index 6b69c63..97901ba 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-web</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 39c7f5a..c4cb122 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-yardstick</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
 
     <properties>
         <yardstick.version>0.7.0</yardstick.version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 68d610e..84e1c79 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
 
     <groupId>org.apache.ignite</groupId>
     <artifactId>apache-ignite</artifactId>
-    <version>1.1.2-SNAPSHOT</version>
+    <version>1.1.3-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <properties>


[25/50] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-sprint-6' into ignite-sprint-6

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-6' into ignite-sprint-6


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

Branch: refs/heads/ignite-917-review
Commit: 9c0b09c58965091e866d0ebdba8055d5471c6e9a
Parents: f173f91 dc05e88
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Jun 17 12:34:04 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Jun 17 12:34:04 2015 +0300

----------------------------------------------------------------------
 examples/pom.xml                                  | 2 +-
 modules/aop/pom.xml                               | 2 +-
 modules/aws/pom.xml                               | 2 +-
 modules/clients/pom.xml                           | 2 +-
 modules/cloud/pom.xml                             | 2 +-
 modules/codegen/pom.xml                           | 2 +-
 modules/core/pom.xml                              | 2 +-
 modules/core/src/main/resources/ignite.properties | 2 +-
 modules/extdata/p2p/pom.xml                       | 2 +-
 modules/extdata/uri/pom.xml                       | 2 +-
 modules/gce/pom.xml                               | 2 +-
 modules/geospatial/pom.xml                        | 2 +-
 modules/hadoop/pom.xml                            | 2 +-
 modules/hibernate/pom.xml                         | 2 +-
 modules/indexing/pom.xml                          | 2 +-
 modules/jcl/pom.xml                               | 2 +-
 modules/jta/pom.xml                               | 2 +-
 modules/log4j/pom.xml                             | 2 +-
 modules/mesos/pom.xml                             | 2 +-
 modules/rest-http/pom.xml                         | 2 +-
 modules/scalar-2.10/pom.xml                       | 2 +-
 modules/scalar/pom.xml                            | 2 +-
 modules/schedule/pom.xml                          | 2 +-
 modules/schema-import/pom.xml                     | 2 +-
 modules/slf4j/pom.xml                             | 2 +-
 modules/spark-2.10/pom.xml                        | 2 +-
 modules/spark/pom.xml                             | 2 +-
 modules/spring/pom.xml                            | 2 +-
 modules/ssh/pom.xml                               | 2 +-
 modules/tools/pom.xml                             | 2 +-
 modules/urideploy/pom.xml                         | 2 +-
 modules/visor-console-2.10/pom.xml                | 2 +-
 modules/visor-console/pom.xml                     | 2 +-
 modules/visor-plugins/pom.xml                     | 2 +-
 modules/web/pom.xml                               | 2 +-
 modules/yardstick/pom.xml                         | 2 +-
 pom.xml                                           | 2 +-
 37 files changed, 37 insertions(+), 37 deletions(-)
----------------------------------------------------------------------



[07/50] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-960' into ignite-960

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-960' into ignite-960


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

Branch: refs/heads/ignite-917-review
Commit: c909caee1e43610bcbf3e1350b78525a0e76ca48
Parents: ca89d81 dd8048b
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jun 16 17:52:15 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jun 16 17:52:15 2015 +0300

----------------------------------------------------------------------
 modules/spring/src/test/config/node1.xml        |  2 +-
 modules/spring/src/test/config/store-cache1.xml |  2 +-
 .../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 63 +++++++++++++++++++-
 .../jdbc/CacheJdbcPojoStoreFactorySelfTest.java |  3 +-
 4 files changed, 63 insertions(+), 7 deletions(-)
----------------------------------------------------------------------



[09/50] incubator-ignite git commit: sp-6 - release notes

Posted by sb...@apache.org.
sp-6 - release notes


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

Branch: refs/heads/ignite-917-review
Commit: 53f4cb75ad08a3dca595dacc30d0e1b256c4fbc8
Parents: ae188c7
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jun 16 18:09:31 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jun 16 18:09:31 2015 +0300

----------------------------------------------------------------------
 RELEASE_NOTES.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53f4cb75/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 1783131..3a5043e 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -8,8 +8,8 @@ Apache Ignite In-Memory Data Fabric 1.2
 * Added memory based evictions.
 * Added integration with Apache Spark.
 * Added integration with Apache Mesos.
-* Added support for log4j2.
 * Added IgniteCache.getAllOutTx() method.
+* Added serializable cache store factories for built-in stores.
 * Bug fixes in In-Memory Accelerator For Apache Hadoop.
 * Many stability and fault-tolerance fixes.
 


[30/50] incubator-ignite git commit: ignite-484-1 - get rid of owning future

Posted by sb...@apache.org.
ignite-484-1 - get rid of owning future


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

Branch: refs/heads/ignite-917-review
Commit: 68c35e734b3754460c4ad807e154ea94066600a0
Parents: 642f1c7
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 17 15:24:13 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 17 15:24:13 2015 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtLocalPartition.java   | 19 -------------------
 1 file changed, 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/68c35e73/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 1392f5e..3a577a7 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
@@ -70,10 +70,6 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
     @GridToStringExclude
     private final GridFutureAdapter<?> rent;
 
-    /** Rent future. */
-    @GridToStringExclude
-    private final GridFutureAdapter<?> own;
-
     /** Entries map. */
     private final ConcurrentMap<KeyCacheObject, GridDhtCacheEntry> map;
 
@@ -118,12 +114,6 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
             }
         };
 
-        own = new GridFutureAdapter<Object>() {
-            @Override public String toString() {
-                return "PartitionOwnFuture [part=" + GridDhtLocalPartition.this + ", map=" + map + ']';
-            }
-        };
-
         map = new ConcurrentHashMap8<>(cctx.config().getStartSize() /
             cctx.affinity().partitions());
 
@@ -426,8 +416,6 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
                 // No need to keep history any more.
                 evictHist = null;
 
-                own.onDone();
-
                 return true;
             }
         }
@@ -462,13 +450,6 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
     }
 
     /**
-     * @return The future which will be completed when partition will have state {@link GridDhtPartitionState#OWNING}.
-     */
-    public IgniteInternalFuture<?> owningFuture() {
-        return own;
-    }
-
-    /**
      * @param updateSeq Update sequence.
      * @return Future for evict attempt.
      */


[49/50] incubator-ignite git commit: # ignite-sprint-6 more info in test assert

Posted by sb...@apache.org.
# ignite-sprint-6 more info in test assert


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

Branch: refs/heads/ignite-917-review
Commit: d874b00dcb1687339adc34b6212e8cbc5b9ffe16
Parents: 6c683c2
Author: sboikov <sb...@gridgain.com>
Authored: Thu Jun 18 11:07:04 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Jun 18 11:07:04 2015 +0300

----------------------------------------------------------------------
 .../IgniteCacheAbstractStopBusySelfTest.java    | 30 ++++++++++++--------
 .../IgniteCacheAtomicStopBusySelfTest.java      |  8 +++---
 ...gniteCacheTransactionalStopBusySelfTest.java |  8 +++---
 3 files changed, 26 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d874b00d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java
index 10b14cc..074f6ff 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java
@@ -36,9 +36,13 @@ import org.apache.ignite.testframework.junits.common.*;
 import org.jetbrains.annotations.*;
 
 import java.io.*;
+import java.util.*;
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
 
+import static org.apache.ignite.cache.CacheRebalanceMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
+
 /**
  *
  */
@@ -53,7 +57,7 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst
     public static final String CACHE_NAME = "StopTest";
 
     /** */
-    public static final TcpDiscoveryIpFinder finder = new TcpDiscoveryVmIpFinder(true);
+    public final TcpDiscoveryIpFinder finder = new TcpDiscoveryVmIpFinder(true);
 
     /** */
     private AtomicBoolean suspended = new AtomicBoolean(false);
@@ -62,7 +66,7 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst
     private CountDownLatch blocked;
 
     /** */
-    protected AtomicReference<Class> bannedMessage = new AtomicReference<>();
+    protected AtomicReference<Class> bannedMsg = new AtomicReference<>();
 
     /**
      * @return Cache mode.
@@ -93,9 +97,9 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst
         if (gridName.endsWith(String.valueOf(CLN_GRD)))
             cfg.setClientMode(true);
 
-        cacheCfg.setRebalanceMode(CacheRebalanceMode.SYNC);
+        cacheCfg.setRebalanceMode(SYNC);
 
-        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
 
         cacheCfg.setBackups(1);
 
@@ -125,14 +129,14 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst
             TimeUnit.MILLISECONDS.sleep(100L);
         }
 
-        assert clientNode().cluster().nodes().size() == 2;
+        assertEquals(2, clientNode().cluster().nodes().size());
     }
 
     /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         suspended.set(false);
 
-        bannedMessage.set(null);
+        bannedMsg.set(null);
 
         afterTestsStopped();
 
@@ -140,7 +144,9 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst
 
         stopGrid(CLN_GRD);
 
-        assert G.allGrids().isEmpty();
+        List<Ignite> nodes = G.allGrids();
+
+        assertTrue("Unexpected nodes: " + nodes, nodes.isEmpty());
     }
 
     /**
@@ -203,12 +209,11 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst
      * @throws Exception If failed.
      */
     public void testGet() throws Exception {
-        bannedMessage.set(GridNearGetRequest.class);
+        bannedMsg.set(GridNearGetRequest.class);
 
         executeTest(new Callable<Integer>() {
             /** {@inheritDoc} */
-            @Override
-            public Integer call() throws Exception {
+            @Override public Integer call() throws Exception {
                 info("Start operation.");
 
                 Integer put = (Integer) clientCache().get(1);
@@ -318,6 +323,7 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst
      * @return Cache configuration.
      * @throws Exception In case of error.
      */
+    @SuppressWarnings("unchecked")
     private CacheConfiguration cacheConfiguration(@Nullable String cacheName) throws Exception {
         CacheConfiguration cfg = defaultCacheConfiguration();
 
@@ -339,10 +345,10 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst
         /** {@inheritDoc} */
         @Override public void sendMessage(ClusterNode node, Message msg) throws IgniteSpiException {
             if (suspended.get()) {
-                assert bannedMessage.get() != null;
+                assert bannedMsg.get() != null;
 
                 if (msg instanceof GridIoMessage
-                    && ((GridIoMessage)msg).message().getClass().equals(bannedMessage.get())) {
+                    && ((GridIoMessage)msg).message().getClass().equals(bannedMsg.get())) {
                     blocked.countDown();
 
                     return;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d874b00d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicStopBusySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicStopBusySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicStopBusySelfTest.java
index bae1601..ed15724 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicStopBusySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAtomicStopBusySelfTest.java
@@ -31,28 +31,28 @@ public class IgniteCacheAtomicStopBusySelfTest extends IgniteCacheAbstractStopBu
 
     /** {@inheritDoc} */
     @Override public void testPut() throws Exception {
-        bannedMessage.set(GridNearAtomicUpdateRequest.class);
+        bannedMsg.set(GridNearAtomicUpdateRequest.class);
 
         super.testPut();
     }
 
     /** {@inheritDoc} */
     @Override public void testPutBatch() throws Exception {
-        bannedMessage.set(GridNearAtomicUpdateRequest.class);
+        bannedMsg.set(GridNearAtomicUpdateRequest.class);
 
         super.testPut();
     }
 
     /** {@inheritDoc} */
     @Override public void testPutAsync() throws Exception {
-        bannedMessage.set(GridNearAtomicUpdateRequest.class);
+        bannedMsg.set(GridNearAtomicUpdateRequest.class);
 
         super.testPut();
     }
 
     /** {@inheritDoc} */
     @Override public void testRemove() throws Exception {
-        bannedMessage.set(GridNearAtomicUpdateRequest.class);
+        bannedMsg.set(GridNearAtomicUpdateRequest.class);
 
         super.testPut();
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d874b00d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java
index fe1b266..e87a772 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java
@@ -30,28 +30,28 @@ public class IgniteCacheTransactionalStopBusySelfTest extends IgniteCacheAbstrac
 
     /** {@inheritDoc} */
     @Override public void testPut() throws Exception {
-        bannedMessage.set(GridNearTxPrepareRequest.class);
+        bannedMsg.set(GridNearTxPrepareRequest.class);
 
         super.testPut();
     }
 
     /** {@inheritDoc} */
     @Override public void testPutBatch() throws Exception {
-        bannedMessage.set(GridNearTxPrepareRequest.class);
+        bannedMsg.set(GridNearTxPrepareRequest.class);
 
         super.testPut();
     }
 
     /** {@inheritDoc} */
     @Override public void testPutAsync() throws Exception {
-        bannedMessage.set(GridNearTxPrepareRequest.class);
+        bannedMsg.set(GridNearTxPrepareRequest.class);
 
         super.testPut();
     }
 
     /** {@inheritDoc} */
     @Override public void testRemove() throws Exception {
-        bannedMessage.set(GridNearTxPrepareRequest.class);
+        bannedMsg.set(GridNearTxPrepareRequest.class);
 
         super.testPut();
     }


[10/50] incubator-ignite git commit: #IGNITE-960 Added tests.

Posted by sb...@apache.org.
#IGNITE-960 Added tests.


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

Branch: refs/heads/ignite-917-review
Commit: d530c8c64477634576007ce6cacf21fc1113f93c
Parents: dd8048b
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 18:47:55 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 18:47:55 2015 +0300

----------------------------------------------------------------------
 .../store/jdbc/CacheJdbcBlobStoreFactory.java   |   2 +-
 .../store/jdbc/CacheJdbcPojoStoreFactory.java   |   4 +-
 modules/hibernate/pom.xml                       |  14 ++
 .../CacheHibernateBlobStoreFactory.java         |  62 +++++-
 .../hibernate/src/test/config/factory-cache.xml |  59 ++++++
 .../src/test/config/factory-cache1.xml          |  61 ++++++
 .../config/factory-incorrect-store-cache.xml    |  56 +++++
 .../CacheHibernateStoreFactorySelfTest.java     | 207 +++++++++++++++++++
 8 files changed, 457 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
index 29a83c9..c145641 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
@@ -92,7 +92,7 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSto
     private String dataSrcBean;
 
     /** Data source. */
-    private DataSource dataSrc;
+    private transient DataSource dataSrc;
 
     /** Application context. */
     @SpringApplicationContextResource

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
index 4cb680a..54f890f 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
@@ -63,10 +63,10 @@ public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheJdbcPojoSto
     private String dataSrcBean;
 
     /** Data source. */
-    private DataSource dataSrc;
+    private transient DataSource dataSrc;
 
     /** Database dialect. */
-    protected JdbcDialect dialect;
+    private transient JdbcDialect dialect;
 
     /** Application context. */
     @SpringApplicationContextResource

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index 10d91a2..d7e098c 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -90,6 +90,20 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-spring</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-log4j</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-beans</artifactId>
             <version>${spring.version}</version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
index 6b89a9e..5154faa 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
@@ -17,9 +17,13 @@
 
 package org.apache.ignite.cache.store.hibernate;
 
+import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.spring.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.resources.*;
 import org.hibernate.*;
 
 import javax.cache.configuration.*;
@@ -119,7 +123,10 @@ import java.util.*;
 public class CacheHibernateBlobStoreFactory<K, V> implements Factory<CacheHibernateBlobStore<K, V>> {
     /** Session factory. */
     @GridToStringExclude
-    private SessionFactory sesFactory;
+    private transient SessionFactory sesFactory;
+
+    /** Session factory bean name. */
+    private String sesFactoryBean;
 
     /** Path to hibernate configuration file. */
     private String hibernateCfgPath;
@@ -128,15 +135,38 @@ public class CacheHibernateBlobStoreFactory<K, V> implements Factory<CacheHibern
     @GridToStringExclude
     private Properties hibernateProps;
 
+    /** Application context. */
+    @SpringApplicationContextResource
+    private Object appContext;
 
     /** {@inheritDoc} */
     @Override public CacheHibernateBlobStore<K, V> create() {
         CacheHibernateBlobStore<K, V> store = new CacheHibernateBlobStore<>();
 
-        store.setSessionFactory(sesFactory);
         store.setHibernateConfigurationPath(hibernateCfgPath);
         store.setHibernateProperties(hibernateProps);
 
+        if (sesFactory != null)
+            store.setSessionFactory(sesFactory);
+        else if (sesFactoryBean != null) {
+            if (appContext == null)
+                throw new IgniteException("Spring application context resource is not injected.");
+
+            IgniteSpringHelper spring;
+
+            try {
+                spring = IgniteComponentType.SPRING.create(false);
+
+                SessionFactory sesFac = spring.loadBeanFromAppContext(appContext, sesFactoryBean);
+
+                store.setSessionFactory(sesFac);
+            }
+            catch (IgniteCheckedException e) {
+                throw new IgniteException("Failed to load bean in application context [beanName=" + sesFactoryBean +
+                        ", igniteConfig=" + appContext + ']');
+            }
+        }
+
         return store;
     }
 
@@ -144,10 +174,26 @@ public class CacheHibernateBlobStoreFactory<K, V> implements Factory<CacheHibern
      * Sets session factory.
      *
      * @param sesFactory Session factory.
+     * @return {@code This} for chaining.
      * @see CacheHibernateBlobStore#setSessionFactory(SessionFactory)
      */
-    public void setSessionFactory(SessionFactory sesFactory) {
+    public CacheHibernateBlobStoreFactory<K, V> setSessionFactory(SessionFactory sesFactory) {
         this.sesFactory = sesFactory;
+
+        return this;
+    }
+
+    /**
+     * Sets name of the data source bean.
+     *
+     * @param sesFactory Session factory bean name.
+     * @return {@code This} for chaining.
+     * @see CacheHibernateBlobStore#setSessionFactory(SessionFactory)
+     */
+    public CacheHibernateBlobStoreFactory<K, V> setSessionFactoryBean(String sesFactory) {
+        this.sesFactoryBean = sesFactory;
+
+        return this;
     }
 
     /**
@@ -157,20 +203,26 @@ public class CacheHibernateBlobStoreFactory<K, V> implements Factory<CacheHibern
      *
      * @param hibernateCfgPath URL or file path or classpath resource
      *      pointing to hibernate configuration XML file.
+     * @return {@code This} for chaining.
      * @see CacheHibernateBlobStore#setHibernateConfigurationPath(String)
      */
-    public void setHibernateConfigurationPath(String hibernateCfgPath) {
+    public CacheHibernateBlobStoreFactory<K, V> setHibernateConfigurationPath(String hibernateCfgPath) {
         this.hibernateCfgPath = hibernateCfgPath;
+
+        return this;
     }
 
     /**
      * Sets Hibernate properties.
      *
      * @param hibernateProps Hibernate properties.
+     * @return {@code This} for chaining.
      * @see CacheHibernateBlobStore#setHibernateProperties(Properties)
      */
-    public void setHibernateProperties(Properties hibernateProps) {
+    public CacheHibernateBlobStoreFactory<K, V> setHibernateProperties(Properties hibernateProps) {
         this.hibernateProps = hibernateProps;
+
+        return this;
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/hibernate/src/test/config/factory-cache.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/config/factory-cache.xml b/modules/hibernate/src/test/config/factory-cache.xml
new file mode 100644
index 0000000..a251846
--- /dev/null
+++ b/modules/hibernate/src/test/config/factory-cache.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+    <bean id="simpleSessionFactory"
+          class="org.apache.ignite.cache.store.hibernate.CacheHibernateStoreFactorySelfTest$DummySessionFactoryExt"/>
+
+    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <property name="cacheConfiguration">
+            <list>
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="name" value="test"/>
+                    <property name="atomicityMode" value="ATOMIC"/>
+                    <property name="backups" value="1"/>
+                    <property name="cacheStoreFactory">
+                        <bean class="org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory">
+                            <property name="sessionFactoryBean" value = "simpleSessionFactory"/>
+                        </bean>
+                    </property>
+                </bean>
+            </list>
+        </property>
+
+        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <value>127.0.0.1:47500..47509</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/hibernate/src/test/config/factory-cache1.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/config/factory-cache1.xml b/modules/hibernate/src/test/config/factory-cache1.xml
new file mode 100644
index 0000000..7f751fb
--- /dev/null
+++ b/modules/hibernate/src/test/config/factory-cache1.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+    <bean id="simpleSessionFactory1"
+          class="org.apache.ignite.cache.store.hibernate.CacheHibernateStoreFactorySelfTest$DummySessionFactory"/>
+
+    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <property name="gridName" value="ignite1"/>
+
+        <property name="cacheConfiguration">
+            <list>
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="name" value="test"/>
+                    <property name="atomicityMode" value="ATOMIC"/>
+                    <property name="backups" value="1"/>
+                    <property name="cacheStoreFactory">
+                        <bean class="org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory">
+                            <property name="sessionFactoryBean" value = "simpleSessionFactory1"/>
+                        </bean>
+                    </property>
+                </bean>
+            </list>
+        </property>
+
+        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <value>127.0.0.1:47500..47509</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/hibernate/src/test/config/factory-incorrect-store-cache.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/config/factory-incorrect-store-cache.xml b/modules/hibernate/src/test/config/factory-incorrect-store-cache.xml
new file mode 100644
index 0000000..459930c
--- /dev/null
+++ b/modules/hibernate/src/test/config/factory-incorrect-store-cache.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <property name="cacheConfiguration">
+            <list>
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="name" value="test"/>
+                    <property name="atomicityMode" value="ATOMIC"/>
+                    <property name="backups" value="1"/>
+                    <property name="cacheStoreFactory">
+                        <bean class="org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory">
+                            <property name="sessionFactoryBean" value = "simpleSessionFactory1"/>
+                        </bean>
+                    </property>
+                </bean>
+            </list>
+        </property>
+
+        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <value>127.0.0.1:47500..47509</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java b/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
index 225fc11..ad0bcfc 100644
--- a/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
+++ b/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
@@ -21,11 +21,24 @@ import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.common.*;
+import org.hibernate.*;
+import org.hibernate.engine.spi.*;
+import org.hibernate.metadata.*;
+import org.hibernate.stat.*;
+
+import javax.naming.*;
+import java.io.*;
+import java.sql.*;
+import java.util.*;
+import java.util.concurrent.*;
 
 /**
  * Test for Cache jdbc blob store factory.
  */
 public class CacheHibernateStoreFactorySelfTest extends GridCommonAbstractTest {
+    /** Cache name. */
+    private static final String CACHE_NAME = "test";
+
     /**
      * @throws Exception If failed.
      */
@@ -38,6 +51,36 @@ public class CacheHibernateStoreFactorySelfTest extends GridCommonAbstractTest {
     }
 
     /**
+     * @throws Exception If failed.
+     */
+    public void testXmlConfiguration() throws Exception {
+        try (Ignite ignite = Ignition.start("modules/hibernate/src/test/config/factory-cache.xml")) {
+            try(Ignite ignite1 = Ignition.start("modules/hibernate/src/test/config/factory-cache1.xml")) {
+                checkStore(ignite.<Integer, String>cache(CACHE_NAME), DummySessionFactoryExt.class);
+
+                checkStore(ignite1.<Integer, String>cache(CACHE_NAME), DummySessionFactory.class);
+            }
+        }
+    }
+
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testIncorrectBeanConfiguration() throws Exception {
+        GridTestUtils.assertThrows(log, new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                try(Ignite ignite =
+                    Ignition.start("modules/hibernate/src/test/config/factory-incorrect-store-cache.xml")) {
+                    ignite.cache(CACHE_NAME).getConfiguration(CacheConfiguration.class).
+                            getCacheStoreFactory().create();
+                }
+                return null;
+            }
+        }, IgniteException.class, "Failed to load bean in application context");
+    }
+
+    /**
      * @return Cache configuration with store.
      */
     private CacheConfiguration<Integer, String> cacheConfiguration() {
@@ -54,6 +97,19 @@ public class CacheHibernateStoreFactorySelfTest extends GridCommonAbstractTest {
 
     /**
      * @param cache Ignite cache.
+     * @param dataSrcClass Data source class.
+     * @throws Exception If store parameters is not the same as in configuration xml.
+     */
+    private void checkStore(IgniteCache<Integer, String> cache, Class<?> dataSrcClass) throws Exception {
+        CacheHibernateBlobStore store = (CacheHibernateBlobStore)cache
+            .getConfiguration(CacheConfiguration.class).getCacheStoreFactory().create();
+
+        assertEquals(dataSrcClass,
+            GridTestUtils.getFieldValue(store, CacheHibernateBlobStore.class, "sesFactory").getClass());
+    }
+
+    /**
+     * @param cache Ignite cache.
      * @throws Exception If store parameters is not the same as in configuration xml.
      */
     private void checkStore(IgniteCache<Integer, String> cache) throws Exception {
@@ -63,4 +119,155 @@ public class CacheHibernateStoreFactorySelfTest extends GridCommonAbstractTest {
         assertEquals("/org/apache/ignite/cache/store/hibernate/hibernate.cfg.xml",
             GridTestUtils.getFieldValue(store, CacheHibernateBlobStore.class, "hibernateCfgPath"));
     }
+
+    /**
+     *
+     */
+    public static class DummySessionFactoryExt extends DummySessionFactory {
+        /** */
+        public DummySessionFactoryExt() {
+            // No-op.
+        }
+    }
+
+    /**
+     *
+     */
+    public static class DummySessionFactory implements SessionFactory {
+        /** {@inheritDoc} */
+        @Override public SessionFactoryOptions getSessionFactoryOptions() {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public SessionBuilder withOptions() {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Session openSession() throws HibernateException {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Session getCurrentSession() throws HibernateException {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public StatelessSessionBuilder withStatelessOptions() {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public StatelessSession openStatelessSession() {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public StatelessSession openStatelessSession(Connection connection) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public ClassMetadata getClassMetadata(Class entityClass) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public ClassMetadata getClassMetadata(String entityName) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public CollectionMetadata getCollectionMetadata(String roleName) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Map<String, ClassMetadata> getAllClassMetadata() {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Map getAllCollectionMetadata() {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Statistics getStatistics() {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void close() throws HibernateException {
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean isClosed() {
+            return false;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Cache getCache() {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void evict(Class persistentClass) throws HibernateException {
+        }
+
+        /** {@inheritDoc} */
+        @Override public void evict(Class persistentClass, Serializable id) throws HibernateException {
+        }
+
+        /** {@inheritDoc} */
+        @Override public void evictEntity(String entityName) throws HibernateException {
+        }
+
+        /** {@inheritDoc} */
+        @Override public void evictEntity(String entityName, Serializable id) throws HibernateException {
+        }
+
+        /** {@inheritDoc} */
+        @Override public void evictCollection(String roleName) throws HibernateException {
+        }
+
+        /** {@inheritDoc} */
+        @Override public void evictCollection(String roleName, Serializable id) throws HibernateException {
+        }
+
+        /** {@inheritDoc} */
+        @Override public void evictQueries(String cacheRegion) throws HibernateException {
+        }
+
+        /** {@inheritDoc} */
+        @Override public void evictQueries() throws HibernateException {
+        }
+
+        /** {@inheritDoc} */
+        @Override public Set getDefinedFilterNames() {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public FilterDefinition getFilterDefinition(String filterName) throws HibernateException {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean containsFetchProfileDefinition(String name) {
+            return false;
+        }
+
+        /** {@inheritDoc} */
+        @Override public TypeHelper getTypeHelper() {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Reference getReference() throws NamingException {
+            return null;
+        }
+    }
 }


[32/50] incubator-ignite git commit: ignite-484-1 - replicated cache group reservation fix + drop reservations group for dead nodes

Posted by sb...@apache.org.
ignite-484-1 - replicated cache group reservation fix + drop reservations group for dead nodes


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

Branch: refs/heads/ignite-917-review
Commit: 1fe215e2cc83954f25cc7c2f0974dcf312694eb8
Parents: 68c35e7
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 17 15:57:24 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 17 15:57:24 2015 +0300

----------------------------------------------------------------------
 .../query/h2/twostep/GridMapQueryExecutor.java  | 22 ++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1fe215e2/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index 42f01cb..aaf64ee 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -123,6 +123,18 @@ public class GridMapQueryExecutor {
             }
         }, EventType.EVT_NODE_FAILED, EventType.EVT_NODE_LEFT);
 
+        // Drop group reservations for dead caches.
+        ctx.event().addLocalEventListener(new GridLocalEventListener() {
+            @Override public void onEvent(Event evt) {
+                String cacheName = ((CacheEvent)evt).cacheName();
+
+                for (T2<String,AffinityTopologyVersion> grpKey : reservations.keySet()) {
+                    if (F.eq(grpKey.get1(), cacheName))
+                        reservations.remove(grpKey);
+                }
+            }
+        }, EventType.EVT_CACHE_STOPPED);
+
         ctx.io().addMessageListener(GridTopic.TOPIC_QUERY, new GridMessageListener() {
             @Override public void onMessage(UUID nodeId, Object msg) {
                 if (!busyLock.enterBusy())
@@ -244,7 +256,9 @@ public class GridMapQueryExecutor {
             if (cctx.isLocal())
                 continue;
 
-            final T2<String,AffinityTopologyVersion> grpKey = new T2<>(cctx.name(), topVer);
+            // For replicated cache topology version does not make sense.
+            final T2<String,AffinityTopologyVersion> grpKey =
+                new T2<>(cctx.name(), cctx.isReplicated() ? null : topVer);
 
             GridReservable r = reservations.get(grpKey);
 
@@ -265,10 +279,10 @@ public class GridMapQueryExecutor {
                             // We don't need to reserve partitions because they will not be evicted in replicated caches.
                             if (part == null || part.state() != OWNING)
                                 return false;
-
-                            // Mark that we checked this replicated cache.
-                            reservations.putIfAbsent(grpKey, ReplicatedReservation.INSTANCE);
                         }
+
+                        // Mark that we checked this replicated cache.
+                        reservations.putIfAbsent(grpKey, ReplicatedReservation.INSTANCE);
                     }
                 }
                 else { // Reserve primary partitions for partitioned cache (if no explicit given).


[04/50] incubator-ignite git commit: #IGNITE-960 Fixed review notes. Added tests. Added check that CacheConfiguration is serializable.

Posted by sb...@apache.org.
#IGNITE-960 Fixed review notes. Added tests. Added check that CacheConfiguration is serializable.


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

Branch: refs/heads/ignite-917-review
Commit: a7ca45bb5fb9afa782d2b2ec134cc6524c7c22f8
Parents: b037baf
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 17:15:49 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 17:15:49 2015 +0300

----------------------------------------------------------------------
 .../cache/store/jdbc/CacheJdbcBlobStore.java    |  22 +-
 .../store/jdbc/CacheJdbcBlobStoreFactory.java   | 287 +++++++++++++++++++
 .../cache/store/jdbc/CacheJdbcPojoStore.java    |   3 +
 .../store/jdbc/CacheJdbcPojoStoreFactory.java   | 145 ++++++++++
 .../processors/cache/GridCacheProcessor.java    |  18 ++
 .../util/spring/IgniteSpringHelper.java         |  10 +
 .../hibernate/CacheHibernateBlobStore.java      |  87 +-----
 .../CacheHibernateBlobStoreFactory.java         | 180 ++++++++++++
 .../CacheHibernateStoreFactorySelfTest.java     |  66 +++++
 .../testsuites/IgniteHibernateTestSuite.java    |   2 +
 .../store/jdbc/CacheJdbcBlobStoreFactory.java   | 237 ---------------
 .../util/spring/IgniteSpringHelperImpl.java     |  17 ++
 .../src/test/config/incorrect-store-cache.xml   |   2 +-
 .../test/config/pojo-incorrect-store-cache.xml  |  56 ++++
 modules/spring/src/test/config/store-cache.xml  |   2 +-
 modules/spring/src/test/config/store-cache1.xml |   2 +-
 .../jdbc/CacheJdbcBlobStoreFactorySelfTest.java |   2 +-
 .../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 194 +++++++++++++
 .../testsuites/IgniteSpringTestSuite.java       |   5 +
 19 files changed, 991 insertions(+), 346 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
index 6852260..e01c879 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
@@ -19,6 +19,7 @@ package org.apache.ignite.cache.store.jdbc;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.store.*;
+import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.*;
@@ -65,27 +66,8 @@ import java.util.concurrent.atomic.*;
  *     <li>Insert entry query (see {@link #setInsertQuery(String)})</li>
  *     <li>Delete entry query (see {@link #setDeleteQuery(String)})</li>
  * </ul>
- * <h2 class="header">Java Example</h2>
- * <pre name="code" class="java">
- *     ...
- *     GridCacheJdbcBlobStore&lt;String, String&gt; store = new GridCacheJdbcBlobStore&lt;String, String&gt;();
- *     ...
- * </pre>
- * <h2 class="header">Spring Example</h2>
- * <pre name="code" class="xml">
- *     ...
- *     &lt;bean id=&quot;cache.jdbc.store&quot;
- *         class=&quot;org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore&quot;&gt;
- *         &lt;property name=&quot;connectionUrl&quot; value=&quot;jdbc:h2:mem:&quot;/&gt;
- *         &lt;property name=&quot;createTableQuery&quot;
- *             value=&quot;create table if not exists ENTRIES (key other, val other)&quot;/&gt;
- *     &lt;/bean&gt;
- *     ...
- * </pre>
  * <p>
- * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
- * <br>
- * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
+ * Use {@link CacheJdbcBlobStoreFactory} factory to pass {@link CacheJdbcBlobStore} to {@link CacheConfiguration}.
  */
 public class CacheJdbcBlobStore<K, V> extends CacheStoreAdapter<K, V> {
     /** Default connection URL (value is <tt>jdbc:h2:mem:jdbcCacheStore;DB_CLOSE_DELAY=-1</tt>). */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
new file mode 100644
index 0000000..29a83c9
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
@@ -0,0 +1,287 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cache.store.jdbc;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.spring.*;
+import org.apache.ignite.internal.util.tostring.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.resources.*;
+
+import javax.cache.configuration.*;
+import javax.sql.*;
+
+/**
+ * {@link Factory} implementation for {@link CacheJdbcBlobStore}.
+ *
+ * Use this factory to pass {@link CacheJdbcBlobStore} to {@link CacheConfiguration}.
+ *
+ * <h2 class="header">Spring Example</h2>
+ * <pre name="code" class="xml">
+ *     &lt;bean id= "simpleDataSource" class="org.h2.jdbcx.JdbcDataSource"/&gt;
+ *
+ *     &lt;bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"&gt;
+ *          ...
+ *          &lt;property name="cacheConfiguration"&gt;
+ *               &lt;list&gt;
+ *                  &lt;bean class="org.apache.ignite.configuration.CacheConfiguration"&gt;
+ *                      ...
+ *                      &lt;property name="cacheStoreFactory"&gt;
+ *                          &lt;bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactory"&gt;
+ *                              &lt;property name="user" value = "GridGain" /&gt;
+ *                              &lt;property name="dataSourceBean" value = "simpleDataSource" /&gt;
+ *                          &lt;/bean&gt;
+ *                      &lt;/property&gt;
+ *                  &lt;/bean&gt;
+ *               &lt;/list&gt;
+ *          &lt;/property&gt;
+ *     &lt;/bean&gt;
+ * </pre>
+ * <p>
+ * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
+ * <br>
+ * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
+ */
+public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobStore<K, V>> {
+    /** Connection URL. */
+    private String connUrl = CacheJdbcBlobStore.DFLT_CONN_URL;
+
+    /** Query to create table. */
+    private String createTblQry = CacheJdbcBlobStore.DFLT_CREATE_TBL_QRY;
+
+    /** Query to load entry. */
+    private String loadQry = CacheJdbcBlobStore.DFLT_LOAD_QRY;
+
+    /** Query to update entry. */
+    private String updateQry = CacheJdbcBlobStore.DFLT_UPDATE_QRY;
+
+    /** Query to insert entries. */
+    private String insertQry = CacheJdbcBlobStore.DFLT_INSERT_QRY;
+
+    /** Query to delete entries. */
+    private String delQry = CacheJdbcBlobStore.DFLT_DEL_QRY;
+
+    /** User name for database access. */
+    private String user;
+
+    /** Password for database access. */
+    @GridToStringExclude
+    private String passwd;
+
+    /** Flag for schema initialization. */
+    private boolean initSchema = true;
+
+    /** Name of data source bean. */
+    private String dataSrcBean;
+
+    /** Data source. */
+    private DataSource dataSrc;
+
+    /** Application context. */
+    @SpringApplicationContextResource
+    private Object appContext;
+
+    /** {@inheritDoc} */
+    @Override public CacheJdbcBlobStore<K, V> create() {
+        CacheJdbcBlobStore<K, V> store = new CacheJdbcBlobStore<>();
+
+        store.setInitSchema(initSchema);
+        store.setConnectionUrl(connUrl);
+        store.setCreateTableQuery(createTblQry);
+        store.setLoadQuery(loadQry);
+        store.setUpdateQuery(updateQry);
+        store.setInsertQuery(insertQry);
+        store.setDeleteQuery(delQry);
+        store.setUser(user);
+        store.setPassword(passwd);
+
+        if (dataSrc != null)
+            store.setDataSource(dataSrc);
+        else if (dataSrcBean != null) {
+            if (appContext == null)
+                throw new IgniteException("Spring application context resource is not injected.");
+
+            IgniteSpringHelper spring;
+
+            try {
+                spring = IgniteComponentType.SPRING.create(false);
+
+                DataSource data = spring.loadBeanFromAppContext(appContext, dataSrcBean);
+
+                store.setDataSource(data);
+            }
+            catch (IgniteCheckedException e) {
+                throw new IgniteException("Failed to load bean in application context [beanName=" + dataSrcBean +
+                    ", igniteConfig=" + appContext + ']');
+            }
+        }
+
+        return store;
+    }
+
+    /**
+     * Flag indicating whether DB schema should be initialized by Ignite (default behaviour) or
+     * was explicitly created by user.
+     *
+     * @param initSchema Initialized schema flag.
+     * @return {@code This} for chaining.
+     * @see CacheJdbcBlobStore#setInitSchema(boolean)
+     */
+    public CacheJdbcBlobStoreFactory<K, V> setInitSchema(boolean initSchema) {
+        this.initSchema = initSchema;
+
+        return this;
+    }
+
+    /**
+     * Sets connection URL.
+     *
+     * @param connUrl Connection URL.
+     * @return {@code This} for chaining.
+     * @see CacheJdbcBlobStore#setConnectionUrl(String)
+     */
+    public CacheJdbcBlobStoreFactory<K, V> setConnectionUrl(String connUrl) {
+        this.connUrl = connUrl;
+
+        return this;
+    }
+
+    /**
+     * Sets create table query.
+     *
+     * @param createTblQry Create table query.
+     * @return {@code This} for chaining.
+     * @see CacheJdbcBlobStore#setCreateTableQuery(String)
+     */
+    public CacheJdbcBlobStoreFactory<K, V> setCreateTableQuery(String createTblQry) {
+        this.createTblQry = createTblQry;
+
+        return this;
+    }
+
+    /**
+     * Sets load query.
+     *
+     * @param loadQry Load query
+     * @return {@code This} for chaining.
+     * @see CacheJdbcBlobStore#setLoadQuery(String)
+     */
+    public CacheJdbcBlobStoreFactory<K, V> setLoadQuery(String loadQry) {
+        this.loadQry = loadQry;
+
+        return this;
+    }
+
+    /**
+     * Sets update entry query.
+     *
+     * @param updateQry Update entry query.
+     * @return {@code This} for chaining.
+     * @see  CacheJdbcBlobStore#setUpdateQuery(String)
+     */
+    public CacheJdbcBlobStoreFactory<K, V> setUpdateQuery(String updateQry) {
+        this.updateQry = updateQry;
+
+        return this;
+    }
+
+    /**
+     * Sets insert entry query.
+     *
+     * @param insertQry Insert entry query.
+     * @return {@code This} for chaining.
+     * @see CacheJdbcBlobStore#setInsertQuery(String)
+     */
+    public CacheJdbcBlobStoreFactory<K, V> setInsertQuery(String insertQry) {
+        this.insertQry = insertQry;
+
+        return this;
+    }
+
+    /**
+     * Sets delete entry query.
+     *
+     * @param delQry Delete entry query.
+     * @return {@code This} for chaining.
+     * @see CacheJdbcBlobStore#setDeleteQuery(String)
+     */
+    public CacheJdbcBlobStoreFactory<K, V> setDeleteQuery(String delQry) {
+        this.delQry = delQry;
+
+        return this;
+    }
+
+    /**
+     * Sets user name for database access.
+     *
+     * @param user User name.
+     * @return {@code This} for chaining.
+     * @see CacheJdbcBlobStore#setUser(String)
+     */
+    public CacheJdbcBlobStoreFactory<K, V> setUser(String user) {
+        this.user = user;
+
+        return this;
+    }
+
+    /**
+     * Sets password for database access.
+     *
+     * @param passwd Password.
+     * @return {@code This} for chaining.
+     * @see CacheJdbcBlobStore#setPassword(String)
+     */
+    public CacheJdbcBlobStoreFactory<K, V> setPassword(String passwd) {
+        this.passwd = passwd;
+
+        return this;
+    }
+
+    /**
+     * Sets name of the data source bean.
+     *
+     * @param dataSrcBean Data source bean name.
+     * @return {@code This} for chaining.
+     * @see CacheJdbcBlobStore#setDataSource(DataSource)
+     */
+    public CacheJdbcBlobStoreFactory<K, V> setDataSourceBean(String dataSrcBean) {
+        this.dataSrcBean = dataSrcBean;
+
+        return this;
+    }
+
+    /**
+     * Sets data source. Data source should be fully configured and ready-to-use.
+     *
+     * @param dataSrc Data source.
+     * @return {@code This} for chaining.
+     * @see CacheJdbcBlobStore#setDataSource(DataSource)
+     */
+    public CacheJdbcBlobStoreFactory<K, V> setDataSource(DataSource dataSrc) {
+        this.dataSrc = dataSrc;
+
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(CacheJdbcBlobStoreFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
index 682f018..da00d95 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
@@ -19,6 +19,7 @@ package org.apache.ignite.cache.store.jdbc;
 
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.store.*;
+import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
@@ -33,6 +34,8 @@ import java.util.*;
  * Implementation of {@link CacheStore} backed by JDBC and POJO via reflection.
  *
  * This implementation stores objects in underlying database using java beans mapping description via reflection.
+ * <p>
+ * Use {@link CacheJdbcPojoStoreFactory} factory to pass {@link CacheJdbcPojoStore} to {@link CacheConfiguration}.
  *
  * @param <K> The type of keys handled by this loader.
  * @param <V> The type of values generated by this loader.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
new file mode 100644
index 0000000..4cb680a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cache.store.jdbc;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.store.jdbc.dialect.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.spring.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.resources.*;
+
+import javax.cache.configuration.*;
+import javax.sql.*;
+
+/**
+ * {@link Factory} implementation for {@link CacheJdbcPojoStore}.
+ *
+ * Use this factory to pass {@link CacheJdbcPojoStore} to {@link CacheConfiguration}.
+ *
+ * <h2 class="header">Spring Example</h2>
+ * <pre name="code" class="xml">
+ *     &lt;bean id= "simpleDataSource" class="org.h2.jdbcx.JdbcDataSource"/&gt;
+ *
+ *     &lt;bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"&gt;
+ *          ...
+ *          &lt;property name="cacheConfiguration"&gt;
+ *               &lt;list&gt;
+ *                  &lt;bean class="org.apache.ignite.configuration.CacheConfiguration"&gt;
+ *                      ...
+ *                      &lt;property name="cacheStoreFactory"&gt;
+ *                          &lt;bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory"&gt;
+ *                              &lt;property name="dataSourceBean" value = "simpleDataSource" /&gt;
+ *                          &lt;/bean&gt;
+ *                      &lt;/property&gt;
+ *                  &lt;/bean&gt;
+ *               &lt;/list&gt;
+ *          &lt;/property&gt;
+ *     &lt;/bean&gt;
+ * </pre>
+ * <p>
+ * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
+ * <br>
+ * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
+ */
+public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheJdbcPojoStore<K, V>> {
+    /** Name of data source bean. */
+    private String dataSrcBean;
+
+    /** Data source. */
+    private DataSource dataSrc;
+
+    /** Database dialect. */
+    protected JdbcDialect dialect;
+
+    /** Application context. */
+    @SpringApplicationContextResource
+    private Object appContext;
+
+    /** {@inheritDoc} */
+    @Override public CacheJdbcPojoStore<K, V> create() {
+        CacheJdbcPojoStore<K, V> store = new CacheJdbcPojoStore<>();
+
+        store.setDialect(dialect);
+
+        if (dataSrc != null)
+            store.setDataSource(dataSrc);
+        else if (dataSrcBean != null) {
+            if (appContext == null)
+                throw new IgniteException("Spring application context resource is not injected.");
+
+            IgniteSpringHelper spring;
+
+            try {
+                spring = IgniteComponentType.SPRING.create(false);
+
+                DataSource data = spring.loadBeanFromAppContext(appContext, dataSrcBean);
+
+                store.setDataSource(data);
+            }
+            catch (Exception e) {
+                throw new IgniteException("Failed to load bean in application context [beanName=" + dataSrcBean +
+                    ", igniteConfig=" + appContext + ']');
+            }
+        }
+
+        return store;
+    }
+
+    /**
+     * Sets name of the data source bean.
+     *
+     * @param dataSrcBean Data source bean name.
+     * @return {@code This} for chaining.
+     * @see CacheJdbcPojoStore#setDataSource(DataSource)
+     */
+    public CacheJdbcPojoStoreFactory<K, V> setDataSourceBean(String dataSrcBean) {
+        this.dataSrcBean = dataSrcBean;
+
+        return this;
+    }
+
+    /**
+     * Sets data source. Data source should be fully configured and ready-to-use.
+     *
+     * @param dataSrc Data source.
+     * @return {@code This} for chaining.
+     * @see CacheJdbcPojoStore#setDataSource(DataSource)
+     */
+    public CacheJdbcPojoStoreFactory<K, V> setDataSource(DataSource dataSrc) {
+        this.dataSrc = dataSrc;
+
+        return this;
+    }
+
+    /**
+     * Set database dialect.
+     *
+     * @param dialect Database dialect.
+     * @see CacheJdbcPojoStore#setDialect(JdbcDialect)
+     */
+    public void setDialect(JdbcDialect dialect) {
+        this.dialect = dialect;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(CacheJdbcPojoStoreFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/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 ab7c48d..2f7f22c 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
@@ -1888,6 +1888,13 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         req.failIfExists(failIfExists);
 
         if (ccfg != null) {
+            try {
+                checkSerializable(ccfg);
+            }
+            catch (IgniteCheckedException e) {
+                return new GridFinishedFuture<>(e);
+            }
+
             if (desc != null && !desc.cancelled()) {
                 if (failIfExists)
                     return new GridFinishedFuture<>(new CacheExistsException("Failed to start cache " +
@@ -2962,6 +2969,17 @@ public class GridCacheProcessor extends GridProcessorAdapter {
         if (val == null)
             return;
 
+        if (val.getCacheStoreFactory() != null) {
+            try {
+                marshaller.unmarshal(marshaller.marshal(val.getCacheStoreFactory()),
+                    val.getCacheStoreFactory().getClass().getClassLoader());
+            }
+            catch (IgniteCheckedException e) {
+                throw new IgniteCheckedException("Failed to validate cache configuration. " +
+                    "Cache store factory is not serializable. Cache name: " + U.maskName(val.getName()), e);
+            }
+        }
+
         try {
             marshaller.unmarshal(marshaller.marshal(val), val.getClass().getClassLoader());
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/core/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelper.java
index a9e9e93..345bb7c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelper.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelper.java
@@ -133,6 +133,16 @@ public interface IgniteSpringHelper {
     public <T> T loadBean(InputStream stream, String beanName) throws IgniteCheckedException;
 
     /**
+     * Loads bean instance by name from application context.
+     *
+     * @param appContext Sprint application context.
+     * @param beanName Bean name.
+     * @return Bean instance.
+     * @throws IgniteCheckedException In case of error.
+     */
+    public <T> T loadBeanFromAppContext(Object appContext, String beanName) throws IgniteCheckedException;
+
+    /**
      * Gets user version for given class loader by checking
      * {@code META-INF/ignite.xml} file for {@code userVersion} attribute. If
      * {@code ignite.xml} file is not found, or user version is not specified there,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java
index 77093b5..e6c542c 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java
@@ -19,6 +19,7 @@ package org.apache.ignite.cache.store.hibernate;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.store.*;
+import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.*;
@@ -59,92 +60,8 @@ import java.util.concurrent.atomic.*;
  * <p>
  * If hibernate properties are provided, mapping
  * {@code GridCacheHibernateStoreEntry.hbm.xml} is included automatically.
- *
- * <h2 class="header">Java Example</h2>
- * In this example existing session factory is provided.
- * <pre name="code" class="java">
- *     ...
- *     CacheHibernateBlobStore&lt;String, String&gt; store = new CacheHibernateBlobStore&lt;String, String&gt;();
- *
- *     store.setSessionFactory(sesFactory);
- *     ...
- * </pre>
- *
- * <h2 class="header">Spring Example (using Spring ORM)</h2>
- * <pre name="code" class="xml">
- *   ...
- *   &lt;bean id=&quot;cache.hibernate.store&quot;
- *       class=&quot;org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStore&quot;&gt;
- *       &lt;property name=&quot;sessionFactory&quot;&gt;
- *           &lt;bean class=&quot;org.springframework.orm.hibernate3.LocalSessionFactoryBean&quot;&gt;
- *               &lt;property name=&quot;hibernateProperties&quot;&gt;
- *                   &lt;value&gt;
- *                       connection.url=jdbc:h2:mem:
- *                       show_sql=true
- *                       hbm2ddl.auto=true
- *                       hibernate.dialect=org.hibernate.dialect.H2Dialect
- *                   &lt;/value&gt;
- *               &lt;/property&gt;
- *               &lt;property name=&quot;mappingResources&quot;&gt;
- *                   &lt;list&gt;
- *                       &lt;value&gt;
- *                           org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreEntry.hbm.xml
- *                       &lt;/value&gt;
- *                   &lt;/list&gt;
- *               &lt;/property&gt;
- *           &lt;/bean&gt;
- *       &lt;/property&gt;
- *   &lt;/bean&gt;
- *   ...
- * </pre>
- *
- * <h2 class="header">Spring Example (using Spring ORM and persistent annotations)</h2>
- * <pre name="code" class="xml">
- *     ...
- *     &lt;bean id=&quot;cache.hibernate.store1&quot;
- *         class=&quot;org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStore&quot;&gt;
- *         &lt;property name=&quot;sessionFactory&quot;&gt;
- *             &lt;bean class=&quot;org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean&quot;&gt;
- *                 &lt;property name=&quot;hibernateProperties&quot;&gt;
- *                     &lt;value&gt;
- *                         connection.url=jdbc:h2:mem:
- *                         show_sql=true
- *                         hbm2ddl.auto=true
- *                         hibernate.dialect=org.hibernate.dialect.H2Dialect
- *                     &lt;/value&gt;
- *                 &lt;/property&gt;
- *                 &lt;property name=&quot;annotatedClasses&quot;&gt;
- *                     &lt;list&gt;
- *                         &lt;value&gt;
- *                             org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreEntry
- *                         &lt;/value&gt;
- *                     &lt;/list&gt;
- *                 &lt;/property&gt;
- *             &lt;/bean&gt;
- *         &lt;/property&gt;
- *     &lt;/bean&gt;
- *     ...
- * </pre>
- *
- * <h2 class="header">Spring Example</h2>
- * <pre name="code" class="xml">
- *     ...
- *     &lt;bean id=&quot;cache.hibernate.store2&quot;
- *         class=&quot;org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStore&quot;&gt;
- *         &lt;property name=&quot;hibernateProperties&quot;&gt;
- *             &lt;props&gt;
- *                 &lt;prop key=&quot;connection.url&quot;&gt;jdbc:h2:mem:&lt;/prop&gt;
- *                 &lt;prop key=&quot;hbm2ddl.auto&quot;&gt;update&lt;/prop&gt;
- *                 &lt;prop key=&quot;show_sql&quot;&gt;true&lt;/prop&gt;
- *             &lt;/props&gt;
- *         &lt;/property&gt;
- *     &lt;/bean&gt;
- *     ...
- * </pre>
  * <p>
- * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
- * <br>
- * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
+ * Use {@link CacheHibernateBlobStoreFactory} factory to pass {@link CacheHibernateBlobStore} to {@link CacheConfiguration}.
  */
 public class CacheHibernateBlobStore<K, V> extends CacheStoreAdapter<K, V> {
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
new file mode 100644
index 0000000..6b89a9e
--- /dev/null
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cache.store.hibernate;
+
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.tostring.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.hibernate.*;
+
+import javax.cache.configuration.*;
+import java.util.*;
+
+/**
+ * {@link Factory} implementation for {@link CacheHibernateBlobStore}.
+ *
+ * Use this factory to pass {@link CacheHibernateBlobStore} to {@link CacheConfiguration}.
+ *
+ * <h2 class="header">Java Example</h2>
+ * In this example existing session factory is provided.
+ * <pre name="code" class="java">
+ *     ...
+ *     CacheHibernateBlobStoreFactory&lt;String, String&gt; factory = new CacheHibernateBlobStoreFactory&lt;String, String&gt;();
+ *
+ *     factory.setSessionFactory(sesFactory);
+ *     ...
+ * </pre>
+ *
+ * <h2 class="header">Spring Example (using Spring ORM)</h2>
+ * <pre name="code" class="xml">
+ *   ...
+ *   &lt;bean id=&quot;cache.hibernate.store.factory&quot;
+ *       class=&quot;org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory&quot;&gt;
+ *       &lt;property name=&quot;sessionFactory&quot;&gt;
+ *           &lt;bean class=&quot;org.springframework.orm.hibernate3.LocalSessionFactoryBean&quot;&gt;
+ *               &lt;property name=&quot;hibernateProperties&quot;&gt;
+ *                   &lt;value&gt;
+ *                       connection.url=jdbc:h2:mem:
+ *                       show_sql=true
+ *                       hbm2ddl.auto=true
+ *                       hibernate.dialect=org.hibernate.dialect.H2Dialect
+ *                   &lt;/value&gt;
+ *               &lt;/property&gt;
+ *               &lt;property name=&quot;mappingResources&quot;&gt;
+ *                   &lt;list&gt;
+ *                       &lt;value&gt;
+ *                           org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreEntry.hbm.xml
+ *                       &lt;/value&gt;
+ *                   &lt;/list&gt;
+ *               &lt;/property&gt;
+ *           &lt;/bean&gt;
+ *       &lt;/property&gt;
+ *   &lt;/bean&gt;
+ *   ...
+ * </pre>
+ *
+ * <h2 class="header">Spring Example (using Spring ORM and persistent annotations)</h2>
+ * <pre name="code" class="xml">
+ *     ...
+ *     &lt;bean id=&quot;cache.hibernate.store.factory1&quot;
+ *         class=&quot;org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory&quot;&gt;
+ *         &lt;property name=&quot;sessionFactory&quot;&gt;
+ *             &lt;bean class=&quot;org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean&quot;&gt;
+ *                 &lt;property name=&quot;hibernateProperties&quot;&gt;
+ *                     &lt;value&gt;
+ *                         connection.url=jdbc:h2:mem:
+ *                         show_sql=true
+ *                         hbm2ddl.auto=true
+ *                         hibernate.dialect=org.hibernate.dialect.H2Dialect
+ *                     &lt;/value&gt;
+ *                 &lt;/property&gt;
+ *                 &lt;property name=&quot;annotatedClasses&quot;&gt;
+ *                     &lt;list&gt;
+ *                         &lt;value&gt;
+ *                             org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreEntry
+ *                         &lt;/value&gt;
+ *                     &lt;/list&gt;
+ *                 &lt;/property&gt;
+ *             &lt;/bean&gt;
+ *         &lt;/property&gt;
+ *     &lt;/bean&gt;
+ *     ...
+ * </pre>
+ *
+ * <h2 class="header">Spring Example</h2>
+ * <pre name="code" class="xml">
+ *     ...
+ *     &lt;bean id=&quot;cache.hibernate.store.factory2&quot;
+ *         class=&quot;org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory&quot;&gt;
+ *         &lt;property name=&quot;hibernateProperties&quot;&gt;
+ *             &lt;props&gt;
+ *                 &lt;prop key=&quot;connection.url&quot;&gt;jdbc:h2:mem:&lt;/prop&gt;
+ *                 &lt;prop key=&quot;hbm2ddl.auto&quot;&gt;update&lt;/prop&gt;
+ *                 &lt;prop key=&quot;show_sql&quot;&gt;true&lt;/prop&gt;
+ *             &lt;/props&gt;
+ *         &lt;/property&gt;
+ *     &lt;/bean&gt;
+ *     ...
+ * </pre>
+ * <p>
+ * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
+ * <br>
+ * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
+ */
+public class CacheHibernateBlobStoreFactory<K, V> implements Factory<CacheHibernateBlobStore<K, V>> {
+    /** Session factory. */
+    @GridToStringExclude
+    private SessionFactory sesFactory;
+
+    /** Path to hibernate configuration file. */
+    private String hibernateCfgPath;
+
+    /** Hibernate properties. */
+    @GridToStringExclude
+    private Properties hibernateProps;
+
+
+    /** {@inheritDoc} */
+    @Override public CacheHibernateBlobStore<K, V> create() {
+        CacheHibernateBlobStore<K, V> store = new CacheHibernateBlobStore<>();
+
+        store.setSessionFactory(sesFactory);
+        store.setHibernateConfigurationPath(hibernateCfgPath);
+        store.setHibernateProperties(hibernateProps);
+
+        return store;
+    }
+
+    /**
+     * Sets session factory.
+     *
+     * @param sesFactory Session factory.
+     * @see CacheHibernateBlobStore#setSessionFactory(SessionFactory)
+     */
+    public void setSessionFactory(SessionFactory sesFactory) {
+        this.sesFactory = sesFactory;
+    }
+
+    /**
+     * Sets hibernate configuration path.
+     * <p>
+     * This may be either URL or file path or classpath resource.
+     *
+     * @param hibernateCfgPath URL or file path or classpath resource
+     *      pointing to hibernate configuration XML file.
+     * @see CacheHibernateBlobStore#setHibernateConfigurationPath(String)
+     */
+    public void setHibernateConfigurationPath(String hibernateCfgPath) {
+        this.hibernateCfgPath = hibernateCfgPath;
+    }
+
+    /**
+     * Sets Hibernate properties.
+     *
+     * @param hibernateProps Hibernate properties.
+     * @see CacheHibernateBlobStore#setHibernateProperties(Properties)
+     */
+    public void setHibernateProperties(Properties hibernateProps) {
+        this.hibernateProps = hibernateProps;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(CacheHibernateBlobStoreFactory.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java b/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
new file mode 100644
index 0000000..225fc11
--- /dev/null
+++ b/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cache.store.hibernate;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.testframework.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+/**
+ * Test for Cache jdbc blob store factory.
+ */
+public class CacheHibernateStoreFactorySelfTest extends GridCommonAbstractTest {
+    /**
+     * @throws Exception If failed.
+     */
+    public void testCacheConfiguration() throws Exception {
+        try (Ignite ignite1 = startGrid(0)) {
+            IgniteCache<Integer, String> cache1 = ignite1.getOrCreateCache(cacheConfiguration());
+
+            checkStore(cache1);
+        }
+    }
+
+    /**
+     * @return Cache configuration with store.
+     */
+    private CacheConfiguration<Integer, String> cacheConfiguration() {
+        CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();
+
+        CacheHibernateBlobStoreFactory<Integer, String> factory = new CacheHibernateBlobStoreFactory();
+
+        factory.setHibernateConfigurationPath("/org/apache/ignite/cache/store/hibernate/hibernate.cfg.xml");
+
+        cfg.setCacheStoreFactory(factory);
+
+        return cfg;
+    }
+
+    /**
+     * @param cache Ignite cache.
+     * @throws Exception If store parameters is not the same as in configuration xml.
+     */
+    private void checkStore(IgniteCache<Integer, String> cache) throws Exception {
+        CacheHibernateBlobStore store = (CacheHibernateBlobStore)cache.getConfiguration(CacheConfiguration.class)
+            .getCacheStoreFactory().create();
+
+        assertEquals("/org/apache/ignite/cache/store/hibernate/hibernate.cfg.xml",
+            GridTestUtils.getFieldValue(store, CacheHibernateBlobStore.class, "hibernateCfgPath"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java b/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
index 3ac5ec4..2965250 100644
--- a/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
+++ b/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
@@ -43,6 +43,8 @@ public class IgniteHibernateTestSuite extends TestSuite {
 
         suite.addTestSuite(CacheHibernateStoreSessionListenerSelfTest.class);
 
+        suite.addTestSuite(CacheHibernateStoreFactorySelfTest.class);
+
         return suite;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java b/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
deleted file mode 100644
index b33b3b6..0000000
--- a/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.cache.store.jdbc;
-
-import org.apache.ignite.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.util.tostring.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.resources.*;
-import org.springframework.context.*;
-
-import javax.cache.configuration.*;
-import javax.sql.*;
-
-/**
- * {@link Factory} implementation for {@link CacheJdbcBlobStore}.
- *
- * Use this factory to pass {@link CacheJdbcBlobStore} to {@link CacheConfiguration}.
- *
- * <h2 class="header">Spring Example</h2>
- * <pre name="code" class="xml"> *
- *     &lt;bean id= "simpleDataSource" class="org.h2.jdbcx.JdbcDataSource"/&gt;
- *
- *     &lt;bean id=&quot;cache.jdbc.store&quot;
- *         class=&quot;org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore&quot;&gt;
- *         &lt;property name=&quot;connectionUrl&quot; value=&quot;jdbc:h2:mem:&quot;/&gt;
- *         &lt;property name=&quot;createTableQuery&quot;
- *             value=&quot;create table if not exists ENTRIES (key other, val other)&quot;/&gt;
- *     &lt;/bean&gt;
- *
- *     &lt;bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"&gt;
- *          ...
- *          &lt;property name="cacheConfiguration"&gt;
- *               &lt;list&gt;
- *                  &lt;bean class="org.apache.ignite.configuration.CacheConfiguration"&gt;
- *                      ...
- *                      &lt;property name="cacheStoreFactory"&gt;
- *                          &lt;bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactory"&gt;
- *                              &lt;property name="user" value = "GridGain" /&gt;
- *                              &lt;property name="dataSourceBean" value = "simpleDataSource" /&gt;
- *                          &lt;/bean&gt;
- *                      &lt;/property&gt;
- *                  &lt;/bean&gt;
- *               &lt;/list&gt;
- *          &lt;/property&gt;
- *     &lt;/bean&gt;
- * </pre>
- * <p>
- * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
- * <br>
- * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
- */
-public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobStore<K, V>> {
-    /** Connection URL. */
-    private String connUrl = CacheJdbcBlobStore.DFLT_CONN_URL;
-
-    /** Query to create table. */
-    private String createTblQry = CacheJdbcBlobStore.DFLT_CREATE_TBL_QRY;
-
-    /** Query to load entry. */
-    private String loadQry = CacheJdbcBlobStore.DFLT_LOAD_QRY;
-
-    /** Query to update entry. */
-    private String updateQry = CacheJdbcBlobStore.DFLT_UPDATE_QRY;
-
-    /** Query to insert entries. */
-    private String insertQry = CacheJdbcBlobStore.DFLT_INSERT_QRY;
-
-    /** Query to delete entries. */
-    private String delQry = CacheJdbcBlobStore.DFLT_DEL_QRY;
-
-    /** User name for database access. */
-    private String user;
-
-    /** Password for database access. */
-    @GridToStringExclude
-    private String passwd;
-
-    /** Flag for schema initialization. */
-    private boolean initSchema = true;
-
-    /** Name of data source bean. */
-    private String dataSrcBean;
-
-    /** Application context. */
-    @SpringApplicationContextResource
-    private ApplicationContext appContext;
-
-    /** {@inheritDoc} */
-    @Override public CacheJdbcBlobStore<K, V> create() {
-        CacheJdbcBlobStore<K, V> store = new CacheJdbcBlobStore<>();
-
-        store.setInitSchema(initSchema);
-        store.setConnectionUrl(connUrl);
-        store.setCreateTableQuery(createTblQry);
-        store.setLoadQuery(loadQry);
-        store.setUpdateQuery(updateQry);
-        store.setInsertQuery(insertQry);
-        store.setDeleteQuery(delQry);
-        store.setUser(user);
-        store.setPassword(passwd);
-
-        if (dataSrcBean != null) {
-            if (appContext == null)
-                throw new IgniteException("Spring application context resource is not injected.");
-
-            if (!appContext.containsBean(dataSrcBean))
-                throw new IgniteException("Failed to find bean in application context [beanName=" + dataSrcBean +
-                    ", appContext=" + appContext + ']');
-
-            DataSource data = (DataSource)appContext.getBean(dataSrcBean);
-
-            store.setDataSource(data);
-        }
-
-        return store;
-    }
-
-    /**
-     * Flag indicating whether DB schema should be initialized by Ignite (default behaviour) or
-     * was explicitly created by user.
-     *
-     * @param initSchema Initialized schema flag.
-     * @return {@code This} for chaining.
-     * @see CacheJdbcBlobStore#setInitSchema(boolean)
-     */
-    public CacheJdbcBlobStoreFactory setInitSchema(boolean initSchema) {
-        this.initSchema = initSchema;
-
-        return this;
-    }
-
-    /**
-     * Sets connection URL.
-     *
-     * @param connUrl Connection URL.
-     * @see CacheJdbcBlobStore#setConnectionUrl(String)
-     */
-    public void setConnectionUrl(String connUrl) {
-        this.connUrl = connUrl;
-    }
-
-    /**
-     * See {@link CacheJdbcBlobStore#setCreateTableQuery(String)}.
-     *
-     * @param createTblQry Create table query.
-     */
-    public void setCreateTableQuery(String createTblQry) {
-        this.createTblQry = createTblQry;
-    }
-
-    /**
-     * See {@link CacheJdbcBlobStore#setLoadQuery(String)}.
-     *
-     * @param loadQry Load query
-     */
-    public void setLoadQuery(String loadQry) {
-        this.loadQry = loadQry;
-    }
-
-    /**
-     * See {@link CacheJdbcBlobStore#setUpdateQuery(String)}.
-     *
-     * @param updateQry Update entry query.
-     */
-    public void setUpdateQuery(String updateQry) {
-        this.updateQry = updateQry;
-    }
-
-    /**
-     * See {@link CacheJdbcBlobStore#setInsertQuery(String)}.
-     *
-     * @param insertQry Insert entry query.
-     */
-    public void setInsertQuery(String insertQry) {
-        this.insertQry = insertQry;
-    }
-
-    /**
-     * See {@link CacheJdbcBlobStore#setDeleteQuery(String)}.
-     *
-     * @param delQry Delete entry query.
-     */
-    public void setDeleteQuery(String delQry) {
-        this.delQry = delQry;
-    }
-
-    /**
-     * See {@link CacheJdbcBlobStore#setUser(String)}.
-     *
-     * @param user User name.
-     */
-    public void setUser(String user) {
-        this.user = user;
-    }
-
-    /**
-     * See {@link CacheJdbcBlobStore#setPassword(String)}.
-     *
-     * @param passwd Password.
-     */
-    public void setPassword(String passwd) {
-        this.passwd = passwd;
-    }
-
-    /**
-     * Sets name of the data source bean.
-     *
-     * See {@link CacheJdbcBlobStore#setDataSource(DataSource)}
-     * for more information.
-     *
-     * @param dataSrcBean Data source bean name.
-     */
-    public void setDataSourceBean(String dataSrcBean) {
-        this.dataSrcBean = dataSrcBean;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(CacheJdbcBlobStoreFactory.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java b/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
index 2c7c7e1..cbb200d 100644
--- a/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
+++ b/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
@@ -192,6 +192,23 @@ public class IgniteSpringHelperImpl implements IgniteSpringHelper {
         }
     }
 
+    /** {@inheritDoc} */
+    @Override public <T> T loadBeanFromAppContext(Object appContext, String beanName) throws IgniteCheckedException {
+        ApplicationContext springCtx = (ApplicationContext)appContext;
+
+        try {
+            return (T)springCtx.getBean(beanName);
+        }
+        catch (NoSuchBeanDefinitionException e) {
+            throw new IgniteCheckedException("Spring bean with provided name doesn't exist " +
+                    ", beanName=" + beanName + ']');
+        }
+        catch (BeansException e) {
+            throw new IgniteCheckedException("Failed to load Spring bean with provided name " +
+                    ", beanName=" + beanName + ']', e);
+        }
+    }
+
     /**
      * @param stream Input stream containing Spring XML configuration.
      * @return Context.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/config/incorrect-store-cache.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/incorrect-store-cache.xml b/modules/spring/src/test/config/incorrect-store-cache.xml
index 9a0b7c6..2ccda21 100644
--- a/modules/spring/src/test/config/incorrect-store-cache.xml
+++ b/modules/spring/src/test/config/incorrect-store-cache.xml
@@ -43,7 +43,7 @@
         <property name="discoverySpi">
             <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                 <property name="ipFinder">
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                         <property name="addresses">
                             <list>
                                 <value>127.0.0.1:47500..47509</value>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/config/pojo-incorrect-store-cache.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/pojo-incorrect-store-cache.xml b/modules/spring/src/test/config/pojo-incorrect-store-cache.xml
new file mode 100644
index 0000000..5627bd0
--- /dev/null
+++ b/modules/spring/src/test/config/pojo-incorrect-store-cache.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+    <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+        <property name="cacheConfiguration">
+            <list>
+                <bean class="org.apache.ignite.configuration.CacheConfiguration">
+                    <property name="name" value="test"/>
+                    <property name="atomicityMode" value="ATOMIC"/>
+                    <property name="backups" value="1"/>
+                    <property name="cacheStoreFactory">
+                        <bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">
+                            <property name="dataSourceBean" value = "simpleDataSource"/>
+                        </bean>
+                    </property>
+                </bean>
+            </list>
+        </property>
+
+        <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+        <property name="discoverySpi">
+            <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+                <property name="ipFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+                        <property name="addresses">
+                            <list>
+                                <value>127.0.0.1:47500..47509</value>
+                            </list>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </property>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/config/store-cache.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/store-cache.xml b/modules/spring/src/test/config/store-cache.xml
index 992a22c..07a4ab0 100644
--- a/modules/spring/src/test/config/store-cache.xml
+++ b/modules/spring/src/test/config/store-cache.xml
@@ -45,7 +45,7 @@
         <property name="discoverySpi">
             <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                 <property name="ipFinder">
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                         <property name="addresses">
                             <list>
                                 <value>127.0.0.1:47500..47509</value>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/config/store-cache1.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/store-cache1.xml b/modules/spring/src/test/config/store-cache1.xml
index 9209e52..bff88e9 100644
--- a/modules/spring/src/test/config/store-cache1.xml
+++ b/modules/spring/src/test/config/store-cache1.xml
@@ -48,7 +48,7 @@
         <property name="discoverySpi">
             <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
                 <property name="ipFinder">
-                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+                    <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                         <property name="addresses">
                             <list>
                                 <value>127.0.0.1:47500..47509</value>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
index 4a693a7..6d3d3fd 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
@@ -78,7 +78,7 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
                 }
                 return null;
             }
-        }, IgniteException.class, "Cannot find bean in application context.");
+        }, IgniteException.class, "Failed to load bean in application context");
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
new file mode 100644
index 0000000..7b709d5
--- /dev/null
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
@@ -0,0 +1,194 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cache.store.jdbc;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.store.jdbc.dialect.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.testframework.*;
+import org.apache.ignite.testframework.junits.common.*;
+import org.h2.jdbcx.*;
+import sun.jdbc.odbc.ee.*;
+
+import javax.cache.*;
+import java.io.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * Test for Cache jdbc blob store factory.
+ */
+public class CacheJdbcPojoStoreFactorySelfTest extends GridCommonAbstractTest {
+    /** Cache name. */
+    private static final String CACHE_NAME = "test";
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testCacheConfiguration() throws Exception {
+        try (Ignite ignite = Ignition.start("modules/spring/src/test/config/node.xml")) {
+            try (Ignite ignite1 = Ignition.start("modules/spring/src/test/config/node1.xml")) {
+                try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cacheConfiguration())) {
+                    try (IgniteCache<Integer, String> cache1 = ignite1.getOrCreateCache(cacheConfiguration())) {
+                        checkStore(cache, JdbcDataSource.class);
+
+                        checkStore(cache1, ConnectionPoolDataSource.class);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testSerializable() throws Exception {
+        GridTestUtils.assertThrows(log, new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                try (Ignite ignite = Ignition.start("modules/spring/src/test/config/node.xml")) {
+                    try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cacheConfigurationH2Dialect())) {
+                        checkStore(cache, JdbcDataSource.class);
+                    }
+                }
+
+                return null;
+            }
+        }, CacheException.class, "Failed to validate cache configuration. Cache store factory is not serializable.");
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testIncorrectBeanConfiguration() throws Exception {
+        GridTestUtils.assertThrows(log, new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                try(Ignite ignite = Ignition.start("modules/spring/src/test/config/pojo-incorrect-store-cache.xml")) {
+                    ignite.cache(CACHE_NAME).getConfiguration(CacheConfiguration.class).
+                        getCacheStoreFactory().create();
+                }
+                return null;
+            }
+        }, IgniteException.class, "Failed to load bean in application context");
+    }
+
+    /**
+     * @return Cache configuration with store.
+     */
+    private CacheConfiguration<Integer, String> cacheConfiguration() {
+        CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();
+
+        CacheJdbcPojoStoreFactory<Integer, String> factory = new CacheJdbcPojoStoreFactory<>();
+
+        factory.setDataSourceBean("simpleDataSource");
+
+        factory.setDialect(new DummyDialect());
+
+        cfg.setCacheStoreFactory(factory);
+
+        return cfg;
+    }
+
+    /**
+     * @return Cache configuration with store.
+     */
+    private CacheConfiguration<Integer, String> cacheConfigurationH2Dialect() {
+        CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();
+
+        CacheJdbcPojoStoreFactory<Integer, String> factory = new CacheJdbcPojoStoreFactory<>();
+
+        factory.setDataSourceBean("simpleDataSource");
+
+        factory.setDialect(new H2Dialect());
+
+        cfg.setCacheStoreFactory(factory);
+
+        return cfg;
+    }
+
+    /**
+     * @param cache Ignite cache.
+     * @param dataSrcClass Data source class.
+     * @throws Exception If store parameters is not the same as in configuration xml.
+     */
+    private void checkStore(IgniteCache<Integer, String> cache, Class<?> dataSrcClass) throws Exception {
+        CacheJdbcPojoStore store = (CacheJdbcPojoStore)cache.getConfiguration(CacheConfiguration.class).
+            getCacheStoreFactory().create();
+
+        assertEquals(dataSrcClass,
+            GridTestUtils.getFieldValue(store, CacheAbstractJdbcStore.class, "dataSrc").getClass());
+    }
+
+    /**
+     *
+     */
+    public static class DummyDialect implements JdbcDialect, Serializable {
+        /** {@inheritDoc} */
+        @Override public String loadCacheSelectRangeQuery(String fullTblName, Collection<String> keyCols) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String loadCacheRangeQuery(String fullTblName, Collection<String> keyCols,
+            Iterable<String> uniqCols, boolean appendLowerBound, boolean appendUpperBound) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String loadCacheQuery(String fullTblName, Iterable<String> uniqCols) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String loadQuery(String fullTblName, Collection<String> keyCols, Iterable<String> cols,
+            int keyCnt) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String insertQuery(String fullTblName, Collection<String> keyCols,
+            Collection<String> valCols) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String updateQuery(String fullTblName, Collection<String> keyCols, Iterable<String> valCols) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean hasMerge() {
+            return false;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String mergeQuery(String fullTblName, Collection<String> keyCols,
+            Collection<String> uniqCols) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String removeQuery(String fullTblName, Iterable<String> keyCols) {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getMaxParameterCount() {
+            return 0;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
index 12dd494..0c2e99e 100644
--- a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
+++ b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.testsuites;
 
 import junit.framework.*;
+import org.apache.ignite.cache.store.jdbc.*;
 import org.apache.ignite.cache.store.spring.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.p2p.*;
@@ -50,6 +51,10 @@ public class IgniteSpringTestSuite extends TestSuite {
 
         suite.addTestSuite(CacheSpringStoreSessionListenerSelfTest.class);
 
+        suite.addTestSuite(CacheJdbcBlobStoreFactorySelfTest.class);
+
+        suite.addTestSuite(CacheJdbcPojoStoreFactorySelfTest.class);
+
         return suite;
     }
 }


[42/50] incubator-ignite git commit: Merge branches 'ignite-484-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-484-1

Posted by sb...@apache.org.
Merge branches 'ignite-484-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-484-1


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

Branch: refs/heads/ignite-917-review
Commit: eebf9c1c7fa07b442e4a341ffa2b5ce2828032c4
Parents: ed43dfe fffc2ec
Author: S.Vladykin <sv...@gridgain.com>
Authored: Thu Jun 18 09:43:45 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Thu Jun 18 09:43:45 2015 +0300

----------------------------------------------------------------------
 .../dht/GridDhtPartitionTopologyImpl.java        |  4 +++-
 .../IgniteCacheP2pUnmarshallingTxErrorTest.java  | 19 ++++++++++---------
 .../junits/common/GridCommonAbstractTest.java    |  8 ++++++--
 3 files changed, 19 insertions(+), 12 deletions(-)
----------------------------------------------------------------------



[41/50] incubator-ignite git commit: # ignite-sprint-6 more info in assert

Posted by sb...@apache.org.
# ignite-sprint-6 more info in assert


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

Branch: refs/heads/ignite-917-review
Commit: fffc2ecc86628a9a25c6f855d89277d124711873
Parents: af829d0
Author: sboikov <sb...@gridgain.com>
Authored: Thu Jun 18 08:57:39 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Jun 18 08:57:39 2015 +0300

----------------------------------------------------------------------
 .../dht/GridDhtPartitionTopologyImpl.java        |  4 +++-
 .../IgniteCacheP2pUnmarshallingTxErrorTest.java  | 19 ++++++++++---------
 .../junits/common/GridCommonAbstractTest.java    |  8 ++++++--
 3 files changed, 19 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fffc2ecc/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 374ab87..de7f876 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
@@ -620,7 +620,9 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
         lock.readLock().lock();
 
         try {
-            assert node2part != null && node2part.valid() : "Invalid node-to-partitions map [topVer=" + topVer +
+            assert node2part != null && node2part.valid() : "Invalid node-to-partitions map [topVer1=" + topVer +
+                ", topVer2=" + this.topVer +
+                ", cache=" + cctx.name() +
                 ", node2part=" + node2part + ']';
 
             Collection<ClusterNode> nodes = null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fffc2ecc/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
index 017f7db..356d67b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
@@ -26,11 +26,13 @@ import org.apache.ignite.transactions.*;
 import javax.cache.*;
 import java.io.*;
 
+import static org.apache.ignite.transactions.TransactionConcurrency.*;
+import static org.apache.ignite.transactions.TransactionIsolation.*;
+
 /**
  * Checks behavior on exception while unmarshalling key.
  */
 public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmarshallingErrorTest {
-
     /** {@inheritDoc} */
     @Override protected CacheAtomicityMode atomicityMode() {
         return CacheAtomicityMode.TRANSACTIONAL;
@@ -41,7 +43,7 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmars
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
         if (!gridName.endsWith("0"))
-            cfg.getCacheConfiguration()[0].setRebalanceDelay(-1); //allows to check GridDhtLockRequest fail.
+            cfg.getCacheConfiguration()[0].setRebalanceDelay(-1); // Allows to check GridDhtLockRequest fail.
 
         return cfg;
     }
@@ -52,8 +54,7 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmars
     protected void failOptimistic() {
         IgniteCache<Object, Object> cache = jcache(0);
 
-        try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.OPTIMISTIC,
-            TransactionIsolation.REPEATABLE_READ)) {
+        try (Transaction tx = grid(0).transactions().txStart(OPTIMISTIC, REPEATABLE_READ)) {
 
             cache.put(new TestKey(String.valueOf(++key)), "");
 
@@ -65,7 +66,7 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmars
             assert X.hasCause(e, IOException.class);
         }
 
-        assert readCnt.get() == 0; //ensure we have read count as expected.
+        assert readCnt.get() == 0; // Ensure we have read count as expected.
     }
 
     /**
@@ -74,8 +75,8 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmars
     protected void failPessimictic() {
         IgniteCache<Object, Object> cache = jcache(0);
 
-        try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC,
-            TransactionIsolation.REPEATABLE_READ)) {
+        try (Transaction tx = grid(0).transactions().txStart(PESSIMISTIC,
+            REPEATABLE_READ)) {
 
             cache.put(new TestKey(String.valueOf(++key)), "");
 
@@ -85,7 +86,7 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmars
             assert X.hasCause(e, IOException.class);
         }
 
-        assert readCnt.get() == 0; //ensure we have read count as expected.
+        assert readCnt.get() == 0; // Ensure we have read count as expected.
     }
 
     /** {@inheritDoc} */
@@ -108,7 +109,7 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmars
         //GridDhtLockRequest unmarshalling failed test
         readCnt.set(3);
 
-        try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+        try (Transaction tx = grid(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
             jcache(0).put(new TestKey(String.valueOf(++key)), ""); //No failure at client side.
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fffc2ecc/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
index bc33746..9941ca8 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
@@ -379,8 +379,10 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
 
                             int exp = affNodes.size();
 
-                            Collection<ClusterNode> owners = top.topologyVersion() == AffinityTopologyVersion.NONE ?
-                                Collections.<ClusterNode>emptyList() : top.nodes(p, AffinityTopologyVersion.NONE);
+                            GridDhtTopologyFuture topFut = top.topologyVersionFuture();
+
+                            Collection<ClusterNode> owners = (topFut != null && topFut.isDone()) ?
+                                top.nodes(p, AffinityTopologyVersion.NONE) : Collections.<ClusterNode>emptyList();
 
                             int actual = owners.size();
 
@@ -390,6 +392,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
                                     ", cache=" + cfg.getName() +
                                     ", cacheId=" + dht.context().cacheId() +
                                     ", topVer=" + top.topologyVersion() +
+                                    ", topFut=" + topFut +
                                     ", p=" + p +
                                     ", affNodesCnt=" + exp +
                                     ", ownersCnt=" + actual +
@@ -406,6 +409,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
                                         ", cache=" + cfg.getName() +
                                         ", cacheId=" + dht.context().cacheId() +
                                         ", topVer=" + top.topologyVersion() +
+                                        ", topFut=" + topFut +
                                         ", p=" + p +
                                         ", affNodesCnt=" + exp +
                                         ", ownersCnt=" + actual +


[34/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1020' into ignite-sprint-6

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1020' into ignite-sprint-6


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

Branch: refs/heads/ignite-917-review
Commit: af829d0ee0a646ac7ed96c65ddda7fc6f38212b0
Parents: 5218210 674072a
Author: sboikov <sb...@gridgain.com>
Authored: Wed Jun 17 17:19:58 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Jun 17 17:19:58 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      |   4 +
 .../processors/cache/IgniteCacheProxy.java      |   7 +
 .../dht/GridDhtTransactionalCacheAdapter.java   |   2 +-
 .../cache/transactions/IgniteTxHandler.java     |   2 +-
 .../transactions/IgniteTxLocalAdapter.java      |  12 +-
 .../dr/IgniteDrDataStreamerCacheUpdater.java    |   7 +-
 .../CacheStoreUsageMultinodeAbstractTest.java   | 305 +++++++++++++++++++
 ...eUsageMultinodeDynamicStartAbstractTest.java | 169 ++++++++++
 ...oreUsageMultinodeDynamicStartAtomicTest.java |  32 ++
 ...heStoreUsageMultinodeDynamicStartTxTest.java |  32 ++
 ...reUsageMultinodeStaticStartAbstractTest.java | 158 ++++++++++
 ...toreUsageMultinodeStaticStartAtomicTest.java |  32 ++
 ...cheStoreUsageMultinodeStaticStartTxTest.java |  32 ++
 .../testsuites/IgniteCacheTestSuite4.java       |   4 +
 14 files changed, 791 insertions(+), 7 deletions(-)
----------------------------------------------------------------------



[43/50] incubator-ignite git commit: Fixed test.

Posted by sb...@apache.org.
Fixed test.


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

Branch: refs/heads/ignite-917-review
Commit: fa6615a8665fb8296c63be3e719d6d186293ea0c
Parents: 5218210
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Thu Jun 18 09:44:45 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Thu Jun 18 09:44:45 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/testframework/junits/GridTestKernalContext.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fa6615a8/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
index 37948d9..24502da 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridTestKernalContext.java
@@ -46,7 +46,7 @@ public class GridTestKernalContext extends GridKernalContextImpl {
             null,
             null,
             null,
-            null);
+            U.allPluginProviders());
 
         GridTestUtils.setFieldValue(grid(), "cfg", config());
 


[06/50] incubator-ignite git commit: #IGNITE-960 Fixed test.

Posted by sb...@apache.org.
#IGNITE-960 Fixed test.


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

Branch: refs/heads/ignite-917-review
Commit: dd8048bd7c4c143395dbc0f18010d101698604cd
Parents: a7ca45b
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 17:51:57 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 17:51:57 2015 +0300

----------------------------------------------------------------------
 modules/spring/src/test/config/node1.xml        |  2 +-
 modules/spring/src/test/config/store-cache1.xml |  2 +-
 .../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 63 +++++++++++++++++++-
 .../jdbc/CacheJdbcPojoStoreFactorySelfTest.java |  3 +-
 4 files changed, 63 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd8048bd/modules/spring/src/test/config/node1.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/node1.xml b/modules/spring/src/test/config/node1.xml
index 67bae12..76539f7 100644
--- a/modules/spring/src/test/config/node1.xml
+++ b/modules/spring/src/test/config/node1.xml
@@ -22,7 +22,7 @@
         http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans.xsd">
 
-    <bean id="simpleDataSource" class="sun.jdbc.odbc.ee.ConnectionPoolDataSource"/>
+    <bean id="simpleDataSource" class="org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactorySelfTest$DummyDataSource"/>
 
     <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
         <property name="gridName" value="ignite1"/>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd8048bd/modules/spring/src/test/config/store-cache1.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/store-cache1.xml b/modules/spring/src/test/config/store-cache1.xml
index bff88e9..a9e58d6 100644
--- a/modules/spring/src/test/config/store-cache1.xml
+++ b/modules/spring/src/test/config/store-cache1.xml
@@ -23,7 +23,7 @@
         http://www.springframework.org/schema/beans/spring-beans.xsd">
 
 
-    <bean id="simpleDataSource1" class="sun.jdbc.odbc.ee.ConnectionPoolDataSource"/>
+    <bean id="simpleDataSource1" class="org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactorySelfTest$DummyDataSource"/>
 
     <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
         <property name="gridName" value="ignite1"/>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd8048bd/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
index 6d3d3fd..7638a46 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
@@ -22,9 +22,11 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.common.*;
 import org.h2.jdbcx.*;
-import sun.jdbc.odbc.ee.*;
 
+import java.io.*;
+import java.sql.*;
 import java.util.concurrent.*;
+import java.util.logging.*;
 
 /**
  * Test for Cache jdbc blob store factory.
@@ -44,7 +46,7 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
             try(Ignite ignite1 = Ignition.start("modules/spring/src/test/config/store-cache1.xml")) {
                 checkStore(ignite.<Integer, String>cache(CACHE_NAME), JdbcDataSource.class);
 
-                checkStore(ignite1.<Integer, String>cache(CACHE_NAME), ConnectionPoolDataSource.class);
+                checkStore(ignite1.<Integer, String>cache(CACHE_NAME), DummyDataSource.class);
             }
         }
     }
@@ -59,7 +61,7 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
                     try (IgniteCache<Integer, String> cache1 = ignite1.getOrCreateCache(cacheConfiguration())) {
                         checkStore(cache, JdbcDataSource.class);
 
-                        checkStore(cache1, ConnectionPoolDataSource.class);
+                        checkStore(cache1, DummyDataSource.class);
                     }
                 }
             }
@@ -112,4 +114,59 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
         assertEquals(dataSrcClass,
             GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "dataSrc").getClass());
     }
+
+    /**
+     *
+     */
+    public static class DummyDataSource implements javax.sql.DataSource, Serializable {
+        /** */
+        public DummyDataSource() {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public Connection getConnection() throws SQLException {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Connection getConnection(String username, String password) throws SQLException {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public PrintWriter getLogWriter() throws SQLException {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setLogWriter(PrintWriter out) throws SQLException {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public void setLoginTimeout(int seconds) throws SQLException {
+            // No-op.
+        }
+
+        /** {@inheritDoc} */
+        @Override public int getLoginTimeout() throws SQLException {
+            return 0;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public <T> T unwrap(Class<T> iface) throws SQLException {
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean isWrapperFor(Class<?> iface) throws SQLException {
+            return false;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd8048bd/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
index 7b709d5..c456339 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
@@ -23,7 +23,6 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.testframework.*;
 import org.apache.ignite.testframework.junits.common.*;
 import org.h2.jdbcx.*;
-import sun.jdbc.odbc.ee.*;
 
 import javax.cache.*;
 import java.io.*;
@@ -47,7 +46,7 @@ public class CacheJdbcPojoStoreFactorySelfTest extends GridCommonAbstractTest {
                     try (IgniteCache<Integer, String> cache1 = ignite1.getOrCreateCache(cacheConfiguration())) {
                         checkStore(cache, JdbcDataSource.class);
 
-                        checkStore(cache1, ConnectionPoolDataSource.class);
+                        checkStore(cache1, CacheJdbcBlobStoreFactorySelfTest.DummyDataSource.class);
                     }
                 }
             }


[24/50] incubator-ignite git commit: Merge branch 'ignite-gg-10429' into ignite-sprint-6

Posted by sb...@apache.org.
Merge branch 'ignite-gg-10429' into ignite-sprint-6


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

Branch: refs/heads/ignite-917-review
Commit: f173f9132eac1b7f8ac31bad795f0694be9a3c14
Parents: d1a2150 01eee2d
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Jun 17 12:33:13 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Jun 17 12:33:13 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    | 13 +-----------
 .../client/GridClientConfiguration.java         |  4 ++--
 .../GridClientOptimizedMarshaller.java          | 21 ++++++++++++++++++++
 .../impl/GridTcpRouterNioListenerAdapter.java   |  2 +-
 .../rest/protocols/tcp/GridTcpRestProtocol.java |  3 ++-
 .../ignite/internal/util/IgniteUtils.java       | 21 ++++++++++++++++++++
 6 files changed, 48 insertions(+), 16 deletions(-)
----------------------------------------------------------------------



[13/50] incubator-ignite git commit: #IGNITE-960 Added serialVersionUID.

Posted by sb...@apache.org.
#IGNITE-960 Added serialVersionUID.


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

Branch: refs/heads/ignite-917-review
Commit: 37d4710c1bbe19396ba6537d8ef41d4b095c2ae7
Parents: ec0ee2e
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 19:07:02 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 19:07:02 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java | 3 +++
 .../apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java | 3 +++
 .../cache/store/hibernate/CacheHibernateBlobStoreFactory.java     | 3 +++
 3 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37d4710c/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
index c145641..297f32e 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
@@ -60,6 +60,9 @@ import javax.sql.*;
  * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
  */
 public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobStore<K, V>> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
     /** Connection URL. */
     private String connUrl = CacheJdbcBlobStore.DFLT_CONN_URL;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37d4710c/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
index cade2aa..ac1f4f1 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
@@ -59,6 +59,9 @@ import javax.sql.*;
  * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
  */
 public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheJdbcPojoStore<K, V>> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
     /** Name of data source bean. */
     private String dataSrcBean;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37d4710c/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
index 5154faa..60eacb9 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
@@ -121,6 +121,9 @@ import java.util.*;
  * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
  */
 public class CacheHibernateBlobStoreFactory<K, V> implements Factory<CacheHibernateBlobStore<K, V>> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
     /** Session factory. */
     @GridToStringExclude
     private transient SessionFactory sesFactory;


[31/50] incubator-ignite git commit: # ignite-1020 do not write to store for local store load

Posted by sb...@apache.org.
# ignite-1020 do not write to store for local store load


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

Branch: refs/heads/ignite-917-review
Commit: 674072a336a2aa276373a5f6820a9e66df88ede8
Parents: e507f03
Author: sboikov <sb...@gridgain.com>
Authored: Wed Jun 17 15:31:57 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Jun 17 15:31:57 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheAdapter.java    | 4 ++++
 .../ignite/internal/processors/cache/IgniteCacheProxy.java    | 7 +++++++
 .../processors/dr/IgniteDrDataStreamerCacheUpdater.java       | 7 ++++++-
 3 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/674072a3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 2ca7687..7335d72 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -3305,6 +3305,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
                 DataStreamerImpl ldr = ctx.kernalContext().dataStream().dataStreamer(ctx.namex());
 
                 try {
+                    ldr.skipStore(true);
+
                     ldr.receiver(new IgniteDrDataStreamerCacheUpdater());
 
                     LocalStoreLoadClosure c = new LocalStoreLoadClosure(p, ldr, plc);
@@ -3504,6 +3506,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
             DataStreamerImpl ldr = ctx.kernalContext().dataStream().dataStreamer(ctx.namex());
 
             try {
+                ldr.skipStore(true);
+
                 ldr.receiver(new IgniteDrDataStreamerCacheUpdater());
 
                 LocalStoreLoadClosure c = new LocalStoreLoadClosure(null, ldr, plc0);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/674072a3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 69ce7b0..0d70792 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -139,6 +139,13 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
     }
 
     /**
+     * @return Operation context.
+     */
+    @Nullable public CacheOperationContext operationContext() {
+        return opCtx;
+    }
+
+    /**
      * Gets cache proxy which does not acquire read lock on gateway enter, should be
      * used only if grid read lock is externally acquired.
      *

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/674072a3/modules/core/src/main/java/org/apache/ignite/internal/processors/dr/IgniteDrDataStreamerCacheUpdater.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/dr/IgniteDrDataStreamerCacheUpdater.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/dr/IgniteDrDataStreamerCacheUpdater.java
index c3a8989..e5bbe39 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/dr/IgniteDrDataStreamerCacheUpdater.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/dr/IgniteDrDataStreamerCacheUpdater.java
@@ -46,7 +46,12 @@ public class IgniteDrDataStreamerCacheUpdater implements StreamReceiver<KeyCache
 
             GridKernalContext ctx = ((IgniteKernal)cache0.unwrap(Ignite.class)).context();
             IgniteLogger log = ctx.log(IgniteDrDataStreamerCacheUpdater.class);
-            GridCacheAdapter cache = ctx.cache().internalCache(cacheName);
+            GridCacheAdapter internalCache = ctx.cache().internalCache(cacheName);
+
+            CacheOperationContext opCtx = ((IgniteCacheProxy)cache0).operationContext();
+
+            IgniteInternalCache cache =
+                opCtx != null ? new GridCacheProxyImpl(internalCache.context(), internalCache, opCtx) : internalCache;
 
             assert !F.isEmpty(col);
 


[38/50] incubator-ignite git commit: Merge branches 'ignite-484-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-484-1

Posted by sb...@apache.org.
Merge branches 'ignite-484-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-484-1


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

Branch: refs/heads/ignite-917-review
Commit: efb4244779b94c9c9f35c63708e4a41da2430bce
Parents: 94060c9 4298238 af829d0
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 17 19:50:12 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 17 19:50:12 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      |   4 +
 .../processors/cache/IgniteCacheProxy.java      |   7 +
 .../dht/GridDhtTransactionalCacheAdapter.java   |   2 +-
 .../cache/transactions/IgniteTxHandler.java     |   2 +-
 .../transactions/IgniteTxLocalAdapter.java      |  12 +-
 .../dr/IgniteDrDataStreamerCacheUpdater.java    |   7 +-
 .../CacheStoreUsageMultinodeAbstractTest.java   | 305 +++++++++++++++++++
 ...eUsageMultinodeDynamicStartAbstractTest.java | 169 ++++++++++
 ...oreUsageMultinodeDynamicStartAtomicTest.java |  32 ++
 ...heStoreUsageMultinodeDynamicStartTxTest.java |  32 ++
 ...reUsageMultinodeStaticStartAbstractTest.java | 158 ++++++++++
 ...toreUsageMultinodeStaticStartAtomicTest.java |  32 ++
 ...cheStoreUsageMultinodeStaticStartTxTest.java |  32 ++
 .../testsuites/IgniteCacheTestSuite4.java       |   4 +
 .../h2/twostep/GridReduceQueryExecutor.java     |   3 +-
 15 files changed, 793 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/efb42447/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --cc modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index 6635dde,6c407d9,11054b7..b956167
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@@@ -273,514 -273,477 -265,113 +273,515 @@@@ public class GridReduceQueryExecutor 
       }
   
       /**
  +     * @param r Query run.
  +     * @param retryVer Retry version.
  +     * @param nodeId Node ID.
  +     */
  +    private void retry(QueryRun r, AffinityTopologyVersion retryVer, UUID nodeId) {
  +        r.state(retryVer, nodeId);
  +    }
  +
  +    /**
  +     * @param cctx Cache context for main space.
  +     * @param extraSpaces Extra spaces.
  +     * @return {@code true} If preloading is active.
  +     */
  +    private boolean isPreloadingActive(final GridCacheContext<?,?> cctx, List<String> extraSpaces) {
  +        if (hasMovingPartitions(cctx))
  +            return true;
  +
  +        if (extraSpaces != null) {
  +            for (String extraSpace : extraSpaces) {
  +                if (hasMovingPartitions(cacheContext(extraSpace)))
  +                    return true;
  +            }
  +        }
  +
  +        return false;
  +    }
  +
  +    /**
  +     * @return {@code true} If cache context
  +     */
  +    private boolean hasMovingPartitions(GridCacheContext<?,?> cctx) {
  +        GridDhtPartitionFullMap fullMap = cctx.topology().partitionMap(false);
  +
  +        for (GridDhtPartitionMap map : fullMap.values()) {
  +            if (map.hasMovingPartitions())
  +                return true;
  +        }
  +
  +        return false;
  +    }
  +
  +    /**
  +     * @param name Cache name.
  +     * @return Cache context.
  +     */
  +    private GridCacheContext<?,?> cacheContext(String name) {
  +        return ctx.cache().internalCache(name).context();
  +    }
  +
  +    /**
  +     * @param topVer Topology version.
  +     * @param cctx Cache context for main space.
  +     * @param extraSpaces Extra spaces.
  +     * @return Data nodes or {@code null} if repartitioning started and we need to retry..
  +     */
  +    private Collection<ClusterNode> stableDataNodes(
  +        AffinityTopologyVersion topVer,
  +        final GridCacheContext<?,?> cctx,
  +        List<String> extraSpaces
  +    ) {
  +        String space = cctx.name();
  +
 -         Set<ClusterNode> nodes = new HashSet<>(ctx.discovery().cacheAffinityNodes(space, topVer));
 ++        Set<ClusterNode> nodes = new HashSet<>(dataNodes(space, topVer));
  +
  +        if (F.isEmpty(nodes))
  +            throw new CacheException("No data nodes found for cache: " + space);
  +
  +        if (!F.isEmpty(extraSpaces)) {
  +            for (String extraSpace : extraSpaces) {
  +                GridCacheContext<?,?> extraCctx = cacheContext(extraSpace);
  +
  +                if (extraCctx.isLocal())
  +                    continue; // No consistency guaranties for local caches.
  +
  +                if (cctx.isReplicated() && !extraCctx.isReplicated())
  +                    throw new CacheException("Queries running on replicated cache should not contain JOINs " +
  +                        "with partitioned tables.");
  +
 -                 Collection<ClusterNode> extraNodes = ctx.discovery().cacheAffinityNodes(extraSpace, topVer);
 ++                Collection<ClusterNode> extraNodes = dataNodes(extraSpace, topVer);
  +
  +                if (F.isEmpty(extraNodes))
  +                    throw new CacheException("No data nodes found for cache: " + extraSpace);
  +
  +                if (cctx.isReplicated() && extraCctx.isReplicated()) {
  +                    nodes.retainAll(extraNodes);
  +
  +                    if (nodes.isEmpty()) {
  +                        if (isPreloadingActive(cctx, extraSpaces))
  +                            return null; // Retry.
  +                        else
  +                            throw new CacheException("Caches '" + cctx.name() + "' and '" + extraSpace +
  +                                "' have distinct set of data nodes.");
  +                    }
  +                }
  +                else if (!cctx.isReplicated() && extraCctx.isReplicated()) {
  +                    if (!extraNodes.containsAll(nodes))
  +                        if (isPreloadingActive(cctx, extraSpaces))
  +                            return null; // Retry.
  +                        else
  +                            throw new CacheException("Caches '" + cctx.name() + "' and '" + extraSpace +
  +                                "' have distinct set of data nodes.");
  +                }
  +                else if (!cctx.isReplicated() && !extraCctx.isReplicated()) {
  +                    if (extraNodes.size() != nodes.size() || !nodes.containsAll(extraNodes))
  +                        if (isPreloadingActive(cctx, extraSpaces))
  +                            return null; // Retry.
  +                        else
  +                            throw new CacheException("Caches '" + cctx.name() + "' and '" + extraSpace +
  +                                "' have distinct set of data nodes.");
  +                }
  +                else
  +                    throw new IllegalStateException();
  +            }
  +        }
  +
  +        return nodes;
  +    }
  +
  +    /**
        * @param cctx Cache context.
        * @param qry Query.
  +     * @param keepPortable Keep portable.
        * @return Cursor.
        */
       public Iterator<List<?>> query(GridCacheContext<?,?> cctx, GridCacheTwoStepQuery qry, boolean keepPortable) {
 -         for (;;) {
  -        long qryReqId = reqIdGen.incrementAndGet();
 ++        for (int attempt = 0;; attempt++) {
 ++            if (attempt != 0) {
 ++                try {
 ++                    Thread.sleep(attempt * 10); // Wait for exchange.
 ++                }
 ++                catch (InterruptedException e) {
 ++                    Thread.currentThread().interrupt();
 + 
  -        QueryRun r = new QueryRun();
 ++                    throw new CacheException("Query was interrupted.", e);
 ++                }
 ++            }
 + 
  -        r.pageSize = qry.pageSize() <= 0 ? GridCacheTwoStepQuery.DFLT_PAGE_SIZE : qry.pageSize();
  +            long qryReqId = reqIdGen.incrementAndGet();
   
  -        r.tbls = new ArrayList<>(qry.mapQueries().size());
  +            QueryRun r = new QueryRun();
   
  -        String space = cctx.name();
  +            r.pageSize = qry.pageSize() <= 0 ? GridCacheTwoStepQuery.DFLT_PAGE_SIZE : qry.pageSize();
   
  -        r.conn = (JdbcConnection)h2.connectionForSpace(space);
  +            r.tbls = new ArrayList<>(qry.mapQueries().size());
   
  -        // TODO    Add topology version.
  -        ClusterGroup dataNodes = ctx.grid().cluster().forDataNodes(space);
  +            String space = cctx.name();
   
  -        if (cctx.isReplicated() || qry.explain()) {
  -            assert qry.explain() || dataNodes.node(ctx.localNodeId()) == null : "We must be on a client node.";
  +            r.conn = (JdbcConnection)h2.connectionForSpace(space);
   
  -            // Select random data node to run query on a replicated data or get EXPLAIN PLAN from a single node.
  -            dataNodes = dataNodes.forRandom();
  -        }
  +            AffinityTopologyVersion topVer = h2.readyTopologyVersion();
   
  -        final Collection<ClusterNode> nodes = dataNodes.nodes();
  +            List<String> extraSpaces = extraSpaces(space, qry.spaces());
   
  -        for (GridCacheSqlQuery mapQry : qry.mapQueries()) {
  -            GridMergeTable tbl;
  +            Collection<ClusterNode> nodes;
  +
  +            // Explicit partition mapping for unstable topology.
  +            Map<ClusterNode, IntArray> partsMap = null;
  +
  +            if (isPreloadingActive(cctx, extraSpaces)) {
  +                if (cctx.isReplicated())
 -                     nodes = replicatedDataNodes(cctx, extraSpaces);
 ++                    nodes = replicatedUnstableDataNodes(cctx, extraSpaces);
  +                else {
 -                     partsMap = partitionLocations(cctx, extraSpaces);
 ++                    partsMap = partitionedUnstableDataNodes(cctx, extraSpaces);
  +
  +                    nodes = partsMap == null ? null : partsMap.keySet();
  +                }
  +            }
  +            else
  +                nodes = stableDataNodes(topVer, cctx, extraSpaces);
  +
  +            if (nodes == null)
  +                continue; // Retry.
  +
  +            assert !nodes.isEmpty();
  +
  +            if (cctx.isReplicated() || qry.explain()) {
-                  assert qry.explain() || !nodes.contains(ctx.cluster().get().localNode()) : "We must be on a client node.";
+ +                assert qry.explain() || !nodes.contains(ctx.cluster().get().localNode()) :
+ +                    "We must be on a client node.";
  +
  +                // Select random data node to run query on a replicated data or get EXPLAIN PLAN from a single node.
  +                nodes = Collections.singleton(F.rand(nodes));
  +            }
  +
  +            for (GridCacheSqlQuery mapQry : qry.mapQueries()) {
  +                GridMergeTable tbl;
  +
  +                try {
  +                    tbl = createFunctionTable(r.conn, mapQry, qry.explain()); // createTable(r.conn, mapQry); TODO
  +                }
  +                catch (IgniteCheckedException e) {
  +                    throw new IgniteException(e);
  +                }
  +
  +                GridMergeIndex idx = tbl.getScanIndex(null);
  +
  +                for (ClusterNode node : nodes)
  +                    idx.addSource(node.id());
  +
  +                r.tbls.add(tbl);
  +
  +                curFunTbl.set(tbl);
  +            }
  +
  +            r.latch = new CountDownLatch(r.tbls.size() * nodes.size());
  +
  +            runs.put(qryReqId, r);
   
               try {
  -                tbl = createFunctionTable(r.conn, mapQry, qry.explain()); // createTable(r.conn, mapQry); TODO
  +                Collection<GridCacheSqlQuery> mapQrys = qry.mapQueries();
  +
  +                if (qry.explain()) {
  +                    mapQrys = new ArrayList<>(qry.mapQueries().size());
  +
  +                    for (GridCacheSqlQuery mapQry : qry.mapQueries())
  +                        mapQrys.add(new GridCacheSqlQuery(mapQry.alias(), "EXPLAIN " + mapQry.query(), mapQry.parameters()));
  +                }
  +
  +                if (nodes.size() != 1 || !F.first(nodes).isLocal()) { // Marshall params for remotes.
  +                    Marshaller m = ctx.config().getMarshaller();
  +
  +                    for (GridCacheSqlQuery mapQry : mapQrys)
  +                        mapQry.marshallParams(m);
  +                }
  +
  +                boolean retry = false;
  +
  +                if (send(nodes,
  +                    new GridQueryRequest(qryReqId, r.pageSize, space, mapQrys, topVer, extraSpaces, null), partsMap)) {
  +                    U.await(r.latch);
  +
  +                    Object state = r.state.get();
  +
  +                    if (state != null) {
  +                        if (state instanceof CacheException)
  +                            throw new CacheException("Failed to run map query remotely.", (CacheException)state);
  +
  +                        if (state instanceof AffinityTopologyVersion) {
  +                            retry = true;
  +
  +                            // If remote node asks us to retry then we have outdated full partition map.
  +                            h2.awaitForReadyTopologyVersion((AffinityTopologyVersion)state);
  +                        }
  +                    }
  +                }
  +                else // Send failed.
  +                    retry = true;
  +
  +                ResultSet res = null;
  +
  +                if (!retry) {
  +                    if (qry.explain())
  +                        return explainPlan(r.conn, space, qry);
  +
  +                    GridCacheSqlQuery rdc = qry.reduceQuery();
  +
  +                    res = h2.executeSqlQueryWithTimer(space, r.conn, rdc.query(), F.asList(rdc.parameters()));
  +                }
  +
  +                for (GridMergeTable tbl : r.tbls) {
  +                    if (!tbl.getScanIndex(null).fetchedAll()) // We have to explicitly cancel queries on remote nodes.
  +                        send(nodes, new GridQueryCancelRequest(qryReqId), null);
  +
  +//                dropTable(r.conn, tbl.getName()); TODO
  +                }
  +
  +                if (retry) {
  +                    if (Thread.currentThread().isInterrupted())
  +                        throw new IgniteInterruptedCheckedException("Query was interrupted.");
  +
  +                    continue;
  +                }
  +
  +                return new GridQueryCacheObjectsIterator(new Iter(res), cctx, keepPortable);
               }
  -            catch (IgniteCheckedException e) {
  -                throw new IgniteException(e);
  +            catch (IgniteCheckedException | RuntimeException e) {
  +                U.closeQuiet(r.conn);
  +
 -                 if (e instanceof CacheException)
 -                     throw (CacheException)e;
 - 
  +                throw new CacheException("Failed to run reduce query locally.", e);
  +            }
  +            finally {
  +                if (!runs.remove(qryReqId, r))
  +                    U.warn(log, "Query run was already removed: " + qryReqId);
  +
  +                curFunTbl.remove();
               }
  +        }
  +    }
  +
  +    /**
  +     * Calculates data nodes for replicated caches on unstable topology.
  +     *
  +     * @param cctx Cache context for main space.
  +     * @param extraSpaces Extra spaces.
  +     * @return Collection of all data nodes owning all the caches or {@code null} for retry.
  +     */
 -     private Collection<ClusterNode> replicatedDataNodes(final GridCacheContext<?,?> cctx, List<String> extraSpaces) {
 ++    private Collection<ClusterNode> replicatedUnstableDataNodes(final GridCacheContext<?,?> cctx,
 ++        List<String> extraSpaces) {
  +        assert cctx.isReplicated() : cctx.name() + " must be replicated";
  +
 -         Set<ClusterNode> nodes = owningReplicatedDataNodes(cctx);
 ++        Set<ClusterNode> nodes = replicatedUnstableDataNodes(cctx);
 + 
  -            GridMergeIndex idx = tbl.getScanIndex(null);
 ++        if (F.isEmpty(nodes))
 ++            return null; // Retry.
   
  -            for (ClusterNode node : nodes)
  -                idx.addSource(node.id());
  +        if (!F.isEmpty(extraSpaces)) {
  +            for (String extraSpace : extraSpaces) {
  +                GridCacheContext<?,?> extraCctx = cacheContext(extraSpace);
   
  -            r.tbls.add(tbl);
  +                if (extraCctx.isLocal())
  +                    continue;
   
  -            curFunTbl.set(tbl);
  +                if (!extraCctx.isReplicated())
  +                    throw new CacheException("Queries running on replicated cache should not contain JOINs " +
  +                        "with partitioned tables.");
  +
 -                 nodes.retainAll(owningReplicatedDataNodes(extraCctx));
 ++                Set<ClusterNode> extraOwners = replicatedUnstableDataNodes(extraCctx);
 ++
 ++                if (F.isEmpty(extraOwners))
 ++                    return null; // Retry.
 ++
 ++                nodes.retainAll(extraOwners);
  +
  +                if (nodes.isEmpty())
  +                    return null; // Retry.
  +            }
           }
   
  -        r.latch = new CountDownLatch(r.tbls.size() * nodes.size());
  +        return nodes;
  +    }
  +
  +    /**
 ++     * @param space Cache name.
 ++     * @param topVer Topology version.
 ++     * @return Collection of data nodes.
 ++     */
 ++    private Collection<ClusterNode> dataNodes(String space, AffinityTopologyVersion topVer) {
 ++        Collection<ClusterNode> res = ctx.discovery().cacheAffinityNodes(space, topVer);
 + 
  -        runs.put(qryReqId, r);
 ++        return res != null ? res : Collections.<ClusterNode>emptySet();
 ++    }
 + 
  -        try {
  -            Collection<GridCacheSqlQuery> mapQrys = qry.mapQueries();
 ++    /**
  +     * Collects all the nodes owning all the partitions for the given replicated cache.
  +     *
  +     * @param cctx Cache context.
 -      * @return Owning nodes.
 ++     * @return Owning nodes or {@code null} if we can't find owners for some partitions.
  +     */
 -     private Set<ClusterNode> owningReplicatedDataNodes(GridCacheContext<?,?> cctx) {
 ++    private Set<ClusterNode> replicatedUnstableDataNodes(GridCacheContext<?,?> cctx) {
  +        assert cctx.isReplicated() : cctx.name() + " must be replicated";
  +
  +        String space = cctx.name();
  +
 -         Set<ClusterNode> dataNodes = new HashSet<>(ctx.discovery().cacheAffinityNodes(space, NONE));
 ++        Set<ClusterNode> dataNodes = new HashSet<>(dataNodes(space, NONE));
  +
  +        if (dataNodes.isEmpty())
  +            throw new CacheException("No data nodes found for cache '" + space + "'");
  +
  +        // Find all the nodes owning all the partitions for replicated cache.
 -         for (int p = 0, extraParts = cctx.affinity().partitions(); p < extraParts; p++) {
 ++        for (int p = 0, parts = cctx.affinity().partitions(); p < parts; p++) {
  +            List<ClusterNode> owners = cctx.topology().owners(p);
  +
 -             if (owners.isEmpty())
 -                 throw new CacheException("No data nodes found for cache '" + space +
 -                     "' for partition " + p);
 ++            if (F.isEmpty(owners))
 ++                return null; // Retry.
  +
  +            dataNodes.retainAll(owners);
  +
  +            if (dataNodes.isEmpty())
 -                 throw new CacheException("No data nodes found for cache '" + space +
 -                     "' owning all the partitions.");
 ++                return null; // Retry.
  +        }
  +
  +        return dataNodes;
  +    }
  +
  +    /**
  +     * Calculates partition mapping for partitioned cache on unstable topology.
  +     *
  +     * @param cctx Cache context for main space.
  +     * @param extraSpaces Extra spaces.
  +     * @return Partition mapping or {@code null} if we can't calculate it due to repartitioning and we need to retry.
  +     */
  +    @SuppressWarnings("unchecked")
 -     private Map<ClusterNode, IntArray> partitionLocations(final GridCacheContext<?,?> cctx, List<String> extraSpaces) {
 ++    private Map<ClusterNode, IntArray> partitionedUnstableDataNodes(final GridCacheContext<?,?> cctx,
 ++        List<String> extraSpaces) {
  +        assert !cctx.isReplicated() && !cctx.isLocal() : cctx.name() + " must be partitioned";
  +
  +        final int partsCnt = cctx.affinity().partitions();
  +
  +        if (extraSpaces != null) { // Check correct number of partitions for partitioned caches.
  +            for (String extraSpace : extraSpaces) {
  +                GridCacheContext<?,?> extraCctx = cacheContext(extraSpace);
   
  -            if (qry.explain()) {
  -                mapQrys = new ArrayList<>(qry.mapQueries().size());
  +                if (extraCctx.isReplicated() || extraCctx.isLocal())
  +                    continue;
   
  -                for (GridCacheSqlQuery mapQry : qry.mapQueries())
  -                    mapQrys.add(new GridCacheSqlQuery(mapQry.alias(), "EXPLAIN " + mapQry.query(), mapQry.parameters()));
  +                int parts = extraCctx.affinity().partitions();
  +
  +                if (parts != partsCnt)
  +                    throw new CacheException("Number of partitions must be the same for correct collocation in " +
  +                        "caches " + cctx.name() + " and " + extraSpace + ".");
               }
  +        }
  +
  +        Set<ClusterNode>[] partLocs = new Set[partsCnt];
   
  -            if (nodes.size() != 1 || !F.first(nodes).isLocal()) { // Marshall params for remotes.
  -                Marshaller m = ctx.config().getMarshaller();
  +        // Fill partition locations for main cache.
  +        for (int p = 0, parts =  cctx.affinity().partitions(); p < parts; p++) {
  +            List<ClusterNode> owners = cctx.topology().owners(p);
   
 -             if (F.isEmpty(owners))
  -                for (GridCacheSqlQuery mapQry : mapQrys)
  -                    mapQry.marshallParams(m);
 ++            if (F.isEmpty(owners)) {
 ++                if (!F.isEmpty(dataNodes(cctx.name(), NONE)))
 ++                    return null; // Retry.
 ++
  +                throw new CacheException("No data nodes found for cache '" + cctx.name() + "' for partition " + p);
 +             }
   
  -            send(nodes, new GridQueryRequest(qryReqId, r.pageSize, space, mapQrys));
  +            partLocs[p] = new HashSet<>(owners);
  +        }
   
  -            r.latch.await();
  +        if (extraSpaces != null) {
  +            // Find owner intersections for each participating partitioned cache partition.
  +            // We need this for logical collocation between different partitioned caches with the same affinity.
  +            for (String extraSpace : extraSpaces) {
  +                GridCacheContext<?,?> extraCctx = cacheContext(extraSpace);
   
  -            if (r.rmtErr != null)
  -                throw new CacheException("Failed to run map query remotely.", r.rmtErr);
  +                if (extraCctx.isReplicated() || extraCctx.isLocal())
  +                    continue;
   
  -            if (qry.explain())
  -                return explainPlan(r.conn, space, qry);
  +                for (int p = 0, parts =  extraCctx.affinity().partitions(); p < parts; p++) {
  +                    List<ClusterNode> owners = extraCctx.topology().owners(p);
   
 -                     if (F.isEmpty(owners))
  -            GridCacheSqlQuery rdc = qry.reduceQuery();
 ++                    if (F.isEmpty(owners)) {
 ++                        if (!F.isEmpty(dataNodes(extraSpace, NONE)))
 ++                            return null; // Retry.
 + 
  -            final ResultSet res = h2.executeSqlQueryWithTimer(space, r.conn, rdc.query(), F.asList(rdc.parameters()));
  +                        throw new CacheException("No data nodes found for cache '" + extraSpace +
  +                            "' for partition " + p);
 ++                    }
   
  -            for (GridMergeTable tbl : r.tbls) {
  -                if (!tbl.getScanIndex(null).fetchedAll()) // We have to explicitly cancel queries on remote nodes.
  -                    send(nodes, new GridQueryCancelRequest(qryReqId));
  +                    if (partLocs[p] == null)
  +                        partLocs[p] = new HashSet<>(owners);
  +                    else {
  +                        partLocs[p].retainAll(owners); // Intersection of owners.
   
  -//                dropTable(r.conn, tbl.getName()); TODO
  +                        if (partLocs[p].isEmpty())
  +                            return null; // Intersection is empty -> retry.
  +                    }
  +                }
               }
   
  -            return new GridQueryCacheObjectsIterator(new Iter(res), cctx, keepPortable);
  +            // Filter nodes where not all the replicated caches loaded.
  +            for (String extraSpace : extraSpaces) {
  +                GridCacheContext<?,?> extraCctx = cacheContext(extraSpace);
  +
  +                if (!extraCctx.isReplicated())
  +                    continue;
  +
 -                 Set<ClusterNode> dataNodes = owningReplicatedDataNodes(extraCctx);
 ++                Set<ClusterNode> dataNodes = replicatedUnstableDataNodes(extraCctx);
 ++
 ++                if (F.isEmpty(dataNodes))
 ++                    return null; // Retry.
  +
  +                for (Set<ClusterNode> partLoc : partLocs) {
  +                    partLoc.retainAll(dataNodes);
  +
  +                    if (partLoc.isEmpty())
  +                        return null; // Retry.
  +                }
  +            }
           }
  -        catch (IgniteCheckedException | InterruptedException | RuntimeException e) {
  -            U.closeQuiet(r.conn);
   
  -            if (e instanceof CacheException)
  -                throw (CacheException)e;
  +        // Collect the final partitions mapping.
  +        Map<ClusterNode, IntArray> res = new HashMap<>();
  +
  +        // Here partitions in all IntArray's will be sorted in ascending order, this is important.
  +        for (int p = 0; p < partLocs.length; p++) {
  +            Set<ClusterNode> pl = partLocs[p];
   
  -            throw new CacheException("Failed to run reduce query locally.", e);
  +            assert !F.isEmpty(pl) : pl;
  +
  +            ClusterNode n = pl.size() == 1 ? F.first(pl) : F.rand(pl);
  +
  +            IntArray parts = res.get(n);
  +
  +            if (parts == null)
  +                res.put(n, parts = new IntArray());
  +
  +            parts.add(p);
           }
  -        finally {
  -            if (!runs.remove(qryReqId, r))
  -                U.warn(log, "Query run was already removed: " + qryReqId);
   
  -            curFunTbl.remove();
  +        return res;
  +    }
  +
  +    /**
  +     * @param mainSpace Main space.
  +     * @param allSpaces All spaces.
  +     * @return List of all extra spaces or {@code null} if none.
  +     */
  +    private List<String> extraSpaces(String mainSpace, Set<String> allSpaces) {
  +        if (F.isEmpty(allSpaces) || (allSpaces.size() == 1 && allSpaces.contains(mainSpace)))
  +            return null;
  +
  +        ArrayList<String> res = new ArrayList<>(allSpaces.size());
  +
  +        for (String space : allSpaces) {
  +            if (!F.eq(space, mainSpace))
  +                res.add(space);
           }
  +
  +        return res;
       }
   
       /**


[26/50] incubator-ignite git commit: ignite-484-1 - minor

Posted by sb...@apache.org.
ignite-484-1 - minor


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

Branch: refs/heads/ignite-917-review
Commit: c1fc7b5d6d7deb895bdf13d3b7e199161d494277
Parents: ca253a8
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 17 13:44:36 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 17 13:44:36 2015 +0300

----------------------------------------------------------------------
 .../distributed/dht/GridDhtLocalPartition.java  |  8 +++-----
 .../dht/GridDhtPartitionsReservation.java       | 20 ++++++++++++++------
 .../IgniteCacheQueryNodeRestartSelfTest2.java   |  8 ++++++--
 3 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1fc7b5d/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 5938fc8..1392f5e 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
@@ -505,14 +505,12 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
      * @return {@code true} If there is a group reservation.
      */
     private boolean groupReserved() {
-        boolean reserved = false;
-
         for (GridDhtPartitionsReservation reservation : reservations) {
-            if (!reservation.canEvict())
-                reserved = true; // Calling all the reservations to allow them unregister themselves.
+            if (!reservation.invalidate())
+                return true; // Failed to invalidate reservation -> we are reserved.
         }
 
-        return reserved;
+        return false;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1fc7b5d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
index a32946a..aced999 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
@@ -34,6 +34,13 @@ public class GridDhtPartitionsReservation implements GridReservable {
     private static final GridDhtLocalPartition[] EMPTY = {};
 
     /** */
+    private static final CI1<GridDhtPartitionsReservation> NO_OP = new CI1<GridDhtPartitionsReservation>() {
+        @Override public void apply(GridDhtPartitionsReservation gridDhtPartitionsReservation) {
+            throw new IllegalStateException();
+        }
+    };
+
+    /** */
     private final Object appKey;
 
     /** */
@@ -154,7 +161,7 @@ public class GridDhtPartitionsReservation implements GridReservable {
         for (;;) {
             int r = reservations.get();
 
-            if (r == -1) // Invalidated by successful canEvict call.
+            if (r == -1) // Invalidated.
                 return false;
 
             assert r >= 0 : r;
@@ -224,20 +231,21 @@ public class GridDhtPartitionsReservation implements GridReservable {
         // Unpublish.
         CI1<GridDhtPartitionsReservation> u = unpublish.get();
 
-        if (u != null && unpublish.compareAndSet(u, null))
+        if (u != null && u != NO_OP && unpublish.compareAndSet(u, NO_OP))
             u.apply(this);
     }
 
     /**
      * Must be checked in {@link GridDhtLocalPartition#tryEvict(boolean)}.
-     * If returns {@code true} then probably partition will be evicted (or at least cleared),
-     * so this reservation object becomes invalid and must be dropped from the partition.
+     * If returns {@code true} this reservation object becomes invalid and partitions
+     * can be evicted or at least cleared.
      * Also this means that after returning {@code true} here method {@link #reserve()} can not
      * return {@code true} anymore.
      *
-     * @return {@code true} If this reservation is NOT reserved and partition CAN be evicted.
+     * @return {@code true} If this reservation was successfully invalidated because it was not
+     *          reserved and partitions can be evicted.
      */
-    public boolean canEvict() {
+    public boolean invalidate() {
         assert parts.get() != null : "all parts must be reserved before registration";
 
         int r = reservations.get();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1fc7b5d/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
index d440b13..527dfea 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
@@ -177,7 +177,7 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
      * @throws Exception If failed.
      */
     public void testRestarts() throws Exception {
-        int duration = 150 * 1000;
+        int duration = 90 * 1000;
         int qryThreadNum = 4;
         int restartThreadsNum = 2; // 4 + 2 = 6 nodes
         final int nodeLifeTime = 2 * 1000;
@@ -197,6 +197,9 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
 
         final List<List<?>> rRes = grid(0).cache("co").query(new SqlFieldsQuery(REPLICATED_QRY)).getAll();
 
+        assertFalse(pRes.isEmpty());
+        assertFalse(rRes.isEmpty());
+
         final AtomicInteger qryCnt = new AtomicInteger();
 
         final AtomicBoolean qrysDone = new AtomicBoolean();
@@ -235,7 +238,8 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
                                 if (!(th instanceof CacheException))
                                     continue;
 
-                                if (th.getMessage().startsWith("Failed to fetch data from node:")) {
+                                if (th.getMessage() != null &&
+                                    th.getMessage().startsWith("Failed to fetch data from node:")) {
                                     failedOnRemoteFetch = true;
 
                                     break;


[48/50] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-sprint-6' into ignite-sprint-6

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-6' into ignite-sprint-6


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

Branch: refs/heads/ignite-917-review
Commit: 6c683c28f5bde0cf22ac7482bc381c861a2c6a62
Parents: cc20ef6 45939ac
Author: sboikov <sb...@gridgain.com>
Authored: Thu Jun 18 10:36:28 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Jun 18 10:36:28 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/checkpoint/s3/S3CheckpointManagerSelfTest.java    | 2 +-
 .../apache/ignite/spi/checkpoint/s3/S3CheckpointSpiSelfTest.java | 4 ++--
 .../spi/checkpoint/s3/S3CheckpointSpiStartStopSelfTest.java      | 2 +-
 .../ignite/spi/checkpoint/s3/S3SessionCheckpointSelfTest.java    | 2 +-
 .../tcp/ipfinder/s3/TcpDiscoveryS3IpFinderSelfTest.java          | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------



[36/50] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-sprint-6' into ignite-917-review

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-6' into ignite-917-review


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

Branch: refs/heads/ignite-917-review
Commit: c826fab2e2ca7f4474a1f2676d4299e651243a18
Parents: 8c1af94 5218210
Author: ashutak <as...@gridgain.com>
Authored: Wed Jun 17 18:29:20 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Wed Jun 17 18:29:20 2015 +0300

----------------------------------------------------------------------
 RELEASE_NOTES.txt                               |   2 +-
 examples/pom.xml                                |   2 +-
 modules/aop/pom.xml                             |   2 +-
 modules/aws/pom.xml                             |   2 +-
 modules/clients/pom.xml                         |   2 +-
 modules/cloud/pom.xml                           |   2 +-
 modules/codegen/pom.xml                         |   2 +-
 modules/core/pom.xml                            |   2 +-
 .../apache/ignite/cache/query/ScanQuery.java    |  20 +-
 .../cache/store/jdbc/CacheJdbcBlobStore.java    |  22 +-
 .../store/jdbc/CacheJdbcBlobStoreFactory.java   | 290 +++++++++++
 .../cache/store/jdbc/CacheJdbcPojoStore.java    |   6 +-
 .../store/jdbc/CacheJdbcPojoStoreFactory.java   | 148 ++++++
 .../configuration/CacheConfiguration.java       |   3 +-
 .../apache/ignite/internal/IgniteKernal.java    |  14 +-
 .../client/GridClientConfiguration.java         |   2 +-
 .../GridClientOptimizedMarshaller.java          |  21 +
 .../impl/GridTcpRouterNioListenerAdapter.java   |   2 +-
 .../internal/interop/InteropBootstrap.java      |   3 +-
 .../internal/interop/InteropIgnition.java       |   5 +-
 .../discovery/GridDiscoveryManager.java         |   9 +-
 .../processors/cache/GridCacheProcessor.java    |  34 +-
 .../dht/preloader/GridDhtPreloader.java         |   2 +-
 .../transactions/IgniteTxLocalAdapter.java      |   6 +-
 .../processors/query/GridQueryProcessor.java    | 102 ++--
 .../rest/protocols/tcp/GridTcpRestProtocol.java |   3 +-
 .../ignite/internal/util/IgniteUtils.java       |  21 +
 .../util/spring/IgniteSpringHelper.java         |  10 +
 .../SpringApplicationContextResource.java       |   4 +-
 .../apache/ignite/resources/SpringResource.java |   6 +-
 .../org/apache/ignite/spi/IgniteSpiAdapter.java |  28 +-
 .../communication/tcp/TcpCommunicationSpi.java  |   2 +-
 .../ignite/spi/discovery/tcp/ClientImpl.java    | 498 +++++++++++++------
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 221 ++++----
 .../spi/discovery/tcp/TcpDiscoveryImpl.java     |  66 +++
 .../ipfinder/TcpDiscoveryIpFinderAdapter.java   |  34 +-
 .../TcpDiscoveryMulticastIpFinder.java          |  19 +-
 .../messages/TcpDiscoveryAbstractMessage.java   |  10 +-
 .../core/src/main/resources/ignite.properties   |   2 +-
 .../apache/ignite/internal/GridSelfTest.java    |  12 +-
 .../GridDiscoveryManagerAliveCacheSelfTest.java |  17 +-
 .../cache/CacheClientStoreSelfTest.java         | 228 +++++++++
 ...acheReadOnlyTransactionalClientSelfTest.java | 327 ------------
 .../GridCacheAbstractFailoverSelfTest.java      |   2 +
 ...ridCacheMultinodeUpdateAbstractSelfTest.java |   9 +
 .../cache/GridCacheVersionMultinodeTest.java    |   8 +-
 ...CacheP2pUnmarshallingRebalanceErrorTest.java |  15 +-
 .../IgniteCacheClientNodeConcurrentStart.java   |  14 +-
 .../distributed/IgniteCacheManyClientsTest.java | 189 ++++++-
 .../GridCachePartitionedTxSalvageSelfTest.java  |  37 +-
 ...CacheClientWriteBehindStoreAbstractTest.java | 104 ++++
 ...teCacheClientWriteBehindStoreAtomicTest.java |  38 ++
 .../IgnteCacheClientWriteBehindStoreTxTest.java |  32 ++
 .../tcp/TcpClientDiscoverySpiSelfTest.java      |  73 ++-
 .../junits/common/GridCommonAbstractTest.java   |  11 +-
 .../IgniteCacheFailoverTestSuite.java           |   8 -
 .../IgniteCacheFailoverTestSuite2.java          |  47 ++
 .../testsuites/IgniteCacheTestSuite4.java       |   6 +-
 .../IgniteCacheWriteBehindTestSuite.java        |   2 +
 modules/extdata/p2p/pom.xml                     |   2 +-
 modules/extdata/uri/pom.xml                     |   2 +-
 modules/gce/pom.xml                             |   2 +-
 modules/geospatial/pom.xml                      |   2 +-
 modules/hadoop/pom.xml                          |   2 +-
 modules/hibernate/pom.xml                       |  16 +-
 .../hibernate/CacheHibernateBlobStore.java      |  87 +---
 .../CacheHibernateBlobStoreFactory.java         | 235 +++++++++
 .../hibernate/src/test/config/factory-cache.xml |  59 +++
 .../src/test/config/factory-cache1.xml          |  61 +++
 .../config/factory-incorrect-store-cache.xml    |  56 +++
 .../CacheHibernateStoreFactorySelfTest.java     | 273 ++++++++++
 .../testsuites/IgniteHibernateTestSuite.java    |   2 +
 modules/indexing/pom.xml                        |   2 +-
 .../CacheAbstractQueryMetricsSelfTest.java      | 205 ++++++++
 .../CachePartitionedQueryMetricsSelfTest.java   |  32 ++
 .../CacheReplicatedQueryMetricsSelfTest.java    |  32 ++
 .../cache/GridCacheQueryMetricsSelfTest.java    | 206 --------
 .../query/h2/sql/BaseH2CompareQueryTest.java    |   2 +-
 .../IgniteCacheQuerySelfTestSuite.java          |   4 +-
 modules/jcl/pom.xml                             |   2 +-
 modules/jta/pom.xml                             |   2 +-
 modules/log4j/pom.xml                           |   2 +-
 modules/mesos/pom.xml                           |   2 +-
 modules/rest-http/pom.xml                       |   2 +-
 modules/scalar-2.10/pom.xml                     |   2 +-
 modules/scalar/pom.xml                          |   2 +-
 modules/schedule/pom.xml                        |   2 +-
 modules/schema-import/pom.xml                   |   2 +-
 modules/slf4j/pom.xml                           |   2 +-
 modules/spark-2.10/pom.xml                      |   2 +-
 modules/spark/pom.xml                           |   2 +-
 modules/spring/pom.xml                          |   9 +-
 .../GridResourceSpringBeanInjector.java         |   2 +-
 .../util/spring/IgniteSpringHelperImpl.java     |  17 +
 .../src/test/config/incorrect-store-cache.xml   |  57 +++
 modules/spring/src/test/config/node.xml         |  43 ++
 modules/spring/src/test/config/node1.xml        |  45 ++
 .../test/config/pojo-incorrect-store-cache.xml  |  56 +++
 modules/spring/src/test/config/store-cache.xml  |  59 +++
 modules/spring/src/test/config/store-cache1.xml |  62 +++
 .../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 172 +++++++
 .../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 193 +++++++
 .../testsuites/IgniteSpringTestSuite.java       |   5 +
 modules/ssh/pom.xml                             |   2 +-
 modules/tools/pom.xml                           |   2 +-
 modules/urideploy/pom.xml                       |   2 +-
 modules/visor-console-2.10/pom.xml              |   2 +-
 modules/visor-console/pom.xml                   |   2 +-
 modules/visor-plugins/pom.xml                   |   2 +-
 modules/web/pom.xml                             |   2 +-
 modules/yardstick/pom.xml                       |   2 +-
 pom.xml                                         |   2 +-
 112 files changed, 3716 insertions(+), 1136 deletions(-)
----------------------------------------------------------------------



[22/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-7' into ignite-1020

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-7' into ignite-1020


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

Branch: refs/heads/ignite-917-review
Commit: e507f030998c98851f97affa14667b64ebdb236e
Parents: a75b868 01eee2d
Author: sboikov <sb...@gridgain.com>
Authored: Wed Jun 17 12:10:41 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Jun 17 12:10:41 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    | 13 +-----------
 .../client/GridClientConfiguration.java         |  4 ++--
 .../GridClientOptimizedMarshaller.java          | 21 ++++++++++++++++++++
 .../impl/GridTcpRouterNioListenerAdapter.java   |  2 +-
 .../rest/protocols/tcp/GridTcpRestProtocol.java |  3 ++-
 .../ignite/internal/util/IgniteUtils.java       | 21 ++++++++++++++++++++
 6 files changed, 48 insertions(+), 16 deletions(-)
----------------------------------------------------------------------



[50/50] incubator-ignite git commit: Merge branch 'ignite-sprint-6' into ignite-917-review

Posted by sb...@apache.org.
Merge branch 'ignite-sprint-6' into ignite-917-review


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

Branch: refs/heads/ignite-917-review
Commit: a3616c2da6ce24aad8b440d6e82986ed7deb9de7
Parents: c826fab d874b00
Author: ashutak <as...@gridgain.com>
Authored: Thu Jun 18 13:16:25 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Thu Jun 18 13:16:25 2015 +0300

----------------------------------------------------------------------
 .../s3/S3CheckpointManagerSelfTest.java         |   2 +-
 .../checkpoint/s3/S3CheckpointSpiSelfTest.java  |   4 +-
 .../s3/S3CheckpointSpiStartStopSelfTest.java    |   2 +-
 .../s3/S3SessionCheckpointSelfTest.java         |   2 +-
 .../s3/TcpDiscoveryS3IpFinderSelfTest.java      |   2 +-
 .../affinity/AffinityTopologyVersion.java       |   7 -
 .../processors/cache/GridCacheAdapter.java      |   4 +
 .../processors/cache/IgniteCacheProxy.java      |   7 +
 .../distributed/dht/GridDhtLocalPartition.java  |  56 +-
 .../dht/GridDhtPartitionTopologyImpl.java       |   4 +-
 .../dht/GridDhtPartitionsReservation.java       | 292 +++++++++
 .../dht/GridDhtTransactionalCacheAdapter.java   |   2 +-
 .../cache/distributed/dht/GridReservable.java   |  35 +
 .../dht/preloader/GridDhtPartitionMap.java      |  26 +-
 .../cache/query/GridCacheQueryManager.java      |  33 -
 .../cache/query/GridCacheTwoStepQuery.java      |  22 +-
 .../cache/transactions/IgniteTxHandler.java     |   2 +-
 .../transactions/IgniteTxLocalAdapter.java      |  12 +-
 .../dr/IgniteDrDataStreamerCacheUpdater.java    |   7 +-
 .../processors/query/GridQueryIndexing.java     |  14 +-
 .../processors/query/GridQueryProcessor.java    |  14 +-
 .../messages/GridQueryNextPageResponse.java     |  34 +-
 .../h2/twostep/messages/GridQueryRequest.java   | 111 +++-
 .../apache/ignite/internal/util/GridDebug.java  |  19 +
 .../CacheStoreUsageMultinodeAbstractTest.java   | 305 +++++++++
 ...eUsageMultinodeDynamicStartAbstractTest.java | 169 +++++
 ...oreUsageMultinodeDynamicStartAtomicTest.java |  32 +
 ...heStoreUsageMultinodeDynamicStartTxTest.java |  32 +
 ...reUsageMultinodeStaticStartAbstractTest.java | 158 +++++
 ...toreUsageMultinodeStaticStartAtomicTest.java |  32 +
 ...cheStoreUsageMultinodeStaticStartTxTest.java |  32 +
 .../cache/GridCacheAbstractFullApiSelfTest.java |  24 +-
 .../IgniteCacheAbstractStopBusySelfTest.java    |  30 +-
 .../IgniteCacheAtomicStopBusySelfTest.java      |   8 +-
 .../IgniteCacheP2pUnmarshallingTxErrorTest.java |  19 +-
 ...gniteCacheTransactionalStopBusySelfTest.java |   8 +-
 .../junits/GridTestKernalContext.java           |   2 +-
 .../junits/common/GridCommonAbstractTest.java   |   8 +-
 .../testsuites/IgniteCacheTestSuite4.java       |   4 +
 .../processors/query/h2/IgniteH2Indexing.java   |  79 ++-
 .../query/h2/sql/GridSqlQuerySplitter.java      |  49 +-
 .../query/h2/twostep/GridMapQueryExecutor.java  | 332 +++++++---
 .../query/h2/twostep/GridMergeIndex.java        |  17 +-
 .../h2/twostep/GridMergeIndexUnsorted.java      |   7 +-
 .../h2/twostep/GridReduceQueryExecutor.java     | 650 ++++++++++++++++---
 .../query/h2/twostep/GridResultPage.java        |  21 +-
 .../cache/GridCacheCrossCacheQuerySelfTest.java |   3 +-
 .../IgniteCacheQueryMultiThreadedSelfTest.java  |   1 -
 ...lientQueryReplicatedNodeRestartSelfTest.java | 419 ++++++++++++
 .../IgniteCacheQueryNodeRestartSelfTest.java    |  36 +-
 .../IgniteCacheQueryNodeRestartSelfTest2.java   | 383 +++++++++++
 .../IgniteCacheQuerySelfTestSuite.java          |   2 +
 52 files changed, 3236 insertions(+), 339 deletions(-)
----------------------------------------------------------------------



[27/50] incubator-ignite git commit: Fixed tests.

Posted by sb...@apache.org.
Fixed tests.


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

Branch: refs/heads/ignite-917-review
Commit: 5218210cf3400913ab2116684b23503efbbd32a3
Parents: 9c0b09c
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Jun 17 14:36:44 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Jun 17 14:36:44 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/client/GridClientConfiguration.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5218210c/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
index f06d779..7fa0dae 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
@@ -110,7 +110,7 @@ public class GridClientConfiguration {
     private ExecutorService executor;
 
     /** Marshaller. */
-    private GridClientMarshaller marshaller;
+    private GridClientMarshaller marshaller = new GridClientOptimizedMarshaller(U.allPluginProviders());
 
     /** Daemon flag. */
     private boolean daemon;
@@ -119,7 +119,7 @@ public class GridClientConfiguration {
      * Creates default configuration.
      */
     public GridClientConfiguration() {
-        marshaller = new GridClientOptimizedMarshaller(U.allPluginProviders());
+        // No-op.
     }
 
     /**


[14/50] incubator-ignite git commit: Merge branch 'ignite-960' into ignite-sprint-6

Posted by sb...@apache.org.
Merge branch 'ignite-960' into ignite-sprint-6


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

Branch: refs/heads/ignite-917-review
Commit: d1a21501bea846bd5778b72c30ec84ec83644844
Parents: 53f4cb7 37d4710
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 19:16:58 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 19:16:58 2015 +0300

----------------------------------------------------------------------
 .../cache/store/jdbc/CacheJdbcBlobStore.java    |  22 +-
 .../store/jdbc/CacheJdbcBlobStoreFactory.java   | 290 +++++++++++++++++++
 .../cache/store/jdbc/CacheJdbcPojoStore.java    |   6 +-
 .../store/jdbc/CacheJdbcPojoStoreFactory.java   | 148 ++++++++++
 .../configuration/CacheConfiguration.java       |   3 +-
 .../processors/cache/GridCacheProcessor.java    |  23 +-
 .../util/spring/IgniteSpringHelper.java         |  10 +
 .../SpringApplicationContextResource.java       |   4 +-
 .../apache/ignite/resources/SpringResource.java |   6 +-
 modules/hibernate/pom.xml                       |  14 +
 .../hibernate/CacheHibernateBlobStore.java      |  87 +-----
 .../CacheHibernateBlobStoreFactory.java         | 235 +++++++++++++++
 .../hibernate/src/test/config/factory-cache.xml |  59 ++++
 .../src/test/config/factory-cache1.xml          |  61 ++++
 .../config/factory-incorrect-store-cache.xml    |  56 ++++
 .../CacheHibernateStoreFactorySelfTest.java     | 273 +++++++++++++++++
 .../testsuites/IgniteHibernateTestSuite.java    |   2 +
 modules/spring/pom.xml                          |   7 +
 .../GridResourceSpringBeanInjector.java         |   2 +-
 .../util/spring/IgniteSpringHelperImpl.java     |  17 ++
 .../src/test/config/incorrect-store-cache.xml   |  57 ++++
 modules/spring/src/test/config/node.xml         |  43 +++
 modules/spring/src/test/config/node1.xml        |  45 +++
 .../test/config/pojo-incorrect-store-cache.xml  |  56 ++++
 modules/spring/src/test/config/store-cache.xml  |  59 ++++
 modules/spring/src/test/config/store-cache1.xml |  62 ++++
 .../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 172 +++++++++++
 .../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 193 ++++++++++++
 .../testsuites/IgniteSpringTestSuite.java       |   5 +
 29 files changed, 1901 insertions(+), 116 deletions(-)
----------------------------------------------------------------------



[19/50] incubator-ignite git commit: #IGNITE-GG-10429 Extract utility method.

Posted by sb...@apache.org.
#IGNITE-GG-10429 Extract utility method.


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

Branch: refs/heads/ignite-917-review
Commit: 01eee2da37961d8f6c8ae477f4a6b3cb8a6a6372
Parents: 9142eb7
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Jun 17 10:48:19 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Jun 17 10:48:19 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    | 13 +-----------
 .../client/GridClientConfiguration.java         | 17 +---------------
 .../impl/GridTcpRouterNioListenerAdapter.java   | 17 +---------------
 .../ignite/internal/util/IgniteUtils.java       | 21 ++++++++++++++++++++
 4 files changed, 24 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/01eee2da/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 9e0dcbf..e19d3d3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -630,18 +630,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
         // Ack configuration.
         ackSpis();
 
-        List<PluginProvider> plugins = AccessController.doPrivileged(new PrivilegedAction<List<PluginProvider>>() {
-            @Override public List<PluginProvider> run() {
-                List<PluginProvider> providers = new ArrayList<>();
-
-                ServiceLoader<PluginProvider> ldr = ServiceLoader.load(PluginProvider.class);
-
-                for (PluginProvider provider : ldr)
-                    providers.add(provider);
-
-                return providers;
-            }
-        });
+        List<PluginProvider> plugins = U.allPluginProviders();
 
         // Spin out SPIs & managers.
         try {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/01eee2da/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
index 4a909a3..f06d779 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
@@ -23,12 +23,10 @@ import org.apache.ignite.internal.client.marshaller.optimized.*;
 import org.apache.ignite.internal.client.ssl.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.plugin.*;
 import org.apache.ignite.plugin.security.*;
 import org.jetbrains.annotations.*;
 
 import java.net.*;
-import java.security.*;
 import java.util.*;
 import java.util.concurrent.*;
 
@@ -121,20 +119,7 @@ public class GridClientConfiguration {
      * Creates default configuration.
      */
     public GridClientConfiguration() {
-        List<PluginProvider> plugins = AccessController.doPrivileged(new PrivilegedAction<List<PluginProvider>>() {
-            @Override public List<PluginProvider> run() {
-                List<PluginProvider> providers = new ArrayList<>();
-
-                ServiceLoader<PluginProvider> ldr = ServiceLoader.load(PluginProvider.class);
-
-                for (PluginProvider provider : ldr)
-                    providers.add(provider);
-
-                return providers;
-            }
-        });
-
-        marshaller = new GridClientOptimizedMarshaller(plugins);
+        marshaller = new GridClientOptimizedMarshaller(U.allPluginProviders());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/01eee2da/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java
index e60f2aa..1775b21 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/router/impl/GridTcpRouterNioListenerAdapter.java
@@ -25,10 +25,8 @@ import org.apache.ignite.internal.client.marshaller.optimized.*;
 import org.apache.ignite.internal.processors.rest.client.message.*;
 import org.apache.ignite.internal.util.nio.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.plugin.*;
 import org.jetbrains.annotations.*;
 
-import java.security.*;
 import java.util.*;
 
 import static org.apache.ignite.internal.util.nio.GridNioSessionMetaKey.*;
@@ -67,20 +65,7 @@ public abstract class GridTcpRouterNioListenerAdapter implements GridNioServerLi
 
         marshMap = new HashMap<>();
 
-        List<PluginProvider> plugins = AccessController.doPrivileged(new PrivilegedAction<List<PluginProvider>>() {
-            @Override public List<PluginProvider> run() {
-                List<PluginProvider> providers = new ArrayList<>();
-
-                ServiceLoader<PluginProvider> ldr = ServiceLoader.load(PluginProvider.class);
-
-                for (PluginProvider provider : ldr)
-                    providers.add(provider);
-
-                return providers;
-            }
-        });
-
-        marshMap.put(GridClientOptimizedMarshaller.ID, new GridClientOptimizedMarshaller(plugins));
+        marshMap.put(GridClientOptimizedMarshaller.ID, new GridClientOptimizedMarshaller(U.allPluginProviders()));
         marshMap.put(GridClientJdkMarshaller.ID, new GridClientJdkMarshaller());
 
         init();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/01eee2da/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index a303abc..6623e85 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -39,6 +39,7 @@ import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.internal.util.worker.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.lifecycle.*;
+import org.apache.ignite.plugin.*;
 import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.discovery.*;
@@ -629,6 +630,26 @@ public abstract class IgniteUtils {
     }
 
     /**
+     * Gets all plugin providers.
+     *
+     * @return Plugins.
+     */
+    public static List<PluginProvider> allPluginProviders() {
+        return AccessController.doPrivileged(new PrivilegedAction<List<PluginProvider>>() {
+            @Override public List<PluginProvider> run() {
+                List<PluginProvider> providers = new ArrayList<>();
+
+                ServiceLoader<PluginProvider> ldr = ServiceLoader.load(PluginProvider.class);
+
+                for (PluginProvider provider : ldr)
+                    providers.add(provider);
+
+                return providers;
+            }
+        });
+    }
+
+    /**
      * Converts exception, but unlike {@link #convertException(IgniteCheckedException)}
      * does not wrap passed in exception if none suitable converter found.
      *


[16/50] incubator-ignite git commit: #IGNITE-GG-10429 Fixed client marshaller.

Posted by sb...@apache.org.
#IGNITE-GG-10429 Fixed client marshaller.


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

Branch: refs/heads/ignite-917-review
Commit: 092bb91f1cf8b99b0f43903fd493d85cac89ee7e
Parents: 7785544
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Jun 17 10:17:49 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Jun 17 10:17:49 2015 +0300

----------------------------------------------------------------------
 .../internal/client/GridClientConfiguration.java | 19 +++++++++++++++++--
 .../optimized/GridClientOptimizedMarshaller.java |  5 +++--
 2 files changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/092bb91f/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
index ee16f94..4a909a3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
@@ -23,10 +23,12 @@ import org.apache.ignite.internal.client.marshaller.optimized.*;
 import org.apache.ignite.internal.client.ssl.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.plugin.*;
 import org.apache.ignite.plugin.security.*;
 import org.jetbrains.annotations.*;
 
 import java.net.*;
+import java.security.*;
 import java.util.*;
 import java.util.concurrent.*;
 
@@ -110,7 +112,7 @@ public class GridClientConfiguration {
     private ExecutorService executor;
 
     /** Marshaller. */
-    private GridClientMarshaller marshaller = new GridClientOptimizedMarshaller();
+    private GridClientMarshaller marshaller;
 
     /** Daemon flag. */
     private boolean daemon;
@@ -119,7 +121,20 @@ public class GridClientConfiguration {
      * Creates default configuration.
      */
     public GridClientConfiguration() {
-        // No-op.
+        List<PluginProvider> plugins = AccessController.doPrivileged(new PrivilegedAction<List<PluginProvider>>() {
+            @Override public List<PluginProvider> run() {
+                List<PluginProvider> providers = new ArrayList<>();
+
+                ServiceLoader<PluginProvider> ldr = ServiceLoader.load(PluginProvider.class);
+
+                for (PluginProvider provider : ldr)
+                    providers.add(provider);
+
+                return providers;
+            }
+        });
+
+        marshaller = new GridClientOptimizedMarshaller(plugins);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/092bb91f/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
index 28b129e..0d99d75 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java
@@ -23,6 +23,7 @@ import org.apache.ignite.internal.client.marshaller.*;
 import org.apache.ignite.internal.processors.rest.client.message.*;
 import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.plugin.*;
+import org.jetbrains.annotations.*;
 
 import java.io.*;
 import java.nio.*;
@@ -53,7 +54,7 @@ public class GridClientOptimizedMarshaller implements GridClientMarshaller {
      *
      * @param plugins Plugins.
      */
-    public GridClientOptimizedMarshaller(List<PluginProvider> plugins) {
+    public GridClientOptimizedMarshaller(@Nullable List<PluginProvider> plugins) {
         opMarsh = new OptimizedMarshaller();
 
         opMarsh.setContext(new ClientMarshallerContext(plugins));
@@ -121,7 +122,7 @@ public class GridClientOptimizedMarshaller implements GridClientMarshaller {
         /**
          * @param plugins Plugins.
          */
-        public ClientMarshallerContext(List<PluginProvider> plugins) {
+        public ClientMarshallerContext(@Nullable List<PluginProvider> plugins) {
             super(plugins);
         }
 


[21/50] incubator-ignite git commit: # ignite-1020 properly skip non-primary entries for store update , tests

Posted by sb...@apache.org.
# ignite-1020 properly skip non-primary entries for store update , tests


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

Branch: refs/heads/ignite-917-review
Commit: a75b868605f661a71ed96f17e9d36471ccbfcd13
Parents: 9a0e659
Author: sboikov <sb...@gridgain.com>
Authored: Wed Jun 17 11:25:23 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Jun 17 12:07:37 2015 +0300

----------------------------------------------------------------------
 .../transactions/IgniteTxLocalAdapter.java      |  12 +-
 .../CacheStoreUsageMultinodeAbstractTest.java   | 305 +++++++++++++++++++
 ...eUsageMultinodeDynamicStartAbstractTest.java | 169 ++++++++++
 ...oreUsageMultinodeDynamicStartAtomicTest.java |  32 ++
 ...heStoreUsageMultinodeDynamicStartTxTest.java |  32 ++
 ...reUsageMultinodeStaticStartAbstractTest.java | 158 ++++++++++
 ...toreUsageMultinodeStaticStartAtomicTest.java |  32 ++
 ...cheStoreUsageMultinodeStaticStartTxTest.java |  32 ++
 .../testsuites/IgniteCacheTestSuite4.java       |   4 +
 9 files changed, 772 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a75b8686/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index bc6308b..7bc9042 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -500,12 +500,16 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                     List<Object> rmvCol = null;
                     CacheStoreManager writeStore = null;
 
-                    boolean skipNear = near() && isWriteToStoreFromDht;
+                    boolean skipNonPrimary = near() && isWriteToStoreFromDht;
 
                     for (IgniteTxEntry e : writeEntries) {
-                        boolean skip = (skipNear && e.cached().isNear()) ||
-                            e.skipStore() ||
-                            (e.context().store().isLocal() && !e.context().affinityNode());
+                        boolean skip = e.skipStore();
+
+                        if (!skip && skipNonPrimary) {
+                            skip = e.cached().isNear() ||
+                                e.cached().detached() ||
+                                !e.context().affinity().primary(e.cached().partition(), topologyVersion()).isLocal();
+                        }
 
                         if (skip)
                             continue;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a75b8686/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeAbstractTest.java
new file mode 100644
index 0000000..79a0293
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeAbstractTest.java
@@ -0,0 +1,305 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cache.store.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.cache.store.*;
+import org.apache.ignite.internal.util.lang.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.*;
+import org.apache.ignite.testframework.junits.common.*;
+import org.apache.ignite.transactions.*;
+import org.jetbrains.annotations.*;
+
+import javax.cache.*;
+import javax.cache.configuration.*;
+import javax.cache.integration.*;
+import java.util.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
+import static org.apache.ignite.internal.IgniteNodeAttributes.*;
+import static org.apache.ignite.transactions.TransactionIsolation.*;
+
+/**
+ *
+ */
+public abstract class CacheStoreUsageMultinodeAbstractTest extends GridCommonAbstractTest {
+    /** */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    protected boolean client;
+
+    /** */
+    protected boolean cache;
+
+    /** */
+    protected boolean cacheStore;
+
+    /** */
+    protected boolean locStore;
+
+    /** */
+    protected boolean writeBehind;
+
+    /** */
+    protected boolean nearCache;
+
+    /** */
+    protected static Map<String, List<Cache.Entry<?, ?>>> writeMap;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        cfg.setClientMode(client);
+
+        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
+
+        if (cache)
+            cfg.setCacheConfiguration(cacheConfiguration());
+
+        return cfg;
+    }
+
+    /**
+     * @return Cache configuration.
+     */
+    @SuppressWarnings("unchecked")
+    protected CacheConfiguration cacheConfiguration() {
+        CacheConfiguration ccfg = new CacheConfiguration();
+
+        ccfg.setCacheMode(PARTITIONED);
+        ccfg.setAtomicityMode(atomicityMode());
+        ccfg.setBackups(1);
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
+
+        if (cacheStore) {
+            if (writeBehind) {
+                ccfg.setWriteBehindEnabled(true);
+                ccfg.setWriteBehindFlushFrequency(100);
+            }
+
+            ccfg.setWriteThrough(true);
+
+            ccfg.setCacheStoreFactory(locStore ? new TestLocalStoreFactory() : new TestStoreFactory());
+        }
+
+        if (nearCache)
+            ccfg.setNearConfiguration(new NearCacheConfiguration());
+
+        return ccfg;
+    }
+
+    /**
+     * @return Cache atomicity mode.
+     */
+    protected abstract CacheAtomicityMode atomicityMode();
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        super.beforeTest();
+
+        writeMap = new HashMap<>();
+    }
+
+    /**
+     * @param clientStore {@code True} if store configured on client node.
+     * @throws Exception If failed.
+     */
+    protected void checkStoreUpdate(boolean clientStore) throws Exception {
+        Ignite client = grid(3);
+
+        assertTrue(client.configuration().isClientMode());
+
+        awaitPartitionMapExchange();
+
+        IgniteCache<Object, Object> cache0 = ignite(0).cache(null);
+        IgniteCache<Object, Object> cache1 = ignite(1).cache(null);
+        IgniteCache<Object, Object> clientCache = client.cache(null);
+
+        assertTrue(((IgniteCacheProxy)cache0).context().store().configured());
+        assertEquals(clientStore, ((IgniteCacheProxy) clientCache).context().store().configured());
+
+        List<TransactionConcurrency> tcList = new ArrayList<>();
+
+        tcList.add(null);
+
+        if (atomicityMode() == TRANSACTIONAL) {
+            tcList.add(TransactionConcurrency.OPTIMISTIC);
+            tcList.add(TransactionConcurrency.PESSIMISTIC);
+        }
+
+        log.info("Start test [atomicityMode=" + atomicityMode() +
+            ", locStore=" + locStore +
+            ", writeBehind=" + writeBehind +
+            ", nearCache=" + nearCache +
+            ", clientStore=" + clientStore + ']');
+
+        for (TransactionConcurrency tc : tcList) {
+            testStoreUpdate(cache0, primaryKey(cache0), tc);
+
+            testStoreUpdate(cache0, backupKey(cache0), tc);
+
+            testStoreUpdate(cache0, nearKey(cache0), tc);
+
+            testStoreUpdate(cache0, primaryKey(cache1), tc);
+
+            testStoreUpdate(clientCache, primaryKey(cache0), tc);
+
+            testStoreUpdate(clientCache, primaryKey(cache1), tc);
+        }
+    }
+
+    /**
+     * @param cache Cache.
+     * @param key Key.
+     * @param tc Transaction concurrency mode.
+     * @throws Exception If failed.
+     */
+    protected void testStoreUpdate(IgniteCache<Object, Object> cache,
+       Object key,
+       @Nullable TransactionConcurrency tc)
+        throws Exception
+    {
+        boolean storeOnPrimary = atomicityMode() == ATOMIC || locStore || writeBehind;
+
+        assertTrue(writeMap.isEmpty());
+
+        Ignite ignite = cache.unwrap(Ignite.class);
+
+        Affinity<Object> obj = ignite.affinity(cache.getName());
+
+        ClusterNode node = obj.mapKeyToNode(key);
+
+        assertNotNull(node);
+
+        String expNode = storeOnPrimary ? (String)node.attribute(ATTR_GRID_NAME) : ignite.name();
+
+        assertNotNull(expNode);
+
+        log.info("Put [node=" + ignite.name() +
+            ", key=" + key +
+            ", primary=" + node.attribute(ATTR_GRID_NAME) +
+            ", tx=" + tc +
+            ", nearCache=" + (cache.getConfiguration(CacheConfiguration.class).getNearConfiguration() != null) +
+            ", storeOnPrimary=" + storeOnPrimary + ']');
+
+        Transaction tx = tc != null ? ignite.transactions().txStart(tc, REPEATABLE_READ) : null;
+
+        cache.put(key, key);
+
+        if (tx != null)
+            tx.commit();
+
+        boolean wait = GridTestUtils.waitForCondition(new GridAbsPredicate() {
+            @Override
+            public boolean apply() {
+                return writeMap.size() > 0;
+            }
+        }, 1000);
+
+        assertTrue("Store is not updated", wait);
+
+        assertEquals("Write on wrong node: " + writeMap, 1, writeMap.size());
+
+        assertEquals(expNode, writeMap.keySet().iterator().next());
+
+        writeMap.clear();
+    }
+
+    /**
+     *
+     */
+    public static class TestStoreFactory implements Factory<CacheStore> {
+        /** {@inheritDoc} */
+        @Override public CacheStore create() {
+            return new TestStore();
+        }
+    }
+
+    /**
+     *
+     */
+    public static class TestLocalStoreFactory implements Factory<CacheStore> {
+        /** {@inheritDoc} */
+        @Override public CacheStore create() {
+            return new TestLocalStore();
+        }
+    }
+
+    /**
+     *
+     */
+    public static class TestStore extends CacheStoreAdapter<Object, Object> {
+        /** */
+        @IgniteInstanceResource
+        private Ignite ignite;
+
+        /** {@inheritDoc} */
+        @SuppressWarnings("SynchronizeOnNonFinalField")
+        @Override public void write(Cache.Entry<?, ?> entry) {
+            synchronized (writeMap) {
+                ignite.log().info("Write [node=" + ignite.name() + ", entry=" + entry + ']');
+
+                String name = ignite.name();
+
+                List<Cache.Entry<?, ?>> list = writeMap.get(name);
+
+                if (list == null) {
+                    list = new ArrayList<>();
+
+                    writeMap.put(name, list);
+                }
+
+                list.add(entry);
+            }
+        }
+
+        /** {@inheritDoc} */
+        @Override public Object load(Object key) throws CacheLoaderException {
+            throw new UnsupportedOperationException();
+        }
+
+        /** {@inheritDoc} */
+        @Override public void delete(Object key) {
+            throw new UnsupportedOperationException();
+        }
+    }
+
+    /**
+     *
+     */
+    @CacheLocalStore
+    public static class TestLocalStore extends TestStore {
+        /** {@inheritDoc} */
+        @Override public void delete(Object key) {
+            // No-op.
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a75b8686/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartAbstractTest.java
new file mode 100644
index 0000000..82667d9
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartAbstractTest.java
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+
+/**
+ *
+ */
+public abstract class CacheStoreUsageMultinodeDynamicStartAbstractTest extends CacheStoreUsageMultinodeAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        cache = false;
+
+        startGridsMultiThreaded(3);
+
+        client = true;
+
+        startGrid(3);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        stopAllGrids();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDynamicStart() throws Exception {
+        checkStoreWithDynamicStart(false);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDynamicStartNearEnabled() throws Exception {
+        nearCache = true;
+
+        checkStoreWithDynamicStart(false);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDynamicFromClientStart() throws Exception {
+        checkStoreWithDynamicStart(true);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDynamicStartFromClientNearEnabled() throws Exception {
+        nearCache = true;
+
+        checkStoreWithDynamicStart(true);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDynamicStartLocalStore() throws Exception {
+        locStore = true;
+
+        checkStoreWithDynamicStart(false);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDynamicStartFromClientLocalStore() throws Exception {
+        locStore = true;
+
+        checkStoreWithDynamicStart(true);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDynamicStartLocalStoreNearEnabled() throws Exception {
+        locStore = true;
+
+        nearCache = true;
+
+        checkStoreWithDynamicStart(false);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDynamicStartWriteBehindStore() throws Exception {
+        writeBehind = true;
+
+        checkStoreWithDynamicStart(false);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDynamicStartFromClientWriteBehindStore() throws Exception {
+        writeBehind = true;
+
+        checkStoreWithDynamicStart(true);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testDynamicStartWriteBehindStoreNearEnabled() throws Exception {
+        writeBehind = true;
+
+        nearCache = true;
+
+        checkStoreWithDynamicStart(false);
+    }
+
+    /**
+     * @param clientStart {@code True} if start cache from client node.
+     * @throws Exception If failed.
+     */
+    private void checkStoreWithDynamicStart(boolean clientStart) throws Exception {
+        cacheStore = true;
+
+        CacheConfiguration ccfg = cacheConfiguration();
+
+        assertNotNull(ccfg.getCacheStoreFactory());
+
+        Ignite srv = ignite(0);
+
+        Ignite client = ignite(3);
+
+        Ignite node = clientStart ? client : srv;
+
+        IgniteCache cache = nearCache ? node.createCache(ccfg, new NearCacheConfiguration()) : node.createCache(ccfg);
+
+        assertNotNull(cache);
+
+        try {
+            if (nearCache)
+                client.createNearCache(null, new NearCacheConfiguration<>());
+
+            checkStoreUpdate(true);
+        }
+        finally {
+            cache = srv.cache(null);
+
+            if (cache != null)
+                cache.close();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a75b8686/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartAtomicTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartAtomicTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartAtomicTest.java
new file mode 100644
index 0000000..884dedd
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartAtomicTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ *
+ */
+public class CacheStoreUsageMultinodeDynamicStartAtomicTest extends CacheStoreUsageMultinodeDynamicStartAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return ATOMIC;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a75b8686/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartTxTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartTxTest.java
new file mode 100644
index 0000000..825b450
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeDynamicStartTxTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ *
+ */
+public class CacheStoreUsageMultinodeDynamicStartTxTest extends CacheStoreUsageMultinodeDynamicStartAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return TRANSACTIONAL;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a75b8686/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartAbstractTest.java
new file mode 100644
index 0000000..c00d003
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartAbstractTest.java
@@ -0,0 +1,158 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.transactions.*;
+
+import java.util.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ *
+ */
+public abstract class CacheStoreUsageMultinodeStaticStartAbstractTest extends CacheStoreUsageMultinodeAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        stopAllGrids();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStaticConfiguration() throws Exception {
+        checkStoreUpdateStaticConfig(true);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStaticConfigurationNearEnabled() throws Exception {
+        nearCache = true;
+
+        checkStoreUpdateStaticConfig(true);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStaticConfigurationLocalStore() throws Exception {
+        locStore = true;
+
+        checkStoreUpdateStaticConfig(true);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStaticConfigurationLocalStoreNearEnabled() throws Exception {
+        locStore = true;
+
+        nearCache = true;
+
+        checkStoreUpdateStaticConfig(true);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStaticConfigurationTxLocalStoreNoClientStore() throws Exception {
+        locStore = true;
+
+        checkStoreUpdateStaticConfig(false);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStaticConfigurationTxLocalStoreNoClientStoreNearEnabled() throws Exception {
+        locStore = true;
+
+        nearCache = true;
+
+        checkStoreUpdateStaticConfig(false);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStaticConfigurationTxWriteBehindStore() throws Exception {
+        writeBehind = true;
+
+        checkStoreUpdateStaticConfig(true);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStaticConfigurationTxWriteBehindStoreNearEnabled() throws Exception {
+        writeBehind = true;
+
+        nearCache = true;
+
+        checkStoreUpdateStaticConfig(true);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStaticConfigurationTxWriteBehindStoreNoClientStore() throws Exception {
+        writeBehind = true;
+
+        checkStoreUpdateStaticConfig(false);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStaticConfigurationTxWriteBehindStoreNoClientStoreNearEnabled() throws Exception {
+        writeBehind = true;
+
+        nearCache = true;
+
+        checkStoreUpdateStaticConfig(false);
+    }
+
+    /**
+     * @param clientStore {@code True} if store should be configured on client node.
+     * @throws Exception If failed.
+     */
+    private void checkStoreUpdateStaticConfig(boolean clientStore) throws Exception {
+        try {
+            cache = true;
+
+            cacheStore = true;
+
+            startGridsMultiThreaded(3);
+
+            client = true;
+
+            cacheStore = clientStore;
+
+            startGrid(3);
+
+            checkStoreUpdate(clientStore);
+        }
+        finally {
+            stopAllGrids();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a75b8686/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartAtomicTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartAtomicTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartAtomicTest.java
new file mode 100644
index 0000000..6908aaa
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartAtomicTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ *
+ */
+public class CacheStoreUsageMultinodeStaticStartAtomicTest extends CacheStoreUsageMultinodeStaticStartAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return ATOMIC;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a75b8686/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartTxTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartTxTest.java
new file mode 100644
index 0000000..b42fd44
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheStoreUsageMultinodeStaticStartTxTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ *
+ */
+public class CacheStoreUsageMultinodeStaticStartTxTest extends CacheStoreUsageMultinodeStaticStartAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return TRANSACTIONAL;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a75b8686/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index d155330..6295a4d 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -135,6 +135,10 @@ public class IgniteCacheTestSuite4 extends TestSuite {
         suite.addTestSuite(CacheJdbcStoreSessionListenerSelfTest.class);
 
         suite.addTestSuite(CacheClientStoreSelfTest.class);
+        suite.addTestSuite(CacheStoreUsageMultinodeStaticStartAtomicTest.class);
+        suite.addTestSuite(CacheStoreUsageMultinodeStaticStartTxTest.class);
+        suite.addTestSuite(CacheStoreUsageMultinodeDynamicStartAtomicTest.class);
+        suite.addTestSuite(CacheStoreUsageMultinodeDynamicStartTxTest.class);
 
         suite.addTestSuite(IgniteStartCacheInTransactionSelfTest.class);
         suite.addTestSuite(IgniteStartCacheInTransactionAtomicSelfTest.class);


[12/50] incubator-ignite git commit: #IGNITE-960 Added tests.

Posted by sb...@apache.org.
#IGNITE-960 Added tests.


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

Branch: refs/heads/ignite-917-review
Commit: ec0ee2e6df8e303eb77d8da2243042b5f0bd64f7
Parents: 83abea4
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 18:53:17 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 18:53:17 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ec0ee2e6/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
index 54f890f..cade2aa 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
@@ -66,7 +66,7 @@ public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheJdbcPojoSto
     private transient DataSource dataSrc;
 
     /** Database dialect. */
-    private transient JdbcDialect dialect;
+    private JdbcDialect dialect;
 
     /** Application context. */
     @SpringApplicationContextResource


[28/50] incubator-ignite git commit: Merge branches 'ignite-484-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-484-1

Posted by sb...@apache.org.
Merge branches 'ignite-484-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-484-1


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

Branch: refs/heads/ignite-917-review
Commit: 0b8587ba81400a5227e8d3bb8be52f8c0d7d179f
Parents: c1fc7b5 5218210
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 17 14:40:23 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 17 14:40:23 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    | 13 +-----------
 .../client/GridClientConfiguration.java         |  2 +-
 .../GridClientOptimizedMarshaller.java          | 21 ++++++++++++++++++++
 .../impl/GridTcpRouterNioListenerAdapter.java   |  2 +-
 .../rest/protocols/tcp/GridTcpRestProtocol.java |  3 ++-
 .../ignite/internal/util/IgniteUtils.java       | 21 ++++++++++++++++++++
 6 files changed, 47 insertions(+), 15 deletions(-)
----------------------------------------------------------------------



[17/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-sprint-6' into ignite-1020

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-6' into ignite-1020


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

Branch: refs/heads/ignite-917-review
Commit: 9a0e659a847ab3ec7c03443e2ada28aac51a26ea
Parents: 7fd1441 d1a2150
Author: sboikov <sb...@gridgain.com>
Authored: Wed Jun 17 10:25:34 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Jun 17 10:25:34 2015 +0300

----------------------------------------------------------------------
 RELEASE_NOTES.txt                               |   2 +-
 .../cache/store/jdbc/CacheJdbcBlobStore.java    |  22 +-
 .../store/jdbc/CacheJdbcBlobStoreFactory.java   | 290 +++++++++++++++++++
 .../cache/store/jdbc/CacheJdbcPojoStore.java    |   6 +-
 .../store/jdbc/CacheJdbcPojoStoreFactory.java   | 148 ++++++++++
 .../configuration/CacheConfiguration.java       |   3 +-
 .../internal/interop/InteropBootstrap.java      |   3 +-
 .../internal/interop/InteropIgnition.java       |   5 +-
 .../processors/cache/GridCacheProcessor.java    |  23 +-
 .../util/spring/IgniteSpringHelper.java         |  10 +
 .../SpringApplicationContextResource.java       |   4 +-
 .../apache/ignite/resources/SpringResource.java |   6 +-
 modules/hibernate/pom.xml                       |  14 +
 .../hibernate/CacheHibernateBlobStore.java      |  87 +-----
 .../CacheHibernateBlobStoreFactory.java         | 235 +++++++++++++++
 .../hibernate/src/test/config/factory-cache.xml |  59 ++++
 .../src/test/config/factory-cache1.xml          |  61 ++++
 .../config/factory-incorrect-store-cache.xml    |  56 ++++
 .../CacheHibernateStoreFactorySelfTest.java     | 273 +++++++++++++++++
 .../testsuites/IgniteHibernateTestSuite.java    |   2 +
 modules/spring/pom.xml                          |   7 +
 .../GridResourceSpringBeanInjector.java         |   2 +-
 .../util/spring/IgniteSpringHelperImpl.java     |  17 ++
 .../src/test/config/incorrect-store-cache.xml   |  57 ++++
 modules/spring/src/test/config/node.xml         |  43 +++
 modules/spring/src/test/config/node1.xml        |  45 +++
 .../test/config/pojo-incorrect-store-cache.xml  |  56 ++++
 modules/spring/src/test/config/store-cache.xml  |  59 ++++
 modules/spring/src/test/config/store-cache1.xml |  62 ++++
 .../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 172 +++++++++++
 .../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 193 ++++++++++++
 .../testsuites/IgniteSpringTestSuite.java       |   5 +
 32 files changed, 1907 insertions(+), 120 deletions(-)
----------------------------------------------------------------------



[05/50] incubator-ignite git commit: Merge branches 'ignite-960' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-960

Posted by sb...@apache.org.
Merge branches 'ignite-960' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-960


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

Branch: refs/heads/ignite-917-review
Commit: ca89d81c3e271ea2f905698540b67df8a2cab079
Parents: a7ca45b ae188c7
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jun 16 17:37:34 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jun 16 17:37:34 2015 +0300

----------------------------------------------------------------------
 .../internal/interop/InteropBootstrap.java      |   3 +-
 .../internal/interop/InteropIgnition.java       |   5 +-
 .../processors/query/GridQueryProcessor.java    | 102 ++++++---
 .../ignite/spi/discovery/tcp/ClientImpl.java    |  87 +++++---
 .../apache/ignite/internal/GridSelfTest.java    |  12 +-
 .../GridDiscoveryManagerAliveCacheSelfTest.java |  17 +-
 .../GridCacheAbstractFailoverSelfTest.java      |   2 +
 ...ridCacheMultinodeUpdateAbstractSelfTest.java |   9 +
 .../cache/GridCacheVersionMultinodeTest.java    |   8 +-
 ...CacheP2pUnmarshallingRebalanceErrorTest.java |  15 +-
 .../IgniteCacheClientNodeConcurrentStart.java   |  14 +-
 .../distributed/IgniteCacheManyClientsTest.java |  69 +++++--
 .../GridCachePartitionedTxSalvageSelfTest.java  |  37 +---
 .../junits/common/GridCommonAbstractTest.java   |  11 +-
 .../IgniteCacheFailoverTestSuite.java           |   8 -
 .../IgniteCacheFailoverTestSuite2.java          |  47 +++++
 .../CacheAbstractQueryMetricsSelfTest.java      | 205 ++++++++++++++++++
 .../CachePartitionedQueryMetricsSelfTest.java   |  32 +++
 .../CacheReplicatedQueryMetricsSelfTest.java    |  32 +++
 .../cache/GridCacheQueryMetricsSelfTest.java    | 206 -------------------
 .../query/h2/sql/BaseH2CompareQueryTest.java    |   2 +-
 .../IgniteCacheQuerySelfTestSuite.java          |   4 +-
 22 files changed, 581 insertions(+), 346 deletions(-)
----------------------------------------------------------------------



[40/50] incubator-ignite git commit: ignite-484-1 - relax test: 2 restarting nodes instead of 3

Posted by sb...@apache.org.
ignite-484-1 - relax test: 2 restarting nodes instead of 3


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

Branch: refs/heads/ignite-917-review
Commit: ed43dfe1c7e9b7db3f6ef33a38dad9b28c41190c
Parents: e602ca0
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 17 20:33:54 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 17 20:33:54 2015 +0300

----------------------------------------------------------------------
 .../near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ed43dfe1/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java
index 3f23005..b868cfb 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheClientQueryReplicatedNodeRestartSelfTest.java
@@ -194,7 +194,7 @@ public class IgniteCacheClientQueryReplicatedNodeRestartSelfTest extends GridCom
     public void testRestarts() throws Exception {
         int duration = 90 * 1000;
         int qryThreadNum = 5;
-        int restartThreadsNum = 3; // 3 of 4 data nodes
+        int restartThreadsNum = 2; // 2 of 4 data nodes
         final int nodeLifeTime = 2 * 1000;
         final int logFreq = 10;