You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/08/19 09:39:55 UTC

[01/50] incubator-ignite git commit: ignite-946: added documentation

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-gg-9615-1 b73750b01 -> da3065212


ignite-946: added documentation


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 4928d99d80a837843ce733eab546a3ea6aa3c2d3
Parents: 2d200a3
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri Jul 31 12:14:54 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jul 31 15:49:12 2015 +0300

----------------------------------------------------------------------
 .../ignite/cache/version/VersionedEntry.java    | 31 +++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4928d99d/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java b/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
index 6f9d8f6..e669f15 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
@@ -17,11 +17,40 @@
 
 package org.apache.ignite.cache.version;
 
+import org.apache.ignite.*;
+
 import javax.cache.*;
+import javax.cache.processor.*;
 import java.util.*;
 
 /**
- * Cache entry along with version information.
+ * Cache entry that stores entry's version related information.
+ *
+ * To get a {@code VersionedEntry} of an {@link Cache.Entry} use {@link Cache.Entry#unwrap(Class)} by passing
+ * {@code VersionedEntry} class to it as the argument.
+ * <p>
+ * {@code VersionedEntry} is supported only for {@link Cache.Entry} returned by one of the following methods:
+ * <ul>
+ * <li>{@link Cache#invoke(Object, EntryProcessor, Object...)}</li>
+ * <li>{@link Cache#invokeAll(Set, EntryProcessor, Object...)}</li>
+ * <li>invoke and invokeAll methods of {@link IgniteCache}</li>
+ * <li>{@link IgniteCache#randomEntry()}</li>
+ * </ul>
+ * <p>
+ * {@code VersionedEntry} is not supported for {@link Cache#iterator()} because of performance reasons.
+ * {@link Cache#iterator()} loads entries from all the cluster nodes and to speed up the load version information
+ * is excluded from responses.
+ * <h2 class="header">Java Example</h2>
+ * <pre name="code" class="java">
+ * Cache<Integer, String> cache = grid(0).cache(null);
+ *
+ *  cache.invoke(100, new EntryProcessor<Integer, String, Object>() {
+ *      public Object process(MutableEntry<Integer, String> entry, Object... arguments) throws EntryProcessorException {
+ *          VersionedEntry<Integer, String> verEntry = entry.unwrap(VersionedEntry.class);
+ *          return entry;
+ *       }
+ *   });
+ * </pre>
  */
 public interface VersionedEntry<K, V> extends Cache.Entry<K, V> {
     /**


[32/50] incubator-ignite git commit: Merge remote-tracking branch 'origin/ignite-1.3.3-p2' into ignite-1.3.3-p2

Posted by vo...@apache.org.
Merge remote-tracking branch 'origin/ignite-1.3.3-p2' into ignite-1.3.3-p2


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 47895da65c84e3c51a0eeb6c526d424ea9fabf41
Parents: a3301b3 9300bbc
Author: sboikov <sb...@gridgain.com>
Authored: Fri Aug 14 11:39:04 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Aug 14 11:39:04 2015 +0300

----------------------------------------------------------------------
 examples/pom.xml                                   | 2 +-
 modules/aop/pom.xml                                | 2 +-
 modules/apache-license-gen/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/modules/uri-dependency/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/kafka/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 +-
 modules/yarn/pom.xml                               | 2 +-
 pom.xml                                            | 2 +-
 41 files changed, 41 insertions(+), 41 deletions(-)
----------------------------------------------------------------------



[08/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/master' into ignite-946

Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-946


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 92e81dca00800b1b74f0ade328121aaf0ab1d4df
Parents: 2e7799d d9acbd1
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Aug 10 09:57:31 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Aug 10 09:57:31 2015 +0300

----------------------------------------------------------------------
 assembly/release-hadoop.xml                     |   5 +
 .../ClientAbstractMultiNodeSelfTest.java        |   4 +-
 .../JettyRestProcessorAbstractSelfTest.java     |  14 +-
 .../apache/ignite/IgniteSystemProperties.java   |   2 +-
 .../store/jdbc/CacheAbstractJdbcStore.java      |  21 +-
 .../apache/ignite/internal/IgniteKernal.java    |   2 +-
 .../org/apache/ignite/internal/IgnitionEx.java  |  43 +-
 .../managers/communication/GridIoManager.java   | 188 +++++++-
 .../processors/cache/GridCacheMvccManager.java  |  73 +--
 .../processors/cache/GridCacheProcessor.java    |  12 +-
 .../processors/cache/GridCacheProxyImpl.java    |  42 +-
 .../processors/cache/GridCacheSwapManager.java  |   2 +-
 .../processors/cache/GridCacheUtils.java        |   1 -
 .../GridDhtPartitionsExchangeFuture.java        |  20 +-
 .../distributed/near/GridNearGetFuture.java     |  20 +-
 .../cache/query/GridCacheSqlQuery.java          |  33 +-
 .../cache/query/GridCacheTwoStepQuery.java      |  34 +-
 .../handlers/query/QueryCommandHandler.java     |   6 +-
 .../ignite/internal/util/GridLogThrottle.java   |  63 ++-
 .../ignite/internal/util/IgniteUtils.java       |  16 +
 .../util/nio/GridCommunicationClient.java       |   5 +-
 .../util/nio/GridNioFinishedFuture.java         |  12 +
 .../ignite/internal/util/nio/GridNioFuture.java |  14 +
 .../internal/util/nio/GridNioFutureImpl.java    |  15 +
 .../util/nio/GridNioRecoveryDescriptor.java     |  13 +-
 .../ignite/internal/util/nio/GridNioServer.java |   5 +
 .../util/nio/GridNioSessionMetaKey.java         |   5 +-
 .../util/nio/GridShmemCommunicationClient.java  |   7 +-
 .../util/nio/GridTcpNioCommunicationClient.java |  14 +-
 .../communication/tcp/TcpCommunicationSpi.java  |  84 +++-
 .../ignite/spi/discovery/tcp/ClientImpl.java    |  29 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java    |  50 +-
 .../spi/discovery/tcp/TcpDiscoveryImpl.java     |  15 +
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |   7 +-
 .../TcpDiscoveryMulticastIpFinder.java          |   7 +-
 .../src/test/config/io-manager-benchmark.xml    |   3 +-
 .../GridJobMasterLeaveAwareSelfTest.java        |  10 +-
 .../IgniteClientReconnectAbstractTest.java      |   5 +-
 .../IgniteClientReconnectCacheTest.java         |   5 +-
 .../GridDeploymentMessageCountSelfTest.java     |   5 +-
 .../cache/CacheStopAndDestroySelfTest.java      |   8 +-
 .../GridCacheAtomicMessageCountSelfTest.java    |   6 +-
 .../processors/cache/GridCacheMvccSelfTest.java |   1 -
 ...ridCacheReplicatedSynchronousCommitTest.java |   5 +-
 .../cache/GridCacheSwapPreloadSelfTest.java     |   2 +
 .../IgniteCacheAbstractStopBusySelfTest.java    |   6 +-
 .../cache/IgniteCacheNearLockValueSelfTest.java |   6 +-
 ...eDynamicCacheStartNoExchangeTimeoutTest.java |   4 +-
 .../cache/IgniteTxReentryAbstractSelfTest.java  |   5 +-
 ...niteCacheClientNodeChangingTopologyTest.java |   6 +-
 ...teCacheClientNodePartitionsExchangeTest.java |   4 +-
 .../IgniteCacheNearOffheapGetSelfTest.java      | 131 ++++++
 ...xOriginatingNodeFailureAbstractSelfTest.java |   6 +-
 ...cOriginatingNodeFailureAbstractSelfTest.java |   6 +-
 .../GridCacheDhtPreloadMessageCountTest.java    |   5 +-
 ...ePrimaryNodeFailureRecoveryAbstractTest.java |   6 +-
 ...eAtomicInvalidPartitionHandlingSelfTest.java |   5 +-
 .../near/IgniteCacheNearTxRollbackTest.java     |   6 +-
 .../GridCacheReplicatedInvalidateSelfTest.java  |   6 +-
 ...CommunicationRecoveryAckClosureSelfTest.java | 464 +++++++++++++++++++
 .../tcp/TcpDiscoveryMultiThreadedTest.java      |   8 +-
 .../testsuites/IgniteCacheTestSuite2.java       |   1 +
 .../IgniteSpiCommunicationSelfTestSuite.java    |   1 +
 .../ignite/util/TestTcpCommunicationSpi.java    |   6 +-
 .../processors/query/h2/IgniteH2Indexing.java   |  27 +-
 .../processors/query/h2/sql/GridSqlElement.java |  18 +-
 .../query/h2/sql/GridSqlFunction.java           |  17 +-
 .../processors/query/h2/sql/GridSqlQuery.java   |   4 +-
 .../query/h2/sql/GridSqlQueryParser.java        |  94 ++--
 .../query/h2/sql/GridSqlQuerySplitter.java      | 117 +++--
 .../processors/query/h2/sql/GridSqlSelect.java  |  76 +--
 .../processors/query/h2/sql/GridSqlType.java    |  24 +-
 .../processors/query/h2/sql/GridSqlUnion.java   |   2 +-
 .../query/h2/twostep/GridMapQueryExecutor.java  |   7 +-
 .../query/h2/twostep/GridMergeIndex.java        |   7 +
 .../h2/twostep/GridMergeIndexUnsorted.java      |  17 +-
 .../query/h2/twostep/GridMergeTable.java        |  52 +--
 .../h2/twostep/GridReduceQueryExecutor.java     | 280 +++++------
 .../query/h2/twostep/GridThreadLocalTable.java  | 262 +++++++++++
 ...CacheScanPartitionQueryFallbackSelfTest.java |  15 +-
 ...idCacheReduceQueryMultithreadedSelfTest.java |  21 +-
 .../IgniteCacheAbstractFieldsQuerySelfTest.java |   2 +-
 modules/log4j2/README.txt                       |  15 +-
 .../ignite/logger/log4j2/Log4J2Logger.java      |   2 +-
 .../ignite/logger/log4j2/Log4j2FileAware.java   |  35 --
 .../http/jetty/GridJettyRestHandler.java        |  12 +-
 .../parser/dialect/OracleMetadataDialect.java   |   4 +-
 .../org/apache/ignite/spark/IgniteContext.scala |  19 +-
 .../src/test/java/config/ignite-test-config.xml |  43 ++
 .../ignite/internal/GridFactorySelfTest.java    |   9 +
 .../visor/commands/kill/VisorKillCommand.scala  |   2 +-
 .../config/benchmark-multicast.properties       |   1 +
 .../yardstick/config/benchmark-query.properties |   3 +-
 modules/yardstick/config/ignite-base-config.xml |   2 -
 .../yardstick/IgniteBenchmarkArguments.java     |  11 +
 .../cache/IgniteJdbcSqlQueryBenchmark.java      | 134 ++++++
 parent/pom.xml                                  |  97 ++--
 scripts/git-apply-patch.sh                      |  94 ----
 scripts/git-patch-functions.sh                  |  56 +--
 99 files changed, 2299 insertions(+), 897 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/92e81dca/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
----------------------------------------------------------------------


[23/50] incubator-ignite git commit: # Register client continuous listeners on node join

Posted by vo...@apache.org.
 # Register client continuous listeners on node join


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 35e3e4e048fa34b5b23ebd0ae235424f3e3492d9
Parents: aed83af
Author: sboikov <sb...@gridgain.com>
Authored: Thu Aug 13 17:37:00 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Aug 13 17:37:00 2015 +0300

----------------------------------------------------------------------
 .../continuous/GridContinuousProcessor.java     | 44 ++++++++++++++++----
 .../IgniteCacheContinuousQueryClientTest.java   | 33 ++++++++++++---
 .../IgniteCacheQuerySelfTestSuite.java          |  1 +
 scripts/git-format-patch.sh                     |  2 +-
 4 files changed, 66 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/35e3e4e0/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
index daa9494..5f1c4bb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
@@ -193,10 +193,10 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
                         unregisterRemote(routineId);
 
                         if (snd.isClient()) {
-                            Map<UUID, LocalRoutineInfo> infoMap = clientInfos.get(snd.id());
+                            Map<UUID, LocalRoutineInfo> clientRoutineMap = clientInfos.get(snd.id());
 
-                            if (infoMap != null)
-                                infoMap.remove(msg.routineId());
+                            if (clientRoutineMap != null)
+                                clientRoutineMap.remove(msg.routineId());
                         }
                     }
                 }
@@ -370,6 +370,34 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
             }
 
             for (Map.Entry<UUID, Map<UUID, LocalRoutineInfo>> entry : data.clientInfos.entrySet()) {
+                UUID clientNodeId = entry.getKey();
+
+                Map<UUID, LocalRoutineInfo> clientRoutineMap = entry.getValue();
+
+                for (Map.Entry<UUID, LocalRoutineInfo> e : clientRoutineMap.entrySet()) {
+                    UUID routineId = e.getKey();
+                    LocalRoutineInfo info = e.getValue();
+
+                    try {
+                        if (info.prjPred != null)
+                            ctx.resource().injectGeneric(info.prjPred);
+
+                        if (info.prjPred == null || info.prjPred.apply(ctx.discovery().localNode())) {
+                            if (registerHandler(clientNodeId,
+                                routineId,
+                                info.hnd,
+                                info.bufSize,
+                                info.interval,
+                                info.autoUnsubscribe,
+                                false))
+                                info.hnd.onListenerRegistered(routineId, ctx);
+                        }
+                    }
+                    catch (IgniteCheckedException err) {
+                        U.error(log, "Failed to register continuous handler.", err);
+                    }
+                }
+
                 Map<UUID, LocalRoutineInfo> map = clientInfos.get(entry.getKey());
 
                 if (map == null) {
@@ -723,17 +751,17 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
         }
 
         if (node.isClient()) {
-            Map<UUID, LocalRoutineInfo> clientRouteMap = clientInfos.get(node.id());
+            Map<UUID, LocalRoutineInfo> clientRoutineMap = clientInfos.get(node.id());
 
-            if (clientRouteMap == null) {
-                clientRouteMap = new HashMap<>();
+            if (clientRoutineMap == null) {
+                clientRoutineMap = new HashMap<>();
 
-                Map<UUID, LocalRoutineInfo> old = clientInfos.put(node.id(), clientRouteMap);
+                Map<UUID, LocalRoutineInfo> old = clientInfos.put(node.id(), clientRoutineMap);
 
                 assert old == null;
             }
 
-            clientRouteMap.put(routineId, new LocalRoutineInfo(data.projectionPredicate(),
+            clientRoutineMap.put(routineId, new LocalRoutineInfo(data.projectionPredicate(),
                 hnd,
                 data.bufferSize(),
                 data.interval(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/35e3e4e0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryClientTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryClientTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryClientTest.java
index bb413a0..d66d1d0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryClientTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryClientTest.java
@@ -20,7 +20,9 @@ package org.apache.ignite.internal.processors.cache.query.continuous;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.query.*;
 import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
 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.junits.common.*;
@@ -38,7 +40,7 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
  */
 public class IgniteCacheContinuousQueryClientTest extends GridCommonAbstractTest {
     /** */
-    protected static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
 
     /** */
     private boolean client;
@@ -47,6 +49,8 @@ public class IgniteCacheContinuousQueryClientTest extends GridCommonAbstractTest
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
+        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+
         CacheConfiguration ccfg = new CacheConfiguration();
 
         ccfg.setCacheMode(PARTITIONED);
@@ -60,6 +64,13 @@ public class IgniteCacheContinuousQueryClientTest extends GridCommonAbstractTest
         return cfg;
     }
 
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        stopAllGrids();
+    }
+
     /**
      * @throws Exception If failed.
      */
@@ -80,15 +91,27 @@ public class IgniteCacheContinuousQueryClientTest extends GridCommonAbstractTest
 
         QueryCursor<?> cur = clientNode.cache(null).query(qry);
 
-        Ignite joined = startGrid(4);
+        Ignite joined1 = startGrid(4);
 
-        IgniteCache<Object, Object> joinedCache = joined.cache(null);
+        IgniteCache<Object, Object> joinedCache1 = joined1.cache(null);
 
-        joinedCache.put(primaryKey(joinedCache), 1);
+        joinedCache1.put(primaryKey(joinedCache1), 1);
 
         assertTrue("Failed to wait for event.", lsnr.latch.await(5, SECONDS));
 
         cur.close();
+
+        lsnr.latch = new CountDownLatch(1);
+
+        Ignite joined2 = startGrid(5);
+
+        IgniteCache<Object, Object> joinedCache2 = joined2.cache(null);
+
+        joinedCache2.put(primaryKey(joinedCache2), 2);
+
+        U.sleep(1000);
+
+        assertEquals("Unexpected event received.", 1, lsnr.latch.getCount());
     }
 
     /**
@@ -96,7 +119,7 @@ public class IgniteCacheContinuousQueryClientTest extends GridCommonAbstractTest
      */
     private static class CacheEventListener implements CacheEntryUpdatedListener<Object, Object> {
         /** */
-        private final CountDownLatch latch = new CountDownLatch(1);
+        private volatile CountDownLatch latch = new CountDownLatch(1);
 
         /** */
         @LoggerResource

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/35e3e4e0/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 2d7d0ce..a3849d7 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
@@ -98,6 +98,7 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
         suite.addTestSuite(GridCacheContinuousQueryAtomicSelfTest.class);
         suite.addTestSuite(GridCacheContinuousQueryAtomicNearEnabledSelfTest.class);
         suite.addTestSuite(GridCacheContinuousQueryAtomicP2PDisabledSelfTest.class);
+        suite.addTestSuite(IgniteCacheContinuousQueryClientTest.class);
 
         // Reduce fields queries.
         suite.addTestSuite(GridCacheReduceFieldsQueryLocalSelfTest.class);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/35e3e4e0/scripts/git-format-patch.sh
----------------------------------------------------------------------
diff --git a/scripts/git-format-patch.sh b/scripts/git-format-patch.sh
index b11c73d..83aee3e 100755
--- a/scripts/git-format-patch.sh
+++ b/scripts/git-format-patch.sh
@@ -20,7 +20,7 @@
 # Git patch-file maker.
 #
 echo 'Usage: scripts/git-format-patch.sh [-ih|--ignitehome <path>] [-idb|--ignitedefbranch <branch-name>] [-ph|--patchhome <path>]'
-echo 'It is a script to create patch between Current branch (branch with changes) and Default branche. The script is safe and do not broke or lose your changes.'
+echo 'It is a script to create patch between Current branch (branch with changes) and Default branch. The script is safe and does not break or lose your changes.'
 echo "It should be called from IGNITE_HOME directory."
 echo "Patch will be created at PATCHES_HOME (= IGNITE_HOME, by default) between Default branch (IGNITE_DEFAULT_BRANCH) and Current branch."
 echo "Note: you can use ${IGNITE_HOME}/scripts/git-patch-prop-local.sh to set your own local properties (to rewrite settings at git-patch-prop-local.sh). "


[33/50] incubator-ignite git commit: Merge branch 'ignite-946'

Posted by vo...@apache.org.
Merge branch 'ignite-946'


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 776084772c06f6149d09726b2f6c3c7a08cef7bc
Parents: 8ecddcc 51a9bd8
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Aug 14 12:54:34 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Aug 14 12:54:34 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/cache/CacheEntry.java     |  94 ++++++++++
 .../processors/cache/CacheEntryImpl.java        |  20 +++
 .../processors/cache/CacheEntryImpl0.java       |   5 +
 .../processors/cache/CacheEntryImplEx.java      |  83 +++++++++
 .../processors/cache/CacheInvokeEntry.java      |  27 ++-
 .../cache/CacheVersionedEntryImpl.java          |  80 ---------
 .../processors/cache/GridCacheAdapter.java      |  13 +-
 .../processors/cache/GridCacheEntryEx.java      |   2 +-
 .../processors/cache/GridCacheMapEntry.java     |  28 ++-
 .../processors/cache/GridCacheSwapManager.java  |  82 +++++----
 .../distributed/dht/GridDhtTxPrepareFuture.java |   2 +-
 .../dht/atomic/GridDhtAtomicCache.java          |   3 +-
 .../local/atomic/GridLocalAtomicCache.java      |   3 +-
 .../cache/transactions/IgniteTxAdapter.java     |  16 +-
 .../cache/transactions/IgniteTxEntry.java       |  16 +-
 .../transactions/IgniteTxLocalAdapter.java      |  83 +++++++--
 .../cache/version/GridCacheVersion.java         |   2 +-
 .../cache/version/GridCacheVersionAware.java    |  30 ++++
 .../cache/version/GridCacheVersionManager.java  |   5 +-
 .../clock/GridClockSyncProcessor.java           |   2 +-
 .../resources/META-INF/classnames.properties    |   3 +-
 .../processors/cache/GridCacheTestEntryEx.java  |   2 +-
 .../CacheVersionedEntryAbstractTest.java        | 170 +++++++++++++++++++
 ...nedEntryLocalAtomicSwapDisabledSelfTest.java |  45 +++++
 ...ersionedEntryLocalTransactionalSelfTest.java |  40 +++++
 ...edEntryPartitionedAtomicOffHeapSelfTest.java |  35 ++++
 ...VersionedEntryPartitionedAtomicSelfTest.java |  35 ++++
 ...PartitionedTransactionalOffHeapSelfTest.java |  36 ++++
 ...edEntryPartitionedTransactionalSelfTest.java |  35 ++++
 ...nedEntryReplicatedAtomicOffHeapSelfTest.java |  35 ++++
 ...eVersionedEntryReplicatedAtomicSelfTest.java |  35 ++++
 ...yReplicatedTransactionalOffHeapSelfTest.java |  36 ++++
 ...nedEntryReplicatedTransactionalSelfTest.java |  35 ++++
 .../testsuites/IgniteCacheTestSuite4.java       |  13 ++
 34 files changed, 1005 insertions(+), 146 deletions(-)
----------------------------------------------------------------------



[41/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.3.3-p2'

Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1.3.3-p2'

Conflicts:
	examples/pom.xml
	modules/aop/pom.xml
	modules/apache-license-gen/pom.xml
	modules/aws/pom.xml
	modules/clients/pom.xml
	modules/cloud/pom.xml
	modules/codegen/pom.xml
	modules/core/pom.xml
	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
	modules/core/src/main/resources/ignite.properties
	modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDhtLocalPartitionAfterRemoveSelfTest.java
	modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
	modules/extdata/p2p/pom.xml
	modules/extdata/uri/modules/uri-dependency/pom.xml
	modules/extdata/uri/pom.xml
	modules/gce/pom.xml
	modules/geospatial/pom.xml
	modules/hadoop/pom.xml
	modules/hibernate/pom.xml
	modules/indexing/pom.xml
	modules/jcl/pom.xml
	modules/jta/pom.xml
	modules/kafka/pom.xml
	modules/log4j/pom.xml
	modules/mesos/pom.xml
	modules/rest-http/pom.xml
	modules/scalar-2.10/pom.xml
	modules/scalar/pom.xml
	modules/schedule/pom.xml
	modules/schema-import/pom.xml
	modules/slf4j/pom.xml
	modules/spark-2.10/pom.xml
	modules/spark/pom.xml
	modules/spring/pom.xml
	modules/ssh/pom.xml
	modules/tools/pom.xml
	modules/urideploy/pom.xml
	modules/visor-console-2.10/pom.xml
	modules/visor-console/pom.xml
	modules/visor-plugins/pom.xml
	modules/web/pom.xml
	modules/yardstick/pom.xml
	modules/yarn/pom.xml
	pom.xml

Merge remote-tracking branch 'remotes/origin/ignite-1.3.3-p2'

Conflicts:
	benchmarks/cache-comparison/pom.xml
	benchmarks/filesystem/hadoop1/pom.xml
	benchmarks/filesystem/hadoop2/pom.xml
	benchmarks/mongo/pom.xml
	benchmarks/risk-analytics/pom.xml
	benchmarks/serialization/pom.xml
	benchmarks/yardstick/src/main/dotnet/gridgain-benchmarks/Properties/AssemblyInfo.cs
	examples/clients/cpp/configure.ac
	examples/clients/dotnet/GridGainExamples/GridGainExamples/Properties/AssemblyInfo.cs
	examples/clients/dotnet/GridGainExamples/GridGainExamplesDll/Properties/AssemblyInfo.cs
	examples/pom.xml
	modules/clients/common/configure.ac
	modules/clients/common/project/vs/Resource.rc
	modules/clients/cpp/_old/main/configure.ac
	modules/clients/cpp/_old/main/tests/configure.ac
	modules/clients/cpp/_old/vsproject/resource.h
	modules/clients/cpp/core-test/configure.ac
	modules/clients/cpp/core-test/project/vs/Resource.rc
	modules/clients/cpp/core/configure.ac
	modules/clients/cpp/core/project/vs/Resource.rc
	modules/clients/dotnet/gridgain-codegen/Properties/AssemblyInfo.cs
	modules/clients/dotnet/gridgain-exe/Properties/AssemblyInfo.cs
	modules/clients/dotnet/gridgain/Properties/AssemblyInfo.cs
	modules/clients/pom.xml
	modules/clients/src/test/dotnet/gridgain-examples-test/Properties/AssemblyInfo.cs
	modules/clients/src/test/dotnet/gridgain-test-compatibility/Properties/AssemblyInfo.cs
	modules/clients/src/test/dotnet/gridgain-test-dll/Properties/AssemblyInfo.cs
	modules/clients/src/test/dotnet/gridgain-test-runner/Properties/AssemblyInfo.cs
	modules/clients/src/test/dotnet/gridgain-test/Properties/AssemblyInfo.cs
	modules/codegen/pom.xml
	modules/compatibility/gg-versions/7.3.3/src/main/java/org/gridgain/grid/compatibility/GridCompatibilityTestsRunner.java
	modules/compatibility/pom.xml
	modules/core/pom.xml
	modules/core/src/main/resources/gridgain.properties
	modules/diagnostic/pom.xml
	modules/dr-demo/pom.xml
	modules/license-gen/pom.xml
	modules/mongo-sniffer/pom.xml
	modules/mongo-visor/pom.xml
	modules/mongo/pom.xml
	modules/tools/pom.xml
	modules/visor-console/pom.xml
	modules/visor-demo/pom.xml
	modules/visor-tester-plugin/pom.xml
	modules/visor-tester/pom.xml
	modules/visor/pom.xml
	modules/yardstick/dotnet/Properties/AssemblyInfo.cs
	modules/yardstick/pom.xml
	parent/pom.xml
	pilots/chronotrack/pom.xml
	pilots/ctb/pom.xml
	pilots/dsi/pom.xml
	pilots/ionic/pom.xml
	pilots/sb/pom.xml
	pilots/sony/pom.xml
	pilots/wellsfargo/pom.xml
	pilots/worldpay/pom.xml
	pom.xml


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 1f00c7071d354b9f817be5daf725f638cd2f347b
Parents: 648cbd7
Author: Anton Vinogradov <vi...@gmail.com>
Authored: Mon Aug 17 11:01:06 2015 +0300
Committer: Anton Vinogradov <vi...@gmail.com>
Committed: Mon Aug 17 11:01:06 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheAdapter.java     | 3 ---
 .../distributed/dht/IgniteCachePutRetryAbstractSelfTest.java   | 6 ------
 2 files changed, 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1f00c707/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 00c0629..177dcfb 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
@@ -2278,8 +2278,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
      * @param filter Filter.
      * @return Put future.
      */
-    public IgniteInternalFuture<Boolean> putAsync(K key, V val,
-        @Nullable CacheEntryPredicate... filter) {
     public IgniteInternalFuture<Boolean> putAsync(K key, V val, @Nullable CacheEntryPredicate... filter) {
         final boolean statsEnabled = ctx.config().isStatisticsEnabled();
 
@@ -4695,7 +4693,6 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
         }
 
         /**
-         * @param tx Transaction.
          */
         public void execute() {
             tx = ctx.tm().newTx(

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1f00c707/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
index 74f62ba..c798369 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
@@ -158,12 +158,6 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
         finished.set(true);
         fut.get();
 
-            fut.get();
-        }
-        finally {
-            finished.set(true);
-        }
-
         for (int i = 0; i < keysCnt; i++)
             assertEquals(iter, cache.get(i));
     }


[03/50] incubator-ignite git commit: ignite-946: formatting fixes

Posted by vo...@apache.org.
ignite-946: formatting 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/26144dc4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/26144dc4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/26144dc4

Branch: refs/heads/ignite-gg-9615-1
Commit: 26144dc4f845af7533cc645d898202b80c0a29f6
Parents: 4928d99
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri Jul 31 12:18:58 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jul 31 15:49:13 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/26144dc4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 45ff619..ebcb908 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -609,16 +609,16 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
         @Nullable IgniteCacheExpiryPolicy expirePlc)
         throws IgniteCheckedException, GridCacheEntryRemovedException {
         return innerGet0(tx,
-                         readSwap,
-                         readThrough,
-                         evt,
-                         unmarshal,
-                         updateMetrics,
-                         tmp,
-                         subjId,
-                         transformClo,
-                         taskName,
-                         expirePlc);
+            readSwap,
+            readThrough,
+            evt,
+            unmarshal,
+            updateMetrics,
+            tmp,
+            subjId,
+            transformClo,
+            taskName,
+            expirePlc);
     }
 
     /** {@inheritDoc} */


[48/50] incubator-ignite git commit: Deprecated IgniteConfiguration.setNodeId()

Posted by vo...@apache.org.
Deprecated IgniteConfiguration.setNodeId()


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

Branch: refs/heads/ignite-gg-9615-1
Commit: fcd9d611503592ef3104feee42d82b3956aae42d
Parents: d31c8c6
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Mon Aug 17 21:24:55 2015 -0700
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Mon Aug 17 21:24:55 2015 -0700

----------------------------------------------------------------------
 .../org/apache/ignite/configuration/IgniteConfiguration.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fcd9d611/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
index 546c382..b670398 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
@@ -60,8 +60,8 @@ import javax.cache.expiry.*;
 import javax.cache.integration.*;
 import javax.cache.processor.*;
 import javax.management.*;
-import java.io.*;
 import javax.net.ssl.*;
+import java.io.*;
 import java.lang.management.*;
 import java.util.*;
 
@@ -970,6 +970,7 @@ public class IgniteConfiguration {
      *
      * @return Unique identifier for this node within grid.
      */
+    @Deprecated
     public UUID getNodeId() {
         return nodeId;
     }
@@ -980,7 +981,9 @@ public class IgniteConfiguration {
      * @param nodeId Unique identifier for local node.
      * @see IgniteConfiguration#getNodeId()
      * @return {@code this} for chaining.
+     * @deprecated Use {@link #setConsistentId(Serializable)} instead.
      */
+    @Deprecated
     public IgniteConfiguration setNodeId(UUID nodeId) {
         this.nodeId = nodeId;
 


[02/50] incubator-ignite git commit: IGNITE-946 Added test to Suite.

Posted by vo...@apache.org.
IGNITE-946 Added test to Suite.


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

Branch: refs/heads/ignite-gg-9615-1
Commit: f0fe0769751b7957a64fc5dd56989e54f1223ab1
Parents: 26144dc
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jul 31 13:00:09 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jul 31 15:49:13 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f0fe0769/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 3ac7879..228be92 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
@@ -164,7 +164,7 @@ public class IgniteCacheTestSuite4 extends TestSuite {
         suite.addTestSuite(CacheVersionedEntryReplicatedAtomicSelfTest.class);
         suite.addTestSuite(CacheVersionedEntryReplicatedTransactionalSelfTest.class);
         suite.addTestSuite(CacheVersionedEntryReplicatedAtomicOffHeapSelfTest.class);
-        suite.addTestSuite(CacheVersionedEntryPartitionedTransactionalOffHeapSelfTest.class);
+        suite.addTestSuite(CacheVersionedEntryReplicatedTransactionalOffHeapSelfTest.class);
 
         return suite;
     }


[07/50] incubator-ignite git commit: review

Posted by vo...@apache.org.
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/53557e32
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/53557e32
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/53557e32

Branch: refs/heads/ignite-gg-9615-1
Commit: 53557e327721fee683b9b37217d530db44166aec
Parents: fe2be79
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Wed Aug 5 10:15:52 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Wed Aug 5 10:15:52 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/transactions/IgniteTxLocalAdapter.java        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53557e32/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 e03f34d..a209780 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
@@ -1937,7 +1937,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
         GridCacheContext cacheCtx,
         Map<KeyCacheObject, GridCacheDrInfo> drMap
     ) {
-        return putAllAsync0(cacheCtx,
+        return this.<Object, Object>putAllAsync0(cacheCtx,
             null,
             null,
             null,


[06/50] incubator-ignite git commit: review

Posted by vo...@apache.org.
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/fe2be79c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fe2be79c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fe2be79c

Branch: refs/heads/ignite-gg-9615-1
Commit: fe2be79c8e4eccf8f823abeb32521f0fca8ddf42
Parents: b2e6734
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Aug 4 17:49:48 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Aug 4 17:49:48 2015 +0300

----------------------------------------------------------------------
 .../ignite/cache/version/package-info.java      |  4 ++--
 .../processors/cache/CacheInvokeEntry.java      |  5 +++--
 .../cache/transactions/IgniteTxEntry.java       |  4 +++-
 .../transactions/IgniteTxLocalAdapter.java      | 20 ++++++++++----------
 4 files changed, 18 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe2be79c/modules/core/src/main/java/org/apache/ignite/cache/version/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/version/package-info.java b/modules/core/src/main/java/org/apache/ignite/cache/version/package-info.java
index 9aeaba2..50ceb13 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/version/package-info.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/version/package-info.java
@@ -16,6 +16,6 @@
  */
 
 /**
- * Contains cache version based implementations.
+ * Contains cache versioned entry interface.
  */
-package org.apache.ignite.cache.version;
\ No newline at end of file
+package org.apache.ignite.cache.version;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe2be79c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
index 2d8f738..515a4c5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
@@ -49,14 +49,15 @@ public class CacheInvokeEntry<K, V> extends CacheLazyEntry<K, V> implements Muta
     public CacheInvokeEntry(GridCacheContext cctx,
         KeyCacheObject keyObj,
         @Nullable CacheObject valObj,
-        GridCacheVersion ver) {
+        GridCacheVersion ver
+    ) {
         super(cctx, keyObj, valObj);
 
         this.hadVal = valObj != null;
         this.ver = ver;
     }
 
-    /** 
+    /**
      * @param ctx Cache context.
      * @param keyObj Key cache object.
      * @param key Key value.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe2be79c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
index ed57bf2..73b9975 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
@@ -577,6 +577,8 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
             ver = entry.version();
         }
         catch (GridCacheEntryRemovedException e) {
+            assert tx.optimistic() : tx;
+
             ver = null;
         }
 
@@ -924,7 +926,7 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
                     return false;
 
                 reader.incrementState();
-                
+
             case 6:
                 flags = reader.readByte("flags");
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe2be79c/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 7f171c2..e03f34d 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
@@ -1937,14 +1937,14 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
         GridCacheContext cacheCtx,
         Map<KeyCacheObject, GridCacheDrInfo> drMap
     ) {
-        return this.<Object, Object>putAllAsync0(cacheCtx,
-                                                 null,
-                                                 null,
-                                                 null,
-                                                 drMap,
-                                                 false,
-                                                 null,
-                                                 null);
+        return putAllAsync0(cacheCtx,
+            null,
+            null,
+            null,
+            drMap,
+            false,
+            null,
+            null);
     }
 
     /** {@inheritDoc} */
@@ -2237,8 +2237,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                             }
                                             catch (GridCacheEntryRemovedException ex) {
                                                 if (log.isDebugEnabled())
-                                                    log.debug("Failed to get entry version: [msg=" +
-                                                        ex.getMessage() + ']');
+                                                    log.debug("Failed to get entry version " +
+                                                        "[err=" + ex.getMessage() + ']');
 
                                                 ver = null;
                                             }


[04/50] incubator-ignite git commit: ignite-946: fixing version retrieval for transactions

Posted by vo...@apache.org.
ignite-946: fixing version retrieval for transactions


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 2e7799d446653bba379cc231628ba2b02c993e5e
Parents: f0fe076
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri Jul 31 15:32:45 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jul 31 15:49:14 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/CacheInvokeEntry.java      |  2 +-
 .../processors/cache/GridCacheMapEntry.java     |  4 +-
 .../cache/transactions/IgniteTxAdapter.java     | 14 ++-
 .../cache/transactions/IgniteTxEntry.java       | 11 ++-
 .../transactions/IgniteTxLocalAdapter.java      | 90 ++++++++++++++++----
 5 files changed, 98 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2e7799d4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
index e6f8d4e..2d8f738 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
@@ -121,7 +121,7 @@ public class CacheInvokeEntry<K, V> extends CacheLazyEntry<K, V> implements Muta
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public <T> T unwrap(Class<T> cls) {
-        if (cls.isAssignableFrom(VersionedEntry.class))
+        if (cls.isAssignableFrom(VersionedEntry.class) && ver != null)
             return (T)new CacheVersionedEntryImpl<>(getKey(), getValue(), ver);
 
         return super.unwrap(cls);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2e7799d4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index ebcb908..43cf2fe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -1653,7 +1653,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
                         oldVal = rawGetOrUnmarshalUnlocked(true);
 
-                        CacheInvokeEntry<Object, Object> entry = new CacheInvokeEntry(cctx, key, oldVal, this.ver);
+                        CacheInvokeEntry<Object, Object> entry = new CacheInvokeEntry(cctx, key, oldVal, version());
 
                         try {
                             Object computed = entryProcessor.process(entry, invokeArgs);
@@ -1878,7 +1878,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
                 EntryProcessor<Object, Object, ?> entryProcessor = (EntryProcessor<Object, Object, ?>)writeObj;
 
-                CacheInvokeEntry<Object, Object> entry = new CacheInvokeEntry(cctx, key, oldVal, this.ver);
+                CacheInvokeEntry<Object, Object> entry = new CacheInvokeEntry(cctx, key, oldVal, version());
 
                 try {
                     Object computed = entryProcessor.process(entry, invokeArgs);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2e7799d4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
index 0d14012..797f75e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
@@ -1228,9 +1228,21 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
 
                 Object key = null;
 
+                GridCacheVersion ver;
+
+                try {
+                    ver = txEntry.cached().version();
+                }
+                catch (GridCacheEntryRemovedException e) {
+                    if (log.isDebugEnabled())
+                        log.debug("Failed to get entry version: [msg=" + e.getMessage() + ']');
+
+                    ver = null;
+                }
+
                 for (T2<EntryProcessor<Object, Object, Object>, Object[]> t : txEntry.entryProcessors()) {
                     CacheInvokeEntry<Object, Object> invokeEntry = new CacheInvokeEntry(txEntry.context(),
-                        txEntry.key(), key, cacheVal, val, txEntry.cached().version());
+                        txEntry.key(), key, cacheVal, val, ver);
 
                     try {
                         EntryProcessor<Object, Object, Object> processor = t.get1();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2e7799d4/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
index 7f06380..ed57bf2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
@@ -571,10 +571,19 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
         Object val = null;
         Object keyVal = null;
 
+        GridCacheVersion ver;
+
+        try {
+            ver = entry.version();
+        }
+        catch (GridCacheEntryRemovedException e) {
+            ver = null;
+        }
+
         for (T2<EntryProcessor<Object, Object, Object>, Object[]> t : entryProcessors()) {
             try {
                 CacheInvokeEntry<Object, Object> invokeEntry = new CacheInvokeEntry(ctx, key, keyVal, cacheVal, val,
-                    entry.version());
+                    ver);
 
                 EntryProcessor processor = t.get1();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2e7799d4/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 d8797fe..7f171c2 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
@@ -1938,13 +1938,13 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
         Map<KeyCacheObject, GridCacheDrInfo> drMap
     ) {
         return this.<Object, Object>putAllAsync0(cacheCtx,
-            null,
-            null,
-            null,
-            drMap,
-            false,
-            null,
-            null);
+                                                 null,
+                                                 null,
+                                                 null,
+                                                 drMap,
+                                                 false,
+                                                 null,
+                                                 null);
     }
 
     /** {@inheritDoc} */
@@ -2229,8 +2229,22 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                     if (retval && !transform)
                                         ret.set(cacheCtx, old, true);
                                     else {
-                                        if (txEntry.op() == TRANSFORM)
-                                            addInvokeResult(txEntry, old, ret);
+                                        if (txEntry.op() == TRANSFORM) {
+                                            GridCacheVersion ver;
+
+                                            try {
+                                                ver = entry.version();
+                                            }
+                                            catch (GridCacheEntryRemovedException ex) {
+                                                if (log.isDebugEnabled())
+                                                    log.debug("Failed to get entry version: [msg=" +
+                                                        ex.getMessage() + ']');
+
+                                                ver = null;
+                                            }
+
+                                            addInvokeResult(txEntry, old, ret, ver);
+                                        }
                                         else
                                             ret.success(true);
                                     }
@@ -2290,8 +2304,21 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
                         enlisted.add(cacheKey);
 
-                        if (txEntry.op() == TRANSFORM)
-                            addInvokeResult(txEntry, txEntry.value(), ret);
+                        if (txEntry.op() == TRANSFORM) {
+                            GridCacheVersion ver;
+
+                            try {
+                                ver = entry.version();
+                            }
+                            catch (GridCacheEntryRemovedException e) {
+                                if (log.isDebugEnabled())
+                                    log.debug("Failed to get entry version: [msg=" + e.getMessage() + ']');
+
+                                ver = null;
+                            }
+
+                            addInvokeResult(txEntry, txEntry.value(), ret, ver);
+                        }
                     }
 
                     if (!pessimistic()) {
@@ -2328,8 +2355,21 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
                         CacheObject cacheVal = cacheCtx.toCacheObject(val);
 
-                        if (e.op() == TRANSFORM)
-                            addInvokeResult(e, cacheVal, ret);
+                        if (e.op() == TRANSFORM) {
+                            GridCacheVersion ver;
+
+                            try {
+                                ver = e.cached().version();
+                            }
+                            catch (GridCacheEntryRemovedException ex) {
+                                if (log.isDebugEnabled())
+                                    log.debug("Failed to get entry version: [msg=" + ex.getMessage() + ']');
+
+                                ver = null;
+                            }
+
+                            addInvokeResult(e, cacheVal, ret, ver);
+                        }
                         else
                             ret.set(cacheCtx, cacheVal, true);
                     }
@@ -2442,8 +2482,21 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                         }
 
                         if (txEntry.op() == TRANSFORM) {
-                            if (computeInvoke)
-                                addInvokeResult(txEntry, v, ret);
+                            if (computeInvoke) {
+                                GridCacheVersion ver;
+
+                                try {
+                                    ver = cached.version();
+                                }
+                                catch (GridCacheEntryRemovedException e) {
+                                    if (log.isDebugEnabled())
+                                        log.debug("Failed to get entry version: [msg=" + e.getMessage() + ']');
+
+                                    ver = null;
+                                }
+
+                                addInvokeResult(txEntry, v, ret, ver);
+                            }
                         }
                         else
                             ret.value(cacheCtx, v);
@@ -2510,8 +2563,10 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
      * @param txEntry Entry.
      * @param cacheVal Value.
      * @param ret Return value to update.
+     * @param ver Entry version.
      */
-    private void addInvokeResult(IgniteTxEntry txEntry, CacheObject cacheVal, GridCacheReturn ret) {
+    private void addInvokeResult(IgniteTxEntry txEntry, CacheObject cacheVal, GridCacheReturn ret,
+        GridCacheVersion ver) {
         GridCacheContext ctx = txEntry.context();
 
         Object key0 = null;
@@ -2522,8 +2577,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
 
             for (T2<EntryProcessor<Object, Object, Object>, Object[]> t : txEntry.entryProcessors()) {
                 CacheInvokeEntry<Object, Object> invokeEntry =
-                    new CacheInvokeEntry(txEntry.context(), txEntry.key(), key0, cacheVal, val0,
-                        txEntry.cached().version());
+                    new CacheInvokeEntry(txEntry.context(), txEntry.key(), key0, cacheVal, val0, ver);
 
                 EntryProcessor<Object, Object, ?> entryProcessor = t.get1();
 


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

Posted by vo...@apache.org.
Merge branches 'ignite-946' and 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-946


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

Branch: refs/heads/ignite-gg-9615-1
Commit: b2e6734c76f17247a2801e63547e5edcc33f770c
Parents: 2e7799d b056a73
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Aug 4 16:34:17 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Aug 4 16:34:17 2015 +0300

----------------------------------------------------------------------
 .../ClientAbstractMultiNodeSelfTest.java        |   4 +-
 .../JettyRestProcessorAbstractSelfTest.java     |  14 +-
 .../apache/ignite/IgniteSystemProperties.java   |   2 +-
 .../store/jdbc/CacheAbstractJdbcStore.java      |  21 +-
 .../apache/ignite/internal/IgniteKernal.java    |   2 +-
 .../org/apache/ignite/internal/IgnitionEx.java  |  43 +-
 .../managers/communication/GridIoManager.java   | 188 +++++++-
 .../processors/cache/GridCacheMvccManager.java  |  73 +--
 .../processors/cache/GridCacheProcessor.java    |   2 +-
 .../processors/cache/GridCacheProxyImpl.java    |  42 +-
 .../processors/cache/GridCacheSwapManager.java  |   2 +-
 .../GridDhtPartitionsExchangeFuture.java        |  20 +-
 .../distributed/near/GridNearGetFuture.java     |  20 +-
 .../handlers/query/QueryCommandHandler.java     |   6 +-
 .../ignite/internal/util/IgniteUtils.java       |  16 +
 .../util/nio/GridCommunicationClient.java       |   5 +-
 .../util/nio/GridNioFinishedFuture.java         |  12 +
 .../ignite/internal/util/nio/GridNioFuture.java |  14 +
 .../internal/util/nio/GridNioFutureImpl.java    |  15 +
 .../util/nio/GridNioRecoveryDescriptor.java     |  13 +-
 .../ignite/internal/util/nio/GridNioServer.java |   5 +
 .../util/nio/GridNioSessionMetaKey.java         |   5 +-
 .../util/nio/GridShmemCommunicationClient.java  |   7 +-
 .../util/nio/GridTcpNioCommunicationClient.java |  14 +-
 .../communication/tcp/TcpCommunicationSpi.java  |  84 +++-
 .../ignite/spi/discovery/tcp/ClientImpl.java    |   2 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java    |  45 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |   2 +-
 .../src/test/config/io-manager-benchmark.xml    |   3 +-
 .../GridJobMasterLeaveAwareSelfTest.java        |  10 +-
 .../IgniteClientReconnectAbstractTest.java      |   5 +-
 .../IgniteClientReconnectCacheTest.java         |   5 +-
 .../GridDeploymentMessageCountSelfTest.java     |   5 +-
 .../cache/CacheStopAndDestroySelfTest.java      |   8 +-
 .../GridCacheAtomicMessageCountSelfTest.java    |   6 +-
 .../processors/cache/GridCacheMvccSelfTest.java |   1 -
 ...ridCacheReplicatedSynchronousCommitTest.java |   5 +-
 .../IgniteCacheAbstractStopBusySelfTest.java    |   6 +-
 .../cache/IgniteCacheNearLockValueSelfTest.java |   6 +-
 ...eDynamicCacheStartNoExchangeTimeoutTest.java |   4 +-
 .../cache/IgniteTxReentryAbstractSelfTest.java  |   5 +-
 ...niteCacheClientNodeChangingTopologyTest.java |   6 +-
 ...teCacheClientNodePartitionsExchangeTest.java |   4 +-
 .../IgniteCacheNearOffheapGetSelfTest.java      | 131 ++++++
 ...xOriginatingNodeFailureAbstractSelfTest.java |   6 +-
 ...cOriginatingNodeFailureAbstractSelfTest.java |   6 +-
 .../GridCacheDhtPreloadMessageCountTest.java    |   5 +-
 ...ePrimaryNodeFailureRecoveryAbstractTest.java |   6 +-
 ...eAtomicInvalidPartitionHandlingSelfTest.java |   5 +-
 .../near/IgniteCacheNearTxRollbackTest.java     |   6 +-
 .../GridCacheReplicatedInvalidateSelfTest.java  |   6 +-
 ...CommunicationRecoveryAckClosureSelfTest.java | 464 +++++++++++++++++++
 .../tcp/TcpDiscoveryMultiThreadedTest.java      |   8 +-
 .../testsuites/IgniteCacheTestSuite2.java       |   1 +
 .../IgniteSpiCommunicationSelfTestSuite.java    |   1 +
 .../ignite/util/TestTcpCommunicationSpi.java    |   6 +-
 ...CacheScanPartitionQueryFallbackSelfTest.java |  15 +-
 .../http/jetty/GridJettyRestHandler.java        |  12 +-
 .../parser/dialect/OracleMetadataDialect.java   |   4 +-
 .../src/test/java/config/ignite-test-config.xml |  43 ++
 .../ignite/internal/GridFactorySelfTest.java    |   9 +
 .../visor/commands/kill/VisorKillCommand.scala  |   2 +-
 62 files changed, 1241 insertions(+), 252 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b2e6734c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
----------------------------------------------------------------------


[43/50] incubator-ignite git commit: Squashed commit for ignite-1239

Posted by vo...@apache.org.
Squashed commit for ignite-1239


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 45c813af7eb4a11ec59d3477a6a0b68791f1d7f2
Parents: 7635e58
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Aug 17 16:51:41 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Aug 17 16:51:41 2015 +0300

----------------------------------------------------------------------
 .../GridDhtUnreservedPartitionException.java    | 66 ++++++++++++++
 .../cache/query/GridCacheQueryAdapter.java      | 56 ++++++++++--
 .../cache/query/GridCacheQueryManager.java      | 71 ++++++++++-----
 ...CacheScanPartitionQueryFallbackSelfTest.java | 96 ++++++++++++++++++++
 4 files changed, 261 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45c813af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnreservedPartitionException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnreservedPartitionException.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnreservedPartitionException.java
new file mode 100644
index 0000000..d824a47
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtUnreservedPartitionException.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.internal.processors.cache.distributed.dht;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.processors.affinity.*;
+
+/**
+ * Exception that is thrown when a partition reservation failed.
+ */
+public class GridDhtUnreservedPartitionException extends IgniteCheckedException {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Partition. */
+    private final int part;
+
+    /** Topology version. */
+    private final AffinityTopologyVersion topVer;
+
+    /**
+     * @param part Partition.
+     * @param topVer Affinity topology version.
+     * @param msg Message.
+     */
+    public GridDhtUnreservedPartitionException(int part, AffinityTopologyVersion topVer, String msg) {
+        super(msg);
+
+        this.part = part;
+        this.topVer = topVer;
+    }
+
+    /**
+     * @return Partition.
+     */
+    public int partition() {
+        return part;
+    }
+
+    /**
+     * @return Affinity topology version.
+     */
+    public AffinityTopologyVersion topologyVersion() {
+        return topVer;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return getClass() + " [part=" + part + ", msg=" + getMessage() + ']';
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45c813af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
index 953cb9a..90f9b9e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
@@ -25,6 +25,7 @@ import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.cluster.*;
 import org.apache.ignite.internal.processors.affinity.*;
 import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
 import org.apache.ignite.internal.processors.query.*;
 import org.apache.ignite.internal.util.future.*;
 import org.apache.ignite.internal.util.typedef.*;
@@ -457,7 +458,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
             return (CacheQueryFuture<R>)(loc ? qryMgr.queryFieldsLocal(bean) :
                 qryMgr.queryFieldsDistributed(bean, nodes));
         else if (type == SCAN && part != null && nodes.size() > 1)
-            return new CacheQueryFallbackFuture<>(nodes, bean, qryMgr);
+            return new CacheQueryFallbackFuture<>(nodes, part, bean, qryMgr, cctx);
         else
             return (CacheQueryFuture<R>)(loc ? qryMgr.queryLocal(bean) : qryMgr.queryDistributed(bean, nodes));
     }
@@ -554,7 +555,13 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
         private volatile GridCacheQueryFutureAdapter<?, ?, R> fut;
 
         /** Backups. */
-        private final Queue<ClusterNode> nodes;
+        private volatile Queue<ClusterNode> nodes;
+
+        /** Topology version of the last detected {@link GridDhtUnreservedPartitionException}. */
+        private volatile AffinityTopologyVersion unreservedTopVer;
+
+        /** Number of times to retry the query on the nodes failed with {@link GridDhtUnreservedPartitionException}. */
+        private volatile int unreservedNodesRetryCnt = 5;
 
         /** Bean. */
         private final GridCacheQueryBean bean;
@@ -562,16 +569,26 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
         /** Query manager. */
         private final GridCacheQueryManager qryMgr;
 
+        /** Cache context. */
+        private final GridCacheContext cctx;
+
+        /** Partition. */
+        private final int part;
+
         /**
          * @param nodes Backups.
+         * @param part Partition.
          * @param bean Bean.
          * @param qryMgr Query manager.
+         * @param cctx Cache context.
          */
-        public CacheQueryFallbackFuture(Collection<ClusterNode> nodes, GridCacheQueryBean bean,
-            GridCacheQueryManager qryMgr) {
+        public CacheQueryFallbackFuture(Collection<ClusterNode> nodes, int part, GridCacheQueryBean bean,
+            GridCacheQueryManager qryMgr, GridCacheContext cctx) {
             this.nodes = fallbacks(nodes);
             this.bean = bean;
             this.qryMgr = qryMgr;
+            this.cctx = cctx;
+            this.part = part;
 
             init();
         }
@@ -598,7 +615,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
          */
         @SuppressWarnings("unchecked")
         private void init() {
-            ClusterNode node = nodes.poll();
+            final ClusterNode node = nodes.poll();
 
             GridCacheQueryFutureAdapter<?, ?, R> fut0 = (GridCacheQueryFutureAdapter<?, ?, R>)(node.isLocal() ?
                 qryMgr.queryLocal(bean) :
@@ -613,8 +630,33 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
                         onDone(e);
                     }
                     catch (IgniteCheckedException e) {
-                        if (F.isEmpty(nodes))
-                            onDone(e);
+                        if (e.hasCause(GridDhtUnreservedPartitionException.class)) {
+                            unreservedTopVer = ((GridDhtUnreservedPartitionException)e.getCause()).topologyVersion();
+
+                            assert unreservedTopVer != null;
+                        }
+
+                        if (F.isEmpty(nodes)) {
+                            final AffinityTopologyVersion topVer = unreservedTopVer;
+
+                            if (topVer != null && --unreservedNodesRetryCnt > 0) {
+                                cctx.affinity().affinityReadyFuture(topVer).listen(
+                                    new IgniteInClosure<IgniteInternalFuture<AffinityTopologyVersion>>() {
+                                        @Override public void apply(
+                                            IgniteInternalFuture<AffinityTopologyVersion> future) {
+
+                                            nodes = fallbacks(cctx.topology().owners(part, topVer));
+
+                                            // Race is impossible here because query retries are executed one by one.
+                                            unreservedTopVer = null;
+
+                                            init();
+                                        }
+                                    });
+                            }
+                            else
+                                onDone(e);
+                        }
                         else
                             init();
                     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45c813af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 5d3f6a3..bfe5ecc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -39,6 +39,7 @@ import org.apache.ignite.lang.*;
 import org.apache.ignite.resources.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.indexing.*;
+
 import org.jetbrains.annotations.*;
 import org.jsr166.*;
 
@@ -170,7 +171,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
     }
 
     /**
-     *  Leaves busy state.
+     * Leaves busy state.
      */
     private void leaveBusy() {
         busyLock.leaveBusy();
@@ -794,7 +795,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                         // double check for owning state
                         if (locPart == null || locPart.state() != OWNING || !locPart.reserve() ||
                             locPart.state() != OWNING)
-                            throw new GridDhtInvalidPartitionException(part, "Partition can't be reserved");
+                            throw new GridDhtUnreservedPartitionException(part,
+                                cctx.affinity().affinityTopologyVersion(), "Partition can not be reserved");
 
                         iter = new Iterator<K>() {
                             private Iterator<KeyCacheObject> iter0 = locPart.keySet().iterator();
@@ -1083,6 +1085,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
 
             boolean rmvRes = true;
 
+            FieldsResult res = null;
+
             final boolean statsEnabled = cctx.config().isStatisticsEnabled();
 
             final boolean readEvt = cctx.gridEvents().isRecordable(EVT_CACHE_QUERY_OBJECT_READ);
@@ -1109,7 +1113,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
 
                 String taskName = cctx.kernalContext().task().resolveTaskName(qry.taskHash());
 
-                FieldsResult res = qryInfo.local() ?
+                res = qryInfo.local() ?
                     executeFieldsQuery(qry, qryInfo.arguments(), qryInfo.local(), qry.subjectId(), taskName,
                     recipient(qryInfo.senderId(), qryInfo.requestId())) :
                     fieldsQueryResult(qryInfo, taskName);
@@ -1232,7 +1236,19 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                     throw (Error)e;
             }
             finally {
-                if (rmvRes)
+                if (qryInfo.local()) {
+                    // Don't we need to always remove local iterators?
+                    if (rmvRes && res != null) {
+                        try {
+                            res.closeIfNotShared(recipient(qryInfo.senderId(), qryInfo.requestId()));
+                        }
+                        catch (IgniteCheckedException e) {
+                            U.error(log, "Failed to close local iterator [qry=" + qryInfo + ", node=" +
+                                cctx.nodeId() + "]", e);
+                        }
+                    }
+                }
+                else if (rmvRes)
                     removeFieldsQueryResult(qryInfo.senderId(), qryInfo.requestId());
             }
         }
@@ -1260,6 +1276,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
         try {
             boolean loc = qryInfo.local();
 
+            QueryResult<K, V> res = null;
+
             if (log.isDebugEnabled())
                 log.debug("Running query: " + qryInfo);
 
@@ -1286,8 +1304,6 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                 IgniteSpiCloseableIterator<IgniteBiTuple<K, V>> iter;
                 GridCacheQueryType type;
 
-                QueryResult<K, V> res;
-
                 res = loc ?
                     executeQuery(qry, qryInfo.arguments(), loc, qry.subjectId(), taskName,
                     recipient(qryInfo.senderId(), qryInfo.requestId())) :
@@ -1350,7 +1366,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                         log.debug("Record [key=" + key +
                             ", val=" + val +
                             ", incBackups=" + incBackups +
-                            ", priNode=" + (primaryNode != null ? U.id8(primaryNode.id())  : null) +
+                            ", priNode=" + (primaryNode != null ? U.id8(primaryNode.id()) : null) +
                             ", node=" + U.id8(cctx.localNode().id()) + ']');
                     }
 
@@ -1496,7 +1512,19 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                     throw (Error)e;
             }
             finally {
-                if (rmvIter)
+                if (loc) {
+                    // Local iterators are always removed.
+                    if (res != null) {
+                        try {
+                            res.closeIfNotShared(recipient(qryInfo.senderId(), qryInfo.requestId()));
+                        }
+                        catch (IgniteCheckedException e) {
+                            U.error(log, "Failed to close local iterator [qry=" + qryInfo + ", node=" +
+                                cctx.nodeId() + "]", e);
+                        }
+                    }
+                }
+                else if (rmvIter)
                     removeQueryResult(qryInfo.senderId(), qryInfo.requestId());
             }
         }
@@ -1552,7 +1580,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
      * @return Iterator.
      * @throws IgniteCheckedException In case of error.
      */
-    @SuppressWarnings({"SynchronizationOnLocalVariableOrMethodParameter",
+    @SuppressWarnings({
+        "SynchronizationOnLocalVariableOrMethodParameter",
         "NonPrivateFieldAccessedInSynchronizedContext"})
     private QueryResult<K, V> queryResult(Map<Long, GridFutureAdapter<QueryResult<K, V>>> futs,
         GridCacheQueryInfo qryInfo, String taskName) throws IgniteCheckedException {
@@ -1680,7 +1709,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
      * @return Fields query result.
      * @throws IgniteCheckedException In case of error.
      */
-    @SuppressWarnings({"SynchronizationOnLocalVariableOrMethodParameter",
+    @SuppressWarnings({
+        "SynchronizationOnLocalVariableOrMethodParameter",
         "NonPrivateFieldAccessedInSynchronizedContext"})
     private FieldsResult fieldsQueryResult(Map<Long, GridFutureAdapter<FieldsResult>> resMap,
         GridCacheQueryInfo qryInfo, String taskName) throws IgniteCheckedException {
@@ -1868,8 +1898,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
     /**
      * @param <K> Key type.
      * @param <V> Value type.
-     * @return Predicate.
      * @param includeBackups Include backups.
+     * @return Predicate.
      */
     @SuppressWarnings("unchecked")
     @Nullable public <K, V> IndexingQueryFilter backupsFilter(boolean includeBackups) {
@@ -1933,7 +1963,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
 
         /** {@inheritDoc} */
         @Override public Collection<CacheSqlMetadata> call() {
-            final GridKernalContext ctx = ((IgniteKernal) ignite).context();
+            final GridKernalContext ctx = ((IgniteKernal)ignite).context();
 
             Collection<String> cacheNames = F.viewReadOnly(ctx.cache().caches(),
                 new C1<IgniteInternalCache<?, ?>, String>() {
@@ -2507,7 +2537,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
             if (!filter.apply(key, val))
                 return null;
 
-            return new IgniteBiTuple<>(e.key(), (V)cctx.unwrapTemporary(e.value())) ;
+            return new IgniteBiTuple<>(e.key(), (V)cctx.unwrapTemporary(e.value()));
         }
     }
 
@@ -2546,7 +2576,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
 
             idx++;
 
-            while(idx < iters.size()) {
+            while (idx < iters.size()) {
                 iter = iters.get(idx);
 
                 if (iter.hasNextX())
@@ -2598,7 +2628,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
 
         /** {@inheritDoc} */
         @Override public <T> T unwrap(Class<T> clazz) {
-            if(clazz.isAssignableFrom(getClass()))
+            if (clazz.isAssignableFrom(getClass()))
                 return clazz.cast(this);
 
             throw new IllegalArgumentException();
@@ -2627,7 +2657,6 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
             assert res;
         }
 
-
         /**
          * Close if this result does not have any other recipients.
          *
@@ -2958,8 +2987,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
     }
 
     /**
-     * Creates user's full text query, queried class, and query clause.
-     * For more information refer to {@link CacheQuery} documentation.
+     * Creates user's full text query, queried class, and query clause. For more information refer to {@link CacheQuery}
+     * documentation.
      *
      * @param clsName Query class name.
      * @param search Search clause.
@@ -2982,14 +3011,14 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
     }
 
     /**
-     * Creates user's SQL fields query for given clause. For more information refer to
-     * {@link CacheQuery} documentation.
+     * Creates user's SQL fields query for given clause. For more information refer to {@link CacheQuery}
+     * documentation.
      *
      * @param qry Query.
      * @param keepPortable Keep portable flag.
      * @return Created query.
      */
-     public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean keepPortable) {
+    public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean keepPortable) {
         A.notNull(qry, "qry");
 
         return new GridCacheQueryAdapter<>(cctx,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/45c813af/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheScanPartitionQueryFallbackSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheScanPartitionQueryFallbackSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheScanPartitionQueryFallbackSelfTest.java
index 84ceafd..f422e9c 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheScanPartitionQueryFallbackSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheScanPartitionQueryFallbackSelfTest.java
@@ -19,9 +19,11 @@ package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.query.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.cluster.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.affinity.*;
 import org.apache.ignite.internal.processors.cache.distributed.dht.*;
@@ -157,6 +159,90 @@ public class CacheScanPartitionQueryFallbackSelfTest extends GridCommonAbstractT
     }
 
     /**
+     * Scan should activate fallback mechanism when new nodes join topology and rebalancing happens in parallel with
+     * scan query.
+     *
+     * @throws Exception In case of error.
+     */
+    public void testScanFallbackOnRebalancing() throws Exception {
+        cacheMode = CacheMode.PARTITIONED;
+        clientMode = false;
+        backups = 1;
+        commSpiFactory = new TestFallbackOnRebalancingCommunicationSpiFactory();
+
+        try {
+            Ignite ignite = startGrids(GRID_CNT);
+
+            final IgniteCacheProxy<Integer, Integer> cache = fillCache(ignite);
+
+            final AtomicBoolean done = new AtomicBoolean(false);
+
+            final AtomicInteger idx = new AtomicInteger(GRID_CNT);
+
+            IgniteInternalFuture fut1 = multithreadedAsync(
+                new Callable<Object>() {
+                    @Override public Object call() throws Exception {
+                        int id = idx.getAndIncrement();
+
+                        while (!done.get()) {
+                            startGrid(id);
+                            Thread.sleep(3000);
+
+                            stopGrid(id);
+
+                            if (done.get())
+                                return null;
+
+                            Thread.sleep(3000);
+                        }
+
+                        return null;
+                    }
+                }, GRID_CNT);
+
+            final AtomicInteger nodeIdx = new AtomicInteger();
+
+            IgniteInternalFuture fut2 = multithreadedAsync(
+                new Callable<Object>() {
+                    @Override public Object call() throws Exception {
+                        int nodeId = nodeIdx.getAndIncrement();
+
+                        IgniteCacheProxy<Integer, Integer> cache = (IgniteCacheProxy<Integer, Integer>)
+                            grid(nodeId).<Integer, Integer>cache(null);
+
+                        while (!done.get()) {
+                            IgniteBiTuple<Integer, UUID> tup = remotePartition(cache.context());
+
+                            int part = tup.get1();
+
+                            try {
+                                CacheQuery<Map.Entry<Integer, Integer>> qry = cache.context().queries().createScanQuery(
+                                    null, part, false);
+
+                                doTestScanQuery(qry);
+                            }
+                            catch (ClusterGroupEmptyCheckedException e) {
+                                log.warning("Invalid partition: " + part, e);
+                            }
+                        }
+
+                        return null;
+                    }
+                }, GRID_CNT);
+
+            Thread.sleep(60 * 1000); // Test for one minute
+
+            done.set(true);
+
+            fut2.get();
+            fut1.get();
+        }
+        finally {
+            stopAllGrids();
+        }
+    }
+
+    /**
      * Scan should try first remote node and fallbacks to second remote node.
      *
      * @throws Exception If failed.
@@ -408,4 +494,14 @@ public class CacheScanPartitionQueryFallbackSelfTest extends GridCommonAbstractT
             };
         }
     }
+
+    /**
+     *
+     */
+    private static class TestFallbackOnRebalancingCommunicationSpiFactory implements CommunicationSpiFactory {
+        /** {@inheritDoc} */
+        @Override public TcpCommunicationSpi create() {
+            return new TcpCommunicationSpi();
+        }
+    }
 }


[30/50] incubator-ignite git commit: 1.3.3-p2-SNAPSHOT

Posted by vo...@apache.org.
1.3.3-p2-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/9300bbc7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9300bbc7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9300bbc7

Branch: refs/heads/ignite-gg-9615-1
Commit: 9300bbc776191218fb687339ba72675f3fe45848
Parents: 51dcd51
Author: Ignite Teamcity <ig...@apache.org>
Authored: Fri Aug 14 11:34:47 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Fri Aug 14 11:34:47 2015 +0300

----------------------------------------------------------------------
 examples/pom.xml                                   | 2 +-
 modules/aop/pom.xml                                | 2 +-
 modules/apache-license-gen/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/modules/uri-dependency/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/kafka/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 +-
 modules/yarn/pom.xml                               | 2 +-
 pom.xml                                            | 2 +-
 41 files changed, 41 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 014cb0a..043689c 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>ignite-examples</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index 1983567..8a271e5 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-aop</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/apache-license-gen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/apache-license-gen/pom.xml b/modules/apache-license-gen/pom.xml
index c723729..e1066c1 100644
--- a/modules/apache-license-gen/pom.xml
+++ b/modules/apache-license-gen/pom.xml
@@ -31,5 +31,5 @@
 
     <groupId>org.apache.ignite</groupId>
     <artifactId>ignite-apache-license-gen</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 1f92999..e5cf518 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-aws</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index cf6a347..44ff225 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-clients</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index b2cb2a7..28a071f 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
     </parent>
 
     <artifactId>ignite-cloud</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <properties>
         <jcloud.version>1.9.0</jcloud.version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 49d4c83..7d5a9dc 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-codegen</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index e9f5531..980559d 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-core</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/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 6a6b866..1bd08d4 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.3.3-p1-SNAPSHOT
+ignite.version=1.3.3-p2-SNAPSHOT
 ignite.build=0
 ignite.revision=DEV
 ignite.rel.date=01011970

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index ebcee89..d81b488 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.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/extdata/uri/modules/uri-dependency/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/modules/uri-dependency/pom.xml b/modules/extdata/uri/modules/uri-dependency/pom.xml
index 4c26e87..7430fa1 100644
--- a/modules/extdata/uri/modules/uri-dependency/pom.xml
+++ b/modules/extdata/uri/modules/uri-dependency/pom.xml
@@ -27,7 +27,7 @@
     <artifactId>ignite-extdata-uri-dep</artifactId>
     <packaging>jar</packaging>
 
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
     <modelVersion>4.0.0</modelVersion>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index db1faa1..4121188 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -32,7 +32,7 @@
     </parent>
 
     <artifactId>ignite-extdata-uri</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index 1442cd5..3c1ea24 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-gce</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index 40650a7..1cb53b6 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-geospatial</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index c371f3f..28a0e10 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-hadoop</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index bc4b2ed..14d257a 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-hibernate</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 70a2818..15067fa 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-indexing</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index fbf21b4..d191858 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jcl</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index 868fb22..9714593 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jta</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index 1536e0b..ed77507 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-kafka</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index c39f892..987c8aa 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-log4j</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index 6a9a22b..7879e63 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-mesos</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <properties>
         <mesos.version>0.22.0</mesos.version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 445321b..4864b55 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.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index 65ebb92..11d9c9a 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.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 4d8b19b..d5241c3 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-scalar</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 65570db..26b2ed3 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-schedule</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 3e4bc70..957c821 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.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index f0a9f86..4c81324 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-slf4j</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index abe71df..3cc13ea 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.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index 3685427..0ba28d8 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spark</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index f46c337..3fdb893 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spring</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index 8d49fa1..7911ff1 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-ssh</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 106192f..e31d996 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-tools</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index 2414193..58fd030 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-urideploy</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/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 3385ae0..a676e10 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.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 22295e0..6eb02e9 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.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 97ff310..a1936e4 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.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <!-- Ignite dependencies -->

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index f47433d..3e31812 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-web</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index de917e5..aa3845b 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-yardstick</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <properties>
         <yardstick.version>0.7.0</yardstick.version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/modules/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yarn/pom.xml b/modules/yarn/pom.xml
index dbe59b0..bfa53bc 100644
--- a/modules/yarn/pom.xml
+++ b/modules/yarn/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-yarn</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
 
     <properties>
         <hadoop.version>2.7.0</hadoop.version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9300bbc7/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index dcda132..176c14e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
 
     <groupId>org.apache.ignite</groupId>
     <artifactId>apache-ignite</artifactId>
-    <version>1.3.3-p1-SNAPSHOT</version>
+    <version>1.3.3-p2-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <properties>


[36/50] incubator-ignite git commit: # Properly handle ClusterTopologyServerNotFoundException for retries

Posted by vo...@apache.org.
# Properly handle ClusterTopologyServerNotFoundException for retries


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 2903a29e7a50802617872bfd0fcc3497c4c7785e
Parents: 122a9db
Author: sboikov <sb...@gridgain.com>
Authored: Fri Aug 14 16:22:25 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Aug 14 16:22:25 2015 +0300

----------------------------------------------------------------------
 .../CachePartialUpdateCheckedException.java     | 29 +++++++++++-
 .../processors/cache/GridCacheAdapter.java      | 50 ++++++++++++--------
 .../dht/atomic/GridNearAtomicUpdateFuture.java  | 48 +++++++++++--------
 .../near/GridNearOptimisticTxPrepareFuture.java |  2 +-
 .../cache/GridCacheAbstractFullApiSelfTest.java |  1 -
 5 files changed, 86 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2903a29e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java
index 0272b7c..f430d12 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
+import org.apache.ignite.internal.processors.affinity.*;
 
 import java.util.*;
 
@@ -32,6 +33,9 @@ public class CachePartialUpdateCheckedException extends IgniteCheckedException {
     /** Failed keys. */
     private final Collection<Object> failedKeys = new ArrayList<>();
 
+    /** */
+    private AffinityTopologyVersion topVer;
+
     /**
      * @param msg Error message.
      */
@@ -50,13 +54,36 @@ public class CachePartialUpdateCheckedException extends IgniteCheckedException {
     /**
      * @param failedKeys Failed keys.
      * @param err Error.
+     * @param topVer Topology version for failed update.
      */
-    public void add(Collection<?> failedKeys, Throwable err) {
+    public void add(Collection<?> failedKeys, Throwable err, AffinityTopologyVersion topVer) {
+        if (topVer != null) {
+            AffinityTopologyVersion topVer0 = this.topVer;
+
+            if (topVer0 == null || topVer.compareTo(topVer0) > 0)
+                this.topVer = topVer;
+        }
+
         this.failedKeys.addAll(failedKeys);
 
         addSuppressed(err);
     }
 
+    /**
+     * @return Topology version.
+     */
+    public AffinityTopologyVersion topologyVersion() {
+        return topVer;
+    }
+
+    /**
+     * @param failedKeys Failed keys.
+     * @param err Error.
+     */
+    public void add(Collection<?> failedKeys, Throwable err) {
+        add(failedKeys, err, null);
+    }
+
     /** {@inheritDoc} */
     @Override public String getMessage() {
         return super.getMessage() + ": " + failedKeys;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2903a29e/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 91af352..992edd8 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
@@ -3975,13 +3975,17 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
                     }
 
                     if (X.hasCause(e, ClusterTopologyCheckedException.class) && i != retries - 1) {
-                        AffinityTopologyVersion topVer = tx.topologyVersion();
+                        ClusterTopologyCheckedException topErr = e.getCause(ClusterTopologyCheckedException.class);
 
-                        assert topVer != null && topVer.topologyVersion() > 0 : tx;
+                        if (!(topErr instanceof ClusterTopologyServerNotFoundException)) {
+                            AffinityTopologyVersion topVer = tx.topologyVersion();
+
+                            assert topVer != null && topVer.topologyVersion() > 0 : tx;
 
-                        ctx.affinity().affinityReadyFuture(topVer.topologyVersion() + 1).get();
+                            ctx.affinity().affinityReadyFuture(topVer.topologyVersion() + 1).get();
 
-                        continue;
+                            continue;
+                        }
                     }
 
                     throw e;
@@ -4702,31 +4706,35 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
                     }
                     catch (IgniteCheckedException e) {
                         if (X.hasCause(e, ClusterTopologyCheckedException.class) && --retries > 0) {
-                            IgniteTxLocalAdapter tx = AsyncOpRetryFuture.this.tx;
+                            ClusterTopologyCheckedException topErr = e.getCause(ClusterTopologyCheckedException.class);
 
-                            assert tx != null;
+                            if (!(topErr instanceof ClusterTopologyServerNotFoundException)) {
+                                IgniteTxLocalAdapter tx = AsyncOpRetryFuture.this.tx;
 
-                            AffinityTopologyVersion topVer = tx.topologyVersion();
+                                assert tx != null;
 
-                            assert topVer != null && topVer.topologyVersion() > 0 : tx;
+                                AffinityTopologyVersion topVer = tx.topologyVersion();
 
-                            IgniteInternalFuture<?> topFut =
-                                ctx.affinity().affinityReadyFuture(topVer.topologyVersion() + 1);
+                                assert topVer != null && topVer.topologyVersion() > 0 : tx;
 
-                            topFut.listen(new IgniteInClosure<IgniteInternalFuture<?>>() {
-                                @Override public void apply(IgniteInternalFuture<?> topFut) {
-                                    try {
-                                        topFut.get();
+                                IgniteInternalFuture<?> topFut =
+                                    ctx.affinity().affinityReadyFuture(topVer.topologyVersion() + 1);
 
-                                        execute();
-                                    }
-                                    catch (IgniteCheckedException e) {
-                                        onDone(e);
+                                topFut.listen(new IgniteInClosure<IgniteInternalFuture<?>>() {
+                                    @Override public void apply(IgniteInternalFuture<?> topFut) {
+                                        try {
+                                            topFut.get();
+
+                                            execute();
+                                        }
+                                        catch (IgniteCheckedException e) {
+                                            onDone(e);
+                                        }
                                     }
-                                }
-                            });
+                                });
 
-                            return;
+                                return;
+                            }
                         }
 
                         onDone(e);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2903a29e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 0498839..5dc5494 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -275,6 +275,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
             if (singleNodeId.equals(nodeId)) {
                 onDone(addFailedKeys(
                     singleReq.keys(),
+                    singleReq.topologyVersion(),
                     new ClusterTopologyCheckedException("Primary node left grid before response is received: " + nodeId)));
 
                 return true;
@@ -286,8 +287,9 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
         GridNearAtomicUpdateRequest req = mappings.get(nodeId);
 
         if (req != null) {
-            addFailedKeys(req.keys(), new ClusterTopologyCheckedException("Primary node left grid before response is " +
-                "received: " + nodeId));
+            addFailedKeys(req.keys(),
+                req.topologyVersion(),
+                new ClusterTopologyCheckedException("Primary node left grid before response is received: " + nodeId));
 
             mappings.remove(nodeId);
 
@@ -356,8 +358,11 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
 
     /**
      * @param failed Keys to remap.
+     * @param errTopVer Topology version for failed update.
      */
-    private void remap(Collection<?> failed) {
+    private void remap(Collection<?> failed, AffinityTopologyVersion errTopVer) {
+        assert errTopVer != null;
+
         GridCacheVersion futVer0 = futVer;
 
         if (futVer0 == null || cctx.mvcc().removeAtomicFuture(futVer0) == null)
@@ -409,15 +414,11 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
 
         GridFutureAdapter<Void> fut0;
 
-        long nextTopVer;
-
         synchronized (this) {
             mappings = new ConcurrentHashMap8<>(keys.size(), 1.0f);
 
             assert topVer != null && topVer.topologyVersion() > 0 : this;
 
-            nextTopVer = topVer.topologyVersion() + 1;
-
             topVer = AffinityTopologyVersion.ZERO;
 
             fut0 = topCompleteFut;
@@ -434,7 +435,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
         updVer = null;
         topLocked = false;
 
-        IgniteInternalFuture<?> fut = cctx.affinity().affinityReadyFuture(nextTopVer);
+        IgniteInternalFuture<?> fut = cctx.affinity().affinityReadyFuture(errTopVer.topologyVersion() + 1);
 
         fut.listen(new CI1<IgniteInternalFuture<?>>() {
             @Override public void apply(final IgniteInternalFuture<?> fut) {
@@ -471,15 +472,17 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
             X.hasCause(err, ClusterTopologyCheckedException.class) &&
             storeFuture() &&
             remapCnt.decrementAndGet() > 0) {
+            ClusterTopologyCheckedException topErr = X.cause(err, ClusterTopologyCheckedException.class);
 
-            CachePartialUpdateCheckedException cause = X.cause(err, CachePartialUpdateCheckedException.class);
+            if (!(topErr instanceof  ClusterTopologyServerNotFoundException)) {
+                CachePartialUpdateCheckedException cause = X.cause(err, CachePartialUpdateCheckedException.class);
 
-            if (F.isEmpty(cause.failedKeys()))
-                cause.printStackTrace();
+                assert cause != null && cause.topologyVersion() != null : err;
 
-            remap(cause.failedKeys());
+                remap(cause.failedKeys(), cause.topologyVersion());
 
-            return false;
+                return false;
+            }
         }
 
         if (super.onDone(retval, err)) {
@@ -528,8 +531,10 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
 
             updateNear(singleReq, res);
 
-            if (res.error() != null)
-                onDone(res.failedKeys() != null ? addFailedKeys(res.failedKeys(), res.error()) : res.error());
+            if (res.error() != null) {
+                onDone(res.failedKeys() != null ?
+                    addFailedKeys(res.failedKeys(), singleReq.topologyVersion(), res.error()) : res.error());
+            }
             else {
                 if (op == TRANSFORM) {
                     if (ret != null)
@@ -551,7 +556,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
                 updateNear(req, res);
 
                 if (res.error() != null)
-                    addFailedKeys(req.keys(), res.error());
+                    addFailedKeys(req.keys(), req.topologyVersion(), res.error());
                 else {
                     if (op == TRANSFORM) {
                         assert !req.fastMap();
@@ -1048,7 +1053,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
                     onDone(new GridCacheReturn(cctx, true, null, true));
             }
             catch (IgniteCheckedException e) {
-                onDone(addFailedKeys(req.keys(), e));
+                onDone(addFailedKeys(req.keys(), req.topologyVersion(), e));
             }
         }
     }
@@ -1079,7 +1084,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
                     cctx.io().send(req.nodeId(), req, cctx.ioPolicy());
                 }
                 catch (IgniteCheckedException e) {
-                    addFailedKeys(req.keys(), e);
+                    addFailedKeys(req.keys(), req.topologyVersion(), e);
 
                     removeMapping(req.nodeId());
                 }
@@ -1135,10 +1140,13 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
 
     /**
      * @param failedKeys Failed keys.
+     * @param topVer Topology version for failed update.
      * @param err Error cause.
      * @return Root {@link org.apache.ignite.internal.processors.cache.CachePartialUpdateCheckedException}.
      */
-    private synchronized IgniteCheckedException addFailedKeys(Collection<KeyCacheObject> failedKeys, Throwable err) {
+    private synchronized IgniteCheckedException addFailedKeys(Collection<KeyCacheObject> failedKeys,
+        AffinityTopologyVersion topVer,
+        Throwable err) {
         CachePartialUpdateCheckedException err0 = this.err;
 
         if (err0 == null)
@@ -1149,7 +1157,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
         for (KeyCacheObject key : failedKeys)
             keys.add(key.value(cctx.cacheObjectContext(), false));
 
-        err0.add(keys, err);
+        err0.add(keys, err, topVer);
 
         return err0;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2903a29e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
index 44b7997..2b86672 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
@@ -416,7 +416,7 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearTxPrepareFutureAd
                 GridCacheContext<?, ?> cacheCtx = cctx.cacheContext(cacheId);
 
                 if (CU.affinityNodes(cacheCtx, topVer).isEmpty()) {
-                    onDone(new ClusterTopologyCheckedException("Failed to map keys for cache (all " +
+                    onDone(new ClusterTopologyServerNotFoundException("Failed to map keys for cache (all " +
                         "partition nodes left the grid): " + cacheCtx.name()));
 
                     return;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2903a29e/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 0a8f87c..ff948a1 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
@@ -5010,7 +5010,6 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         assertThrows(log, new Callable<Object>() {
             @Override public Object call() throws Exception {
-
                 IgniteFuture fut = cache.future().chain(new IgniteClosure<IgniteFuture, Object>() {
                     @Override public Object apply(IgniteFuture o) {
                         return o.get();


[49/50] incubator-ignite git commit: Exception handling

Posted by vo...@apache.org.
Exception handling


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 09da9c2a369b52b06fe9312aafd19f1085ba79d2
Parents: fcd9d61
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Mon Aug 17 23:44:59 2015 -0700
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Mon Aug 17 23:44:59 2015 -0700

----------------------------------------------------------------------
 .../ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java       | 2 +-
 .../ignite/internal/util/spring/IgniteSpringHelperImpl.java      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/09da9c2a/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 ac1f4f1..5449433 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
@@ -98,7 +98,7 @@ public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheJdbcPojoSto
             }
             catch (Exception e) {
                 throw new IgniteException("Failed to load bean in application context [beanName=" + dataSrcBean +
-                    ", igniteConfig=" + appContext + ']');
+                    ", igniteConfig=" + appContext + ']', e);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/09da9c2a/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 435f522..d65a199 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
@@ -201,11 +201,11 @@ public class IgniteSpringHelperImpl implements IgniteSpringHelper {
         }
         catch (NoSuchBeanDefinitionException e) {
             throw new IgniteCheckedException("Spring bean with provided name doesn't exist " +
-                    ", beanName=" + beanName + ']');
+                ", beanName=" + beanName + ']');
         }
         catch (BeansException e) {
             throw new IgniteCheckedException("Failed to load Spring bean with provided name " +
-                    ", beanName=" + beanName + ']', e);
+                ", beanName=" + beanName + ']', e);
         }
     }
 


[21/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/master' into ignite-946

Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-946


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 51a9bd85e5cb7cb38fcc60b7adf808fe0545e7df
Parents: 4f8f32a 36f7ba6
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu Aug 13 09:12:26 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu Aug 13 09:12:26 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheGateway.java      |  5 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 91 +++++++++++++-------
 2 files changed, 62 insertions(+), 34 deletions(-)
----------------------------------------------------------------------



[44/50] incubator-ignite git commit: Merge branch 'ignite-1241-dev' of https://github.com/dmagda/incubator-ignite

Posted by vo...@apache.org.
Merge branch 'ignite-1241-dev' of https://github.com/dmagda/incubator-ignite


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

Branch: refs/heads/ignite-gg-9615-1
Commit: ad121478b6f6d0d733e8d651a541f03b4fb849f4
Parents: 45c813a 38070b2
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Aug 17 17:11:54 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Aug 17 17:11:54 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 26 ++++++++++++++------
 .../spi/discovery/tcp/TcpDiscoveryImpl.java     |  4 +--
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  4 ---
 .../tcp/internal/TcpDiscoveryNode.java          | 18 +++++++-------
 .../tcp/internal/TcpDiscoveryNodesRing.java     | 23 +++++++++++++++++
 5 files changed, 53 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad121478/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ad121478/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------


[11/50] incubator-ignite git commit: ignite-946: fixed comments and bugs

Posted by vo...@apache.org.
ignite-946: fixed comments and bugs


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

Branch: refs/heads/ignite-gg-9615-1
Commit: c1582fc32884cdf9494df32fb33207d64ed1230f
Parents: 911ffbb
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Aug 10 12:44:31 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Aug 10 12:44:31 2015 +0300

----------------------------------------------------------------------
 .../ignite/cache/version/VersionedEntry.java       | 17 +++++++++--------
 .../cache/version/CacheVersionedEntryImpl.java     |  4 ++--
 .../processors/clock/GridClockSyncProcessor.java   |  2 +-
 .../version/CacheVersionedEntryAbstractTest.java   |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1582fc3/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java b/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
index 2c0879b..1aac68a 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
@@ -73,30 +73,31 @@ public interface VersionedEntry<K, V> extends Cache.Entry<K, V> {
     };
 
     /**
-     * Gets entry's topology version.
+     * Gets the topology version at the time when the entry with a given pair of key and value has been created.
      *
      * @return Topology version plus number of seconds from the start time of the first grid node.
      */
     public int topologyVersion();
 
     /**
-     * Gets entry's order.
+     * Gets versioned entry unique order.
+     * Each time a cache entry for a given key is updated a new {@code VersionedEntry} with increased order is created.
      *
-     * @return Version order.
+     * @return Versioned entry unique order.
      */
     public long order();
 
     /**
-     * Gets entry's node order.
+     * Gets local node order at the time when the entry with a given pair of key and value has been created.
      *
-     * @return Node order on which this version was assigned.
+     * @return Local node order on which this version has been assigned.
      */
     public int nodeOrder();
 
     /**
-     * Gets entry's global time.
+     * Gets the time when the entry with a given pair of key and value has been created.
      *
-     * @return Adjusted time.
+     * @return Time in milliseconds.
      */
-    public long globalTime();
+    public long creationTime();
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1582fc3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
index 924eff9..74e4a9a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
@@ -74,7 +74,7 @@ public class CacheVersionedEntryImpl<K, V> extends CacheEntryImpl<K, V> implemen
     }
 
     /** {@inheritDoc} */
-    @Override public long globalTime() {
+    @Override public long creationTime() {
         return ver.globalTime();
     }
 
@@ -95,6 +95,6 @@ public class CacheVersionedEntryImpl<K, V> extends CacheEntryImpl<K, V> implemen
     /** {@inheritDoc} */
     public String toString() {
         return "VersionedEntry [key=" + getKey() + ", val=" + getValue() + ", topVer=" + ver.topologyVersion() +
-            ", nodeOrder=" + ver.nodeOrder() + ", order=" + ver.order() + ", globalTime=" + ver.globalTime() + ']';
+            ", nodeOrder=" + ver.nodeOrder() + ", order=" + ver.order() + ", creationTime=" + ver.globalTime() + ']';
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1582fc3/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockSyncProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockSyncProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockSyncProcessor.java
index 3ac44f2..69b07b3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockSyncProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/clock/GridClockSyncProcessor.java
@@ -264,7 +264,7 @@ public class GridClockSyncProcessor extends GridProcessorAdapter {
         long now = clockSrc.currentTimeMillis();
 
         if (snap == null)
-            return System.currentTimeMillis();
+            return now;
 
         Long delta = snap.deltas().get(ctx.localNodeId());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1582fc3/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
index b121995..0ad8038 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
@@ -164,7 +164,7 @@ public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractS
         assert entry.topologyVersion() > 0;
         assert entry.order() > 0;
         assert entry.nodeOrder() > 0;
-        assert entry.globalTime() > 0;
+        assert entry.creationTime() > 0;
 
         assertNotNull(entry.getKey());
         assertNotNull(entry.getValue());


[39/50] incubator-ignite git commit: ignite-534 - IgniteJmsStreamer implemented. Closes #14.

Posted by vo...@apache.org.
ignite-534 - IgniteJmsStreamer implemented. Closes #14.


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 0d701127c8a95a30f4c484247e84ab1f10f95e3a
Parents: d0536dc
Author: Raul Kripalani <ra...@apache.org>
Authored: Fri Aug 14 16:11:19 2015 -0700
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Fri Aug 14 16:11:19 2015 -0700

----------------------------------------------------------------------
 .../ignite/internal/util/GridArgumentCheck.java |  17 +
 modules/jms11/pom.xml                           |  98 ++++
 .../apache/ignite/stream/jms11/JmsStreamer.java | 524 ++++++++++++++++++
 .../ignite/stream/jms11/MessageTransformer.java |  43 ++
 .../stream/jms11/IgniteJmsStreamerTest.java     | 551 +++++++++++++++++++
 .../jms11/IgniteJmsStreamerTestSuite.java       |  34 ++
 .../ignite/stream/jms11/TestTransformers.java   | 123 +++++
 pom.xml                                         |   1 +
 8 files changed, 1391 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d701127/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java b/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java
index b94bae6..8289f90 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java
@@ -35,6 +35,9 @@ public class GridArgumentCheck {
     /** Not empty argument error message suffix. */
     private static final String NOT_EMPTY_SUFFIX = " must not be empty.";
 
+    /** Not null or empty error message suffix. */
+    private static final String NOT_NULL_OR_EMPTY_SUFFIX = " must not be null or empty.";
+
     /**
      * Checks if given argument value is not {@code null}. Otherwise - throws {@link NullPointerException}.
      *
@@ -145,4 +148,18 @@ public class GridArgumentCheck {
         if (arr.length == 0)
             throw new IllegalArgumentException(INVALID_ARG_MSG_PREFIX + name + NOT_EMPTY_SUFFIX);
     }
+
+    /**
+     * Checks that a String is not null or empty.
+     *
+     * @param value Value to check.
+     * @param name Argument name.
+     */
+    public static void notNullOrEmpty(String value, String name) {
+        notNull(value, name);
+
+        if (value.trim().length() == 0) {
+            throw new IllegalArgumentException(INVALID_ARG_MSG_PREFIX + name + NOT_NULL_OR_EMPTY_SUFFIX);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d701127/modules/jms11/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jms11/pom.xml b/modules/jms11/pom.xml
new file mode 100644
index 0000000..c93ea9a
--- /dev/null
+++ b/modules/jms11/pom.xml
@@ -0,0 +1,98 @@
+<?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.
+-->
+
+<!--
+    POM file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.ignite</groupId>
+        <artifactId>ignite-parent</artifactId>
+        <version>1</version>
+        <relativePath>../../parent</relativePath>
+    </parent>
+
+    <artifactId>ignite-jms11</artifactId>
+    <version>1.4.1-SNAPSHOT</version>
+
+    <properties>
+        <activemq.version>5.11.1</activemq.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.jms</groupId>
+            <artifactId>jms-api</artifactId>
+            <version>1.1-rev-1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>activemq-client</artifactId>
+            <version>${activemq.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>activemq-broker</artifactId>
+            <version>${activemq.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.activemq</groupId>
+            <artifactId>activemq-kahadb-store</artifactId>
+            <version>${activemq.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.apache.ignite</groupId>
+            <artifactId>ignite-spring</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ignite</groupId>
+            <artifactId>ignite-core</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d701127/modules/jms11/src/main/java/org/apache/ignite/stream/jms11/JmsStreamer.java
----------------------------------------------------------------------
diff --git a/modules/jms11/src/main/java/org/apache/ignite/stream/jms11/JmsStreamer.java b/modules/jms11/src/main/java/org/apache/ignite/stream/jms11/JmsStreamer.java
new file mode 100644
index 0000000..de84a3e
--- /dev/null
+++ b/modules/jms11/src/main/java/org/apache/ignite/stream/jms11/JmsStreamer.java
@@ -0,0 +1,524 @@
+/*
+ * 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.stream.jms11;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.stream.*;
+
+import javax.jms.*;
+import javax.jms.Queue;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+/**
+ * Streamer that consumes from a JMS destination and feeds key-value pairs into an {@link IgniteDataStreamer} instance.
+ * <p>
+ * This Streamer uses purely JMS semantics and it is not coupled with any JMS implementation. It uses {@link
+ * MessageListener} to receive messages. You must provide your broker's {@link javax.jms.ConnectionFactory} when
+ * creating a {@link JmsStreamer}.
+ * <p>
+ * You must also provide a {@link MessageTransformer} to convert the incoming message into cache entries.
+ * <p>
+ * This Streamer has many features:
+ *
+ * <ul>
+ *     <li>Consumes from queues or topics.</li>
+ *     <li>For topics, it supports durable subscriptions.</li>
+ *     <li>Concurrent consumers are supported via the <tt>threads</tt> parameter. When consuming from queues,
+ *     this component will start as many {@link Session} objects with separate {@link MessageListener} instances each,
+ *     therefore achieving <i>native</i> concurrency (in terms of the JMS standard).<br>
+ *     When consuming from topics, obviously we cannot start multiple threads as that would lead us to consume
+ *     duplicate messages. Therefore, we achieve concurrency in a <i>virtualized</i> manner through an internal
+ *     thread pool.</li>
+ *     <li>Transacted sessions are supported through the <tt>transacted</tt> parameter.</li>
+ *     <li>Batched consumption is possible via the <tt>batched</tt> parameter. Depending on the broker, this
+ *     technique can provide a higher throughput as it decreases the amount of message acknowledgement round trips
+ *     that are necessary, albeit at the expense possible duplicate messages (especially if an incident
+ *     occurs in the middle of a transaction).<br>
+ *     Batches are committed when the <tt>batchClosureMillis</tt> time has elapsed, or when a Session has received
+ *     at least <tt>batchClosureSize</tt> messages. Time-based closure fires with the specified frequency and applies to
+ *     all {@link Session}s in parallel. Size-based closure applies individually to each <tt>Session</tt> (as transactions
+ *     are <tt>Session-bound</tt> in JMS, so it will fire when that {@link Session} has processed that many messages.
+ *     Both options are compatible with each other, or you can disable either (see setter documentation),
+ *     but not both.</li>
+ *     <li>Can specify the destination with implementation-specific {@link Destination} objects or with names.</li>
+ * </ul>
+
+ *
+ * @author Raul Kripalani
+ */
+public class JmsStreamer<T extends Message, K, V> extends StreamAdapter<T, K, V> {
+
+    /** Logger. */
+    private IgniteLogger log;
+
+    /**
+     * <i>Compulsory.</i> The message transformer that converts an incoming JMS {@link Message} (or subclass) into one
+     * or multiple cache entries.
+     */
+    private MessageTransformer<T, K, V> transformer;
+
+    /** The JMS {@link ConnectionFactory} to use. */
+    private ConnectionFactory connectionFactory;
+
+    /** Whether to register or not as a durable subscription (for topic consumption). */
+    private boolean durableSubscription;
+
+    /** Name of the durable subscription, as required by the JMS specification. */
+    private String durableSubscriptionName;
+
+    /** Client ID in case we're using durable subscribers. */
+    private String clientId;
+
+    /** The JMS {@link Destination}; takes precedence over destinationName if both are set. */
+    private Destination destination;
+
+    /** Name of the destination. */
+    private String destinationName;
+
+    /** Whether to consume in a transacted manner. */
+    private boolean transacted;
+
+    /** Whether to consume messages in batches. May lead to duplicate consumption. Value <tt>true</tt> implies
+     * <tt>transacted = true</tt>. */
+    private boolean batched;
+
+    /** When using batched consumers, the amount of messages after the batch (transaction) will be committed. */
+    private int batchClosureSize = 50;
+
+    /**
+     * When using batched consumers, the amount of time to wait before the batch (transaction) will be committed. A
+     * value of 0 or -1 disables timed-based session commits.
+     */
+    private long batchClosureMillis = 1000;
+
+    /** Destination type. */
+    private Class<? extends Destination> destinationType = Queue.class;
+
+    /**
+     * Number of threads to concurrently consume JMS messages. When working with queues, we will start as many {@link
+     * javax.jms.Session} objects as indicated by this field, i.e. you will get native concurrency. On the other hand,
+     * when consuming from a topic, for obvious reason we will only start 1 message consumer but we will distribute the
+     * processing of received messages to as many concurrent threads as indicated.
+     */
+    private int threads = 1;
+
+    /** Whether we are stopped or not. */
+    private volatile boolean stopped = true;
+
+    /** JMS Connection. */
+    private Connection connection;
+
+    /** Stores the current JMS Sessions. */
+    private Set<Session> sessions = Collections.newSetFromMap(new ConcurrentHashMap<Session, Boolean>());
+
+    /** Message consumers. */
+    private Set<MessageConsumer> consumers = Collections.newSetFromMap(new ConcurrentHashMap<MessageConsumer, Boolean>());
+
+    /** Message listeners. */
+    private Set<IgniteJmsMessageListener> listeners = Collections.newSetFromMap(new ConcurrentHashMap<IgniteJmsMessageListener, Boolean>());
+
+    /** Scheduler for handling {@link #batchClosureMillis}. */
+    private ScheduledExecutorService scheduler;
+
+    /**
+     * Starts streamer.
+     *
+     * @throws IgniteException If failed.
+     */
+    public void start() throws IgniteException {
+        if (!stopped)
+            throw new IgniteException("Attempted to start an already started JMS Streamer");
+
+        try {
+            A.notNull(getStreamer(), "streamer");
+            A.notNull(getIgnite(), "ignite");
+
+            log = getIgnite().log();
+
+            A.notNull(transformer, "message transformer");
+            A.notNull(connectionFactory, "connection factory");
+            A.ensure(threads > 0, "threads > 0");
+
+            // handle batched && transacted parameter interaction
+            if (batched && !transacted) {
+                log.warning("Starting a Batched JMS Streamer without transacted flag = true. Setting it automatically.");
+                transacted = true;
+            }
+
+            // handle batch completion criteria
+            if (batched) {
+                A.ensure(batchClosureMillis > 0 || batchClosureSize > 0, "at least one of batch closure size or " +
+                    "batch closure frequency must be specified when using batch consumption");
+            }
+
+            // check the parameters needed for durable subscriptions, if enabled
+            if (durableSubscription) {
+                A.notNullOrEmpty(clientId, "client id is compulsory when using durable subscriptions");
+                A.notNullOrEmpty(durableSubscriptionName, "durable subscription name is compulsory when using " +
+                    "durable subscriptions");
+            }
+
+            // validate the destination; if we have an explicit destination, make sure it's of type Queue or Topic;
+            // else make sure that the destinationName and the destinationType are valid
+            if (destination == null) {
+                A.notNull(destinationType, "destination type");
+                A.ensure(destinationType.isAssignableFrom(Queue.class) || destinationType.isAssignableFrom(Topic.class),
+                    "this streamer can only handle Queues or Topics.");
+                A.notNullOrEmpty(destinationName, "destination or destination name");
+            }
+            else if (destination instanceof Queue) {
+                destinationType = Queue.class;
+            }
+            else if (destination instanceof Topic) {
+                destinationType = Topic.class;
+            }
+            else {
+                throw new IllegalArgumentException("Invalid destination object. Can only handle Queues or Topics.");
+            }
+
+            // create a new connection and the client iD if relevant.
+            connection = connectionFactory.createConnection();
+            if (clientId != null && clientId.trim().length() > 0) {
+                connection.setClientID(clientId.trim());
+            }
+
+            // build the JMS objects
+            if (destinationType == Queue.class) {
+                initializeJmsObjectsForQueue();
+            }
+            else {
+                initializeJmsObjectsForTopic();
+            }
+
+            stopped = false;
+
+            // start the JMS connection
+            connection.start();
+
+            // set up the scheduler service for committing batches
+            if (batched && batchClosureMillis > 0) {
+                scheduler = Executors.newScheduledThreadPool(1);
+                scheduler.schedule(new Runnable() {
+                    @Override
+                    public void run() {
+                        for (Session session : sessions) {
+                            try {
+                                session.commit();
+                                if (log.isDebugEnabled()) {
+                                    log.debug("Committing session from time-based batch completion [session=" +
+                                        session + "]");
+                                }
+                            }
+                            catch (JMSException e) {
+                                log.warning("Error while committing session: from batch time-based completion " +
+                                    "[session=" + session + "]");
+                            }
+                        }
+                        for (IgniteJmsMessageListener ml : listeners) {
+                            ml.resetBatchCounter();
+                        }
+                    }
+                }, batchClosureMillis, TimeUnit.MILLISECONDS);
+            }
+
+        }
+        catch (Throwable t) {
+            throw new IgniteException("Exception while initializing JmsStreamer", t);
+        }
+
+    }
+
+    /**
+     * Stops streamer.
+     */
+    public void stop() throws IgniteException {
+        if (stopped)
+            throw new IgniteException("Attempted to stop an already stopped JMS Streamer");
+
+
+        try {
+            stopped = true;
+
+            if (scheduler != null && !scheduler.isShutdown()) {
+                scheduler.shutdown();
+                scheduler = null;
+            }
+
+            connection.stop();
+            connection.close();
+
+            for (Session s : sessions) {
+                s.close();
+            }
+
+            sessions.clear();
+            consumers.clear();
+            listeners.clear();
+        }
+        catch (Throwable t) {
+            throw new IgniteException("Exception while stopping JmsStreamer", t);
+        }
+    }
+
+    /**
+     * Sets the JMS {@link ConnectionFactory}.
+     *
+     * @param connectionFactory JMS {@link ConnectionFactory} for this streamer to use.
+     */
+    public void setConnectionFactory(ConnectionFactory connectionFactory) {
+        this.connectionFactory = connectionFactory;
+    }
+
+    /**
+     * <i>Compulsory.</i> The {@link MessageTransformer} that converts an incoming JMS {@link Message} (or subclass)
+     * into one or multiple cache entries.
+     *
+     * @param transformer The implementation of the MessageTransformer to use.
+     */
+    public void setTransformer(MessageTransformer<T, K, V> transformer) {
+        this.transformer = transformer;
+    }
+
+    /**
+     * Sets the JMS {@link Destination} explicitly. Takes precedence over destinationName if both are set.
+     *
+     * @param destination JMS {@link Destination} if setting it explicitly.
+     */
+    public void setDestination(Destination destination) {
+        this.destination = destination;
+    }
+
+    /**
+     * Sets the name of the JMS destination to consume from.
+     *
+     * @param destinationName The name of the destination; will be passed on directly to the broker.
+     */
+    public void setDestinationName(String destinationName) {
+        this.destinationName = destinationName;
+    }
+
+    /**
+     * Sets the type of the destination to create, when used in combination with {@link #setDestinationName(String)}. It
+     * can be an interface or the implementation class specific to the broker.
+     *
+     * @param destinationType The class representing the destination type. Suggested values: {@link Queue} or {@link
+     * Topic}. <i>Compulsory</i> if using {@link #destinationName}.
+     * @see Queue
+     * @see Topic
+     */
+    public void setDestinationType(Class<? extends Destination> destinationType) {
+        this.destinationType = destinationType;
+    }
+
+    /**
+     * Sets the number of threads to concurrently consume JMS messages. <p> When working with queues, we will start as
+     * many {@link javax.jms.Session} objects as indicated by this field, i.e. you will get native concurrency. <p> On
+     * the other hand, when consuming from a topic, for obvious reason we will only start 1 message consumer but we will
+     * distribute the processing of received messages to as many concurrent threads as indicated.
+     *
+     * @param threads Number of threads to use. Default: <tt>1</tt>.
+     */
+    public void setThreads(int threads) {
+        this.threads = threads;
+    }
+
+    /**
+     * Sets the client ID of the JMS {@link Connection}.
+     *
+     * @param clientId Client ID in case we're using durable subscribers. Default: none.
+     */
+    public void setClientId(String clientId) {
+        this.clientId = clientId;
+    }
+
+    /**
+     * A <tt>true</tt> value is only accepted in combination with topic consumption.
+     *
+     * @param durableSubscription Whether or not to use durable subscriptions. Default: <tt>false</tt>.
+     */
+    public void setDurableSubscription(boolean durableSubscription) {
+        this.durableSubscription = durableSubscription;
+    }
+
+    /**
+     * Instructs the streamer whether to use local JMS transactions or not.
+     *
+     * @param transacted Whether to consume or not in a transacted manner. Default: <tt>false</tt>.
+     */
+    public void setTransacted(boolean transacted) {
+        this.transacted = transacted;
+    }
+
+    /**
+     * Batch consumption leverages JMS Transactions to minimise round trips to the broker. <p> Rather than ACKing every
+     * single message received, they will be received in the context of a JMS transaction which will be committed once
+     * the indicated batch closure size or batch closure time has elapsed. <p> Warning: May lead to duplicate
+     * consumption.
+     *
+     * @param batched Whether to consume messages in batches. Value <tt>true</tt> implies <tt>transacted = true</tt>.
+     * Default: <tt>false</tt>.
+     * @see #setBatchClosureMillis(long)
+     * @see #setBatchClosureSize(int)
+     */
+    public void setBatched(boolean batched) {
+        this.batched = batched;
+    }
+
+    /**
+     * When using batched consumption, sets the amount of messages that will be received before a batch is committed.
+     *
+     * @param batchClosureSize The amount of messages processed before a batch is committed. Default: <tt>50</tt>.
+     */
+    public void setBatchClosureSize(int batchClosureSize) {
+        this.batchClosureSize = batchClosureSize;
+    }
+
+    /**
+     * When using batched consumption, sets the time in milliseconds that will elapse before a batch is committed.
+     *
+     * @param batchClosureMillis Milliseconds before a batch is committed. Default: <tt>1000ms</tt>.
+     */
+    public void setBatchClosureMillis(long batchClosureMillis) {
+        this.batchClosureMillis = batchClosureMillis;
+    }
+
+    /**
+     * When using Durable Subscribers, sets the name of the durable subscriber. It is compulsory.
+     *
+     * @param durableSubscriptionName Name of the durable subscriber. Default: none.
+     */
+    public void setDurableSubscriptionName(String durableSubscriptionName) {
+        this.durableSubscriptionName = durableSubscriptionName;
+    }
+
+    private void initializeJmsObjectsForTopic() throws JMSException {
+        Session session = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
+        Topic topic = (Topic)destination;
+
+        if (destination == null)
+            topic = session.createTopic(destinationName);
+
+        MessageConsumer consumer = durableSubscription ? session.createDurableSubscriber(topic, durableSubscriptionName) :
+            session.createConsumer(topic);
+
+        IgniteJmsMessageListener messageListener = new IgniteJmsMessageListener(session, true);
+        consumer.setMessageListener(messageListener);
+
+        consumers.add(consumer);
+        sessions.add(session);
+        listeners.add(messageListener);
+    }
+
+    private void initializeJmsObjectsForQueue() throws JMSException {
+        for (int i = 0; i < threads; i++) {
+            Session session = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
+
+            if (destination == null)
+                destination = session.createQueue(destinationName);
+
+            MessageConsumer consumer = session.createConsumer(destination);
+
+            IgniteJmsMessageListener messageListener = new IgniteJmsMessageListener(session, false);
+            consumer.setMessageListener(messageListener);
+
+            consumers.add(consumer);
+            sessions.add(session);
+            listeners.add(messageListener);
+        }
+    }
+
+    private void processMessage(T message) {
+        final IgniteDataStreamer<K, V> streamer = getStreamer();
+
+        Map<K, V> entries = transformer.apply(message);
+
+        if (entries == null || entries.size() == 0)
+            return;
+
+        streamer.addData(entries);
+    }
+
+    /**
+     * Message listener for queues.
+     */
+    private class IgniteJmsMessageListener implements MessageListener {
+
+        private Session session;
+        private AtomicInteger counter = new AtomicInteger(0);
+        private Executor executor;
+
+        public IgniteJmsMessageListener(Session session, boolean createThreadPool) {
+            this.session = session;
+
+            // if we don't need a thread pool, create a dummy one that executes the task synchronously
+            //noinspection NullableProblems
+            this.executor = createThreadPool ? Executors.newFixedThreadPool(threads) : new Executor() {
+                @Override
+                public void execute(Runnable command) {
+                    command.run();
+                }
+            };
+        }
+
+        @Override
+        public void onMessage(final Message message) {
+            if (stopped) {
+                return;
+            }
+
+            executor.execute(new Runnable() {
+                @Override @SuppressWarnings("unchecked")
+                public void run() {
+                    processMessage((T)message);
+                    if (batched) {
+                        // batch completion may be handled by timer only
+                        if (batchClosureSize <= 0)
+                            return;
+
+                        else if (counter.incrementAndGet() >= batchClosureSize) {
+                            try {
+                                session.commit();
+                                counter.set(0);
+                            }
+                            catch (Exception e) {
+                                log.warning("Could not commit JMS session upon completion of batch.", e);
+                            }
+                        }
+                    }
+                    else if (transacted) {
+                        try {
+                            session.commit();
+                        }
+                        catch (JMSException e) {
+                            log.warning("Could not commit JMS session (non-batched).", e);
+                        }
+                    }
+                }
+            });
+
+        }
+
+        public void resetBatchCounter() {
+            counter.set(0);
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d701127/modules/jms11/src/main/java/org/apache/ignite/stream/jms11/MessageTransformer.java
----------------------------------------------------------------------
diff --git a/modules/jms11/src/main/java/org/apache/ignite/stream/jms11/MessageTransformer.java b/modules/jms11/src/main/java/org/apache/ignite/stream/jms11/MessageTransformer.java
new file mode 100644
index 0000000..3cb0231
--- /dev/null
+++ b/modules/jms11/src/main/java/org/apache/ignite/stream/jms11/MessageTransformer.java
@@ -0,0 +1,43 @@
+/*
+ * 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.stream.jms11;
+
+import org.jetbrains.annotations.*;
+
+import javax.jms.*;
+import java.util.*;
+
+/**
+ * Implement this interface to transform from a {@link Message} to a set of cache entries in the form of a {@link Map}.
+ *
+ * @param <T> The type of JMS Message.
+ * @param <K> The type of the cache key.
+ * @param <V> The type of the cache value.
+ * @author Raul Kripalani
+ */
+public interface MessageTransformer<T extends Message, K, V> {
+
+    /**
+     * Transformation function.
+     *
+     * @param message The message received from the JMS broker.
+     * @return Set of cache entries to add to the cache. It could be empty or null if the message should be skipped.
+     */
+    @Nullable Map<K, V> apply(T message);
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d701127/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
----------------------------------------------------------------------
diff --git a/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java b/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
new file mode 100644
index 0000000..f1c107d
--- /dev/null
+++ b/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTest.java
@@ -0,0 +1,551 @@
+/*
+ * 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.stream.jms11;
+
+import org.apache.activemq.*;
+import org.apache.activemq.broker.*;
+import org.apache.activemq.broker.region.*;
+import org.apache.activemq.broker.region.policy.*;
+import org.apache.activemq.command.*;
+import org.apache.ignite.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import org.junit.*;
+
+import javax.jms.*;
+import javax.jms.Destination;
+import javax.jms.Message;
+import javax.jms.Queue;
+import javax.jms.Topic;
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.events.EventType.*;
+
+/**
+ * Test for {@link JmsStreamer}. Tests both queues and topics.
+ *
+ * @author Raul Kripalani
+ */
+public class IgniteJmsStreamerTest extends GridCommonAbstractTest {
+
+    private static final int CACHE_ENTRY_COUNT = 100;
+    private static final String QUEUE_NAME = "ignite.test.queue";
+    private static final String TOPIC_NAME = "ignite.test.topic";
+    private static final Map<String, String> TEST_DATA = new HashMap<>();
+
+    static {
+        for (int i = 1; i <= CACHE_ENTRY_COUNT; i++)
+            TEST_DATA.put(Integer.toString(i), "v" + i);
+    }
+
+    private BrokerService broker;
+    private ConnectionFactory connectionFactory;
+
+    /** Constructor. */
+    public IgniteJmsStreamerTest() {
+        super(true);
+    }
+
+    @Before @SuppressWarnings("unchecked")
+    public void beforeTest() throws Exception {
+        grid().<Integer, String>getOrCreateCache(defaultCacheConfiguration());
+
+        broker = new BrokerService();
+        broker.deleteAllMessages();
+        broker.setPersistent(false);
+
+        PolicyMap policyMap = new PolicyMap();
+        PolicyEntry policy = new PolicyEntry();
+        policy.setQueuePrefetch(1);
+        broker.setDestinationPolicy(policyMap);
+        broker.getDestinationPolicy().setDefaultEntry(policy);
+
+        broker.start(true);
+
+        connectionFactory = new ActiveMQConnectionFactory(BrokerRegistry.getInstance().findFirst().getVmConnectorURI());
+
+    }
+
+    @After
+    public void afterTest() throws Exception {
+        grid().cache(null).clear();
+
+        broker.deleteAllMessages();
+        broker.stop();
+    }
+
+    public void testQueueFromName() throws Exception {
+        Destination destination = new ActiveMQQueue(QUEUE_NAME);
+
+        // produce messages into the queue
+        produceObjectMessages(destination, false);
+
+        try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+            JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
+            jmsStreamer.setDestinationType(Queue.class);
+            jmsStreamer.setDestinationName(QUEUE_NAME);
+
+            // subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
+            CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
+
+            jmsStreamer.start();
+
+            // all cache PUT events received in 10 seconds
+            latch.await(10, TimeUnit.SECONDS);
+
+            assertAllCacheEntriesLoaded();
+
+            jmsStreamer.stop();
+        }
+
+    }
+
+    public void testTopicFromName() throws JMSException, InterruptedException {
+        Destination destination = new ActiveMQTopic(TOPIC_NAME);
+
+        // should not produced messages until subscribed to the topic; otherwise they will be missed because this is not
+        // a durable subscriber (for which a dedicated test exists)
+
+        try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+            JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
+            jmsStreamer.setDestinationType(Topic.class);
+            jmsStreamer.setDestinationName(TOPIC_NAME);
+
+            // subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
+            CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
+
+            jmsStreamer.start();
+
+            // produce messages
+            produceObjectMessages(destination, false);
+
+            // all cache PUT events received in 10 seconds
+            latch.await(10, TimeUnit.SECONDS);
+
+            assertAllCacheEntriesLoaded();
+
+            jmsStreamer.stop();
+        }
+
+    }
+
+    public void testQueueFromExplicitDestination() throws Exception {
+        Destination destination = new ActiveMQQueue(QUEUE_NAME);
+
+        // produce messages into the queue
+        produceObjectMessages(destination, false);
+
+        try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+            JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
+            jmsStreamer.setDestination(destination);
+
+            // subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
+            CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
+
+            // start the streamer
+            jmsStreamer.start();
+
+            // all cache PUT events received in 10 seconds
+            latch.await(10, TimeUnit.SECONDS);
+
+            assertAllCacheEntriesLoaded();
+
+            jmsStreamer.stop();
+        }
+
+    }
+
+    public void testTopicFromExplicitDestination() throws JMSException, InterruptedException {
+        Destination destination = new ActiveMQTopic(TOPIC_NAME);
+
+        // should not produced messages until subscribed to the topic; otherwise they will be missed because this is not
+        // a durable subscriber (for which a dedicated test exists)
+
+        try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+            JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
+            jmsStreamer.setDestination(destination);
+
+            // subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
+            CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
+
+            jmsStreamer.start();
+
+            // produce messages
+            produceObjectMessages(destination, false);
+
+            // all cache PUT events received in 10 seconds
+            latch.await(10, TimeUnit.SECONDS);
+
+            assertAllCacheEntriesLoaded();
+
+            jmsStreamer.stop();
+        }
+
+    }
+
+    public void testInsertMultipleCacheEntriesFromOneMessage() throws Exception {
+        Destination destination = new ActiveMQQueue(QUEUE_NAME);
+
+        // produce A SINGLE MESSAGE, containing all data, into the queue
+        produceStringMessages(destination, true);
+
+        try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+            JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
+            jmsStreamer.setDestination(destination);
+
+            // subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
+            CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
+
+            jmsStreamer.start();
+
+            // all cache PUT events received in 10 seconds
+            latch.await(10, TimeUnit.SECONDS);
+
+            assertAllCacheEntriesLoaded();
+
+            jmsStreamer.stop();
+        }
+
+    }
+
+    public void testDurableSubscriberStartStopStart() throws Exception {
+        Destination destination = new ActiveMQTopic(TOPIC_NAME);
+
+        try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+            JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
+            jmsStreamer.setDestination(destination);
+            jmsStreamer.setDurableSubscription(true);
+            jmsStreamer.setClientId(Long.toString(System.currentTimeMillis()));
+            jmsStreamer.setDurableSubscriptionName("ignite-test-durable");
+
+            // we start the streamer so that the durable subscriber registers itself
+            jmsStreamer.start();
+
+            // we stop it immediately
+            jmsStreamer.stop();
+
+            // we assert that there are no clients of the broker (to make sure we disconnected properly)
+            assertEquals(0, broker.getCurrentConnections());
+
+            // we send messages while we're still away
+            produceStringMessages(destination, false);
+
+            // subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
+            CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
+
+            jmsStreamer.start();
+
+            // all cache PUT events received in 10 seconds
+            latch.await(10, TimeUnit.SECONDS);
+
+            assertAllCacheEntriesLoaded();
+
+            jmsStreamer.stop();
+        }
+
+    }
+
+    public void testQueueMessagesConsumedInBatchesCompletionSizeBased() throws Exception {
+        Destination destination = new ActiveMQQueue(QUEUE_NAME);
+
+        // produce multiple messages into the queue
+        produceStringMessages(destination, false);
+
+        try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+            JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
+            jmsStreamer.setDestination(destination);
+            jmsStreamer.setBatched(true);
+            jmsStreamer.setBatchClosureSize(99);
+
+            // disable time-based session commits
+            jmsStreamer.setBatchClosureMillis(0);
+
+            // subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
+            CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
+
+            jmsStreamer.start();
+
+            // all cache PUT events received in 10 seconds
+            latch.await(10, TimeUnit.SECONDS);
+
+            assertAllCacheEntriesLoaded();
+
+            // we expect all entries to be loaded, but still one (uncommitted) message should remain in the queue
+            // as observed by the broker
+            DestinationStatistics qStats = broker.getBroker().getDestinationMap().get(destination).getDestinationStatistics();
+            assertEquals(1, qStats.getMessages().getCount());
+            assertEquals(1, qStats.getInflight().getCount());
+
+            jmsStreamer.stop();
+        }
+
+    }
+
+    public void testQueueMessagesConsumedInBatchesCompletionTimeBased() throws Exception {
+        Destination destination = new ActiveMQQueue(QUEUE_NAME);
+
+        // produce multiple messages into the queue
+        produceStringMessages(destination, false);
+
+        try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+            JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
+            jmsStreamer.setDestination(destination);
+            jmsStreamer.setBatched(true);
+            jmsStreamer.setBatchClosureMillis(2000);
+            // disable size-based session commits
+            jmsStreamer.setBatchClosureSize(0);
+
+            // subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
+            CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
+            DestinationStatistics qStats = broker.getBroker().getDestinationMap().get(destination).getDestinationStatistics();
+
+            jmsStreamer.start();
+
+            // all messages are still inflight
+            assertEquals(CACHE_ENTRY_COUNT, qStats.getMessages().getCount());
+            assertEquals(0, qStats.getDequeues().getCount());
+
+            // wait a little bit
+            Thread.sleep(100);
+
+            // all messages are still inflight
+            assertEquals(CACHE_ENTRY_COUNT, qStats.getMessages().getCount());
+            assertEquals(0, qStats.getDequeues().getCount());
+
+            // now let the scheduler execute
+            Thread.sleep(2100);
+
+            // all messages are committed
+            assertEquals(0, qStats.getMessages().getCount());
+            assertEquals(CACHE_ENTRY_COUNT, qStats.getDequeues().getCount());
+
+            latch.await(5, TimeUnit.SECONDS);
+
+            assertAllCacheEntriesLoaded();
+
+            jmsStreamer.stop();
+        }
+
+    }
+
+    public void testGenerateNoEntries() throws Exception {
+        Destination destination = new ActiveMQQueue(QUEUE_NAME);
+
+        // produce multiple messages into the queue
+        produceStringMessages(destination, false);
+
+        try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+            JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
+            // override the transformer with one that generates no cache entries
+            jmsStreamer.setTransformer(TestTransformers.generateNoEntries());
+            jmsStreamer.setDestination(destination);
+
+            // subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
+            CountDownLatch latch = subscribeToPutEvents(1);
+
+            jmsStreamer.start();
+
+            // no cache PUT events were received in 3 seconds, i.e. CountDownLatch does not fire
+            assertFalse(latch.await(3, TimeUnit.SECONDS));
+
+            jmsStreamer.stop();
+        }
+
+    }
+
+    public void testTransactedSessionNoBatching() throws Exception {
+        Destination destination = new ActiveMQQueue(QUEUE_NAME);
+
+        // produce multiple messages into the queue
+        produceStringMessages(destination, false);
+
+        try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+            JmsStreamer<TextMessage, String, String> jmsStreamer = newJmsStreamer(TextMessage.class, dataStreamer);
+            jmsStreamer.setTransacted(true);
+            jmsStreamer.setDestination(destination);
+
+            // subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
+            CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
+
+            jmsStreamer.start();
+
+            // all cache PUT events received in 10 seconds
+            latch.await(10, TimeUnit.SECONDS);
+
+            assertAllCacheEntriesLoaded();
+
+            jmsStreamer.stop();
+        }
+
+    }
+
+    public void testQueueMultipleThreads() throws Exception {
+        Destination destination = new ActiveMQQueue(QUEUE_NAME);
+
+        // produce messages into the queue
+        produceObjectMessages(destination, false);
+
+        try (IgniteDataStreamer<String, String> dataStreamer = grid().dataStreamer(null)) {
+            JmsStreamer<ObjectMessage, String, String> jmsStreamer = newJmsStreamer(ObjectMessage.class, dataStreamer);
+            jmsStreamer.setDestination(destination);
+            jmsStreamer.setThreads(5);
+
+            // subscribe to cache PUT events and return a countdown latch starting at CACHE_ENTRY_COUNT
+            CountDownLatch latch = subscribeToPutEvents(CACHE_ENTRY_COUNT);
+
+            // start the streamer
+            jmsStreamer.start();
+
+            DestinationStatistics qStats = broker.getBroker().getDestinationMap().get(destination).getDestinationStatistics();
+            assertEquals(5, qStats.getConsumers().getCount());
+
+            // all cache PUT events received in 10 seconds
+            latch.await(10, TimeUnit.SECONDS);
+
+            // assert that all consumers received messages - given that the prefetch is 1
+            for (Subscription subscription : broker.getBroker().getDestinationMap().get(destination).getConsumers())
+                assertTrue(subscription.getDequeueCounter() > 0);
+
+            assertAllCacheEntriesLoaded();
+
+            jmsStreamer.stop();
+        }
+
+    }
+
+    private void assertAllCacheEntriesLoaded() {
+        // Get the cache and check that the entries are present
+        IgniteCache<String, String> cache = grid().cache(null);
+        for (Map.Entry<String, String> entry : TEST_DATA.entrySet())
+            assertEquals(entry.getValue(), cache.get(entry.getKey()));
+    }
+
+    @SuppressWarnings("unchecked")
+    private <T extends Message> JmsStreamer<T, String, String> newJmsStreamer(Class<T> type,
+        IgniteDataStreamer<String, String> dataStreamer) {
+
+        JmsStreamer<T, String, String> jmsStreamer = new JmsStreamer<>();
+        jmsStreamer.setIgnite(grid());
+        jmsStreamer.setStreamer(dataStreamer);
+        jmsStreamer.setConnectionFactory(connectionFactory);
+
+        if (type == ObjectMessage.class) {
+            jmsStreamer.setTransformer((MessageTransformer<T, String, String>) TestTransformers.forObjectMessage());
+        }
+        else {
+            jmsStreamer.setTransformer((MessageTransformer<T, String, String>) TestTransformers.forTextMessage());
+        }
+
+        dataStreamer.allowOverwrite(true);
+        dataStreamer.autoFlushFrequency(10);
+        return jmsStreamer;
+    }
+
+    private CountDownLatch subscribeToPutEvents(int expect) {
+        Ignite ignite = grid();
+
+        // Listen to cache PUT events and expect as many as messages as test data items
+        final CountDownLatch latch = new CountDownLatch(expect);
+        @SuppressWarnings("serial") IgniteBiPredicate<UUID, CacheEvent> callback = new IgniteBiPredicate<UUID, CacheEvent>() {
+            @Override public boolean apply(UUID uuid, CacheEvent evt) {
+                latch.countDown();
+                return true;
+            }
+        };
+
+        ignite.events(ignite.cluster().forCacheNodes(null)).remoteListen(callback, null, EVT_CACHE_OBJECT_PUT);
+        return latch;
+    }
+
+    private void produceObjectMessages(Destination destination, boolean singleMessage) throws JMSException {
+        Session session = connectionFactory.createConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
+        MessageProducer mp = session.createProducer(destination);
+        HashSet<TestTransformers.TestObject> set = new HashSet<>();
+
+        for (String key : TEST_DATA.keySet()) {
+            TestTransformers.TestObject to = new TestTransformers.TestObject(key, TEST_DATA.get(key));
+            set.add(to);
+        }
+
+        int messagesSent;
+        if (singleMessage) {
+            mp.send(session.createObjectMessage(set));
+            messagesSent = 1;
+        }
+        else {
+            for (TestTransformers.TestObject to : set)
+                mp.send(session.createObjectMessage(to));
+
+            messagesSent = set.size();
+        }
+
+        if (destination instanceof Queue) {
+            try {
+                assertEquals(messagesSent, broker.getBroker().getDestinationMap().get(destination)
+                    .getDestinationStatistics().getMessages().getCount());
+            }
+            catch (Exception e) {
+                fail(e.toString());
+            }
+        }
+
+    }
+
+    private void produceStringMessages(Destination destination, boolean singleMessage) throws JMSException {
+        Session session = connectionFactory.createConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);
+        MessageProducer mp = session.createProducer(destination);
+        HashSet<String> set = new HashSet<>();
+
+        for (String key : TEST_DATA.keySet())
+            set.add(key + "," + TEST_DATA.get(key));
+
+        int messagesSent;
+        if (singleMessage) {
+            StringBuilder sb = new StringBuilder();
+
+            for (String s : set)
+                sb.append(s).append("|");
+
+            sb.deleteCharAt(sb.length() - 1);
+            mp.send(session.createTextMessage(sb.toString()));
+            messagesSent = 1;
+
+        }
+        else {
+            for (String s : set) {
+                mp.send(session.createTextMessage(s));
+            }
+            messagesSent = set.size();
+        }
+
+        if (destination instanceof Queue) {
+            try {
+                assertEquals(messagesSent, broker.getBroker().getDestinationMap().get(destination)
+                    .getDestinationStatistics().getMessages().getCount());
+            }
+            catch (Exception e) {
+                fail(e.toString());
+            }
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d701127/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTestSuite.java b/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTestSuite.java
new file mode 100644
index 0000000..e299f04
--- /dev/null
+++ b/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/IgniteJmsStreamerTestSuite.java
@@ -0,0 +1,34 @@
+/*
+ * 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.stream.jms11;
+
+import org.junit.runner.*;
+import org.junit.runners.*;
+
+/**
+ * JMS streamer tests.
+ *
+ * @author Raul Kripalani
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+    IgniteJmsStreamerTest.class
+})
+public class IgniteJmsStreamerTestSuite {
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d701127/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/TestTransformers.java
----------------------------------------------------------------------
diff --git a/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/TestTransformers.java b/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/TestTransformers.java
new file mode 100644
index 0000000..ce001a1
--- /dev/null
+++ b/modules/jms11/src/test/java/org/apache/ignite/stream/jms11/TestTransformers.java
@@ -0,0 +1,123 @@
+/*
+ * 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.stream.jms11;
+
+import javax.jms.*;
+import java.io.*;
+import java.util.*;
+
+/**
+ * Test transformers for JmsStreamer tests.
+ *
+ * @author Raul Kripalani
+ */
+public class TestTransformers {
+
+    /**
+     * Returns a transformer for JMS {@link TextMessage}s, capable of extracting many tuples from a single message,
+     * if pipe characters are encountered.
+     *
+     * @return
+     */
+    public static MessageTransformer<TextMessage, String, String> forTextMessage() {
+        return new MessageTransformer<TextMessage, String, String>() {
+            @Override
+            public Map<String, String> apply(TextMessage message) {
+                final Map<String, String> answer = new HashMap<>();
+                String text;
+                try {
+                    text = message.getText();
+                }
+                catch (JMSException e) {
+                    e.printStackTrace();
+                    return Collections.emptyMap();
+                }
+                for (String s : text.split("\\|")) {
+                    String[] tokens = s.split(",");
+                    answer.put(tokens[0], tokens[1]);
+                }
+                return answer;
+            }
+        };
+    }
+
+    /**
+     * Returns a transformer for JMS {@link ObjectMessage}s, capable of extracting many tuples from a single message,
+     * if the payload is a {@link Collection}.
+     *
+     * @return
+     */
+    public static MessageTransformer<ObjectMessage, String, String> forObjectMessage() {
+        return new MessageTransformer<ObjectMessage, String, String>() {
+            @Override @SuppressWarnings("unchecked")
+            public Map<String, String> apply(ObjectMessage message) {
+                Object object;
+                try {
+                    object = message.getObject();
+                }
+                catch (JMSException e) {
+                    e.printStackTrace();
+                    return Collections.emptyMap();
+                }
+
+                final Map<String, String> answer = new HashMap<>();
+                if (object instanceof Collection) {
+                    for (TestObject to : (Collection<TestObject>)object)
+                        answer.put(to.getKey(), to.getValue());
+
+                }
+                else if (object instanceof TestObject) {
+                    TestObject to = (TestObject)object;
+                    answer.put(to.getKey(), to.getValue());
+                }
+                return answer;
+            }
+        };
+    }
+
+    public static MessageTransformer<TextMessage, String, String> generateNoEntries() {
+        return new MessageTransformer<TextMessage, String, String>() {
+            @Override
+            public Map<String, String> apply(TextMessage message) {
+                return null;
+            }
+        };
+    }
+
+    public static class TestObject implements Serializable {
+        private static final long serialVersionUID = -7332027566186690945L;
+
+        private String key;
+        private String value;
+
+        public TestObject(String key, String value) {
+            this.key = key;
+            this.value = value;
+        }
+
+        public String getKey() {
+            return key;
+        }
+
+        public String getValue() {
+            return value;
+        }
+
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0d701127/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4d53d96..f3a5d65 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,6 +74,7 @@
         <module>modules/mesos</module>
         <module>modules/kafka</module>
         <module>modules/yarn</module>
+        <module>modules/jms11</module>
     </modules>
 
     <profiles>


[20/50] incubator-ignite git commit: ignite-946: renamed VersionedEntry to CacheEntry

Posted by vo...@apache.org.
ignite-946: renamed VersionedEntry to CacheEntry


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 4f8f32af80d2c13df3fd8d3c5b302c0fd04906c5
Parents: 954c459
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu Aug 13 09:10:45 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu Aug 13 09:10:45 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/cache/CacheEntry.java     | 94 ++++++++++++++++++++
 .../ignite/cache/version/VersionedEntry.java    | 92 -------------------
 .../ignite/cache/version/package-info.java      | 21 -----
 .../processors/cache/CacheEntryImpl.java        |  6 +-
 .../processors/cache/CacheEntryImpl0.java       |  6 +-
 .../processors/cache/CacheEntryImplEx.java      | 83 +++++++++++++++++
 .../processors/cache/CacheInvokeEntry.java      |  6 +-
 .../processors/cache/GridCacheEntryEx.java      |  2 +-
 .../processors/cache/GridCacheMapEntry.java     | 12 +--
 .../cache/version/CacheVersionedEntryImpl.java  | 83 -----------------
 .../resources/META-INF/classnames.properties    |  3 +-
 .../processors/cache/GridCacheTestEntryEx.java  |  2 +-
 .../CacheVersionedEntryAbstractTest.java        | 27 +++---
 13 files changed, 209 insertions(+), 228 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f8f32af/modules/core/src/main/java/org/apache/ignite/cache/CacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheEntry.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheEntry.java
new file mode 100644
index 0000000..a6a2aa3
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheEntry.java
@@ -0,0 +1,94 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+
+import javax.cache.*;
+import javax.cache.processor.*;
+import java.util.*;
+
+/**
+ * Cache entry that extends {@link javax.cache.Cache.Entry} by providing additional entry related information.
+ *
+ * To get an instance of {@code CacheEntry} use {@link javax.cache.Cache.Entry#unwrap(Class)} method by passing
+ * {@code CacheEntry} class to it as the argument.
+ * <p>
+ * {@code CacheEntry} is supported only for {@link javax.cache.Cache.Entry} returned by one of the following methods:
+ * <ul>
+ * <li>{@link javax.cache.Cache#invoke(Object, EntryProcessor, Object...)}</li>
+ * <li>{@link javax.cache.Cache#invokeAll(Set, EntryProcessor, Object...)}</li>
+ * <li>invoke and invokeAll methods of {@link IgniteCache}</li>
+ * <li>{@link IgniteCache#randomEntry()}</li>
+ * </ul>
+ * <p>
+ * {@code CacheEntry} is not supported for {@link javax.cache.Cache#iterator()} because of performance reasons.
+ * {@link javax.cache.Cache#iterator()} loads entries from all the cluster nodes and to speed up the load additional
+ * information, like entry's version, is ignored.
+ *
+ * <h2 class="header">Java Example</h2>
+ * <pre name="code" class="java">
+ * IgniteCache<Integer, String> cache = grid(0).cache(null);
+ *
+ * CacheEntry<String, Integer> entry1 = cache.invoke(100,
+ *     new EntryProcessor<Integer, String, CacheEntry<String, Integer>>() {
+ *          public CacheEntry<String, Integer> process(MutableEntry<Integer, String> entry,
+ *              Object... arguments) throws EntryProcessorException {
+ *                  return entry.unwrap(CacheEntry.class);
+ *          }
+ *     });
+ *
+ * // Cache entry for the given key may be updated at some point later.
+ *
+ * CacheEntry<String, Integer> entry2 = cache.invoke(100,
+ *     new EntryProcessor<Integer, String, CacheEntry<String, Integer>>() {
+ *          public CacheEntry<String, Integer> process(MutableEntry<Integer, String> entry,
+ *              Object... arguments) throws EntryProcessorException {
+ *                  return entry.unwrap(CacheEntry.class);
+ *          }
+ *     });
+ *
+ * // Comparing entries' versions.
+ * if (entry1.version().compareTo(entry2.version()) < 0) {
+ *     // the entry has been updated
+ * }
+ * </pre>
+ */
+public interface CacheEntry<K, V> extends Cache.Entry<K, V> {
+    /**
+     * Returns a comparable object representing the version of this cache entry.
+     * <p>
+     * It is valid to compare cache entries' versions for the same key. In this case the latter update will be
+     * represented by a higher version. The result of versions comparison of cache entries of different keys is
+     * undefined.
+     *
+     * @return Version of this cache entry.
+     */
+    public Comparable version();
+
+    /**
+     * Returns the time when the cache entry for the given key has been updated or initially created.
+     * <p>
+     * It is valid to compare cache entries' update time for the same key. In this case the latter update will
+     * be represented by higher update time. The result of update time comparison of cache entries of different keys is
+     * undefined.
+     *
+     * @return Time in milliseconds.
+     */
+    public long updateTime();
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f8f32af/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java b/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
deleted file mode 100644
index 135d681..0000000
--- a/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
+++ /dev/null
@@ -1,92 +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.version;
-
-import org.apache.ignite.*;
-
-import javax.cache.*;
-import javax.cache.processor.*;
-import java.util.*;
-
-/**
- * Cache entry that stores entry's version related information along with its data.
- *
- * To get a {@code VersionedEntry} of an {@link Cache.Entry} use {@link Cache.Entry#unwrap(Class)} by passing
- * {@code VersionedEntry} class to it as the argument.
- * <p>
- * {@code VersionedEntry} is supported only for {@link Cache.Entry} returned by one of the following methods:
- * <ul>
- * <li>{@link Cache#invoke(Object, EntryProcessor, Object...)}</li>
- * <li>{@link Cache#invokeAll(Set, EntryProcessor, Object...)}</li>
- * <li>invoke and invokeAll methods of {@link IgniteCache}</li>
- * <li>{@link IgniteCache#randomEntry()}</li>
- * </ul>
- * <p>
- * {@code VersionedEntry} is not supported for {@link Cache#iterator()} because of performance reasons.
- * {@link Cache#iterator()} loads entries from all the cluster nodes and to speed up the load version information
- * is excluded from responses.
- * <h2 class="header">Java Example</h2>
- * <pre name="code" class="java">
- * IgniteCache<Integer, String> cache = grid(0).cache(null);
- *
- * VersionedEntry<String, Integer> entry1 = cache.invoke(100,
- *     new EntryProcessor<Integer, String, VersionedEntry<String, Integer>>() {
- *          public VersionedEntry<String, Integer> process(MutableEntry<Integer, String> entry,
- *              Object... arguments) throws EntryProcessorException {
- *                  return entry.unwrap(VersionedEntry.class);
- *          }
- *     });
- *
- * // Cache entry for the given key may be updated at some point later.
- *
- * VersionedEntry<String, Integer> entry2 = cache.invoke(100,
- *     new EntryProcessor<Integer, String, VersionedEntry<String, Integer>>() {
- *          public VersionedEntry<String, Integer> process(MutableEntry<Integer, String> entry,
- *              Object... arguments) throws EntryProcessorException {
- *                  return entry.unwrap(VersionedEntry.class);
- *          }
- *     });
- *
- * if (entry1.version().compareTo(entry2.version()) < 0) {
- *     // the entry has been updated
- * }
- * </pre>
- */
-public interface VersionedEntry<K, V> extends Cache.Entry<K, V> {
-    /**
-     * Returns a comparable object representing the version of this cache entry.
-     * <p>
-     * It is valid to compare cache entries' versions for the same key. In this case the latter update will be
-     * represented by a higher version. The result of versions comparison of cache entries of different keys is
-     * undefined.
-     *
-     * @return Version of this cache entry.
-     */
-    public Comparable version();
-
-    /**
-     * Returns the time when the cache entry for the given key has been updated or initially created.
-     * <p>
-     * It is valid to compare cache entries' update time for the same key. In this case the latter update will
-     * be represented by higher update time. The result of update time comparison of cache entries of different keys is
-     * undefined.
-     *
-     * @return Time in milliseconds.
-     */
-    public long updateTime();
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f8f32af/modules/core/src/main/java/org/apache/ignite/cache/version/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/version/package-info.java b/modules/core/src/main/java/org/apache/ignite/cache/version/package-info.java
deleted file mode 100644
index 50ceb13..0000000
--- a/modules/core/src/main/java/org/apache/ignite/cache/version/package-info.java
+++ /dev/null
@@ -1,21 +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.
- */
-
-/**
- * Contains cache versioned entry interface.
- */
-package org.apache.ignite.cache.version;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f8f32af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl.java
index 98f3616..3ef2889 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl.java
@@ -17,7 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache;
 
-import org.apache.ignite.cache.version.*;
+import org.apache.ignite.cache.*;
 import org.apache.ignite.internal.processors.cache.version.*;
 
 import javax.cache.*;
@@ -82,8 +82,8 @@ public class CacheEntryImpl<K, V> implements Cache.Entry<K, V>, Externalizable {
         if(cls.isAssignableFrom(getClass()))
             return cls.cast(this);
 
-        if (ver != null && cls.isAssignableFrom(VersionedEntry.class))
-            return (T)new CacheVersionedEntryImpl<>(key, val, ver);
+        if (ver != null && cls.isAssignableFrom(CacheEntry.class))
+            return (T)new CacheEntryImplEx<>(key, val, ver);
 
         throw new IllegalArgumentException("Unwrapping to class is not supported: " + cls);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f8f32af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl0.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl0.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl0.java
index 987fbd3..eabd2af 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl0.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl0.java
@@ -17,7 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache;
 
-import org.apache.ignite.cache.version.*;
+import org.apache.ignite.cache.*;
 import org.apache.ignite.internal.processors.cache.version.*;
 
 import javax.cache.*;
@@ -52,8 +52,8 @@ public class CacheEntryImpl0<K, V> implements Cache.Entry<K, V> {
     @Override public <T> T unwrap(Class<T> cls) {
         if(cls.isAssignableFrom(getClass()))
             return cls.cast(this);
-        else if (cls.isAssignableFrom(VersionedEntry.class) && e instanceof GridCacheVersionAware)
-            return (T)new CacheVersionedEntryImpl<>(e.getKey(), e.getValue(), ((GridCacheVersionAware)e).version());
+        else if (cls.isAssignableFrom(CacheEntry.class) && e instanceof GridCacheVersionAware)
+            return (T)new CacheEntryImplEx<>(e.getKey(), e.getValue(), ((GridCacheVersionAware)e).version());
 
         throw new IllegalArgumentException("Unwrapping to class is not supported: " + cls);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f8f32af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImplEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImplEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImplEx.java
new file mode 100644
index 0000000..f674ba5
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImplEx.java
@@ -0,0 +1,83 @@
+/*
+ * 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 org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.cache.version.*;
+
+import java.io.*;
+
+/**
+ *
+ */
+public class CacheEntryImplEx<K, V> extends CacheEntryImpl<K, V> implements CacheEntry<K, V> {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Version. */
+    private GridCacheVersion ver;
+
+    /**
+     * Required by {@link Externalizable}.
+     */
+    public CacheEntryImplEx() {
+        // No-op.
+    }
+
+    /**
+     * @param key Key.
+     * @param val Value (always null).
+     * @param ver Version.
+     */
+    public CacheEntryImplEx(K key, V val, GridCacheVersion ver) {
+        super(key, val);
+
+        this.ver = ver;
+    }
+
+    /** {@inheritDoc} */
+    public GridCacheVersion version() {
+        return ver;
+    }
+
+    /** {@inheritDoc} */
+    @Override public long updateTime() {
+        return ver.globalTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeExternal(ObjectOutput out) throws IOException {
+        super.writeExternal(out);
+
+        out.writeObject(ver);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+        super.readExternal(in);
+
+        ver = (GridCacheVersion)in.readObject();
+    }
+
+    /** {@inheritDoc} */
+    public String toString() {
+        return "VersionedEntry [key=" + getKey() + ", val=" + getValue() + ", topVer=" + ver.topologyVersion() +
+            ", nodeOrder=" + ver.nodeOrder() + ", order=" + ver.order() + ", updateTime=" + ver.globalTime() + ']';
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f8f32af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
index 515a4c5..711b598 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
@@ -17,7 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache;
 
-import org.apache.ignite.cache.version.*;
+import org.apache.ignite.cache.*;
 import org.apache.ignite.internal.processors.cache.version.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
@@ -122,8 +122,8 @@ public class CacheInvokeEntry<K, V> extends CacheLazyEntry<K, V> implements Muta
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public <T> T unwrap(Class<T> cls) {
-        if (cls.isAssignableFrom(VersionedEntry.class) && ver != null)
-            return (T)new CacheVersionedEntryImpl<>(getKey(), getValue(), ver);
+        if (cls.isAssignableFrom(CacheEntry.class) && ver != null)
+            return (T)new CacheEntryImplEx<>(getKey(), getValue(), ver);
 
         return super.unwrap(cls);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f8f32af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
index c2d0271..1b5a717 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
@@ -163,7 +163,7 @@ public interface GridCacheEntryEx {
      * @return Entry which holds key and version (no value, since entry
      *      is intended to be used in sync evictions checks).
      */
-    public <K, V> CacheVersionedEntryImpl<K, V> wrapVersioned();
+    public <K, V> CacheEntryImplEx<K, V> wrapVersioned();
 
     /**
      * @return Not-null version if entry is obsolete.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f8f32af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 298f7a6..17cc8dd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -3589,17 +3589,17 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
     }
 
     /** {@inheritDoc} */
-    @Override public synchronized <K, V> CacheVersionedEntryImpl<K, V> wrapVersioned() {
-        return new CacheVersionedEntryImpl<>(key.<K>value(cctx.cacheObjectContext(), false), null, ver);
+    @Override public synchronized <K, V> CacheEntryImplEx<K, V> wrapVersioned() {
+        return new CacheEntryImplEx<>(key.<K>value(cctx.cacheObjectContext(), false), null, ver);
     }
 
     /**
      * @return Entry which holds key, value and version.
      */
-    private synchronized <K, V> CacheVersionedEntryImpl<K, V> wrapVersionedWithValue() {
+    private synchronized <K, V> CacheEntryImplEx<K, V> wrapVersionedWithValue() {
         V val = this.val == null ? null : this.val.<V>value(cctx.cacheObjectContext(), false);
 
-        return new CacheVersionedEntryImpl<>(key.<K>value(cctx.cacheObjectContext(), false), val, ver);
+        return new CacheEntryImplEx<>(key.<K>value(cctx.cacheObjectContext(), false), val, ver);
     }
 
     /** {@inheritDoc} */
@@ -4028,8 +4028,8 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
             if (cls.isAssignableFrom(EvictableEntry.class))
                 return (T)wrapEviction();
 
-            if (cls.isAssignableFrom(CacheVersionedEntryImpl.class))
-                return cls == CacheVersionedEntryImpl.class ? (T)wrapVersioned() : (T)wrapVersionedWithValue();
+            if (cls.isAssignableFrom(CacheEntryImplEx.class))
+                return cls == CacheEntryImplEx.class ? (T)wrapVersioned() : (T)wrapVersionedWithValue();
 
             if (cls.isAssignableFrom(GridCacheVersion.class))
                 return (T)ver;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f8f32af/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
deleted file mode 100644
index c036bc1..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
+++ /dev/null
@@ -1,83 +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.internal.processors.cache.version;
-
-import org.apache.ignite.cache.version.*;
-import org.apache.ignite.internal.processors.cache.*;
-import org.jetbrains.annotations.*;
-
-import java.io.*;
-
-/**
- *
- */
-public class CacheVersionedEntryImpl<K, V> extends CacheEntryImpl<K, V> implements VersionedEntry<K, V> {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** Version. */
-    private GridCacheVersion ver;
-
-    /**
-     * Required by {@link Externalizable}.
-     */
-    public CacheVersionedEntryImpl() {
-        // No-op.
-    }
-
-    /**
-     * @param key Key.
-     * @param val Value (always null).
-     * @param ver Version.
-     */
-    public CacheVersionedEntryImpl(K key, V val, GridCacheVersion ver) {
-        super(key, val);
-
-        this.ver = ver;
-    }
-
-    /** {@inheritDoc} */
-    public GridCacheVersion version() {
-        return ver;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long updateTime() {
-        return ver.globalTime();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-
-        out.writeObject(ver);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        super.readExternal(in);
-
-        ver = (GridCacheVersion)in.readObject();
-    }
-
-    /** {@inheritDoc} */
-    public String toString() {
-        return "VersionedEntry [key=" + getKey() + ", val=" + getValue() + ", topVer=" + ver.topologyVersion() +
-            ", nodeOrder=" + ver.nodeOrder() + ", order=" + ver.order() + ", updateTime=" + ver.globalTime() + ']';
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f8f32af/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index ff75b02..1fb9a37 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -35,6 +35,7 @@ org.apache.ignite.cache.CacheMode
 org.apache.ignite.cache.CachePartialUpdateException
 org.apache.ignite.cache.CachePeekMode
 org.apache.ignite.cache.CacheRebalanceMode
+org.apache.ignite.cache.CacheEntry
 org.apache.ignite.cache.CacheServerNotFoundException
 org.apache.ignite.cache.CacheTypeFieldMetadata
 org.apache.ignite.cache.CacheTypeMetadata
@@ -289,7 +290,7 @@ org.apache.ignite.internal.processors.cache.CacheOperationContext
 org.apache.ignite.internal.processors.cache.CachePartialUpdateCheckedException
 org.apache.ignite.internal.processors.cache.CacheStorePartialUpdateException
 org.apache.ignite.internal.processors.cache.CacheType
-org.apache.ignite.internal.processors.cache.version.CacheVersionedEntryImpl
+org.apache.ignite.internal.processors.cache.CacheEntryImplEx
 org.apache.ignite.internal.processors.cache.CacheWeakQueryIteratorsHolder$WeakQueryFutureIterator
 org.apache.ignite.internal.processors.cache.DynamicCacheChangeBatch
 org.apache.ignite.internal.processors.cache.DynamicCacheChangeRequest

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f8f32af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
index eaa6e13..0055557 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
@@ -350,7 +350,7 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr
     }
 
     /** {@inheritDoc} */
-    @Override public CacheVersionedEntryImpl wrapVersioned() {
+    @Override public CacheEntryImplEx wrapVersioned() {
         assert false;
 
         return null;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f8f32af/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
index 9648b9b..2e1ca90 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.processors.cache.version;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.version.*;
 import org.apache.ignite.internal.processors.cache.*;
 
 import javax.cache.*;
@@ -63,7 +62,7 @@ public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractS
 
                 invoked.incrementAndGet();
 
-                VersionedEntry<Integer, String> verEntry = entry.unwrap(VersionedEntry.class);
+                CacheEntry<Integer, String> verEntry = entry.unwrap(CacheEntry.class);
 
                 checkVersionedEntry(verEntry);
 
@@ -93,7 +92,7 @@ public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractS
 
                 invoked.incrementAndGet();
 
-                VersionedEntry<Integer, String> verEntry = entry.unwrap(VersionedEntry.class);
+                CacheEntry<Integer, String> verEntry = entry.unwrap(CacheEntry.class);
 
                 checkVersionedEntry(verEntry);
 
@@ -111,7 +110,7 @@ public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractS
         IgniteCache<Integer, String> cache = grid(0).cache(null);
 
         for (int i = 0; i < 5; i++)
-            checkVersionedEntry(cache.randomEntry().unwrap(VersionedEntry.class));
+            checkVersionedEntry(cache.randomEntry().unwrap(CacheEntry.class));
     }
 
     /**
@@ -125,7 +124,7 @@ public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractS
             cache.localEntries(CachePeekMode.ONHEAP);
 
         for (Cache.Entry<Integer, String> entry : entries)
-            checkVersionedEntry(entry.unwrap(VersionedEntry.class));
+            checkVersionedEntry(entry.unwrap(CacheEntry.class));
     }
 
     /**
@@ -134,21 +133,21 @@ public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractS
     public void testVersionComparision() throws Exception {
         IgniteCache<Integer, String> cache = grid(0).cache(null);
 
-        VersionedEntry<String, Integer> ver1 = cache.invoke(100,
-            new EntryProcessor<Integer, String, VersionedEntry<String, Integer>>() {
-                @Override public VersionedEntry<String, Integer> process(MutableEntry<Integer, String> entry,
+        CacheEntry<String, Integer> ver1 = cache.invoke(100,
+            new EntryProcessor<Integer, String, CacheEntry<String, Integer>>() {
+                @Override public CacheEntry<String, Integer> process(MutableEntry<Integer, String> entry,
                     Object... arguments) throws EntryProcessorException {
-                        return entry.unwrap(VersionedEntry.class);
+                        return entry.unwrap(CacheEntry.class);
                     }
             });
 
         cache.put(100, "new value 100");
 
-        VersionedEntry<String, Integer> ver2 = cache.invoke(100,
-            new EntryProcessor<Integer, String, VersionedEntry<String, Integer>>() {
-                @Override public VersionedEntry<String, Integer> process(MutableEntry<Integer, String> entry,
+        CacheEntry<String, Integer> ver2 = cache.invoke(100,
+            new EntryProcessor<Integer, String, CacheEntry<String, Integer>>() {
+                @Override public CacheEntry<String, Integer> process(MutableEntry<Integer, String> entry,
                     Object... arguments) throws EntryProcessorException {
-                        return entry.unwrap(VersionedEntry.class);
+                        return entry.unwrap(CacheEntry.class);
                     }
             });
 
@@ -159,7 +158,7 @@ public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractS
     /**
      * @param entry Versioned entry.
      */
-    private void checkVersionedEntry(VersionedEntry<Integer, String> entry) {
+    private void checkVersionedEntry(CacheEntry<Integer, String> entry) {
         assertNotNull(entry);
 
         assertNotNull(entry.version());


[50/50] incubator-ignite git commit: Merge branch 'master' into ignite-gg-9615-1

Posted by vo...@apache.org.
Merge branch 'master' into ignite-gg-9615-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/da306521
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/da306521
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/da306521

Branch: refs/heads/ignite-gg-9615-1
Commit: da306521295cfdaaa84d51ebe69f2478d818ca0b
Parents: b73750b 09da9c2
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Wed Aug 19 10:08:43 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Wed Aug 19 10:08:43 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/cache/CacheEntry.java     |  94 ++++
 .../store/jdbc/CacheJdbcPojoStoreFactory.java   |   2 +-
 .../configuration/IgniteConfiguration.java      |   5 +-
 .../org/apache/ignite/internal/IgnitionEx.java  |  10 +-
 .../processors/cache/CacheEntryImpl.java        |  20 +
 .../processors/cache/CacheEntryImpl0.java       |   5 +
 .../processors/cache/CacheEntryImplEx.java      |  83 +++
 .../processors/cache/CacheInvokeEntry.java      |  27 +-
 .../CachePartialUpdateCheckedException.java     |  29 +-
 .../cache/CacheVersionedEntryImpl.java          |  80 ---
 .../processors/cache/GridCacheAdapter.java      | 174 +++++-
 .../processors/cache/GridCacheEntryEx.java      |   2 +-
 .../processors/cache/GridCacheGateway.java      |   5 +-
 .../processors/cache/GridCacheMapEntry.java     |  32 +-
 .../processors/cache/GridCacheSwapManager.java  |  82 ++-
 .../distributed/dht/GridDhtTxPrepareFuture.java |   2 +-
 .../GridDhtUnreservedPartitionException.java    |  66 +++
 .../dht/atomic/GridDhtAtomicCache.java          |   3 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |  63 ++-
 .../near/GridNearOptimisticTxPrepareFuture.java |   2 +-
 .../local/atomic/GridLocalAtomicCache.java      |   3 +-
 .../cache/query/GridCacheQueryAdapter.java      |  56 +-
 .../cache/query/GridCacheQueryManager.java      |  71 ++-
 .../cache/transactions/IgniteTxAdapter.java     |  16 +-
 .../cache/transactions/IgniteTxEntry.java       |  16 +-
 .../transactions/IgniteTxLocalAdapter.java      |  83 ++-
 .../cache/version/GridCacheVersion.java         |   2 +-
 .../cache/version/GridCacheVersionAware.java    |  30 +
 .../cache/version/GridCacheVersionManager.java  |   5 +-
 .../clock/GridClockSyncProcessor.java           |   2 +-
 .../continuous/GridContinuousProcessor.java     |  60 +-
 .../ignite/internal/util/GridArgumentCheck.java |  17 +
 .../ignite/internal/util/nio/GridNioServer.java |   4 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java    |  83 ++-
 .../spi/discovery/tcp/TcpDiscoveryImpl.java     |   4 +-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  49 +-
 .../tcp/internal/TcpDiscoveryNode.java          |  18 +-
 .../tcp/internal/TcpDiscoveryNodesRing.java     |  23 +
 .../resources/META-INF/classnames.properties    |   3 +-
 ...cheDhtLocalPartitionAfterRemoveSelfTest.java |  33 +-
 .../cache/GridCacheAbstractFullApiSelfTest.java |   1 -
 .../processors/cache/GridCacheTestEntryEx.java  |   2 +-
 .../IgniteCacheSizeFailoverTest.java            | 115 ++++
 .../IgniteCachePutRetryAbstractSelfTest.java    | 120 +++-
 ...PutRetryAtomicPrimaryWriteOrderSelfTest.java |  32 ++
 ...ridCacheContinuousQueryAbstractSelfTest.java |   2 +-
 .../IgniteCacheContinuousQueryClientTest.java   | 137 +++++
 .../CacheVersionedEntryAbstractTest.java        | 170 ++++++
 ...nedEntryLocalAtomicSwapDisabledSelfTest.java |  45 ++
 ...ersionedEntryLocalTransactionalSelfTest.java |  40 ++
 ...edEntryPartitionedAtomicOffHeapSelfTest.java |  35 ++
 ...VersionedEntryPartitionedAtomicSelfTest.java |  35 ++
 ...PartitionedTransactionalOffHeapSelfTest.java |  36 ++
 ...edEntryPartitionedTransactionalSelfTest.java |  35 ++
 ...nedEntryReplicatedAtomicOffHeapSelfTest.java |  35 ++
 ...eVersionedEntryReplicatedAtomicSelfTest.java |  35 ++
 ...yReplicatedTransactionalOffHeapSelfTest.java |  36 ++
 ...nedEntryReplicatedTransactionalSelfTest.java |  35 ++
 .../continuous/GridEventConsumeSelfTest.java    |   4 +-
 .../tcp/IgniteCacheSslStartStopSelfTest.java    |   1 +
 .../spi/discovery/tcp/TcpDiscoverySelfTest.java | 152 ++++-
 .../TcpDiscoverySpiFailureTimeoutSelfTest.java  |   8 +-
 .../IgniteCacheFailoverTestSuite.java           |   3 +
 .../testsuites/IgniteCacheTestSuite2.java       |   1 +
 .../testsuites/IgniteCacheTestSuite4.java       |  13 +
 .../query/h2/sql/GridSqlQuerySplitter.java      |   3 +
 .../query/h2/twostep/GridMergeTable.java        |   7 +-
 .../query/h2/twostep/GridThreadLocalTable.java  |  22 +-
 ...CacheScanPartitionQueryFallbackSelfTest.java |  96 ++++
 .../query/IgniteSqlSplitterSelfTest.java        | 152 +++++
 .../IgniteCacheQuerySelfTestSuite.java          |   3 +
 modules/jms11/pom.xml                           |  98 ++++
 .../apache/ignite/stream/jms11/JmsStreamer.java | 524 ++++++++++++++++++
 .../ignite/stream/jms11/MessageTransformer.java |  43 ++
 .../stream/jms11/IgniteJmsStreamerTest.java     | 551 +++++++++++++++++++
 .../jms11/IgniteJmsStreamerTestSuite.java       |  34 ++
 .../ignite/stream/jms11/TestTransformers.java   | 123 +++++
 .../apache/ignite/logger/log4j/Log4JLogger.java |   4 +
 .../java/org/apache/ignite/IgniteSpring.java    |   8 +-
 .../util/spring/IgniteSpringHelperImpl.java     |   4 +-
 pom.xml                                         |   1 +
 scripts/git-format-patch.sh                     |   2 +-
 82 files changed, 3837 insertions(+), 330 deletions(-)
----------------------------------------------------------------------



[28/50] incubator-ignite git commit: Fixed threads cleanup in continuous processor

Posted by vo...@apache.org.
Fixed threads cleanup in continuous processor


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 8ecddcc2dcb064b759486d43a4f09173f268b3cf
Parents: 260238e
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Thu Aug 13 16:25:09 2015 -0700
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Thu Aug 13 16:25:09 2015 -0700

----------------------------------------------------------------------
 .../internal/processors/continuous/GridEventConsumeSelfTest.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8ecddcc2/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/GridEventConsumeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/GridEventConsumeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/GridEventConsumeSelfTest.java
index 5ce2efd..7ab858b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/GridEventConsumeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/continuous/GridEventConsumeSelfTest.java
@@ -26,7 +26,6 @@ import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.resources.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -125,6 +124,7 @@ public class GridEventConsumeSelfTest extends GridCommonAbstractTest {
                 assertEquals(0, U.<Map>field(proc, "rmtInfos").size());
                 assertEquals(0, U.<Map>field(proc, "startFuts").size());
                 assertEquals(0, U.<Map>field(proc, "stopFuts").size());
+                assertEquals(0, U.<Map>field(proc, "bufCheckThreads").size());
             }
         }
         finally {
@@ -754,7 +754,7 @@ public class GridEventConsumeSelfTest extends GridCommonAbstractTest {
      */
     public void testNodeJoinWithP2P() throws Exception {
         fail("https://issues.apache.org/jira/browse/IGNITE-585");
-        
+
         final Collection<UUID> nodeIds = new HashSet<>();
         final AtomicInteger cnt = new AtomicInteger();
         final CountDownLatch latch = new CountDownLatch(GRID_CNT + 1);


[47/50] incubator-ignite git commit: master - OFFSET clause fix IGNITE-1259

Posted by vo...@apache.org.
master - OFFSET clause fix IGNITE-1259


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

Branch: refs/heads/ignite-gg-9615-1
Commit: d31c8c6477e03563bf73db3cf216250b9c22b562
Parents: 9c939be
Author: S.Vladykin <sv...@gridgain.com>
Authored: Mon Aug 17 21:25:25 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Mon Aug 17 21:25:25 2015 +0300

----------------------------------------------------------------------
 .../query/h2/sql/GridSqlQuerySplitter.java      |   3 +
 .../query/IgniteSqlSplitterSelfTest.java        | 152 +++++++++++++++++++
 .../IgniteCacheQuerySelfTestSuite.java          |   2 +
 3 files changed, 157 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d31c8c64/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
index 2f8bcdd..34aef87 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/sql/GridSqlQuerySplitter.java
@@ -205,6 +205,9 @@ public class GridSqlQuerySplitter {
         if (mapQry.offset() != null) {
             rdcQry.offset(mapQry.offset());
 
+            if (mapQry.limit() != null) // LIMIT off + lim
+                mapQry.limit(op(GridSqlOperationType.PLUS, mapQry.offset(), mapQry.limit()));
+
             mapQry.offset(null);
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d31c8c64/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
new file mode 100644
index 0000000..6ec6bb3
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
@@ -0,0 +1,152 @@
+/*
+ * 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.query;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.query.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.*;
+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 java.util.*;
+
+/**
+ * Tests for correct distributed partitioned queries.
+ */
+@SuppressWarnings("unchecked")
+public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest {
+    /** */
+    private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration() throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration();
+
+        cfg.setPeerClassLoadingEnabled(false);
+
+        TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+        disco.setIpFinder(ipFinder);
+
+        cfg.setDiscoverySpi(disco);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        startGridsMultiThreaded(3, false);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * @param name Cache name.
+     * @param partitioned Partition or replicated cache.
+     * @param idxTypes Indexed types.
+     * @return Cache configuration.
+     */
+    private static CacheConfiguration cacheConfig(String name, boolean partitioned, Class<?>... idxTypes) {
+        return new CacheConfiguration()
+            .setName(name)
+            .setCacheMode(partitioned ? CacheMode.PARTITIONED : CacheMode.REPLICATED)
+            .setAtomicityMode(CacheAtomicityMode.ATOMIC)
+            .setBackups(1)
+            .setIndexedTypes(idxTypes);
+    }
+
+    /**
+     * Tests offset and limit clauses for query.
+     * @throws Exception If failed.
+     */
+    public void testOffsetLimit() throws Exception {
+        IgniteCache<Integer, Integer> c = ignite(0).getOrCreateCache(cacheConfig("ints", true,
+            Integer.class, Integer.class));
+
+        try {
+            List<Integer> res = new ArrayList<>();
+
+            Random rnd = new GridRandom();
+
+            for (int i = 0; i < 10; i++) {
+                int val = rnd.nextInt(100);
+
+                c.put(i, val);
+                res.add(val);
+            }
+
+            Collections.sort(res);
+
+            String qry = "select _val from Integer order by _val ";
+
+            assertEqualsCollections(res,
+                column(0, c.query(new SqlFieldsQuery(qry)).getAll()));
+
+            assertEqualsCollections(res.subList(0, 0),
+                column(0, c.query(new SqlFieldsQuery(qry + "limit ?").setArgs(0)).getAll()));
+
+            assertEqualsCollections(res.subList(0, 3),
+                column(0, c.query(new SqlFieldsQuery(qry + "limit ?").setArgs(3)).getAll()));
+
+            assertEqualsCollections(res.subList(0, 9),
+                column(0, c.query(new SqlFieldsQuery(qry + "limit ? offset ?").setArgs(9, 0)).getAll()));
+
+            assertEqualsCollections(res.subList(3, 7),
+                column(0, c.query(new SqlFieldsQuery(qry + "limit ? offset ?").setArgs(4, 3)).getAll()));
+
+            assertEqualsCollections(res.subList(7, 9),
+                column(0, c.query(new SqlFieldsQuery(qry + "limit ? offset ?").setArgs(2, 7)).getAll()));
+
+            assertEqualsCollections(res.subList(8, 10),
+                column(0, c.query(new SqlFieldsQuery(qry + "limit ? offset ?").setArgs(2, 8)).getAll()));
+
+            assertEqualsCollections(res.subList(9, 10),
+                column(0, c.query(new SqlFieldsQuery(qry + "limit ? offset ?").setArgs(1, 9)).getAll()));
+
+            assertEqualsCollections(res.subList(10, 10),
+                column(0, c.query(new SqlFieldsQuery(qry + "limit ? offset ?").setArgs(1, 10)).getAll()));
+
+            assertEqualsCollections(res.subList(9, 10),
+                column(0, c.query(new SqlFieldsQuery(qry + "limit ? offset abs(-(4 + ?))").setArgs(1, 5)).getAll()));
+        }
+        finally {
+            c.destroy();
+        }
+    }
+
+    /**
+     * @param idx Column index.
+     * @param rows Rows.
+     * @return Column as list.
+     */
+    private static List<?> column(int idx, List<List<?>> rows) {
+        List res = new ArrayList<>(rows.size());
+
+        for (List<?> row : rows)
+            res.add(row.get(idx));
+
+        return res;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d31c8c64/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 a3849d7..730c79f 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
@@ -25,6 +25,7 @@ import org.apache.ignite.internal.processors.cache.local.*;
 import org.apache.ignite.internal.processors.cache.query.*;
 import org.apache.ignite.internal.processors.cache.query.continuous.*;
 import org.apache.ignite.internal.processors.cache.reducefields.*;
+import org.apache.ignite.internal.processors.query.*;
 import org.apache.ignite.internal.processors.query.h2.sql.*;
 import org.apache.ignite.spi.communication.tcp.*;
 
@@ -43,6 +44,7 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
         suite.addTestSuite(GridQueryParsingTest.class);
 
         // Queries tests.
+        suite.addTestSuite(IgniteSqlSplitterSelfTest.class);
         suite.addTestSuite(GridCacheQueryIndexDisabledSelfTest.class);
         suite.addTestSuite(IgniteCacheQueryLoadSelfTest.class);
         suite.addTestSuite(IgniteCacheLocalQuerySelfTest.class);


[24/50] incubator-ignite git commit: When NIO server port is set to -1, we do not need to check address for null.

Posted by vo...@apache.org.
When NIO server port is set to -1, we do not need to check address for null.


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 7290d0658aa10675095f1a0379f5c21b9bb09bc4
Parents: aed83af
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Aug 13 18:09:54 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Aug 13 18:09:54 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/internal/util/nio/GridNioServer.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7290d065/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
index c180837..2d60f98 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
@@ -209,7 +209,9 @@ public class GridNioServer<T> {
         IgniteBiInClosure<GridNioSession, Integer> msgQueueLsnr,
         GridNioFilter... filters
     ) throws IgniteCheckedException {
-        A.notNull(addr, "addr");
+        if (port != -1)
+            A.notNull(addr, "addr");
+
         A.notNull(lsnr, "lsnr");
         A.notNull(log, "log");
         A.notNull(order, "order");


[14/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/master' into ignite-946

Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-946


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 801d6df1acd2615c1a85e9e3829983011b5fd0a3
Parents: b6bef13 ae11e9b
Author: Denis Magda <dm...@gridgain.com>
Authored: Tue Aug 11 10:19:21 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue Aug 11 10:19:21 2015 +0300

----------------------------------------------------------------------
 .../configuration/IgniteConfiguration.java      |  1 -
 .../GridCachePartitionExchangeManager.java      | 48 +++++++----
 .../dht/atomic/GridDhtAtomicCache.java          | 36 +++++---
 .../cache/CacheStopAndDestroySelfTest.java      | 87 --------------------
 4 files changed, 56 insertions(+), 116 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/801d6df1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------


[29/50] incubator-ignite git commit: # ignite-1228

Posted by vo...@apache.org.
# ignite-1228

Signed-off-by: Valentin Kulichenko <va...@gmail.com>


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

Branch: refs/heads/ignite-gg-9615-1
Commit: e5eef50844580bd9ef2dba6bdfc1efca8992e78a
Parents: 8ecddcc
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Tue Aug 11 18:34:58 2015 -0700
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Thu Aug 13 18:57:20 2015 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/ignite/logger/log4j/Log4JLogger.java    | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e5eef508/modules/log4j/src/main/java/org/apache/ignite/logger/log4j/Log4JLogger.java
----------------------------------------------------------------------
diff --git a/modules/log4j/src/main/java/org/apache/ignite/logger/log4j/Log4JLogger.java b/modules/log4j/src/main/java/org/apache/ignite/logger/log4j/Log4JLogger.java
index e3828ab..bc843fb 100644
--- a/modules/log4j/src/main/java/org/apache/ignite/logger/log4j/Log4JLogger.java
+++ b/modules/log4j/src/main/java/org/apache/ignite/logger/log4j/Log4JLogger.java
@@ -342,6 +342,10 @@ public class Log4JLogger implements IgniteLogger, LoggerNodeIdAware, Log4jFileAw
                     impl.setLevel(logLevel);
             }
 
+            // If still don't have appenders, disable logging.
+            if (!isConfigured())
+                impl.setLevel(Level.OFF);
+
             quiet0 = quiet;
             inited = true;
         }


[26/50] incubator-ignite git commit: Fixed threads cleanup in continuous processor

Posted by vo...@apache.org.
Fixed threads cleanup in continuous processor


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

Branch: refs/heads/ignite-gg-9615-1
Commit: ba3abceca10a1745253a3c28e7a6fe6f5833d266
Parents: 6697b0c
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Thu Aug 13 15:50:39 2015 -0700
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Thu Aug 13 15:50:39 2015 -0700

----------------------------------------------------------------------
 .../continuous/GridContinuousProcessor.java         | 16 +++++++++++-----
 .../GridCacheContinuousQueryAbstractSelfTest.java   |  2 +-
 2 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ba3abcec/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
index 5f1c4bb..a360e35 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
@@ -29,7 +29,6 @@ import org.apache.ignite.internal.managers.eventstorage.*;
 import org.apache.ignite.internal.processors.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.processors.timeout.*;
-import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.future.*;
 import org.apache.ignite.internal.util.tostring.*;
 import org.apache.ignite.internal.util.typedef.*;
@@ -72,7 +71,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
     private final ConcurrentMap<UUID, StopFuture> stopFuts = new ConcurrentHashMap8<>();
 
     /** Threads started by this processor. */
-    private final Collection<IgniteThread> threads = new GridConcurrentHashSet<>();
+    private final Map<UUID, IgniteThread> bufCheckThreads = new ConcurrentHashMap8<>();
 
     /** */
     private final ConcurrentMap<IgniteUuid, SyncMessageAckFuture> syncMsgFuts = new ConcurrentHashMap8<>();
@@ -311,8 +310,10 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
 
         ctx.io().removeMessageListener(TOPIC_CONTINUOUS);
 
-        U.interrupt(threads);
-        U.joinThreads(threads, log);
+        for (IgniteThread thread : bufCheckThreads.values()) {
+            U.interrupt(thread);
+            U.join(thread);
+        }
 
         if (log.isDebugEnabled())
             log.debug("Continuous processor stopped.");
@@ -915,7 +916,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
                     }
                 });
 
-                threads.add(checker);
+                bufCheckThreads.put(routineId, checker);
 
                 checker.start();
             }
@@ -947,6 +948,11 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
             ctx.io().removeMessageListener(hnd.orderedTopic());
 
         hnd.unregister(routineId, ctx);
+
+        IgniteThread checker = bufCheckThreads.remove(routineId);
+
+        if (checker != null)
+            checker.interrupt();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ba3abcec/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
index 4681071..7b628b4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryAbstractSelfTest.java
@@ -29,7 +29,6 @@ import org.apache.ignite.internal.processors.datastructures.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
-import org.apache.ignite.marshaller.optimized.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -177,6 +176,7 @@ public abstract class GridCacheContinuousQueryAbstractSelfTest extends GridCommo
             assertEquals(String.valueOf(i), 0, ((Map)U.field(proc, "rmtInfos")).size());
             assertEquals(String.valueOf(i), 0, ((Map)U.field(proc, "startFuts")).size());
             assertEquals(String.valueOf(i), 0, ((Map)U.field(proc, "stopFuts")).size());
+            assertEquals(String.valueOf(i), 0, ((Map)U.field(proc, "bufCheckThreads")).size());
 
             CacheContinuousQueryManager mgr = grid(i).context().cache().internalCache().context().continuousQueries();
 


[19/50] incubator-ignite git commit: Fixed error message

Posted by vo...@apache.org.
Fixed error message


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 36f7ba669fd5b706fd9b01c06ce20dbb7610d50f
Parents: 653c0b2
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Wed Aug 12 16:56:18 2015 -0700
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Wed Aug 12 16:56:18 2015 -0700

----------------------------------------------------------------------
 .../apache/ignite/internal/processors/cache/GridCacheGateway.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/36f7ba66/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
index 93c5858..58c9035 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
@@ -156,7 +156,7 @@ public class GridCacheGateway<K, V> {
             GridCachePreloader preldr = cache != null ? cache.preloader() : null;
 
             if (preldr == null)
-                throw new IllegalStateException("Cache has been closed: " + ctx.name());
+                throw new IllegalStateException("Cache has been closed or destroyed: " + ctx.name());
 
             preldr.startFuture().get();
         }


[13/50] incubator-ignite git commit: ignite-946: simplified VersionedEntry interface

Posted by vo...@apache.org.
ignite-946: simplified VersionedEntry interface


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

Branch: refs/heads/ignite-gg-9615-1
Commit: b6bef13eef82d9a2e040c01881d07c186ade372e
Parents: dd3cecf
Author: Denis Magda <dm...@gridgain.com>
Authored: Tue Aug 11 10:17:24 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue Aug 11 10:17:24 2015 +0300

----------------------------------------------------------------------
 .../ignite/cache/version/VersionedEntry.java    | 83 +++++++++-----------
 .../cache/version/CacheVersionedEntryImpl.java  | 23 +-----
 .../cache/version/GridCacheVersionManager.java  |  4 +-
 .../CacheVersionedEntryAbstractTest.java        |  9 +--
 4 files changed, 45 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b6bef13e/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java b/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
index 1aac68a..135d681 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
@@ -24,7 +24,7 @@ import javax.cache.processor.*;
 import java.util.*;
 
 /**
- * Cache entry that stores entry's version related information.
+ * Cache entry that stores entry's version related information along with its data.
  *
  * To get a {@code VersionedEntry} of an {@link Cache.Entry} use {@link Cache.Entry#unwrap(Class)} by passing
  * {@code VersionedEntry} class to it as the argument.
@@ -42,62 +42,51 @@ import java.util.*;
  * is excluded from responses.
  * <h2 class="header">Java Example</h2>
  * <pre name="code" class="java">
- * Cache<Integer, String> cache = grid(0).cache(null);
+ * IgniteCache<Integer, String> cache = grid(0).cache(null);
  *
- *  cache.invoke(100, new EntryProcessor<Integer, String, Object>() {
- *      public Object process(MutableEntry<Integer, String> entry, Object... arguments) throws EntryProcessorException {
- *          VersionedEntry<Integer, String> verEntry = entry.unwrap(VersionedEntry.class);
- *          return entry;
- *       }
- *   });
+ * VersionedEntry<String, Integer> entry1 = cache.invoke(100,
+ *     new EntryProcessor<Integer, String, VersionedEntry<String, Integer>>() {
+ *          public VersionedEntry<String, Integer> process(MutableEntry<Integer, String> entry,
+ *              Object... arguments) throws EntryProcessorException {
+ *                  return entry.unwrap(VersionedEntry.class);
+ *          }
+ *     });
+ *
+ * // Cache entry for the given key may be updated at some point later.
+ *
+ * VersionedEntry<String, Integer> entry2 = cache.invoke(100,
+ *     new EntryProcessor<Integer, String, VersionedEntry<String, Integer>>() {
+ *          public VersionedEntry<String, Integer> process(MutableEntry<Integer, String> entry,
+ *              Object... arguments) throws EntryProcessorException {
+ *                  return entry.unwrap(VersionedEntry.class);
+ *          }
+ *     });
+ *
+ * if (entry1.version().compareTo(entry2.version()) < 0) {
+ *     // the entry has been updated
+ * }
  * </pre>
  */
 public interface VersionedEntry<K, V> extends Cache.Entry<K, V> {
     /**
-     * Versions comparator.
-     */
-    public static final Comparator<VersionedEntry> VER_COMP = new Comparator<VersionedEntry>() {
-        @Override public int compare(VersionedEntry o1, VersionedEntry o2) {
-            int res = Integer.compare(o1.topologyVersion(), o2.topologyVersion());
-
-            if (res != 0)
-                return res;
-
-            res = Long.compare(o1.order(), o2.order());
-
-            if (res != 0)
-                return res;
-
-            return Integer.compare(o1.nodeOrder(), o2.nodeOrder());
-        }
-    };
-
-    /**
-     * Gets the topology version at the time when the entry with a given pair of key and value has been created.
-     *
-     * @return Topology version plus number of seconds from the start time of the first grid node.
-     */
-    public int topologyVersion();
-
-    /**
-     * Gets versioned entry unique order.
-     * Each time a cache entry for a given key is updated a new {@code VersionedEntry} with increased order is created.
-     *
-     * @return Versioned entry unique order.
-     */
-    public long order();
-
-    /**
-     * Gets local node order at the time when the entry with a given pair of key and value has been created.
+     * Returns a comparable object representing the version of this cache entry.
+     * <p>
+     * It is valid to compare cache entries' versions for the same key. In this case the latter update will be
+     * represented by a higher version. The result of versions comparison of cache entries of different keys is
+     * undefined.
      *
-     * @return Local node order on which this version has been assigned.
+     * @return Version of this cache entry.
      */
-    public int nodeOrder();
+    public Comparable version();
 
     /**
-     * Gets the time when the entry with a given pair of key and value has been created.
+     * Returns the time when the cache entry for the given key has been updated or initially created.
+     * <p>
+     * It is valid to compare cache entries' update time for the same key. In this case the latter update will
+     * be represented by higher update time. The result of update time comparison of cache entries of different keys is
+     * undefined.
      *
      * @return Time in milliseconds.
      */
-    public long creationTime();
+    public long updateTime();
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b6bef13e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
index 22b699a..97b1995 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
@@ -51,30 +51,13 @@ public class CacheVersionedEntryImpl<K, V> extends CacheEntryImpl<K, V> implemen
         this.ver = ver;
     }
 
-    /**
-     * @return Version.
-     */
-    @Nullable public GridCacheVersion version() {
-        return ver;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int topologyVersion() {
-        return ver.topologyOrder();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int nodeOrder() {
-        return ver.nodeOrder();
-    }
-
     /** {@inheritDoc} */
-    @Override public long order() {
-        return ver.order();
+    public GridCacheVersion version() {
+        return ver;
     }
 
     /** {@inheritDoc} */
-    @Override public long creationTime() {
+    @Override public long updateTime() {
         return ver.globalTime();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b6bef13e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
index d465a0c..85b14a4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
@@ -224,6 +224,8 @@ public class GridCacheVersionManager extends GridCacheSharedManagerAdapter {
         if (topVer == -1)
             topVer = cctx.kernalContext().discovery().topologyVersion();
 
+        long globalTime = cctx.kernalContext().clockSync().adjustedTime(topVer);
+
         if (addTime) {
             if (gridStartTime == 0)
                 gridStartTime = cctx.kernalContext().discovery().gridStartTime();
@@ -231,8 +233,6 @@ public class GridCacheVersionManager extends GridCacheSharedManagerAdapter {
             topVer += (gridStartTime - TOP_VER_BASE_TIME) / 1000;
         }
 
-        long globalTime = cctx.kernalContext().clockSync().adjustedTime(topVer);
-
         int locNodeOrder = (int)cctx.localNode().order();
 
         if (txSerEnabled) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b6bef13e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
index 0ad8038..9648b9b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
@@ -152,7 +152,8 @@ public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractS
                     }
             });
 
-        assert VersionedEntry.VER_COMP.compare(ver1, ver2) < 0;
+        assert ver1.version().compareTo(ver2.version()) < 0;
+        assert ver1.updateTime() < ver2.updateTime();
     }
 
     /**
@@ -161,10 +162,8 @@ public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractS
     private void checkVersionedEntry(VersionedEntry<Integer, String> entry) {
         assertNotNull(entry);
 
-        assert entry.topologyVersion() > 0;
-        assert entry.order() > 0;
-        assert entry.nodeOrder() > 0;
-        assert entry.creationTime() > 0;
+        assertNotNull(entry.version());
+        assert entry.updateTime() > 0;
 
         assertNotNull(entry.getKey());
         assertNotNull(entry.getValue());


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

Posted by vo...@apache.org.
Merge remote-tracking branch 'origin/master'


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 6697b0c98c098a96ce572048b0c82cbfdfd41dca
Parents: 7290d06 35e3e4e
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Aug 13 18:10:25 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Aug 13 18:10:25 2015 +0300

----------------------------------------------------------------------
 .../continuous/GridContinuousProcessor.java     | 44 ++++++++++++++++----
 .../IgniteCacheContinuousQueryClientTest.java   | 33 ++++++++++++---
 .../IgniteCacheQuerySelfTestSuite.java          |  1 +
 scripts/git-format-patch.sh                     |  2 +-
 4 files changed, 66 insertions(+), 14 deletions(-)
----------------------------------------------------------------------



[31/50] incubator-ignite git commit: # Fix TopologyVersionAwareJob

Posted by vo...@apache.org.
 # Fix TopologyVersionAwareJob


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

Branch: refs/heads/ignite-gg-9615-1
Commit: a3301b3511a742c7c2cc013a4e31a1a838482938
Parents: 51dcd51
Author: sboikov <sb...@gridgain.com>
Authored: Fri Aug 14 11:27:29 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Aug 14 11:37:47 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      |   9 +-
 .../IgniteCacheSizeFailoverTest.java            | 115 +++++++++++++++++++
 .../IgniteCachePutRetryAbstractSelfTest.java    |  19 ++-
 ...PutRetryAtomicPrimaryWriteOrderSelfTest.java |  32 ++++++
 .../tcp/IgniteCacheSslStartStopSelfTest.java    |   1 +
 .../IgniteCacheFailoverTestSuite.java           |   3 +
 6 files changed, 175 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a3301b35/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 18f4004..47ede5b 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
@@ -5597,9 +5597,12 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
                     jobCtx.holdcc();
 
                     fut.listen(new CI1<IgniteInternalFuture<?>>() {
-                        @Override
-                        public void apply(IgniteInternalFuture<?> t) {
-                            jobCtx.callcc();
+                        @Override public void apply(IgniteInternalFuture<?> t) {
+                            ((IgniteKernal)ignite).context().closure().runLocalSafe(new Runnable() {
+                                @Override public void run() {
+                                    jobCtx.callcc();
+                                }
+                            }, false);
                         }
                     });
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a3301b35/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSizeFailoverTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSizeFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSizeFailoverTest.java
new file mode 100644
index 0000000..a76d894
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSizeFailoverTest.java
@@ -0,0 +1,115 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+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 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.CacheWriteSynchronizationMode.*;
+
+/**
+ *
+ */
+public class IgniteCacheSizeFailoverTest extends GridCommonAbstractTest {
+    /** */
+    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+
+        CacheConfiguration ccfg = new CacheConfiguration();
+
+        ccfg.setCacheMode(PARTITIONED);
+        ccfg.setAtomicityMode(ATOMIC);
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
+        ccfg.setBackups(1);
+
+        cfg.setCacheConfiguration(ccfg);
+
+        return cfg;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testSize() throws Exception {
+        startGrids(2);
+
+        final AtomicBoolean stop = new AtomicBoolean();
+
+        final AtomicInteger cntr = new AtomicInteger();
+
+        IgniteInternalFuture<?> fut = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                int idx = cntr.getAndIncrement();
+
+                IgniteCache<Object, Object> cache = ignite(idx).cache(null);
+
+                long cntr = 0;
+
+                while (!stop.get()) {
+                    cache.size();
+
+                    if (cntr++ % 1000 == 0)
+                        log.info("Iteration: " + cntr);
+                }
+
+                return null;
+            }
+        }, 2, "size-thread");
+
+        try {
+            for (int i = 0; i < 10; i++) {
+                log.info("Start node: " + i);
+
+                Ignite node = startGrid(3);
+
+                IgniteCache<Object, Object> cache = node.cache(null);
+
+                for (int j = 0; j < 100; j++)
+                    assertTrue(cache.size() >= 0);
+
+                log.info("Stop node: " + i);
+
+                stopGrid(3);
+            }
+        }
+        finally {
+            stop.set(true);
+        }
+
+        log.info("Stop test.");
+
+        fut.get();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a3301b35/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
index bfddbe7..dcba325 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.cache.distributed.dht;
 
+import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
@@ -29,6 +30,9 @@ import org.apache.ignite.testframework.*;
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
 
+import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*;
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
 /**
  *
  */
@@ -47,6 +51,7 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
     @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
         CacheConfiguration cfg = super.cacheConfiguration(gridName);
 
+        cfg.setAtomicWriteOrderMode(writeOrderMode());
         cfg.setBackups(1);
 
         return cfg;
@@ -66,6 +71,13 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
     }
 
     /**
+     * @return Write order mode.
+     */
+    protected CacheAtomicWriteOrderMode writeOrderMode() {
+        return CLOCK;
+    }
+
+    /**
      * @throws Exception If failed.
      */
     public void testPut() throws Exception {
@@ -87,8 +99,13 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
 
         int keysCnt = keysCount();
 
+        IgniteCache<Object, Object> cache = ignite(0).cache(null);
+
+        if (atomicityMode() == ATOMIC)
+            assertEquals(writeOrderMode(), cache.getConfiguration(CacheConfiguration.class).getAtomicWriteOrderMode());
+
         for (int i = 0; i < keysCnt; i++)
-            ignite(0).cache(null).put(i, i);
+            cache.put(i, i);
 
         finished.set(true);
         fut.get();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a3301b35/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCachePutRetryAtomicPrimaryWriteOrderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCachePutRetryAtomicPrimaryWriteOrderSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCachePutRetryAtomicPrimaryWriteOrderSelfTest.java
new file mode 100644
index 0000000..e9682c5
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/IgniteCachePutRetryAtomicPrimaryWriteOrderSelfTest.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.distributed.dht.atomic;
+
+import org.apache.ignite.cache.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+
+import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*;
+
+/**
+ *
+ */
+public class IgniteCachePutRetryAtomicPrimaryWriteOrderSelfTest extends IgniteCachePutRetryAtomicSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicWriteOrderMode writeOrderMode() {
+        return PRIMARY;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a3301b35/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteCacheSslStartStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteCacheSslStartStopSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteCacheSslStartStopSelfTest.java
index 9bf6caa..5b9af4f 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteCacheSslStartStopSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteCacheSslStartStopSelfTest.java
@@ -26,6 +26,7 @@ import org.apache.ignite.testframework.*;
  *
  */
 public class IgniteCacheSslStartStopSelfTest extends IgniteCachePutRetryAbstractSelfTest {
+    /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a3301b35/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
index 524bfb3..af2b85c 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
@@ -73,10 +73,13 @@ public class IgniteCacheFailoverTestSuite extends TestSuite {
         suite.addTestSuite(IgniteCacheTxNearDisabledFairAffinityPutGetRestartTest.class);
 
         suite.addTestSuite(IgniteCachePutRetryAtomicSelfTest.class);
+        suite.addTestSuite(IgniteCachePutRetryAtomicPrimaryWriteOrderSelfTest.class);
         suite.addTestSuite(IgniteCachePutRetryTransactionalSelfTest.class);
 
         suite.addTestSuite(IgniteCacheSslStartStopSelfTest.class);
 
+        suite.addTestSuite(IgniteCacheSizeFailoverTest.class);
+
         return suite;
     }
 }


[27/50] incubator-ignite git commit: JavaDoc fix

Posted by vo...@apache.org.
JavaDoc fix


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 260238e041c66a02f2552692bab2f44a923f7d41
Parents: ba3abce
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Thu Aug 13 15:50:48 2015 -0700
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Thu Aug 13 15:50:48 2015 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/ignite/internal/IgnitionEx.java  | 10 +++++-----
 .../src/main/java/org/apache/ignite/IgniteSpring.java     |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/260238e0/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 3790703..fd74745 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -429,7 +429,7 @@ public class IgnitionEx {
      * @param springCtx Optional Spring application context, possibly {@code null}.
      *      Spring bean definitions for bean injection are taken from this context.
      *      If provided, this context can be injected into grid tasks and grid jobs using
-     *      {@link SpringApplicationContextResource @IgniteSpringApplicationContextResource} annotation.
+     *      {@link SpringApplicationContextResource @SpringApplicationContextResource} annotation.
      * @return Started grid.
      * @throws IgniteCheckedException If default grid could not be started. This exception will be thrown
      *      also if default grid has already been started.
@@ -466,7 +466,7 @@ public class IgnitionEx {
      * @param springCtx Optional Spring application context, possibly {@code null}.
      *      Spring bean definitions for bean injection are taken from this context.
      *      If provided, this context can be injected into grid tasks and grid jobs using
-     *      {@link SpringApplicationContextResource @IgniteSpringApplicationContextResource} annotation.
+     *      {@link SpringApplicationContextResource @SpringApplicationContextResource} annotation.
      * @return Started grid.
      * @throws IgniteCheckedException If grid could not be started. This exception will be thrown
      *      also if named grid has already been started.
@@ -642,7 +642,7 @@ public class IgnitionEx {
      * @param springCtx Optional Spring application context, possibly {@code null}.
      *      Spring bean definitions for bean injection are taken from this context.
      *      If provided, this context can be injected into grid tasks and grid jobs using
-     *      {@link SpringApplicationContextResource @IgniteSpringApplicationContextResource} annotation.
+     *      {@link SpringApplicationContextResource @SpringApplicationContextResource} annotation.
      * @return Started grid. If Spring configuration contains multiple grid instances,
      *      then the 1st found instance is returned.
      * @throws IgniteCheckedException If grid could not be started or configuration
@@ -690,7 +690,7 @@ public class IgnitionEx {
      * @param springCtx Optional Spring application context, possibly {@code null}.
      *      Spring bean definitions for bean injection are taken from this context.
      *      If provided, this context can be injected into grid tasks and grid jobs using
-     *      {@link SpringApplicationContextResource @IgniteSpringApplicationContextResource} annotation.
+     *      {@link SpringApplicationContextResource @SpringApplicationContextResource} annotation.
      * @return Started grid. If Spring configuration contains multiple grid instances,
      *      then the 1st found instance is returned.
      * @throws IgniteCheckedException If grid could not be started or configuration
@@ -769,7 +769,7 @@ public class IgnitionEx {
      * @param springCtx Optional Spring application context, possibly {@code null}.
      *      Spring bean definitions for bean injection are taken from this context.
      *      If provided, this context can be injected into grid tasks and grid jobs using
-     *      {@link SpringApplicationContextResource @IgniteSpringApplicationContextResource} annotation.
+     *      {@link SpringApplicationContextResource @SpringApplicationContextResource} annotation.
      * @return Started grid. If Spring configuration contains multiple grid instances,
      *      then the 1st found instance is returned.
      * @throws IgniteCheckedException If grid could not be started or configuration

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/260238e0/modules/spring/src/main/java/org/apache/ignite/IgniteSpring.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/IgniteSpring.java b/modules/spring/src/main/java/org/apache/ignite/IgniteSpring.java
index 0fa6a1c..7d673df 100644
--- a/modules/spring/src/main/java/org/apache/ignite/IgniteSpring.java
+++ b/modules/spring/src/main/java/org/apache/ignite/IgniteSpring.java
@@ -27,7 +27,7 @@ import java.net.*;
 
 /**
  * Factory methods to start Ignite with optional Spring application context, this context can be injected into
- * grid tasks and grid jobs using {@link org.apache.ignite.resources.SpringApplicationContextResource @IgniteSpringApplicationContextResource}
+ * grid tasks and grid jobs using {@link org.apache.ignite.resources.SpringApplicationContextResource @SpringApplicationContextResource}
  * annotation.
  * <p>
  * You can also instantiate grid directly from Spring without using {@code Ignite}.
@@ -42,7 +42,7 @@ public class IgniteSpring {
      * @param springCtx Optional Spring application context, possibly {@code null}.
      *      Spring bean definitions for bean injection are taken from this context.
      *      If provided, this context can be injected into grid tasks and grid jobs using
-     *      {@link org.apache.ignite.resources.SpringApplicationContextResource @IgniteSpringApplicationContextResource} annotation.
+     *      {@link org.apache.ignite.resources.SpringApplicationContextResource @SpringApplicationContextResource} annotation.
      * @return Started grid.
      * @throws IgniteCheckedException If default grid could not be started. This exception will be thrown
      *      also if default grid has already been started.
@@ -58,7 +58,7 @@ public class IgniteSpring {
      * @param springCtx Optional Spring application context, possibly {@code null}.
      *      Spring bean definitions for bean injection are taken from this context.
      *      If provided, this context can be injected into grid tasks and grid jobs using
-     *      {@link org.apache.ignite.resources.SpringApplicationContextResource @IgniteSpringApplicationContextResource} annotation.
+     *      {@link org.apache.ignite.resources.SpringApplicationContextResource @SpringApplicationContextResource} annotation.
      * @return Started grid.
      * @throws IgniteCheckedException If grid could not be started. This exception will be thrown
      *      also if named grid has already been started.
@@ -80,7 +80,7 @@ public class IgniteSpring {
      * @param springCtx Optional Spring application context, possibly {@code null}.
      *      Spring bean definitions for bean injection are taken from this context.
      *      If provided, this context can be injected into grid tasks and grid jobs using
-     *      {@link org.apache.ignite.resources.SpringApplicationContextResource @IgniteSpringApplicationContextResource} annotation.
+     *      {@link org.apache.ignite.resources.SpringApplicationContextResource @SpringApplicationContextResource} annotation.
      * @return Started grid. If Spring configuration contains multiple grid instances,
      *      then the 1st found instance is returned.
      * @throws IgniteCheckedException If grid could not be started or configuration


[38/50] incubator-ignite git commit: ignite-1228 - Closed #18

Posted by vo...@apache.org.
ignite-1228 - Closed #18


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

Branch: refs/heads/ignite-gg-9615-1
Commit: d0536dcec02e46cc1e68a13676e87a140d511db2
Parents: 7760847 e5eef50
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Fri Aug 14 15:31:34 2015 -0700
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Fri Aug 14 15:31:34 2015 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/ignite/logger/log4j/Log4JLogger.java    | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------



[37/50] incubator-ignite git commit: # Properly handle ClusterTopologyServerNotFoundException for retries

Posted by vo...@apache.org.
# Properly handle ClusterTopologyServerNotFoundException for retries


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 5faffb98032f54ed1160279de9d52938aef94bd2
Parents: 2903a29
Author: sboikov <sb...@gridgain.com>
Authored: Fri Aug 14 16:23:19 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Aug 14 16:23:19 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/CachePartialUpdateCheckedException.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5faffb98/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java
index f430d12..c2259df 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CachePartialUpdateCheckedException.java
@@ -34,7 +34,7 @@ public class CachePartialUpdateCheckedException extends IgniteCheckedException {
     private final Collection<Object> failedKeys = new ArrayList<>();
 
     /** */
-    private AffinityTopologyVersion topVer;
+    private transient AffinityTopologyVersion topVer;
 
     /**
      * @param msg Error message.


[16/50] incubator-ignite git commit: # ignite-1175: call 'onDeferredDelete' from innerRemover

Posted by vo...@apache.org.
# ignite-1175: call 'onDeferredDelete' from innerRemover


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 51dcd518e51883ca043492a86928cf3488db4bd7
Parents: 834b347
Author: sboikov <sb...@gridgain.com>
Authored: Tue Aug 11 11:30:02 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Aug 11 11:39:54 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheMapEntry.java     |   4 +-
 ...cheDhtLocalPartitionAfterRemoveSelfTest.java | 112 +++++++++++++++++++
 .../testsuites/IgniteCacheTestSuite2.java       |   1 +
 3 files changed, 116 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51dcd518/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 4680994..a078bed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -1232,7 +1232,9 @@ public abstract class GridCacheMapEntry implements GridCacheEntryEx {
         if (writeThrough)
             cctx.store().remove(tx, keyValue(false));
 
-        if (!cctx.deferredDelete()) {
+        if (cctx.deferredDelete() && !detached() && !isInternal())
+            cctx.onDeferredDelete(this, newVer);
+        else {
             boolean marked = false;
 
             synchronized (this) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51dcd518/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDhtLocalPartitionAfterRemoveSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDhtLocalPartitionAfterRemoveSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDhtLocalPartitionAfterRemoveSelfTest.java
new file mode 100644
index 0000000..a930d35
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDhtLocalPartitionAfterRemoveSelfTest.java
@@ -0,0 +1,112 @@
+/*
+ * 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.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ * Test for remove operation.
+ */
+public class CacheDhtLocalPartitionAfterRemoveSelfTest extends GridCommonAbstractTest {
+    /** Grid count. */
+    private static final int GRID_CNT = 3;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        CacheConfiguration ccfg = new CacheConfiguration();
+
+        ccfg.setAtomicityMode(TRANSACTIONAL);
+        ccfg.setNearConfiguration(null);
+
+        cfg.setCacheConfiguration(ccfg);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        startGrids(GRID_CNT);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testMemoryUsage() throws Exception {
+        assertEquals(10_000, GridDhtLocalPartition.MAX_DELETE_QUEUE_SIZE);
+
+        IgniteCache<TestKey, Integer> cache = grid(0).cache(null);
+
+        for (int i = 0; i < 20_000; ++i)
+            cache.put(new TestKey(String.valueOf(i)), i);
+
+        for (int i = 0; i < 20_000; ++i)
+            assertEquals((Object)i, cache.getAndRemove(new TestKey(String.valueOf(i))));
+
+        assertEquals(0, cache.size());
+
+        for (int g = 0; g < GRID_CNT; g++) {
+            cache = grid(g).cache(null);
+
+            for (GridDhtLocalPartition p : dht(cache).topology().localPartitions()) {
+                int size = p.size();
+
+                assertTrue("Unexpected size: " + size, size <= 32);
+            }
+        }
+    }
+
+    /**
+     * Test key.
+     */
+    private static class TestKey {
+        /** Key. */
+        private String key;
+
+        /**
+         * @param key Key.
+         */
+        public TestKey(String key) {
+            this.key = key;
+        }
+
+        /** {@inheritDoc} */
+        @Override public int hashCode() {
+            return key.hashCode();
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean equals(Object obj) {
+            if (obj == null || !(obj instanceof TestKey))
+                return false;
+
+            return key.equals(((TestKey)obj).key);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51dcd518/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
index bf760f5..dcbab07 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
@@ -98,6 +98,7 @@ public class IgniteCacheTestSuite2 extends TestSuite {
         suite.addTest(new TestSuite(GridCacheDhtPreloadPutGetSelfTest.class));
         suite.addTest(new TestSuite(GridCacheDhtPreloadDisabledSelfTest.class));
         suite.addTest(new TestSuite(GridCacheDhtPreloadMultiThreadedSelfTest.class));
+        suite.addTest(new TestSuite(CacheDhtLocalPartitionAfterRemoveSelfTest.class));
         suite.addTest(new TestSuite(GridCacheColocatedPreloadRestartSelfTest.class));
         suite.addTest(new TestSuite(GridCacheNearPreloadRestartSelfTest.class));
         suite.addTest(new TestSuite(GridCacheDhtPreloadStartStopSelfTest.class));


[45/50] incubator-ignite git commit: master - schema drop fix for TL tables

Posted by vo...@apache.org.
master - schema drop fix for TL tables


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 952c7fc99d63b5af0d5a3fe7df4b610f8baf9001
Parents: ad12147
Author: S.Vladykin <sv...@gridgain.com>
Authored: Mon Aug 17 21:22:50 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Mon Aug 17 21:22:50 2015 +0300

----------------------------------------------------------------------
 .../query/h2/twostep/GridThreadLocalTable.java  | 22 +++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/952c7fc9/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
index c468371..f6735b5 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridThreadLocalTable.java
@@ -21,6 +21,7 @@ import org.h2.api.*;
 import org.h2.command.ddl.*;
 import org.h2.engine.*;
 import org.h2.index.*;
+import org.h2.message.*;
 import org.h2.result.*;
 import org.h2.schema.*;
 import org.h2.table.*;
@@ -154,7 +155,7 @@ public class GridThreadLocalTable extends Table {
 
     /** {@inheritDoc} */
     @Override public String getTableType() {
-        return tbl.get().getTableType();
+        return EXTERNAL_TABLE_ENGINE;
     }
 
     /** {@inheritDoc} */
@@ -179,7 +180,7 @@ public class GridThreadLocalTable extends Table {
 
     /** {@inheritDoc} */
     @Override public long getMaxDataModificationId() {
-        return tbl.get().getMaxDataModificationId();
+        return 0;
     }
 
     /** {@inheritDoc} */
@@ -194,7 +195,7 @@ public class GridThreadLocalTable extends Table {
 
     /** {@inheritDoc} */
     @Override public boolean canDrop() {
-        return tbl.get().canDrop();
+        return false;
     }
 
     /** {@inheritDoc} */
@@ -204,12 +205,14 @@ public class GridThreadLocalTable extends Table {
 
     /** {@inheritDoc} */
     @Override public long getRowCountApproximation() {
-        return tbl.get().getRowCountApproximation();
+        Table t = tbl.get();
+
+        return t == null ? 0 : t.getRowCountApproximation();
     }
 
     /** {@inheritDoc} */
     @Override public long getDiskSpaceUsed() {
-        return tbl.get().getDiskSpaceUsed();
+        return 0;
     }
 
     /** {@inheritDoc} */
@@ -219,12 +222,17 @@ public class GridThreadLocalTable extends Table {
 
     /** {@inheritDoc} */
     @Override public String getDropSQL() {
-        return tbl.get().getDropSQL();
+        return "";
+    }
+
+    /** {@inheritDoc} */
+    @Override public void addDependencies(HashSet<DbObject> dependencies) {
+        // No-op. We should not have any dependencies to add.
     }
 
     /** {@inheritDoc} */
     @Override public void checkRename() {
-        tbl.get().checkRename();
+        throw DbException.getUnsupportedException("rename");
     }
 
     /**


[10/50] incubator-ignite git commit: ignite-946: fixed review notes

Posted by vo...@apache.org.
ignite-946: fixed review 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/911ffbb5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/911ffbb5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/911ffbb5

Branch: refs/heads/ignite-gg-9615-1
Commit: 911ffbb5de261d662a915677b99cae4a160407eb
Parents: 9f16eb1
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Aug 10 11:39:44 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Aug 10 11:39:44 2015 +0300

----------------------------------------------------------------------
 .../ignite/cache/version/VersionedEntry.java    |  2 +-
 .../processors/cache/CacheEntryImpl0.java       |  4 +-
 .../processors/cache/GridCacheMapEntry.java     |  2 +-
 .../processors/cache/GridCacheSwapManager.java  | 88 ++++++++++++--------
 .../cache/transactions/IgniteTxAdapter.java     |  2 +
 .../cache/transactions/IgniteTxEntry.java       |  2 +-
 .../transactions/IgniteTxLocalAdapter.java      |  8 ++
 .../cache/version/GridCacheVersionAware.java    | 30 +++++++
 .../cache/version/GridVersionedMapEntry.java    | 33 --------
 .../CacheVersionedEntryAbstractTest.java        |  2 +-
 10 files changed, 99 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/911ffbb5/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java b/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
index e669f15..2c0879b 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/version/VersionedEntry.java
@@ -56,7 +56,7 @@ public interface VersionedEntry<K, V> extends Cache.Entry<K, V> {
     /**
      * Versions comparator.
      */
-    public static final Comparator<VersionedEntry> VERSIONS_COMPARATOR = new Comparator<VersionedEntry>() {
+    public static final Comparator<VersionedEntry> VER_COMP = new Comparator<VersionedEntry>() {
         @Override public int compare(VersionedEntry o1, VersionedEntry o2) {
             int res = Integer.compare(o1.topologyVersion(), o2.topologyVersion());
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/911ffbb5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl0.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl0.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl0.java
index a5e27d6..987fbd3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl0.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEntryImpl0.java
@@ -52,8 +52,8 @@ public class CacheEntryImpl0<K, V> implements Cache.Entry<K, V> {
     @Override public <T> T unwrap(Class<T> cls) {
         if(cls.isAssignableFrom(getClass()))
             return cls.cast(this);
-        else if (cls.isAssignableFrom(VersionedEntry.class) && e instanceof GridVersionedMapEntry)
-            return (T)new CacheVersionedEntryImpl<>(e.getKey(), e.getValue(), ((GridVersionedMapEntry)e).version());
+        else if (cls.isAssignableFrom(VersionedEntry.class) && e instanceof GridCacheVersionAware)
+            return (T)new CacheVersionedEntryImpl<>(e.getKey(), e.getValue(), ((GridCacheVersionAware)e).version());
 
         throw new IllegalArgumentException("Unwrapping to class is not supported: " + cls);
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/911ffbb5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 43cf2fe..298f7a6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -1385,7 +1385,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
                 assert entryProcessor != null;
 
-                CacheInvokeEntry<Object, Object> entry = new CacheInvokeEntry<>(cctx, key, old, this.ver);
+                CacheInvokeEntry<Object, Object> entry = new CacheInvokeEntry<>(cctx, key, old, version());
 
                 try {
                     Object computed = entryProcessor.process(entry, invokeArgs);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/911ffbb5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
index ffe6169..ea9b0fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSwapManager.java
@@ -1513,41 +1513,7 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
             @Override protected Map.Entry<K, V> onNext() {
                 final Map.Entry<byte[], byte[]> cur0 = it.next();
 
-                cur = new GridVersionedMapEntry<K, V>() {
-                    @Override public K getKey() {
-                        try {
-                            KeyCacheObject key = cctx.toCacheKeyObject(cur0.getKey());
-
-                            return key.value(cctx.cacheObjectContext(), false);
-                        }
-                        catch (IgniteCheckedException e) {
-                            throw new IgniteException(e);
-                        }
-                    }
-
-                    @Override public V getValue() {
-                        try {
-                            GridCacheSwapEntry e = unmarshalSwapEntry(cur0.getValue());
-
-                            swapEntry(e);
-
-                            return e.value().value(cctx.cacheObjectContext(), false);
-                        }
-                        catch (IgniteCheckedException ex) {
-                            throw new IgniteException(ex);
-                        }
-                    }
-
-                    @Override public GridCacheVersion version() {
-                        GridCacheSwapEntry e = unmarshalSwapEntry(cur0.getValue());
-
-                        return e.version();
-                    }
-
-                    @Override public V setValue(V val) {
-                        throw new UnsupportedOperationException();
-                    }
-                };
+                cur = new GridVersionedMapEntry<K, V>(cur0);
 
                 return cur;
             }
@@ -2330,4 +2296,56 @@ public class GridCacheSwapManager extends GridCacheManagerAdapter {
          */
         abstract protected GridCloseableIterator<T1> partitionIterator(int part) throws IgniteCheckedException;
     }
+
+    private class GridVersionedMapEntry<K,V> implements Map.Entry<K,V>, GridCacheVersionAware {
+        /** */
+        private Map.Entry<byte[], byte[]> entry;
+
+        /**
+         * Constructor.
+         *
+         * @param entry Entry.
+         */
+        public GridVersionedMapEntry(Map.Entry<byte[], byte[]> entry) {
+            this.entry = entry;
+        }
+
+        /** {@inheritDoc} */
+        @Override public K getKey() {
+            try {
+                KeyCacheObject key = cctx.toCacheKeyObject(entry.getKey());
+
+                return key.value(cctx.cacheObjectContext(), false);
+            }
+            catch (IgniteCheckedException e) {
+                throw new IgniteException(e);
+            }
+        }
+
+        /** {@inheritDoc} */
+        @Override public V getValue() {
+            try {
+                GridCacheSwapEntry e = unmarshalSwapEntry(entry.getValue());
+
+                swapEntry(e);
+
+                return e.value().value(cctx.cacheObjectContext(), false);
+            }
+            catch (IgniteCheckedException ex) {
+                throw new IgniteException(ex);
+            }
+        }
+
+        /** {@inheritDoc} */
+        @Override public GridCacheVersion version() {
+            GridCacheSwapEntry e = unmarshalSwapEntry(entry.getValue());
+
+            return e.version();
+        }
+
+        /** {@inheritDoc} */
+        @Override public V setValue(V val) {
+            throw new UnsupportedOperationException();
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/911ffbb5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
index 797f75e..e9fdd22 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
@@ -1234,6 +1234,8 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
                     ver = txEntry.cached().version();
                 }
                 catch (GridCacheEntryRemovedException e) {
+                    assert optimistic() : txEntry;
+
                     if (log.isDebugEnabled())
                         log.debug("Failed to get entry version: [msg=" + e.getMessage() + ']');
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/911ffbb5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
index 73b9975..3c792f6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxEntry.java
@@ -577,7 +577,7 @@ public class IgniteTxEntry implements GridPeerDeployAware, Message {
             ver = entry.version();
         }
         catch (GridCacheEntryRemovedException e) {
-            assert tx.optimistic() : tx;
+            assert tx == null || tx.optimistic() : tx;
 
             ver = null;
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/911ffbb5/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 a209780..b354fed 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
@@ -2236,6 +2236,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                                 ver = entry.version();
                                             }
                                             catch (GridCacheEntryRemovedException ex) {
+                                                assert optimistic() : txEntry;
+
                                                 if (log.isDebugEnabled())
                                                     log.debug("Failed to get entry version " +
                                                         "[err=" + ex.getMessage() + ']');
@@ -2311,6 +2313,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                 ver = entry.version();
                             }
                             catch (GridCacheEntryRemovedException e) {
+                                assert optimistic() : txEntry;
+
                                 if (log.isDebugEnabled())
                                     log.debug("Failed to get entry version: [msg=" + e.getMessage() + ']');
 
@@ -2362,6 +2366,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                 ver = e.cached().version();
                             }
                             catch (GridCacheEntryRemovedException ex) {
+                                assert optimistic() : e;
+
                                 if (log.isDebugEnabled())
                                     log.debug("Failed to get entry version: [msg=" + ex.getMessage() + ']');
 
@@ -2489,6 +2495,8 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                     ver = cached.version();
                                 }
                                 catch (GridCacheEntryRemovedException e) {
+                                    assert optimistic() : txEntry;
+
                                     if (log.isDebugEnabled())
                                         log.debug("Failed to get entry version: [msg=" + e.getMessage() + ']');
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/911ffbb5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionAware.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionAware.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionAware.java
new file mode 100644
index 0000000..0c0a270
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionAware.java
@@ -0,0 +1,30 @@
+/*
+ * 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.version;
+
+/**
+ * Interface implemented by classes that holds version related information.
+ */
+public interface GridCacheVersionAware {
+    /**
+     * Gets version.
+     *
+     * @return Cache entry version.
+     */
+    public GridCacheVersion version();
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/911ffbb5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridVersionedMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridVersionedMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridVersionedMapEntry.java
deleted file mode 100644
index f653fac..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridVersionedMapEntry.java
+++ /dev/null
@@ -1,33 +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.internal.processors.cache.version;
-
-import java.util.*;
-
-/**
- * This interface extends {@link java.util.Map.Entry} by adding the method that returns entry's
- * {@link GridCacheVersion}.
- */
-public interface GridVersionedMapEntry<K, V> extends Map.Entry<K, V> {
-    /**
-     * Gets entry version.
-     *
-     * @return Entry version.
-     */
-    public GridCacheVersion version();
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/911ffbb5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
index 25a2a42..b121995 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryAbstractTest.java
@@ -152,7 +152,7 @@ public abstract class CacheVersionedEntryAbstractTest extends GridCacheAbstractS
                     }
             });
 
-        assert VersionedEntry.VERSIONS_COMPARATOR.compare(ver1, ver2) < 0;
+        assert VersionedEntry.VER_COMP.compare(ver1, ver2) < 0;
     }
 
     /**


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

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


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 9f16eb165f2aad48f05cef17f608eb2898c078a3
Parents: 92e81dc 53557e3
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Aug 10 09:58:27 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Mon Aug 10 09:58:27 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/cache/version/package-info.java |  4 ++--
 .../processors/cache/CacheInvokeEntry.java        |  5 +++--
 .../cache/transactions/IgniteTxEntry.java         |  4 +++-
 .../cache/transactions/IgniteTxLocalAdapter.java  | 18 +++++++++---------
 4 files changed, 17 insertions(+), 14 deletions(-)
----------------------------------------------------------------------



[15/50] incubator-ignite git commit: 1.3.3-p1-SNAPSHOT

Posted by vo...@apache.org.
1.3.3-p1-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/834b3476
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/834b3476
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/834b3476

Branch: refs/heads/ignite-gg-9615-1
Commit: 834b34765fac4cb87d9d8f4bdb39c14a9e61275d
Parents: 7d747d2
Author: Ignite Teamcity <ig...@apache.org>
Authored: Tue Aug 11 10:53:58 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Tue Aug 11 10:53:58 2015 +0300

----------------------------------------------------------------------
 examples/pom.xml                                   | 2 +-
 modules/aop/pom.xml                                | 2 +-
 modules/apache-license-gen/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/modules/uri-dependency/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/kafka/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 +-
 modules/yarn/pom.xml                               | 2 +-
 pom.xml                                            | 2 +-
 41 files changed, 41 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 1338a18..014cb0a 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
     </parent>
 
     <artifactId>ignite-examples</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index 194ffab..1983567 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-aop</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/apache-license-gen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/apache-license-gen/pom.xml b/modules/apache-license-gen/pom.xml
index 11259a5..c723729 100644
--- a/modules/apache-license-gen/pom.xml
+++ b/modules/apache-license-gen/pom.xml
@@ -31,5 +31,5 @@
 
     <groupId>org.apache.ignite</groupId>
     <artifactId>ignite-apache-license-gen</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 37f6250..1f92999 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-aws</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index 1b33d4b..cf6a347 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-clients</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 45d08e7..b2cb2a7 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
     </parent>
 
     <artifactId>ignite-cloud</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <properties>
         <jcloud.version>1.9.0</jcloud.version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 2e8e4ed..49d4c83 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-codegen</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 222e14b..e9f5531 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-core</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/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 44e954e..6a6b866 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.3.3-SNAPSHOT
+ignite.version=1.3.3-p1-SNAPSHOT
 ignite.build=0
 ignite.revision=DEV
 ignite.rel.date=01011970

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index ad9fc03..ebcee89 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.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/extdata/uri/modules/uri-dependency/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/modules/uri-dependency/pom.xml b/modules/extdata/uri/modules/uri-dependency/pom.xml
index a0ed86e..4c26e87 100644
--- a/modules/extdata/uri/modules/uri-dependency/pom.xml
+++ b/modules/extdata/uri/modules/uri-dependency/pom.xml
@@ -27,7 +27,7 @@
     <artifactId>ignite-extdata-uri-dep</artifactId>
     <packaging>jar</packaging>
 
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
     <modelVersion>4.0.0</modelVersion>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index 46ec215..db1faa1 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -32,7 +32,7 @@
     </parent>
 
     <artifactId>ignite-extdata-uri</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index 3c13c4c..1442cd5 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-gce</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index 33fda30..40650a7 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-geospatial</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index eee70d6..c371f3f 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-hadoop</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index a583d52..bc4b2ed 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-hibernate</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index bf2b369..70a2818 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-indexing</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 9583e52..fbf21b4 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jcl</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index 2007d1b..868fb22 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-jta</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index 6a15c48..1536e0b 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-kafka</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index 6157eba..c39f892 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-log4j</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index c207f79..6a9a22b 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-mesos</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <properties>
         <mesos.version>0.22.0</mesos.version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 7e06bae..445321b 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.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index 449dab2..65ebb92 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.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index ef39a79..4d8b19b 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-scalar</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 690f25b..65570db 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-schedule</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 2c56a3f..3e4bc70 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.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 7b51fcb..f0a9f86 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-slf4j</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index 5b1745a..abe71df 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.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index d793279..3685427 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spark</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index afee3f4..f46c337 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-spring</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index d6e9ab7..8d49fa1 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-ssh</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 83c800d..106192f 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-tools</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index f22da10..2414193 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-urideploy</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/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 fc0fa57..3385ae0 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.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index a6a9678..22295e0 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.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index fca86fd..97ff310 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.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <!-- Ignite dependencies -->

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index 0a8d53f..f47433d 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-web</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <dependencies>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 853f9d4..de917e5 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-yardstick</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <properties>
         <yardstick.version>0.7.0</yardstick.version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/modules/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yarn/pom.xml b/modules/yarn/pom.xml
index 2d90422..dbe59b0 100644
--- a/modules/yarn/pom.xml
+++ b/modules/yarn/pom.xml
@@ -31,7 +31,7 @@
     </parent>
 
     <artifactId>ignite-yarn</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
 
     <properties>
         <hadoop.version>2.7.0</hadoop.version>

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/834b3476/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 260e45b..dcda132 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
 
     <groupId>org.apache.ignite</groupId>
     <artifactId>apache-ignite</artifactId>
-    <version>1.3.3-SNAPSHOT</version>
+    <version>1.3.3-p1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <properties>


[42/50] incubator-ignite git commit: Squashed commit of the IGNITE-1229

Posted by vo...@apache.org.
Squashed commit of the IGNITE-1229


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 7635e5894df6aab477b82253451b729985f632be
Parents: 1f00c70
Author: Denis Magda <dm...@gridgain.com>
Authored: Mon Aug 17 16:41:03 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Aug 17 16:41:03 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/ServerImpl.java    |  57 ++++++-
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  45 ++++--
 .../spi/discovery/tcp/TcpDiscoverySelfTest.java | 152 ++++++++++++++++++-
 .../TcpDiscoverySpiFailureTimeoutSelfTest.java  |   8 +-
 4 files changed, 245 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7635e589/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 76144e3..40e110f 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -114,7 +114,7 @@ class ServerImpl extends TcpDiscoveryImpl {
     protected TcpDiscoverySpiState spiState = DISCONNECTED;
 
     /** Map with proceeding ping requests. */
-    private final ConcurrentMap<InetSocketAddress, IgniteInternalFuture<IgniteBiTuple<UUID, Boolean>>> pingMap =
+    private final ConcurrentMap<InetSocketAddress, GridPingFutureAdapter<IgniteBiTuple<UUID, Boolean>>> pingMap =
         new ConcurrentHashMap8<>();
 
     /**
@@ -497,9 +497,9 @@ class ServerImpl extends TcpDiscoveryImpl {
             return F.t(getLocalNodeId(), clientPingRes);
         }
 
-        GridFutureAdapter<IgniteBiTuple<UUID, Boolean>> fut = new GridFutureAdapter<>();
+        GridPingFutureAdapter<IgniteBiTuple<UUID, Boolean>> fut = new GridPingFutureAdapter<>();
 
-        IgniteInternalFuture<IgniteBiTuple<UUID, Boolean>> oldFut = pingMap.putIfAbsent(addr, fut);
+        GridPingFutureAdapter<IgniteBiTuple<UUID, Boolean>> oldFut = pingMap.putIfAbsent(addr, fut);
 
         if (oldFut != null)
             return oldFut.get();
@@ -520,7 +520,11 @@ class ServerImpl extends TcpDiscoveryImpl {
 
                         long tstamp = U.currentTimeMillis();
 
-                        sock = spi.openSocket(addr, timeoutHelper);
+                        sock = spi.createSocket();
+
+                        fut.sock = sock;
+
+                        sock = spi.openSocket(sock, addr, timeoutHelper);
 
                         openedSock = true;
 
@@ -597,6 +601,21 @@ class ServerImpl extends TcpDiscoveryImpl {
         }
     }
 
+    /**
+     * Interrupts all existed 'ping' request for the given node.
+     *
+     * @param node Node that may be pinged.
+     */
+    private void interruptPing(TcpDiscoveryNode node) {
+        for (InetSocketAddress addr : spi.getNodeAddresses(node)) {
+            GridPingFutureAdapter fut = pingMap.get(addr);
+
+            if (fut != null && fut.sock != null)
+                // Reference to the socket is not set to null. No need to assign it to a local variable.
+                U.closeQuiet(fut.sock);
+        }
+    }
+
     /** {@inheritDoc} */
     @Override public void disconnect() throws IgniteSpiException {
         spiStop0(true);
@@ -3366,6 +3385,8 @@ class ServerImpl extends TcpDiscoveryImpl {
             if (msg.verified() && !locNodeId.equals(leavingNodeId)) {
                 TcpDiscoveryNode leftNode = ring.removeNode(leavingNodeId);
 
+                interruptPing(leavingNode);
+
                 assert leftNode != null;
 
                 if (log.isDebugEnabled())
@@ -3533,6 +3554,8 @@ class ServerImpl extends TcpDiscoveryImpl {
             if (msg.verified()) {
                 node = ring.removeNode(nodeId);
 
+                interruptPing(node);
+
                 assert node != null;
 
                 long topVer;
@@ -5142,4 +5165,30 @@ class ServerImpl extends TcpDiscoveryImpl {
             spi.writeToSocket(sock, msg, bout, timeout);
         }
     }
+
+    /**
+     *
+     */
+    private static class GridPingFutureAdapter<R> extends GridFutureAdapter<R> {
+        /** Socket. */
+        private volatile Socket sock;
+
+        /**
+         * Returns socket associated with this ping future.
+         *
+         * @return Socket or {@code null} if no socket associated.
+         */
+        public Socket sock() {
+            return sock;
+        }
+
+        /**
+         * Associates socket with this ping future.
+         *
+         * @param sock Socket.
+         */
+        public void sock(Socket sock) {
+            this.sock = sock;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7635e589/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 18a540c..2f3d410 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -1167,18 +1167,49 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi, T
      * @param timeoutHelper Timeout helper.
      * @return Opened socket.
      * @throws IOException If failed.
+     * @throws IgniteSpiOperationTimeoutException In case of timeout.
      */
     protected Socket openSocket(InetSocketAddress sockAddr, IgniteSpiOperationTimeoutHelper timeoutHelper)
         throws IOException, IgniteSpiOperationTimeoutException {
-        assert sockAddr != null;
+        return openSocket(createSocket(), sockAddr, timeoutHelper);
+    }
 
-        InetSocketAddress resolved = sockAddr.isUnresolved() ?
-            new InetSocketAddress(InetAddress.getByName(sockAddr.getHostName()), sockAddr.getPort()) : sockAddr;
+    /**
+     * Connects to remote address sending {@code U.IGNITE_HEADER} when connection is established.
+     *
+     * @param sock Socket bound to a local host address.
+     * @param remAddr Remote address.
+     * @param timeoutHelper Timeout helper.
+     * @return Connected socket.
+     * @throws IOException If failed.
+     * @throws IgniteSpiOperationTimeoutException In case of timeout.
+     */
+    protected Socket openSocket(Socket sock, InetSocketAddress remAddr, IgniteSpiOperationTimeoutHelper timeoutHelper)
+        throws IOException, IgniteSpiOperationTimeoutException {
+
+        assert remAddr != null;
+
+        InetSocketAddress resolved = remAddr.isUnresolved() ?
+            new InetSocketAddress(InetAddress.getByName(remAddr.getHostName()), remAddr.getPort()) : remAddr;
 
         InetAddress addr = resolved.getAddress();
 
         assert addr != null;
 
+        sock.connect(resolved, (int)timeoutHelper.nextTimeoutChunk(sockTimeout));
+
+        writeToSocket(sock, U.IGNITE_HEADER, timeoutHelper.nextTimeoutChunk(sockTimeout));
+
+        return sock;
+    }
+
+    /**
+     * Creates socket binding it to a local host address. This operation is not blocking.
+     *
+     * @return Created socket.
+     * @throws IOException If failed.
+     */
+    Socket createSocket() throws IOException {
         Socket sock;
 
         if (isSslEnabled())
@@ -1190,10 +1221,6 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi, T
 
         sock.setTcpNoDelay(true);
 
-        sock.connect(resolved, (int)timeoutHelper.nextTimeoutChunk(sockTimeout));
-
-        writeToSocket(sock, U.IGNITE_HEADER, timeoutHelper.nextTimeoutChunk(sockTimeout));
-
         return sock;
     }
 
@@ -1250,8 +1277,8 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi, T
      * @throws IOException If IO failed or write timed out.
      * @throws IgniteCheckedException If marshalling failed.
      */
-    protected void writeToSocket(Socket sock, TcpDiscoveryAbstractMessage msg, long timeout)
-        throws IOException, IgniteCheckedException {
+    protected void writeToSocket(Socket sock, TcpDiscoveryAbstractMessage msg, long timeout) throws IOException,
+        IgniteCheckedException {
         writeToSocket(sock, msg, new GridByteArrayOutputStream(8 * 1024), timeout); // 8K.
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7635e589/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
index 9a44c24..2b404c7 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
@@ -70,7 +70,8 @@ public class TcpDiscoverySelfTest extends GridCommonAbstractTest {
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        TcpDiscoverySpi spi = new TcpDiscoverySpi();
+        TcpDiscoverySpi spi = gridName.contains("testPingInterruptedOnNodeFailedFailingNode") ?
+            new TestTcpDiscoverySpi() : new TcpDiscoverySpi();
 
         discoMap.put(gridName, spi);
 
@@ -128,6 +129,8 @@ public class TcpDiscoverySelfTest extends GridCommonAbstractTest {
             if (U.isMacOs())
                 spi.setLocalAddress(F.first(U.allLocalIps()));
         }
+        else if (gridName.contains("testPingInterruptedOnNodeFailedPingingNode"))
+            cfg.setFailureDetectionTimeout(30_000);
 
         return cfg;
     }
@@ -339,6 +342,153 @@ public class TcpDiscoverySelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If any error occurs.
      */
+    public void testPingInterruptedOnNodeFailed() throws Exception {
+        try {
+            final Ignite pingingNode = startGrid("testPingInterruptedOnNodeFailedPingingNode");
+            final Ignite failedNode = startGrid("testPingInterruptedOnNodeFailedFailingNode");
+            startGrid("testPingInterruptedOnNodeFailedSimpleNode");
+
+            ((TestTcpDiscoverySpi)failedNode.configuration().getDiscoverySpi()).ignorePingResponse = true;
+
+            final CountDownLatch pingLatch = new CountDownLatch(1);
+
+            final CountDownLatch eventLatch = new CountDownLatch(1);
+
+            final AtomicBoolean pingRes = new AtomicBoolean(true);
+
+            final AtomicBoolean failRes = new AtomicBoolean(false);
+
+            long startTs = System.currentTimeMillis();
+
+            pingingNode.events().localListen(
+                new IgnitePredicate<Event>() {
+                    @Override public boolean apply(Event event) {
+                        if (((DiscoveryEvent)event).eventNode().id().equals(failedNode.cluster().localNode().id())) {
+                            failRes.set(true);
+                            eventLatch.countDown();
+                        }
+
+                        return true;
+                    }
+                },
+                EventType.EVT_NODE_FAILED);
+
+            IgniteInternalFuture<?> pingFut = multithreadedAsync(
+                new Callable<Object>() {
+                    @Override public Object call() throws Exception {
+                        pingLatch.countDown();
+
+                        pingRes.set(pingingNode.configuration().getDiscoverySpi().pingNode(
+                            failedNode.cluster().localNode().id()));
+
+                        return null;
+                    }
+                }, 1);
+
+            IgniteInternalFuture<?> failingFut = multithreadedAsync(
+                new Callable<Object>() {
+                    @Override public Object call() throws Exception {
+                        pingLatch.await();
+
+                        Thread.sleep(3000);
+
+                        ((TestTcpDiscoverySpi)failedNode.configuration().getDiscoverySpi()).simulateNodeFailure();
+
+                        return null;
+                    }
+                }, 1);
+
+            failingFut.get();
+            pingFut.get();
+
+            assertFalse(pingRes.get());
+
+            assertTrue(System.currentTimeMillis() - startTs <
+                pingingNode.configuration().getFailureDetectionTimeout() / 2);
+
+            assertTrue(eventLatch.await(7, TimeUnit.SECONDS));
+            assertTrue(failRes.get());
+        }
+        finally {
+            stopAllGrids();
+        }
+    }
+
+    /**
+     * @throws Exception If any error occurs.
+     */
+    public void testPingInterruptedOnNodeLeft() throws Exception {
+        try {
+            final Ignite pingingNode = startGrid("testPingInterruptedOnNodeFailedPingingNode");
+            final Ignite leftNode = startGrid("testPingInterruptedOnNodeFailedFailingNode");
+            startGrid("testPingInterruptedOnNodeFailedSimpleNode");
+
+            ((TestTcpDiscoverySpi)leftNode.configuration().getDiscoverySpi()).ignorePingResponse = true;
+
+            final CountDownLatch pingLatch = new CountDownLatch(1);
+
+            final AtomicBoolean pingRes = new AtomicBoolean(true);
+
+            long startTs = System.currentTimeMillis();
+
+            IgniteInternalFuture<?> pingFut = multithreadedAsync(
+                new Callable<Object>() {
+                    @Override public Object call() throws Exception {
+                        pingLatch.countDown();
+
+                        pingRes.set(pingingNode.configuration().getDiscoverySpi().pingNode(
+                            leftNode.cluster().localNode().id()));
+
+                        return null;
+                    }
+                }, 1);
+
+            IgniteInternalFuture<?> stoppingFut = multithreadedAsync(
+                new Callable<Object>() {
+                    @Override public Object call() throws Exception {
+                        pingLatch.await();
+
+                        Thread.sleep(3000);
+
+                        stopGrid("testPingInterruptedOnNodeFailedFailingNode");
+
+                        return null;
+                    }
+                }, 1);
+
+            stoppingFut.get();
+            pingFut.get();
+
+            assertFalse(pingRes.get());
+
+            assertTrue(System.currentTimeMillis() - startTs <
+                pingingNode.configuration().getFailureDetectionTimeout() / 2);
+        }
+        finally {
+            stopAllGrids();
+        }
+    }
+
+    /**
+     *
+     */
+    private static class TestTcpDiscoverySpi extends TcpDiscoverySpi {
+        /** */
+        private boolean ignorePingResponse;
+
+        /** {@inheritDoc} */
+        protected void writeToSocket(Socket sock, TcpDiscoveryAbstractMessage msg, long timeout) throws IOException,
+            IgniteCheckedException {
+            if (msg instanceof TcpDiscoveryPingResponse && ignorePingResponse)
+                return;
+            else
+                super.writeToSocket(sock, msg, timeout);
+        }
+    }
+
+    /**
+     * @throws Exception If any error occurs.
+     */
     public void testNodeAdded() throws Exception {
         try {
             final Ignite g1 = startGrid(1);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7635e589/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureTimeoutSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureTimeoutSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureTimeoutSelfTest.java
index fbea187..df36644 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureTimeoutSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiFailureTimeoutSelfTest.java
@@ -305,7 +305,8 @@ public class TcpDiscoverySpiFailureTimeoutSelfTest extends AbstractDiscoverySelf
 
 
         /** {@inheritDoc} */
-        @Override protected Socket openSocket(InetSocketAddress sockAddr, IgniteSpiOperationTimeoutHelper timeoutHelper)
+        @Override protected Socket openSocket(Socket sock, InetSocketAddress sockAddr,
+            IgniteSpiOperationTimeoutHelper timeoutHelper)
             throws IOException, IgniteSpiOperationTimeoutException {
 
             if (openSocketTimeout) {
@@ -330,11 +331,12 @@ public class TcpDiscoverySpiFailureTimeoutSelfTest extends AbstractDiscoverySelf
                 }
             }
 
-            Socket sock = super.openSocket(sockAddr, timeoutHelper);
+            super.openSocket(sock, sockAddr, timeoutHelper);
 
             try {
                 Thread.sleep(1500);
-            } catch (InterruptedException e) {
+            }
+            catch (InterruptedException e) {
                 // Ignore
             }
 


[17/50] incubator-ignite git commit: ignite-946: reverted renaming topVer to avoid breaking compatibility

Posted by vo...@apache.org.
ignite-946: reverted renaming topVer to avoid breaking compatibility


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 954c4591c95b7625042657f7a7311f4ea0f17c19
Parents: 801d6df
Author: Denis Magda <dm...@gridgain.com>
Authored: Tue Aug 11 15:00:47 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue Aug 11 15:00:47 2015 +0300

----------------------------------------------------------------------
 .../cache/GridCacheAtomicVersionComparator.java |  4 +--
 .../processors/cache/GridCacheMapEntry.java     |  2 +-
 .../processors/cache/GridCacheUtils.java        |  2 +-
 .../cache/transactions/IgniteTxManager.java     |  2 +-
 .../cache/version/CacheVersionedEntryImpl.java  |  4 +--
 .../version/GridCachePlainVersionedEntry.java   |  2 +-
 .../version/GridCacheRawVersionedEntry.java     |  2 +-
 .../cache/version/GridCacheVersion.java         | 26 ++++++++++----------
 .../cache/version/GridCacheVersionManager.java  |  4 +--
 .../ignite/internal/util/IgniteUtils.java       |  4 +--
 .../cache/GridCacheEntryVersionSelfTest.java    |  4 +--
 11 files changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
index 45288d9..3a06100 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
@@ -32,8 +32,8 @@ public class GridCacheAtomicVersionComparator {
      * @return Comparison value.
      */
     public int compare(GridCacheVersion one, GridCacheVersion other, boolean ignoreTime) {
-        int topVer = one.topologyOrder();
-        int otherTopVer = other.topologyOrder();
+        int topVer = one.topologyVersion();
+        int otherTopVer = other.topologyVersion();
 
         if (topVer == otherTopVer) {
             long globalTime = one.globalTime();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 33c42c4..298f7a6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -1927,7 +1927,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
             // Incorporate conflict version into new version if needed.
             if (conflictVer != null && conflictVer != newVer)
-                newVer = new GridCacheVersionEx(newVer.topologyOrder(),
+                newVer = new GridCacheVersionEx(newVer.topologyVersion(),
                     newVer.globalTime(),
                     newVer.order(),
                     newVer.nodeOrder(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index 75f1dee..a313e3d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -1060,7 +1060,7 @@ public class GridCacheUtils {
 
         byte[] bytes = new byte[28];
 
-        U.intToBytes(ver.topologyOrder(), bytes, 0);
+        U.intToBytes(ver.topologyVersion(), bytes, 0);
         U.longToBytes(ver.globalTime(), bytes, 4);
         U.longToBytes(ver.order(), bytes, 12);
         U.intToBytes(ver.nodeOrderAndDrIdRaw(), bytes, 20);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index 446002e..630330e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -2098,7 +2098,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
          * @param nearVer Near transaction version.
          */
         private CommittedVersion(GridCacheVersion ver, GridCacheVersion nearVer) {
-            super(ver.topologyOrder(), ver.globalTime(), ver.order(), ver.nodeOrder(), ver.dataCenterId());
+            super(ver.topologyVersion(), ver.globalTime(), ver.order(), ver.nodeOrder(), ver.dataCenterId());
 
             assert nearVer != null;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
index 97b1995..c036bc1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
@@ -77,7 +77,7 @@ public class CacheVersionedEntryImpl<K, V> extends CacheEntryImpl<K, V> implemen
 
     /** {@inheritDoc} */
     public String toString() {
-        return "VersionedEntry [key=" + getKey() + ", val=" + getValue() + ", topVer=" + ver.topologyOrder() +
-            ", nodeOrder=" + ver.nodeOrder() + ", order=" + ver.order() + ", creationTime=" + ver.globalTime() + ']';
+        return "VersionedEntry [key=" + getKey() + ", val=" + getValue() + ", topVer=" + ver.topologyVersion() +
+            ", nodeOrder=" + ver.nodeOrder() + ", order=" + ver.order() + ", updateTime=" + ver.globalTime() + ']';
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
index 102805c..4f13ae7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
@@ -101,7 +101,7 @@ public class GridCachePlainVersionedEntry<K, V> implements GridCacheVersionedEnt
 
     /** {@inheritDoc} */
     @Override public int topologyVersion() {
-        return ver.topologyOrder();
+        return ver.topologyVersion();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
index f8d33f6..87fe976 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
@@ -155,7 +155,7 @@ public class GridCacheRawVersionedEntry<K, V> extends DataStreamerEntry implemen
 
     /** {@inheritDoc} */
     @Override public int topologyVersion() {
-        return ver.topologyOrder();
+        return ver.topologyVersion();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
index 7adfa2e..8df54c8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
@@ -42,7 +42,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
     private static final int DR_ID_MASK = 0x1F;
 
     /** Topology version. */
-    private int topOrder;
+    private int topVer;
 
     /** Node order (used as global order) and DR ID. */
     private int nodeOrderDrId;
@@ -76,7 +76,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
         if (nodeOrder > NODE_ORDER_MASK)
             throw new IllegalArgumentException("Node order overflow: " + nodeOrder);
 
-        this.topOrder = topVer;
+        this.topVer = topVer;
         this.globalTime = globalTime;
         this.order = order;
 
@@ -91,7 +91,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
      * @param order Version order.
      */
     public GridCacheVersion(int topVer, int nodeOrderDrId, long globalTime, long order) {
-        this.topOrder = topVer;
+        this.topVer = topVer;
         this.nodeOrderDrId = nodeOrderDrId;
         this.globalTime = globalTime;
         this.order = order;
@@ -100,8 +100,8 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
     /**
      * @return Topology version plus number of seconds from the start time of the first grid node..
      */
-    public int topologyOrder() {
-        return topOrder;
+    public int topologyVersion() {
+        return topVer;
     }
 
     /**
@@ -184,12 +184,12 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
      * @return Version represented as {@code GridUuid}
      */
     public IgniteUuid asGridUuid() {
-        return new IgniteUuid(new UUID(((long)topOrder << 32) | nodeOrderDrId, globalTime), order);
+        return new IgniteUuid(new UUID(((long)topVer << 32) | nodeOrderDrId, globalTime), order);
     }
 
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeInt(topOrder);
+        out.writeInt(topVer);
         out.writeLong(globalTime);
         out.writeLong(order);
         out.writeInt(nodeOrderDrId);
@@ -197,7 +197,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException {
-        topOrder = in.readInt();
+        topVer = in.readInt();
         globalTime = in.readLong();
         order = in.readLong();
         nodeOrderDrId = in.readInt();
@@ -213,12 +213,12 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
 
         GridCacheVersion that = (GridCacheVersion)o;
 
-        return topOrder == that.topOrder && order == that.order && nodeOrder() == that.nodeOrder();
+        return topVer == that.topVer && order == that.order && nodeOrder() == that.nodeOrder();
     }
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        int res = topOrder;
+        int res = topVer;
 
         res = 31 * res + nodeOrder();
 
@@ -230,7 +230,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
     /** {@inheritDoc} */
     @SuppressWarnings("IfMayBeConditional")
     @Override public int compareTo(GridCacheVersion other) {
-        int res = Integer.compare(topologyOrder(), other.topologyOrder());
+        int res = Integer.compare(topologyVersion(), other.topologyVersion());
 
         if (res != 0)
             return res;
@@ -274,7 +274,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeInt("topVer", topOrder))
+                if (!writer.writeInt("topVer", topVer))
                     return false;
 
                 writer.incrementState();
@@ -317,7 +317,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
                 reader.incrementState();
 
             case 3:
-                topOrder = reader.readInt("topVer");
+                topVer = reader.readInt("topVer");
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
index 85b14a4..ecf79c9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
@@ -196,7 +196,7 @@ public class GridCacheVersionManager extends GridCacheSharedManagerAdapter {
      * @return Next version for cache store operations.
      */
     public GridCacheVersion nextForLoad(GridCacheVersion ver) {
-        return next(ver.topologyOrder(), false, true);
+        return next(ver.topologyVersion(), false, true);
     }
 
     /**
@@ -206,7 +206,7 @@ public class GridCacheVersionManager extends GridCacheSharedManagerAdapter {
      * @return Next version based on given cache version.
      */
     public GridCacheVersion next(GridCacheVersion ver) {
-        return next(ver.topologyOrder(), false, false);
+        return next(ver.topologyVersion(), false, false);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/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 a1c40f4..f8c4c7e 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
@@ -8705,7 +8705,7 @@ public abstract class IgniteUtils {
 
             assert drVer != null;
 
-            UNSAFE.putInt(arr, off, drVer.topologyOrder());
+            UNSAFE.putInt(arr, off, drVer.topologyVersion());
 
             off += 4;
 
@@ -8722,7 +8722,7 @@ public abstract class IgniteUtils {
             off += 8;
         }
 
-        UNSAFE.putInt(arr, off, ver.topologyOrder());
+        UNSAFE.putInt(arr, off, ver.topologyVersion());
 
         off += 4;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954c4591/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
index 4e34e16..28358d4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
@@ -116,7 +116,7 @@ public class GridCacheEntryVersionSelfTest extends GridCommonAbstractTest {
                         long order = grid.affinity(null).mapKeyToNode(key).order();
 
                         // Check topology version.
-                        assertEquals(3, ver.topologyOrder() -
+                        assertEquals(3, ver.topologyVersion() -
                             (grid.context().discovery().gridStartTime() - TOP_VER_BASE_TIME) / 1000);
 
                         // Check node order.
@@ -143,7 +143,7 @@ public class GridCacheEntryVersionSelfTest extends GridCommonAbstractTest {
                         long order = grid.affinity(null).mapKeyToNode(key).order();
 
                         // Check topology version.
-                        assertEquals(4, ver.topologyOrder() -
+                        assertEquals(4, ver.topologyVersion() -
                             (grid.context().discovery().gridStartTime() - TOP_VER_BASE_TIME) / 1000);
 
                         // Check node order.


[35/50] incubator-ignite git commit: ignite-1241-dev: fixed endless "failure detection threshold" warnings for the case when there is only one server and client nodes in the topology

Posted by vo...@apache.org.
ignite-1241-dev: fixed endless "failure detection threshold" warnings for the case when there is only one server and client nodes in the topology


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 38070b28bdda9e95b125f27706037c9916edeeb6
Parents: 7760847
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri Aug 14 16:20:18 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Aug 14 16:20:18 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/ServerImpl.java    | 26 ++++++++++++++------
 .../spi/discovery/tcp/TcpDiscoveryImpl.java     |  4 +--
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  4 ---
 .../tcp/internal/TcpDiscoveryNode.java          | 18 +++++++-------
 .../tcp/internal/TcpDiscoveryNodesRing.java     | 23 +++++++++++++++++
 5 files changed, 53 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38070b28/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 76144e3..c8c4c50 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -628,9 +628,9 @@ class ServerImpl extends TcpDiscoveryImpl {
     }
 
     /** {@inheritDoc} */
-    @Override protected void onDataReceived() {
+    @Override protected void onMessageExchanged() {
         if (spi.failureDetectionTimeoutEnabled() && locNode != null)
-            locNode.lastDataReceivedTime(U.currentTimeMillis());
+            locNode.lastExchangeTime(U.currentTimeMillis());
     }
 
     /**
@@ -1916,9 +1916,13 @@ class ServerImpl extends TcpDiscoveryImpl {
             if (spi.ensured(msg))
                 msgHist.add(msg);
 
-            if (msg.senderNodeId() != null && !msg.senderNodeId().equals(getLocalNodeId()))
-                // Reset the flag.
+            if (msg.senderNodeId() != null && !msg.senderNodeId().equals(getLocalNodeId())) {
+                // Received a message from remote node.
+                onMessageExchanged();
+
+                // Reset the failure flag.
                 failureThresholdReached = false;
+            }
 
             spi.stats.onMessageProcessingFinished(msg);
         }
@@ -2278,6 +2282,8 @@ class ServerImpl extends TcpDiscoveryImpl {
 
                                 int res = spi.readReceipt(sock, timeoutHelper.nextTimeoutChunk(ackTimeout0));
 
+                                onMessageExchanged();
+
                                 if (log.isDebugEnabled())
                                     log.debug("Message has been sent to next node [msg=" + msg +
                                         ", next=" + next.id() +
@@ -4104,9 +4110,12 @@ class ServerImpl extends TcpDiscoveryImpl {
          * Check connection aliveness status.
          */
         private void checkConnection() {
+            Boolean hasRemoteSrvNodes = null;
+
             if (spi.failureDetectionTimeoutEnabled() && !failureThresholdReached &&
-                U.currentTimeMillis() - locNode.lastDataReceivedTime() >= connCheckThreshold &&
-                ring.hasRemoteNodes() && spiStateCopy() == CONNECTED) {
+                U.currentTimeMillis() - locNode.lastExchangeTime() >= connCheckThreshold &&
+                spiStateCopy() == CONNECTED &&
+                (hasRemoteSrvNodes = ring.hasRemoteServerNodes())) {
 
                 log.info("Local node seems to be disconnected from topology (failure detection timeout " +
                     "is reached): [failureDetectionTimeout=" + spi.failureDetectionTimeout() +
@@ -4123,7 +4132,10 @@ class ServerImpl extends TcpDiscoveryImpl {
             if (elapsed > 0)
                 return;
 
-            if (ring.hasRemoteNodes()) {
+            if (hasRemoteSrvNodes == null)
+                hasRemoteSrvNodes = ring.hasRemoteServerNodes();
+
+            if (hasRemoteSrvNodes) {
                 sendMessageAcrossRing(new TcpDiscoveryConnectionCheckMessage(locNode));
 
                 lastTimeConnCheckMsgSent = U.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38070b28/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
index e25f0b6..14d037d 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryImpl.java
@@ -132,9 +132,9 @@ abstract class TcpDiscoveryImpl {
     }
 
     /**
-     * Called when a chunk of data is received from a remote node.
+     * Called when a local node either received from or sent to a remote node a message.
      */
-    protected void onDataReceived() {
+    protected void onMessageExchanged() {
         // No-op
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38070b28/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 18a540c..74dc36c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -1371,8 +1371,6 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi, T
 
             T res = marsh.unmarshal(in == null ? sock.getInputStream() : in, U.gridClassLoader());
 
-            impl.onDataReceived();
-
             return res;
         }
         catch (IOException | IgniteCheckedException e) {
@@ -1414,8 +1412,6 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi, T
             if (res == -1)
                 throw new EOFException();
 
-            impl.onDataReceived();
-
             return res;
         }
         catch (SocketTimeoutException e) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38070b28/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
index 44e9006..135dc59 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
@@ -89,8 +89,8 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements Cluste
     @GridToStringExclude
     private volatile long lastUpdateTime = U.currentTimeMillis();
 
-    /** The most recent time when a data chunk was received from a node. */
-    private volatile long lastDataReceivedTime = U.currentTimeMillis();
+    /** The most recent time when node exchanged a message with a remote node. */
+    private volatile long lastExchangeTime = U.currentTimeMillis();
 
     /** Metrics provider (transient). */
     @GridToStringExclude
@@ -393,21 +393,21 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements Cluste
     }
 
     /**
-     * Gets the last time a node received a data chunk from a remote node.
+     * Gets the last time a node exchanged a message with a remote node.
      *
      * @return Time in milliseconds.
      */
-    public long lastDataReceivedTime() {
-        return lastDataReceivedTime;
+    public long lastExchangeTime() {
+        return lastExchangeTime;
     }
 
     /**
-     * Sets the last time a node receive a data chunk from a remote node in a topology.
+     * Sets the last time a node exchanged a message with a remote node.
      *
-     * @param lastDataReceivedTime Time in milliseconds.
+     * @param lastExchangeTime Time in milliseconds.
      */
-    public void lastDataReceivedTime(long lastDataReceivedTime) {
-        this.lastDataReceivedTime = lastDataReceivedTime;
+    public void lastExchangeTime(long lastExchangeTime) {
+        this.lastExchangeTime = lastExchangeTime;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/38070b28/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNodesRing.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNodesRing.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNodesRing.java
index acb479d..2422e14 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNodesRing.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNodesRing.java
@@ -152,6 +152,29 @@ public class TcpDiscoveryNodesRing {
     }
 
     /**
+     * Checks whether the topology has remote server nodes in.
+     *
+     * @return {@code true} if the topology has remote server nodes in.
+     */
+    public boolean hasRemoteServerNodes() {
+        rwLock.readLock().lock();
+
+        try {
+            if (nodes.size() < 2)
+                return false;
+
+            for (TcpDiscoveryNode node : nodes)
+                if (!node.isClient() && !node.id().equals(locNode.id()))
+                    return true;
+
+            return false;
+        }
+        finally {
+            rwLock.readLock().unlock();
+        }
+    }
+
+    /**
      * Adds node to topology, also initializes node last update time with current
      * system time.
      *


[34/50] incubator-ignite git commit: # Wait for next topology version before retry, retries for async tx operations

Posted by vo...@apache.org.
# Wait for next topology version before retry, retries for async tx operations


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 122a9dbf337d5c1128be32d4efee1e0f1dc683f5
Parents: 47895da
Author: sboikov <sb...@gridgain.com>
Authored: Fri Aug 14 12:50:06 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Aug 14 13:57:19 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAdapter.java      | 143 +++++++++++++++++--
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |  25 +++-
 .../IgniteCachePutRetryAbstractSelfTest.java    |  94 ++++++++++--
 3 files changed, 237 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/122a9dbf/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 47ede5b..91af352 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
@@ -2283,8 +2283,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
      * @param filter Filter.
      * @return Put future.
      */
-    public IgniteInternalFuture<Boolean> putAsync(K key, V val,
-                                                  @Nullable CacheEntryPredicate... filter) {
+    public IgniteInternalFuture<Boolean> putAsync(K key, V val, @Nullable CacheEntryPredicate... filter) {
         final boolean statsEnabled = ctx.config().isStatisticsEnabled();
 
         final long start = statsEnabled ? System.nanoTime() : 0L;
@@ -3975,8 +3974,15 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
                         U.addLastCause(e, e1, log);
                     }
 
-                    if (X.hasCause(e, ClusterTopologyCheckedException.class) && i != retries - 1)
+                    if (X.hasCause(e, ClusterTopologyCheckedException.class) && i != retries - 1) {
+                        AffinityTopologyVersion topVer = tx.topologyVersion();
+
+                        assert topVer != null && topVer.topologyVersion() > 0 : tx;
+
+                        ctx.affinity().affinityReadyFuture(topVer.topologyVersion() + 1).get();
+
                         continue;
+                    }
 
                     throw e;
                 }
@@ -4014,18 +4020,36 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
         IgniteTxLocalAdapter tx = ctx.tm().threadLocalTx(ctx);
 
-        if (tx == null || tx.implicit())
-            tx = ctx.tm().newTx(
-                true,
-                op.single(),
-                ctx.systemTx() ? ctx : null,
-                OPTIMISTIC,
-                READ_COMMITTED,
-                ctx.kernalContext().config().getTransactionConfiguration().getDefaultTxTimeout(),
-                !ctx.skipStore(),
-                0);
+        if (tx == null || tx.implicit()) {
+            boolean skipStore = ctx.skipStore(); // Save value of thread-local flag.
+
+            CacheOperationContext opCtx = ctx.operationContextPerCall();
+
+            int retries = opCtx != null && opCtx.noRetries() ? 1 : MAX_RETRIES;
 
-        return asyncOp(tx, op);
+            if (retries == 1) {
+                tx = ctx.tm().newTx(
+                    true,
+                    op.single(),
+                    ctx.systemTx() ? ctx : null,
+                    OPTIMISTIC,
+                    READ_COMMITTED,
+                    ctx.kernalContext().config().getTransactionConfiguration().getDefaultTxTimeout(),
+                    !skipStore,
+                    0);
+
+                return asyncOp(tx, op);
+            }
+            else {
+                AsyncOpRetryFuture<T> fut = new AsyncOpRetryFuture<>(op, skipStore, retries);
+
+                fut.execute();
+
+                return fut;
+            }
+        }
+        else
+            return asyncOp(tx, op);
     }
 
     /**
@@ -4624,6 +4648,97 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
     /**
      *
      */
+    private class AsyncOpRetryFuture<T> extends GridFutureAdapter<T> {
+        /** */
+        private AsyncOp<T> op;
+
+        /** */
+        private boolean skipStore;
+
+        /** */
+        private int retries;
+
+        /** */
+        private IgniteTxLocalAdapter tx;
+
+        /**
+         * @param op Operation.
+         * @param skipStore Skip store flag.
+         * @param retries Number of retries.
+         */
+        public AsyncOpRetryFuture(AsyncOp<T> op,
+            boolean skipStore,
+            int retries) {
+            assert retries > 1 : retries;
+
+            this.op = op;
+            this.tx = null;
+            this.skipStore = skipStore;
+            this.retries = retries;
+        }
+
+        /**
+         * @param tx Transaction.
+         */
+        public void execute() {
+            tx = ctx.tm().newTx(
+                true,
+                op.single(),
+                ctx.systemTx() ? ctx : null,
+                OPTIMISTIC,
+                READ_COMMITTED,
+                ctx.kernalContext().config().getTransactionConfiguration().getDefaultTxTimeout(),
+                !skipStore,
+                0);
+
+            IgniteInternalFuture<T> fut = asyncOp(tx, op);
+
+            fut.listen(new IgniteInClosure<IgniteInternalFuture<T>>() {
+                @Override public void apply(IgniteInternalFuture<T> fut) {
+                    try {
+                        T res = fut.get();
+
+                        onDone(res);
+                    }
+                    catch (IgniteCheckedException e) {
+                        if (X.hasCause(e, ClusterTopologyCheckedException.class) && --retries > 0) {
+                            IgniteTxLocalAdapter tx = AsyncOpRetryFuture.this.tx;
+
+                            assert tx != null;
+
+                            AffinityTopologyVersion topVer = tx.topologyVersion();
+
+                            assert topVer != null && topVer.topologyVersion() > 0 : tx;
+
+                            IgniteInternalFuture<?> topFut =
+                                ctx.affinity().affinityReadyFuture(topVer.topologyVersion() + 1);
+
+                            topFut.listen(new IgniteInClosure<IgniteInternalFuture<?>>() {
+                                @Override public void apply(IgniteInternalFuture<?> topFut) {
+                                    try {
+                                        topFut.get();
+
+                                        execute();
+                                    }
+                                    catch (IgniteCheckedException e) {
+                                        onDone(e);
+                                    }
+                                }
+                            });
+
+                            return;
+                        }
+
+                        onDone(e);
+                    }
+                }
+            });
+        }
+    }
+
+    /**
+     *
+     */
     private static class PeekModes {
         /** */
         private boolean near;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/122a9dbf/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 751c9ba..0498839 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -409,9 +409,15 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
 
         GridFutureAdapter<Void> fut0;
 
+        long nextTopVer;
+
         synchronized (this) {
             mappings = new ConcurrentHashMap8<>(keys.size(), 1.0f);
 
+            assert topVer != null && topVer.topologyVersion() > 0 : this;
+
+            nextTopVer = topVer.topologyVersion() + 1;
+
             topVer = AffinityTopologyVersion.ZERO;
 
             fut0 = topCompleteFut;
@@ -428,7 +434,24 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
         updVer = null;
         topLocked = false;
 
-        map();
+        IgniteInternalFuture<?> fut = cctx.affinity().affinityReadyFuture(nextTopVer);
+
+        fut.listen(new CI1<IgniteInternalFuture<?>>() {
+            @Override public void apply(final IgniteInternalFuture<?> fut) {
+                cctx.kernalContext().closure().runLocalSafe(new Runnable() {
+                    @Override public void run() {
+                        try {
+                            fut.get();
+
+                            map();
+                        }
+                        catch (IgniteCheckedException e) {
+                            onDone(e);
+                        }
+                    }
+                });
+            }
+        });
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/122a9dbf/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
index dcba325..9abc5c8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.testframework.*;
 
+import java.util.*;
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
 
@@ -76,11 +77,25 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
     protected CacheAtomicWriteOrderMode writeOrderMode() {
         return CLOCK;
     }
-
     /**
      * @throws Exception If failed.
      */
     public void testPut() throws Exception {
+        checkPut(false);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPutAsync() throws Exception {
+        checkPut(true);
+    }
+
+    /**
+     * @param async If {@code true} tests asynchronous put.
+     * @throws Exception If failed.
+     */
+    private void checkPut(boolean async) throws Exception {
         final AtomicBoolean finished = new AtomicBoolean();
 
         IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
@@ -104,20 +119,67 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
         if (atomicityMode() == ATOMIC)
             assertEquals(writeOrderMode(), cache.getConfiguration(CacheConfiguration.class).getAtomicWriteOrderMode());
 
-        for (int i = 0; i < keysCnt; i++)
-            cache.put(i, i);
+        int iter = 0;
+
+        long stopTime = System.currentTimeMillis() + 60_000;
+
+        if (async) {
+            IgniteCache<Object, Object> cache0 = cache.withAsync();
+
+            while (System.currentTimeMillis() < stopTime) {
+                Integer val = ++iter;
+
+                for (int i = 0; i < keysCnt; i++) {
+                    cache0.put(i, val);
+
+                    cache0.future().get();
+                }
+
+                for (int i = 0; i < keysCnt; i++) {
+                    cache0.get(i);
+
+                    assertEquals(val, cache0.future().get());
+                }
+            }
+        }
+        else {
+            while (System.currentTimeMillis() < stopTime) {
+                Integer val = ++iter;
+
+                for (int i = 0; i < keysCnt; i++)
+                    cache.put(i, val);
+
+                for (int i = 0; i < keysCnt; i++)
+                    assertEquals(val, cache.get(i));
+            }
+        }
 
         finished.set(true);
         fut.get();
 
         for (int i = 0; i < keysCnt; i++)
-            assertEquals(i, ignite(0).cache(null).get(i));
+            assertEquals(iter, cache.get(i));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testFailsWithNoRetries() throws Exception {
+        checkFailsWithNoRetries(false);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testFailsWithNoRetriesAsync() throws Exception {
+        checkFailsWithNoRetries(true);
     }
 
     /**
+     * @param async If {@code true} tests asynchronous put.
      * @throws Exception If failed.
      */
-    public void testFailWithNoRetries() throws Exception {
+    private void checkFailsWithNoRetries(boolean async) throws Exception {
         final AtomicBoolean finished = new AtomicBoolean();
 
         IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
@@ -136,22 +198,34 @@ public abstract class IgniteCachePutRetryAbstractSelfTest extends GridCacheAbstr
 
         int keysCnt = keysCount();
 
-        boolean exceptionThrown = false;
+        boolean eThrown = false;
+
+        IgniteCache<Object, Object> cache = ignite(0).cache(null).withNoRetries();
+
+        if (async)
+            cache = cache.withAsync();
 
         for (int i = 0; i < keysCnt; i++) {
             try {
-                ignite(0).cache(null).withNoRetries().put(i, i);
+                if (async) {
+                    cache.put(i, i);
+
+                    cache.future().get();
+                }
+                else
+                    cache.put(i, i);
             }
             catch (Exception e) {
-                assertTrue("Invalid exception: " + e, X.hasCause(e, ClusterTopologyCheckedException.class) || X.hasCause(e, CachePartialUpdateException.class));
+                assertTrue("Invalid exception: " + e,
+                    X.hasCause(e, ClusterTopologyCheckedException.class, CachePartialUpdateException.class));
 
-                exceptionThrown = true;
+                eThrown = true;
 
                 break;
             }
         }
 
-        assertTrue(exceptionThrown);
+        assertTrue(eThrown);
 
         finished.set(true);
         fut.get();


[46/50] incubator-ignite git commit: master - index sort fix for merge tables

Posted by vo...@apache.org.
master - index sort fix for merge tables


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 9c939bec1bfa2c3396051c155ffb06775a329aad
Parents: 952c7fc
Author: S.Vladykin <sv...@gridgain.com>
Authored: Mon Aug 17 21:23:26 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Mon Aug 17 21:23:26 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/query/h2/twostep/GridMergeTable.java  | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9c939bec/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
index 0b335d3..7d2235d 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeTable.java
@@ -35,9 +35,6 @@ public class GridMergeTable extends TableBase {
     private final GridKernalContext ctx;
 
     /** */
-    private final ArrayList<Index> idxs = new ArrayList<>(1);
-
-    /** */
     private final GridMergeIndex idx;
 
     /**
@@ -49,8 +46,6 @@ public class GridMergeTable extends TableBase {
 
         this.ctx = ctx;
         idx = new GridMergeIndexUnsorted(this, "merge_scan");
-
-        idxs.add(idx);
     }
 
     /**
@@ -124,7 +119,7 @@ public class GridMergeTable extends TableBase {
 
     /** {@inheritDoc} */
     @Override public ArrayList<Index> getIndexes() {
-        return idxs;
+        return null;
     }
 
     /** {@inheritDoc} */


[18/50] incubator-ignite git commit: Fixed error message

Posted by vo...@apache.org.
Fixed error message


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 653c0b28d340a37893741b0d381a63330732fd10
Parents: d5986c2
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Wed Aug 12 16:54:47 2015 -0700
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Wed Aug 12 16:54:47 2015 -0700

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/GridCacheGateway.java      | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/653c0b28/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
index a3c8da6..93c5858 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheGateway.java
@@ -156,8 +156,7 @@ public class GridCacheGateway<K, V> {
             GridCachePreloader preldr = cache != null ? cache.preloader() : null;
 
             if (preldr == null)
-                throw new IllegalStateException("Grid is in invalid state to perform this operation. " +
-                    "It either not started yet or has already being or have stopped [gridName=" + ctx.gridName() + ']');
+                throw new IllegalStateException("Cache has been closed: " + ctx.name());
 
             preldr.startFuture().get();
         }
@@ -177,7 +176,7 @@ public class GridCacheGateway<K, V> {
         try {
             return setOperationContextPerCall(opCtx);
         }
-        catch (RuntimeException e) {
+        catch (Throwable e) {
             rwLock.readUnlock();
 
             throw e;


[12/50] incubator-ignite git commit: ignite-946: renamed topologyVersion to topologyOrder for GridCacheVersion

Posted by vo...@apache.org.
ignite-946: renamed topologyVersion to topologyOrder for GridCacheVersion


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

Branch: refs/heads/ignite-gg-9615-1
Commit: dd3cecf6a68deec93c084af2f7d7e1be9de9f877
Parents: c1582fc
Author: Denis Magda <dm...@gridgain.com>
Authored: Tue Aug 11 09:02:00 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue Aug 11 09:02:00 2015 +0300

----------------------------------------------------------------------
 .../cache/GridCacheAtomicVersionComparator.java |  4 +--
 .../processors/cache/GridCacheMapEntry.java     |  2 +-
 .../processors/cache/GridCacheUtils.java        |  2 +-
 .../cache/transactions/IgniteTxManager.java     |  2 +-
 .../cache/version/CacheVersionedEntryImpl.java  |  4 +--
 .../version/GridCachePlainVersionedEntry.java   |  2 +-
 .../version/GridCacheRawVersionedEntry.java     |  2 +-
 .../cache/version/GridCacheVersion.java         | 28 ++++++++++----------
 .../cache/version/GridCacheVersionManager.java  |  5 ++--
 .../ignite/internal/util/IgniteUtils.java       |  4 +--
 .../cache/GridCacheEntryVersionSelfTest.java    |  4 +--
 11 files changed, 29 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd3cecf6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
index 3a06100..45288d9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicVersionComparator.java
@@ -32,8 +32,8 @@ public class GridCacheAtomicVersionComparator {
      * @return Comparison value.
      */
     public int compare(GridCacheVersion one, GridCacheVersion other, boolean ignoreTime) {
-        int topVer = one.topologyVersion();
-        int otherTopVer = other.topologyVersion();
+        int topVer = one.topologyOrder();
+        int otherTopVer = other.topologyOrder();
 
         if (topVer == otherTopVer) {
             long globalTime = one.globalTime();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd3cecf6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index 298f7a6..33c42c4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -1927,7 +1927,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
             // Incorporate conflict version into new version if needed.
             if (conflictVer != null && conflictVer != newVer)
-                newVer = new GridCacheVersionEx(newVer.topologyVersion(),
+                newVer = new GridCacheVersionEx(newVer.topologyOrder(),
                     newVer.globalTime(),
                     newVer.order(),
                     newVer.nodeOrder(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd3cecf6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index a313e3d..75f1dee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -1060,7 +1060,7 @@ public class GridCacheUtils {
 
         byte[] bytes = new byte[28];
 
-        U.intToBytes(ver.topologyVersion(), bytes, 0);
+        U.intToBytes(ver.topologyOrder(), bytes, 0);
         U.longToBytes(ver.globalTime(), bytes, 4);
         U.longToBytes(ver.order(), bytes, 12);
         U.intToBytes(ver.nodeOrderAndDrIdRaw(), bytes, 20);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd3cecf6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
index 630330e..446002e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
@@ -2098,7 +2098,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
          * @param nearVer Near transaction version.
          */
         private CommittedVersion(GridCacheVersion ver, GridCacheVersion nearVer) {
-            super(ver.topologyVersion(), ver.globalTime(), ver.order(), ver.nodeOrder(), ver.dataCenterId());
+            super(ver.topologyOrder(), ver.globalTime(), ver.order(), ver.nodeOrder(), ver.dataCenterId());
 
             assert nearVer != null;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd3cecf6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
index 74e4a9a..22b699a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/CacheVersionedEntryImpl.java
@@ -60,7 +60,7 @@ public class CacheVersionedEntryImpl<K, V> extends CacheEntryImpl<K, V> implemen
 
     /** {@inheritDoc} */
     @Override public int topologyVersion() {
-        return ver.topologyVersion();
+        return ver.topologyOrder();
     }
 
     /** {@inheritDoc} */
@@ -94,7 +94,7 @@ public class CacheVersionedEntryImpl<K, V> extends CacheEntryImpl<K, V> implemen
 
     /** {@inheritDoc} */
     public String toString() {
-        return "VersionedEntry [key=" + getKey() + ", val=" + getValue() + ", topVer=" + ver.topologyVersion() +
+        return "VersionedEntry [key=" + getKey() + ", val=" + getValue() + ", topVer=" + ver.topologyOrder() +
             ", nodeOrder=" + ver.nodeOrder() + ", order=" + ver.order() + ", creationTime=" + ver.globalTime() + ']';
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd3cecf6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
index 4f13ae7..102805c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCachePlainVersionedEntry.java
@@ -101,7 +101,7 @@ public class GridCachePlainVersionedEntry<K, V> implements GridCacheVersionedEnt
 
     /** {@inheritDoc} */
     @Override public int topologyVersion() {
-        return ver.topologyVersion();
+        return ver.topologyOrder();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd3cecf6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
index 87fe976..f8d33f6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheRawVersionedEntry.java
@@ -155,7 +155,7 @@ public class GridCacheRawVersionedEntry<K, V> extends DataStreamerEntry implemen
 
     /** {@inheritDoc} */
     @Override public int topologyVersion() {
-        return ver.topologyVersion();
+        return ver.topologyOrder();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd3cecf6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
index 64eef99..7adfa2e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersion.java
@@ -42,7 +42,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
     private static final int DR_ID_MASK = 0x1F;
 
     /** Topology version. */
-    private int topVer;
+    private int topOrder;
 
     /** Node order (used as global order) and DR ID. */
     private int nodeOrderDrId;
@@ -76,7 +76,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
         if (nodeOrder > NODE_ORDER_MASK)
             throw new IllegalArgumentException("Node order overflow: " + nodeOrder);
 
-        this.topVer = topVer;
+        this.topOrder = topVer;
         this.globalTime = globalTime;
         this.order = order;
 
@@ -85,13 +85,13 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
 
 
     /**
-     * @param topVer Topology version.
+     * @param topVer Topology version plus number of seconds from the start time of the first grid node.
      * @param nodeOrderDrId Node order and DR ID.
      * @param globalTime Globally adjusted time.
      * @param order Version order.
      */
     public GridCacheVersion(int topVer, int nodeOrderDrId, long globalTime, long order) {
-        this.topVer = topVer;
+        this.topOrder = topVer;
         this.nodeOrderDrId = nodeOrderDrId;
         this.globalTime = globalTime;
         this.order = order;
@@ -100,8 +100,8 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
     /**
      * @return Topology version plus number of seconds from the start time of the first grid node..
      */
-    public int topologyVersion() {
-        return topVer;
+    public int topologyOrder() {
+        return topOrder;
     }
 
     /**
@@ -184,12 +184,12 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
      * @return Version represented as {@code GridUuid}
      */
     public IgniteUuid asGridUuid() {
-        return new IgniteUuid(new UUID(((long)topVer << 32) | nodeOrderDrId, globalTime), order);
+        return new IgniteUuid(new UUID(((long)topOrder << 32) | nodeOrderDrId, globalTime), order);
     }
 
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeInt(topVer);
+        out.writeInt(topOrder);
         out.writeLong(globalTime);
         out.writeLong(order);
         out.writeInt(nodeOrderDrId);
@@ -197,7 +197,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException {
-        topVer = in.readInt();
+        topOrder = in.readInt();
         globalTime = in.readLong();
         order = in.readLong();
         nodeOrderDrId = in.readInt();
@@ -213,12 +213,12 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
 
         GridCacheVersion that = (GridCacheVersion)o;
 
-        return topVer == that.topVer && order == that.order && nodeOrder() == that.nodeOrder();
+        return topOrder == that.topOrder && order == that.order && nodeOrder() == that.nodeOrder();
     }
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        int res = topVer;
+        int res = topOrder;
 
         res = 31 * res + nodeOrder();
 
@@ -230,7 +230,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
     /** {@inheritDoc} */
     @SuppressWarnings("IfMayBeConditional")
     @Override public int compareTo(GridCacheVersion other) {
-        int res = Integer.compare(topologyVersion(), other.topologyVersion());
+        int res = Integer.compare(topologyOrder(), other.topologyOrder());
 
         if (res != 0)
             return res;
@@ -274,7 +274,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
                 writer.incrementState();
 
             case 3:
-                if (!writer.writeInt("topVer", topVer))
+                if (!writer.writeInt("topVer", topOrder))
                     return false;
 
                 writer.incrementState();
@@ -317,7 +317,7 @@ public class GridCacheVersion implements Message, Comparable<GridCacheVersion>,
                 reader.incrementState();
 
             case 3:
-                topVer = reader.readInt("topVer");
+                topOrder = reader.readInt("topVer");
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd3cecf6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
index 90919c7..d465a0c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/version/GridCacheVersionManager.java
@@ -24,7 +24,6 @@ import org.apache.ignite.internal.managers.eventstorage.*;
 import org.apache.ignite.internal.processors.affinity.*;
 import org.apache.ignite.internal.processors.cache.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.lang.*;
 
 import java.util.*;
 import java.util.concurrent.atomic.*;
@@ -197,7 +196,7 @@ public class GridCacheVersionManager extends GridCacheSharedManagerAdapter {
      * @return Next version for cache store operations.
      */
     public GridCacheVersion nextForLoad(GridCacheVersion ver) {
-        return next(ver.topologyVersion(), false, true);
+        return next(ver.topologyOrder(), false, true);
     }
 
     /**
@@ -207,7 +206,7 @@ public class GridCacheVersionManager extends GridCacheSharedManagerAdapter {
      * @return Next version based on given cache version.
      */
     public GridCacheVersion next(GridCacheVersion ver) {
-        return next(ver.topologyVersion(), false, false);
+        return next(ver.topologyOrder(), false, false);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd3cecf6/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 f8c4c7e..a1c40f4 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
@@ -8705,7 +8705,7 @@ public abstract class IgniteUtils {
 
             assert drVer != null;
 
-            UNSAFE.putInt(arr, off, drVer.topologyVersion());
+            UNSAFE.putInt(arr, off, drVer.topologyOrder());
 
             off += 4;
 
@@ -8722,7 +8722,7 @@ public abstract class IgniteUtils {
             off += 8;
         }
 
-        UNSAFE.putInt(arr, off, ver.topologyVersion());
+        UNSAFE.putInt(arr, off, ver.topologyOrder());
 
         off += 4;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd3cecf6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
index 28358d4..4e34e16 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
@@ -116,7 +116,7 @@ public class GridCacheEntryVersionSelfTest extends GridCommonAbstractTest {
                         long order = grid.affinity(null).mapKeyToNode(key).order();
 
                         // Check topology version.
-                        assertEquals(3, ver.topologyVersion() -
+                        assertEquals(3, ver.topologyOrder() -
                             (grid.context().discovery().gridStartTime() - TOP_VER_BASE_TIME) / 1000);
 
                         // Check node order.
@@ -143,7 +143,7 @@ public class GridCacheEntryVersionSelfTest extends GridCommonAbstractTest {
                         long order = grid.affinity(null).mapKeyToNode(key).order();
 
                         // Check topology version.
-                        assertEquals(4, ver.topologyVersion() -
+                        assertEquals(4, ver.topologyOrder() -
                             (grid.context().discovery().gridStartTime() - TOP_VER_BASE_TIME) / 1000);
 
                         // Check node order.


[22/50] incubator-ignite git commit: # Test for ignite-1245.

Posted by vo...@apache.org.
# Test for ignite-1245.


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

Branch: refs/heads/ignite-gg-9615-1
Commit: aed83af5f76c47bc9e4d0e8f60955fc6c6b42aac
Parents: 36f7ba6
Author: sboikov <sb...@gridgain.com>
Authored: Thu Aug 13 13:05:43 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Aug 13 13:05:43 2015 +0300

----------------------------------------------------------------------
 .../IgniteCacheContinuousQueryClientTest.java   | 114 +++++++++++++++++++
 1 file changed, 114 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aed83af5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryClientTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryClientTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryClientTest.java
new file mode 100644
index 0000000..bb413a0
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryClientTest.java
@@ -0,0 +1,114 @@
+/*
+ * 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.query.continuous;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.query.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.resources.*;
+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.event.*;
+import java.util.concurrent.*;
+
+import static java.util.concurrent.TimeUnit.*;
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
+
+/**
+ *
+ */
+public class IgniteCacheContinuousQueryClientTest extends GridCommonAbstractTest {
+    /** */
+    protected static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    private boolean client;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        CacheConfiguration ccfg = new CacheConfiguration();
+
+        ccfg.setCacheMode(PARTITIONED);
+        ccfg.setAtomicityMode(ATOMIC);
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
+
+        cfg.setCacheConfiguration(ccfg);
+
+        cfg.setClientMode(client);
+
+        return cfg;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testNodeJoins() throws Exception {
+        startGrids(2);
+
+        client = true;
+
+        Ignite clientNode = startGrid(3);
+
+        client = false;
+
+        CacheEventListener lsnr = new CacheEventListener();
+
+        ContinuousQuery<Object, Object> qry = new ContinuousQuery<>();
+
+        qry.setLocalListener(lsnr);
+
+        QueryCursor<?> cur = clientNode.cache(null).query(qry);
+
+        Ignite joined = startGrid(4);
+
+        IgniteCache<Object, Object> joinedCache = joined.cache(null);
+
+        joinedCache.put(primaryKey(joinedCache), 1);
+
+        assertTrue("Failed to wait for event.", lsnr.latch.await(5, SECONDS));
+
+        cur.close();
+    }
+
+    /**
+     *
+     */
+    private static class CacheEventListener implements CacheEntryUpdatedListener<Object, Object> {
+        /** */
+        private final CountDownLatch latch = new CountDownLatch(1);
+
+        /** */
+        @LoggerResource
+        private IgniteLogger log;
+
+        /** {@inheritDoc} */
+        @Override public void onUpdated(Iterable<CacheEntryEvent<?, ?>> evts) {
+            for (CacheEntryEvent<?, ?> evt : evts) {
+                log.info("Received cache event: " + evt);
+
+                latch.countDown();
+            }
+        }
+    }
+}


[40/50] incubator-ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.3.3-p2'

Posted by vo...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1.3.3-p2'

Conflicts:
	examples/pom.xml
	modules/aop/pom.xml
	modules/apache-license-gen/pom.xml
	modules/aws/pom.xml
	modules/clients/pom.xml
	modules/cloud/pom.xml
	modules/codegen/pom.xml
	modules/core/pom.xml
	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
	modules/core/src/main/resources/ignite.properties
	modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheDhtLocalPartitionAfterRemoveSelfTest.java
	modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
	modules/extdata/p2p/pom.xml
	modules/extdata/uri/modules/uri-dependency/pom.xml
	modules/extdata/uri/pom.xml
	modules/gce/pom.xml
	modules/geospatial/pom.xml
	modules/hadoop/pom.xml
	modules/hibernate/pom.xml
	modules/indexing/pom.xml
	modules/jcl/pom.xml
	modules/jta/pom.xml
	modules/kafka/pom.xml
	modules/log4j/pom.xml
	modules/mesos/pom.xml
	modules/rest-http/pom.xml
	modules/scalar-2.10/pom.xml
	modules/scalar/pom.xml
	modules/schedule/pom.xml
	modules/schema-import/pom.xml
	modules/slf4j/pom.xml
	modules/spark-2.10/pom.xml
	modules/spark/pom.xml
	modules/spring/pom.xml
	modules/ssh/pom.xml
	modules/tools/pom.xml
	modules/urideploy/pom.xml
	modules/visor-console-2.10/pom.xml
	modules/visor-console/pom.xml
	modules/visor-plugins/pom.xml
	modules/web/pom.xml
	modules/yardstick/pom.xml
	modules/yarn/pom.xml
	pom.xml

Merge remote-tracking branch 'remotes/origin/ignite-1.3.3-p2'

Conflicts:
	benchmarks/cache-comparison/pom.xml
	benchmarks/filesystem/hadoop1/pom.xml
	benchmarks/filesystem/hadoop2/pom.xml
	benchmarks/mongo/pom.xml
	benchmarks/risk-analytics/pom.xml
	benchmarks/serialization/pom.xml
	benchmarks/yardstick/src/main/dotnet/gridgain-benchmarks/Properties/AssemblyInfo.cs
	examples/clients/cpp/configure.ac
	examples/clients/dotnet/GridGainExamples/GridGainExamples/Properties/AssemblyInfo.cs
	examples/clients/dotnet/GridGainExamples/GridGainExamplesDll/Properties/AssemblyInfo.cs
	examples/pom.xml
	modules/clients/common/configure.ac
	modules/clients/common/project/vs/Resource.rc
	modules/clients/cpp/_old/main/configure.ac
	modules/clients/cpp/_old/main/tests/configure.ac
	modules/clients/cpp/_old/vsproject/resource.h
	modules/clients/cpp/core-test/configure.ac
	modules/clients/cpp/core-test/project/vs/Resource.rc
	modules/clients/cpp/core/configure.ac
	modules/clients/cpp/core/project/vs/Resource.rc
	modules/clients/dotnet/gridgain-codegen/Properties/AssemblyInfo.cs
	modules/clients/dotnet/gridgain-exe/Properties/AssemblyInfo.cs
	modules/clients/dotnet/gridgain/Properties/AssemblyInfo.cs
	modules/clients/pom.xml
	modules/clients/src/test/dotnet/gridgain-examples-test/Properties/AssemblyInfo.cs
	modules/clients/src/test/dotnet/gridgain-test-compatibility/Properties/AssemblyInfo.cs
	modules/clients/src/test/dotnet/gridgain-test-dll/Properties/AssemblyInfo.cs
	modules/clients/src/test/dotnet/gridgain-test-runner/Properties/AssemblyInfo.cs
	modules/clients/src/test/dotnet/gridgain-test/Properties/AssemblyInfo.cs
	modules/codegen/pom.xml
	modules/compatibility/gg-versions/7.3.3/src/main/java/org/gridgain/grid/compatibility/GridCompatibilityTestsRunner.java
	modules/compatibility/pom.xml
	modules/core/pom.xml
	modules/core/src/main/resources/gridgain.properties
	modules/diagnostic/pom.xml
	modules/dr-demo/pom.xml
	modules/license-gen/pom.xml
	modules/mongo-sniffer/pom.xml
	modules/mongo-visor/pom.xml
	modules/mongo/pom.xml
	modules/tools/pom.xml
	modules/visor-console/pom.xml
	modules/visor-demo/pom.xml
	modules/visor-tester-plugin/pom.xml
	modules/visor-tester/pom.xml
	modules/visor/pom.xml
	modules/yardstick/dotnet/Properties/AssemblyInfo.cs
	modules/yardstick/pom.xml
	parent/pom.xml
	pilots/chronotrack/pom.xml
	pilots/ctb/pom.xml
	pilots/dsi/pom.xml
	pilots/ionic/pom.xml
	pilots/sb/pom.xml
	pilots/sony/pom.xml
	pilots/wellsfargo/pom.xml
	pilots/worldpay/pom.xml
	pom.xml


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

Branch: refs/heads/ignite-gg-9615-1
Commit: 648cbd78282dea1e895a80be9d1322952d4d7af3
Parents: 0d70112 5faffb9
Author: Anton Vinogradov <vi...@gmail.com>
Authored: Mon Aug 17 10:58:54 2015 +0300
Committer: Anton Vinogradov <vi...@gmail.com>
Committed: Mon Aug 17 10:58:54 2015 +0300

----------------------------------------------------------------------
 .../CachePartialUpdateCheckedException.java     |  29 +++-
 .../processors/cache/GridCacheAdapter.java      | 160 +++++++++++++++++--
 .../processors/cache/GridCacheMapEntry.java     |   4 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |  63 ++++++--
 .../near/GridNearOptimisticTxPrepareFuture.java |   2 +-
 ...cheDhtLocalPartitionAfterRemoveSelfTest.java |  33 ++--
 .../cache/GridCacheAbstractFullApiSelfTest.java |   1 -
 .../IgniteCacheSizeFailoverTest.java            | 115 +++++++++++++
 .../IgniteCachePutRetryAbstractSelfTest.java    | 120 ++++++++++++--
 ...PutRetryAtomicPrimaryWriteOrderSelfTest.java |  32 ++++
 .../tcp/IgniteCacheSslStartStopSelfTest.java    |   1 +
 .../IgniteCacheFailoverTestSuite.java           |   3 +
 .../testsuites/IgniteCacheTestSuite2.java       |   1 +
 13 files changed, 499 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/648cbd78/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index d125382,992edd8..00c0629
--- 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
@@@ -2278,8 -2283,7 +2278,9 @@@ public abstract class GridCacheAdapter<
       * @param filter Filter.
       * @return Put future.
       */
 +    public IgniteInternalFuture<Boolean> putAsync(K key, V val,
 +        @Nullable CacheEntryPredicate... filter) {
+     public IgniteInternalFuture<Boolean> putAsync(K key, V val, @Nullable CacheEntryPredicate... filter) {
          final boolean statsEnabled = ctx.config().isStatisticsEnabled();
  
          final long start = statsEnabled ? System.nanoTime() : 0L;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/648cbd78/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/648cbd78/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/648cbd78/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearOptimisticTxPrepareFuture.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/648cbd78/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/648cbd78/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
index 7f2d173,9abc5c8..74f62ba
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCachePutRetryAbstractSelfTest.java
@@@ -69,10 -81,23 +81,25 @@@ public abstract class IgniteCachePutRet
       * @throws Exception If failed.
       */
      public void testPut() throws Exception {
+         checkPut(false);
+     }
+ 
+     /**
+      * @throws Exception If failed.
+      */
+     public void testPutAsync() throws Exception {
+         checkPut(true);
+     }
+ 
+     /**
+      * @param async If {@code true} tests asynchronous put.
+      * @throws Exception If failed.
+      */
+     private void checkPut(boolean async) throws Exception {
          final AtomicBoolean finished = new AtomicBoolean();
  
 +        int keysCnt = keysCount();
 +
          IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
              @Override public Object call() throws Exception {
                  while (!finished.get()) {
@@@ -87,21 -112,53 +114,58 @@@
              }
          });
  
 -        int keysCnt = keysCount();
  
-         try {
-             for (int i = 0; i < keysCnt; i++)
-                 ignite(0).cache(null).put(i, i);
+         IgniteCache<Object, Object> cache = ignite(0).cache(null);
  
-             finished.set(true);
+         if (atomicityMode() == ATOMIC)
+             assertEquals(writeOrderMode(), cache.getConfiguration(CacheConfiguration.class).getAtomicWriteOrderMode());
+ 
+         int iter = 0;
+ 
+         long stopTime = System.currentTimeMillis() + 60_000;
+ 
+         if (async) {
+             IgniteCache<Object, Object> cache0 = cache.withAsync();
+ 
+             while (System.currentTimeMillis() < stopTime) {
+                 Integer val = ++iter;
+ 
+                 for (int i = 0; i < keysCnt; i++) {
+                     cache0.put(i, val);
+ 
+                     cache0.future().get();
+                 }
+ 
+                 for (int i = 0; i < keysCnt; i++) {
+                     cache0.get(i);
+ 
+                     assertEquals(val, cache0.future().get());
+                 }
+             }
+         }
+         else {
+             while (System.currentTimeMillis() < stopTime) {
+                 Integer val = ++iter;
+ 
+                 for (int i = 0; i < keysCnt; i++)
+                     cache.put(i, val);
+ 
+                 for (int i = 0; i < keysCnt; i++)
+                     assertEquals(val, cache.get(i));
+             }
+         }
+ 
+         finished.set(true);
+         fut.get();
  
 +            fut.get();
 +        }
 +        finally {
 +            finished.set(true);
 +        }
 +
          for (int i = 0; i < keysCnt; i++)
-             assertEquals(i, ignite(0).cache(null).get(i));
+             assertEquals(iter, cache.get(i));
      }
  
      /**
@@@ -124,34 -196,39 +203,45 @@@
              }
          });
  
 -        int keysCnt = keysCount();
 +        try {
 +            int keysCnt = keysCount();
  
-             boolean eThrown = false;
+         boolean eThrown = false;
+ 
+         IgniteCache<Object, Object> cache = ignite(0).cache(null).withNoRetries();
+ 
+         if (async)
+             cache = cache.withAsync();
  
-             for (int i = 0; i < keysCnt; i++) {
-                 try {
-                     ignite(0).cache(null).withNoRetries().put(i, i);
+         for (int i = 0; i < keysCnt; i++) {
+             try {
+                 if (async) {
+                     cache.put(i, i);
+ 
+                     cache.future().get();
                  }
-                 catch (Exception e) {
-                     assertTrue("Invalid exception: " + e, X.hasCause(e, ClusterTopologyCheckedException.class) ||
-                         X.hasCause(e, CachePartialUpdateException.class));
+                 else
+                     cache.put(i, i);
+             }
+             catch (Exception e) {
+                 assertTrue("Invalid exception: " + e,
+                     X.hasCause(e, ClusterTopologyCheckedException.class, CachePartialUpdateException.class));
  
-                     eThrown = true;
+                 eThrown = true;
  
 -                break;
 +                    break;
 +                }
              }
 -        }
  
-             assertTrue(eThrown);
+         assertTrue(eThrown);
  
 -        finished.set(true);
 -        fut.get();
 +            finished.set(true);
 +
 +            fut.get();
 +        }
 +        finally {
 +            finished.set(true);
 +        }
      }
  
      /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/648cbd78/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite2.java
----------------------------------------------------------------------