You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by av...@apache.org on 2015/07/17 14:51:10 UTC
[01/50] [abbrv] incubator-ignite git commit: Javadoc fixed
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-630 fd541fc3b -> 79ba5a792
Javadoc fixed
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ab655edf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ab655edf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ab655edf
Branch: refs/heads/ignite-630
Commit: ab655edf102328c654cac3dbd1ab31db1392fa47
Parents: a747ca4
Author: agura <ag...@gridgain.com>
Authored: Fri Jul 10 17:10:09 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri Jul 10 17:10:09 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/configuration/CacheConfiguration.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ab655edf/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 63c7269..57f1e9d 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -828,7 +828,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
/**
* Gets caching mode to use. You can configure cache either to be local-only,
- * fully replicated, partitioned, or near. If not provided, {@link CacheMode#REPLICATED}
+ * fully replicated, partitioned, or near. If not provided, {@link CacheMode#PARTITIONED}
* mode will be used by default (defined by {@link #DFLT_CACHE_MODE} constant).
*
* @return {@code True} if cache is local.
[25/50] [abbrv] incubator-ignite git commit: ignite-1085:
reimplemented
Posted by av...@apache.org.
ignite-1085: reimplemented
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f0ace1f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f0ace1f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f0ace1f9
Branch: refs/heads/ignite-630
Commit: f0ace1f997b3e7b7a0692870aba4fd80302f9813
Parents: 24aae82
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Jul 15 14:03:50 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jul 15 14:03:50 2015 +0300
----------------------------------------------------------------------
.../discovery/GridDiscoveryManager.java | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f0ace1f9/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 1bac4d0..b35628c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -193,6 +193,9 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
super(ctx, ctx.config().getDiscoverySpi());
}
+ /** */
+ private final CountDownLatch startLatch = new CountDownLatch(1);
+
/**
* @return Memory usage of non-heap memory.
*/
@@ -376,8 +379,6 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
});
}
- final CountDownLatch startLatch = new CountDownLatch(1);
-
spi.setListener(new DiscoverySpiListener() {
@Override public void onDiscovery(
int type,
@@ -1052,6 +1053,8 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
/** {@inheritDoc} */
@Override public void onKernalStop0(boolean cancel) {
+ startLatch.countDown();
+
// Stop segment check worker.
if (segChkWrk != null) {
segChkWrk.cancel();
@@ -1224,16 +1227,9 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
* @return Discovery collection cache.
*/
public DiscoCache discoCache() {
- Snapshot cur;
-
- while ((cur = topSnap.get()) == null) {
- // Wrap the SPI collection to avoid possible floating collection.
- if (topSnap.compareAndSet(null, cur = new Snapshot(
- AffinityTopologyVersion.ZERO,
- new DiscoCache(localNode(), getSpi().getRemoteNodes())))) {
- return cur.discoCache;
- }
- }
+ Snapshot cur = topSnap.get();
+
+ assert cur != null;
return cur.discoCache;
}
[11/50] [abbrv] incubator-ignite git commit: release notes
Posted by av...@apache.org.
release notes
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d5ed4947
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d5ed4947
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d5ed4947
Branch: refs/heads/ignite-630
Commit: d5ed4947f299f61a94a7b4856c60908c98eff5da
Parents: ee8820a
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Jul 13 14:24:18 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Jul 13 14:24:18 2015 +0300
----------------------------------------------------------------------
RELEASE_NOTES.txt | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d5ed4947/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index f68a339..73ea48b 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -6,6 +6,7 @@ Apache Ignite In-Memory Data Fabric 1.3
* Added auto-retries for cache operations in recoverable cases.
* Added integration with Apache YARN.
+* Added auto detection and dropping of slow client nodes.
* Fixed several issues with JTA integration.
* Fixed several issues with Hibernate L2 cache.
* Fixed issue with GAR files in source release.
[30/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/master'
Posted by av...@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/cd3a9b61
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cd3a9b61
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cd3a9b61
Branch: refs/heads/ignite-630
Commit: cd3a9b61bbad20dc0cd2ba239de6399aa2754dc3
Parents: d38a70d bdd1762
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Jul 15 20:04:53 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Jul 15 20:04:53 2015 -0700
----------------------------------------------------------------------
.../internal/processors/query/GridQueryProcessor.java | 4 +++-
.../GridCacheAbstractNodeRestartSelfTest.java | 12 ++++++------
.../IgniteCacheAtomicReplicatedNodeRestartSelfTest.java | 5 +++++
3 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
[18/50] [abbrv] incubator-ignite git commit: ignite-mys-26: fixed
queries on local nodes when keepPortable is set
Posted by av...@apache.org.
ignite-mys-26: fixed queries on local nodes when keepPortable is set
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/322e5df8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/322e5df8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/322e5df8
Branch: refs/heads/ignite-630
Commit: 322e5df8e28b5b1d36bf04afc25fd5845f3115b7
Parents: b19ed0c
Author: Denis Magda <dm...@gridgain.com>
Authored: Tue Jul 14 17:45:53 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Tue Jul 14 17:45:53 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/processors/query/GridQueryProcessor.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/322e5df8/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 6af0f40..1ba1fae 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -737,6 +737,8 @@ public class GridQueryProcessor extends GridProcessorAdapter {
throw new IllegalStateException("Failed to execute query (grid is stopping).");
try {
+ final boolean keepPortable = cctx.keepPortable();
+
return executeQuery(cctx, new IgniteOutClosureX<QueryCursor<List<?>>>() {
@Override public QueryCursor<List<?>> applyx() throws IgniteCheckedException {
String space = cctx.name();
@@ -750,7 +752,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
QueryCursorImpl<List<?>> cursor = new QueryCursorImpl<>(new Iterable<List<?>>() {
@Override public Iterator<List<?>> iterator() {
- return new GridQueryCacheObjectsIterator(res.iterator(), cctx, cctx.keepPortable());
+ return new GridQueryCacheObjectsIterator(res.iterator(), cctx, keepPortable);
}
});
[05/50] [abbrv] incubator-ignite git commit: # ignite-648:
Implemented.
Posted by av...@apache.org.
# ignite-648: Implemented.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8218fe6f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8218fe6f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8218fe6f
Branch: refs/heads/ignite-630
Commit: 8218fe6fa42b2daa6816cf862fe1450ad0cf11d3
Parents: ab655ed
Author: ashutak <as...@gridgain.com>
Authored: Fri Jul 10 21:40:31 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Fri Jul 10 21:40:31 2015 +0300
----------------------------------------------------------------------
modules/core/pom.xml | 7 +
.../affinity/fair/FairAffinityFunction.java | 5 +-
.../cache/GridCacheAbstractFullApiSelfTest.java | 323 ++++++----
.../cache/GridCacheAbstractSelfTest.java | 14 +-
...eAtomicNearOnlyMultiNodeFullApiSelfTest.java | 3 +
...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 5 +-
.../near/GridCacheNearTxMultiNodeSelfTest.java | 10 +-
...achePartitionedMultiNodeFullApiSelfTest.java | 48 +-
...OnlyFairAffinityMultiJvmFullApiSelfTest.java | 31 +
...AtomicClientOnlyMultiJvmFullApiSelfTest.java | 31 +
...tOnlyMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...pyOnReadDisabledMultiJvmFullApiSelfTest.java | 31 +
...omicFairAffinityMultiJvmFullApiSelfTest.java | 31 +
.../GridCacheAtomicMultiJvmFullApiSelfTest.java | 30 +
...tomicMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...bledFairAffinityMultiJvmFullApiSelfTest.java | 31 +
...tomicNearEnabledMultiJvmFullApiSelfTest.java | 31 +
...rimaryWriteOrderMultiJvmFullApiSelfTest.java | 31 +
...heAtomicNearOnlyMultiJvmFullApiSelfTest.java | 31 +
...rOnlyMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...cheAtomicOffHeapMultiJvmFullApiSelfTest.java | 31 +
...micOffHeapTieredMultiJvmFullApiSelfTest.java | 36 ++
...rderFairAffinityMultiJvmFullApiSelfTest.java | 31 +
...rimaryWriteOrderMultiJvmFullApiSelfTest.java | 31 +
...OrderMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...rityOrderOffHeapMultiJvmFullApiSelfTest.java | 31 +
...derOffHeapTieredMultiJvmFullApiSelfTest.java | 36 ++
...OnlyFairAffinityMultiJvmFullApiSelfTest.java | 31 +
...ridCacheNearOnlyMultiJvmFullApiSelfTest.java | 30 +
...rOnlyMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...pyOnReadDisabledMultiJvmFullApiSelfTest.java | 31 +
...onedFairAffinityMultiJvmFullApiSelfTest.java | 31 +
...CachePartitionedMultiJvmFullApiSelfTest.java | 30 +
...ionedMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...micOffHeapTieredMultiJvmFullApiSelfTest.java | 36 ++
...bledFairAffinityMultiJvmFullApiSelfTest.java | 31 +
...onedNearDisabledMultiJvmFullApiSelfTest.java | 31 +
...abledMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...rDisabledOffHeapMultiJvmFullApiSelfTest.java | 31 +
...ledOffHeapTieredMultiJvmFullApiSelfTest.java | 36 ++
...rtitionedOffHeapMultiJvmFullApiSelfTest.java | 31 +
...nedOffHeapTieredMultiJvmFullApiSelfTest.java | 36 ++
...ReplicatedAtomicMultiJvmFullApiSelfTest.java | 31 +
...rimaryWriteOrderMultiJvmFullApiSelfTest.java | 31 +
...dCacheReplicatedMultiJvmFullApiSelfTest.java | 30 +
...catedMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...plicatedNearOnlyMultiJvmFullApiSelfTest.java | 37 ++
...eplicatedOffHeapMultiJvmFullApiSelfTest.java | 31 +
...tedOffHeapTieredMultiJvmFullApiSelfTest.java | 36 ++
.../testframework/junits/GridAbstractTest.java | 380 +++++++++++-
.../junits/common/GridCommonAbstractTest.java | 50 +-
.../junits/multijvm/AffinityProcessProxy.java | 195 ++++++
.../multijvm/IgniteCacheProcessProxy.java | 602 +++++++++++++++++++
.../multijvm/IgniteClusterProcessProxy.java | 320 ++++++++++
.../multijvm/IgniteEventsProcessProxy.java | 148 +++++
.../junits/multijvm/IgniteNodeRunner.java | 184 ++++++
.../junits/multijvm/IgniteProcessProxy.java | 571 ++++++++++++++++++
...IgniteCacheFullApiMultiJvmSelfTestSuite.java | 89 +++
parent/pom.xml | 40 ++
pom.xml | 1 -
60 files changed, 4094 insertions(+), 204 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 6c5af02..5ac49ae 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -55,6 +55,13 @@
</dependency>
<dependency>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ <version>1.4.8</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.2</version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java
index 0253e62..14a4f53 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/fair/FairAffinityFunction.java
@@ -19,7 +19,7 @@ package org.apache.ignite.cache.affinity.fair;
import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cluster.*;
-import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.*;
import org.apache.ignite.events.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -31,7 +31,8 @@ import java.util.*;
* Fair affinity function which tries to ensure that all nodes get equal number of partitions with
* minimum amount of reassignments between existing nodes.
* <p>
- * Cache affinity can be configured for individual caches via {@link CacheConfiguration#getAffinity()} method.
+ * Cache affinity can be configured for individual caches via
+ * {@link CacheConfiguration#setAffinity(AffinityFunction)} method.
*/
@AffinityCentralizedFunction
public class FairAffinityFunction implements AffinityFunction {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/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 151c249..f8d1ce3 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
@@ -61,6 +61,7 @@ import static org.apache.ignite.transactions.TransactionState.*;
/**
* Full API cache test.
*/
+@SuppressWarnings("TransientFieldInNonSerializableClass")
public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstractSelfTest {
/** Increment processor for invoke operations. */
public static final EntryProcessor<String, Integer, String> INCR_PROCESSOR = new EntryProcessor<String, Integer, String>() {
@@ -105,7 +106,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
};
/** Dflt grid. */
- protected Ignite dfltIgnite;
+ protected transient Ignite dfltIgnite;
/** */
private Map<String, CacheConfiguration[]> cacheCfgMap;
@@ -162,7 +163,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
super.beforeTestsStarted();
for (Map.Entry<String, CacheConfiguration[]> entry : cacheCfgMap.entrySet()) {
- Ignite ignite = IgnitionEx.grid(entry.getKey());
+ Ignite ignite = grid(entry.getKey());
for (CacheConfiguration cfg : entry.getValue())
ignite.createCache(cfg);
@@ -206,7 +207,10 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cfg.setCacheConfiguration();
- return IgnitionEx.start(optimize(cfg), ctx);
+ if (!isRemoteJvm(gridName))
+ return IgnitionEx.start(optimize(cfg), ctx);
+ else
+ return startRemoteGrid(gridName, optimize(cfg), ctx);
}
/** {@inheritDoc} */
@@ -251,7 +255,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
int size = 10;
- Map<String, Integer> map = new HashMap<>();
+ final Map<String, Integer> map = new HashMap<>();
for (int i = 0; i < size; i++)
map.put("key" + i, i);
@@ -284,15 +288,19 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
}
for (int i = 0; i < gridCount(); i++) {
- GridCacheContext<String, Integer> ctx = context(i);
+ executeOnLocalOrRemoteJvm(i, new TestIgniteIdxRunnable() {
+ @Override public void run(int idx) throws Exception {
+ GridCacheContext<String, Integer> ctx = context(idx);
- int sum = 0;
+ int sum = 0;
- for (String key : map.keySet())
- if (ctx.affinity().localNode(key, new AffinityTopologyVersion(ctx.discovery().topologyVersion())))
- sum++;
+ for (String key : map.keySet())
+ if (ctx.affinity().localNode(key, new AffinityTopologyVersion(ctx.discovery().topologyVersion())))
+ sum++;
- assertEquals("Incorrect key size on cache #" + i, sum, jcache(i).localSize(ALL));
+ assertEquals("Incorrect key size on cache #" + idx, sum, jcache(idx).localSize(ALL));
+ }
+ });
}
for (int i = 0; i < gridCount(); i++) {
@@ -359,6 +367,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testRemoveAllSkipStore() throws Exception {
+ if (isMultiJvm())
+ fail("https://issues.apache.org/jira/browse/IGNITE-1088");
+
IgniteCache<String, Integer> jcache = jcache();
jcache.putAll(F.asMap("1", 1, "2", 2, "3", 3));
@@ -448,7 +459,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception In case of error.
*/
public void testGetAll() throws Exception {
- Transaction tx = txEnabled() ? transactions().txStart() : null;
+ Transaction tx = txShouldBeUsed() ? transactions().txStart() : null;
final IgniteCache<String, Integer> cache = jcache();
@@ -495,7 +506,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertNull(map2.get("key9999"));
// Now do the same checks but within transaction.
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
try (Transaction tx0 = transactions().txStart()) {
assert cache.getAll(Collections.<String>emptySet()).isEmpty();
@@ -548,7 +559,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testGetTxNonExistingKey() throws Exception {
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
try (Transaction ignored = transactions().txStart()) {
assert jcache().get("key999123") == null;
}
@@ -626,7 +637,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception In case of error.
*/
public void testPutTx() throws Exception {
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
IgniteCache<String, Integer> cache = jcache();
try (Transaction tx = transactions().txStart()) {
@@ -729,7 +740,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cache.put("key2", 1);
cache.put("key3", 3);
- Transaction tx = txEnabled() ? ignite(0).transactions().txStart(concurrency, isolation) : null;
+ Transaction tx = txShouldBeUsed() ? ignite(0).transactions().txStart(concurrency, isolation) : null;
try {
assertEquals("null", cache.invoke("key1", INCR_IGNITE_PROCESSOR));
@@ -783,7 +794,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cache.put("key2", 1);
cache.put("key3", 3);
- Transaction tx = txEnabled() ? ignite(0).transactions().txStart(concurrency, isolation) : null;
+ Transaction tx = txShouldBeUsed() ? ignite(0).transactions().txStart(concurrency, isolation) : null;
try {
assertEquals("null", cache.invoke("key1", INCR_PROCESSOR));
@@ -866,7 +877,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cache.put("key2", 1);
cache.put("key3", 3);
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
Map<String, EntryProcessorResult<String>> res;
try (Transaction tx = ignite(0).transactions().txStart(concurrency, isolation)) {
@@ -1022,7 +1033,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
final String key = primaryKeysForCache(cache, 1).get(0);
- Transaction tx = txEnabled() ? ignite(0).transactions().txStart(concurrency, READ_COMMITTED) : null;
+ Transaction tx = txShouldBeUsed() ? ignite(0).transactions().txStart(concurrency, READ_COMMITTED) : null;
try {
if (startVal)
@@ -1083,7 +1094,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cache.put("key", 4);
- Transaction tx = txEnabled() ? ignite(0).transactions().txStart(concurrency, READ_COMMITTED) : null;
+ Transaction tx = txShouldBeUsed() ? ignite(0).transactions().txStart(concurrency, READ_COMMITTED) : null;
try {
cache.remove("key");
@@ -1154,7 +1165,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
if (!put)
cache.put("key", 1);
- Transaction tx = txEnabled() ? ignite(0).transactions().txStart(concurrency, isolation) : null;
+ Transaction tx = txShouldBeUsed() ? ignite(0).transactions().txStart(concurrency, isolation) : null;
try {
if (put)
@@ -1313,7 +1324,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception In case of error.
*/
public void testPutx() throws Exception {
- if (txEnabled())
+ if (txShouldBeUsed())
checkPut(true);
}
@@ -1365,7 +1376,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testPutAsync() throws Exception {
- Transaction tx = txEnabled() ? transactions().txStart() : null;
+ Transaction tx = txShouldBeUsed() ? transactions().txStart() : null;
IgniteCache<String, Integer> cacheAsync = jcache().withAsync();
@@ -1436,7 +1447,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception In case of error.
*/
public void testNullInTx() throws Exception {
- if (!txEnabled())
+ if (!txShouldBeUsed())
return;
final IgniteCache<String, Integer> cache = jcache();
@@ -1685,7 +1696,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception In case of error.
*/
public void testGetAndPutIfAbsent() throws Exception {
- Transaction tx = txEnabled() ? transactions().txStart() : null;
+ Transaction tx = txShouldBeUsed() ? transactions().txStart() : null;
IgniteCache<String, Integer> cache = jcache();
@@ -1729,17 +1740,20 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertEquals((Integer)1, cache.getAndPutIfAbsent("key2", 3));
// Check db.
- putToStore("key3", 3);
+ if (!isMultiJvm()) {
+ putToStore("key3", 3);
+
+ assertEquals((Integer)3, cache.getAndPutIfAbsent("key3", 4));
- assertEquals((Integer)3, cache.getAndPutIfAbsent("key3", 4));
+ assertEquals((Integer)3, cache.get("key3"));
+ }
assertEquals((Integer)1, cache.get("key2"));
- assertEquals((Integer)3, cache.get("key3"));
cache.localEvict(Collections.singleton("key2"));
// Same checks inside tx.
- tx = txEnabled() ? transactions().txStart() : null;
+ tx = txShouldBeUsed() ? transactions().txStart() : null;
try {
assertEquals((Integer)1, cache.getAndPutIfAbsent("key2", 3));
@@ -1759,7 +1773,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testGetAndPutIfAbsentAsync() throws Exception {
- Transaction tx = txEnabled() ? transactions().txStart() : null;
+ Transaction tx = txShouldBeUsed() ? transactions().txStart() : null;
IgniteCache<String, Integer> cache = jcache();
@@ -1798,16 +1812,18 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertEquals((Integer)1, cacheAsync.<Integer>future().get());
// Check db.
- putToStore("key3", 3);
+ if (!isMultiJvm()) {
+ putToStore("key3", 3);
- cacheAsync.getAndPutIfAbsent("key3", 4);
+ cacheAsync.getAndPutIfAbsent("key3", 4);
- assertEquals((Integer)3, cacheAsync.<Integer>future().get());
+ assertEquals((Integer)3, cacheAsync.<Integer>future().get());
+ }
cache.localEvict(Collections.singleton("key2"));
// Same checks inside tx.
- tx = txEnabled() ? transactions().txStart() : null;
+ tx = txShouldBeUsed() ? transactions().txStart() : null;
try {
cacheAsync.getAndPutIfAbsent("key2", 3);
@@ -1845,14 +1861,16 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertFalse(cache.putIfAbsent("key2", 3));
// Check db.
- putToStore("key3", 3);
+ if (!isMultiJvm()) {
+ putToStore("key3", 3);
- assertFalse(cache.putIfAbsent("key3", 4));
+ assertFalse(cache.putIfAbsent("key3", 4));
+ }
cache.localEvict(Collections.singleton("key2"));
// Same checks inside tx.
- Transaction tx = txEnabled() ? transactions().txStart() : null;
+ Transaction tx = txShouldBeUsed() ? transactions().txStart() : null;
try {
assertFalse(cache.putIfAbsent("key2", 3));
@@ -1872,7 +1890,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception In case of error.
*/
public void testPutxIfAbsentAsync() throws Exception {
- if (txEnabled())
+ if (txShouldBeUsed())
checkPutxIfAbsentAsync(true);
}
@@ -1916,11 +1934,13 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertFalse(cacheAsync.<Boolean>future().get());
// Check db.
- putToStore("key3", 3);
+ if (!isMultiJvm()) {
+ putToStore("key3", 3);
- cacheAsync.putIfAbsent("key3", 4);
+ cacheAsync.putIfAbsent("key3", 4);
- assertFalse(cacheAsync.<Boolean>future().get());
+ assertFalse(cacheAsync.<Boolean>future().get());
+ }
cache.localEvict(Arrays.asList("key2"));
@@ -1932,9 +1952,11 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertFalse(cacheAsync.<Boolean>future().get());
- cacheAsync.putIfAbsent("key3", 4);
+ if (!isMultiJvm()) {
+ cacheAsync.putIfAbsent("key3", 4);
- assertFalse(cacheAsync.<Boolean>future().get());
+ assertFalse(cacheAsync.<Boolean>future().get());
+ }
if (tx != null)
tx.commit();
@@ -1945,7 +1967,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
}
assertEquals((Integer)1, cache.get("key2"));
- assertEquals((Integer)3, cache.get("key3"));
+
+ if (!isMultiJvm())
+ assertEquals((Integer)3, cache.get("key3"));
}
/**
@@ -2014,11 +2038,13 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assert cache.get("key") == 4;
- putToStore("key2", 5);
+ if (!isMultiJvm()) {
+ putToStore("key2", 5);
- info("key2 5 -> 6");
+ info("key2 5 -> 6");
- assert cache.replace("key2", 5, 6);
+ assert cache.replace("key2", 5, 6);
+ }
for (int i = 0; i < gridCount(); i++) {
info("Peek key on grid [i=" + i + ", nodeId=" + grid(i).localNode().id() +
@@ -2028,11 +2054,12 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
", peekVal=" + grid(i).cache(null).localPeek("key2", ONHEAP) + ']');
}
- assertEquals((Integer)6, cache.get("key2"));
+ if (!isMultiJvm())
+ assertEquals((Integer)6, cache.get("key2"));
cache.localEvict(Collections.singleton("key"));
- Transaction tx = txEnabled() ? transactions().txStart() : null;
+ Transaction tx = txShouldBeUsed() ? transactions().txStart() : null;
try {
assert cache.replace("key", 4, 5);
@@ -2070,15 +2097,17 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assert cache.get("key") == 4;
- putToStore("key2", 5);
+ if (!isMultiJvm()) {
+ putToStore("key2", 5);
- assert cache.replace("key2", 6);
+ assert cache.replace("key2", 6);
- assertEquals((Integer)6, cache.get("key2"));
+ assertEquals((Integer)6, cache.get("key2"));
+ }
cache.localEvict(Collections.singleton("key"));
- Transaction tx = txEnabled() ? transactions().txStart() : null;
+ Transaction tx = txShouldBeUsed() ? transactions().txStart() : null;
try {
assert cache.replace("key", 5);
@@ -2144,17 +2173,19 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assert cache.get("key") == 4;
- putToStore("key2", 5);
+ if (!isMultiJvm()) {
+ putToStore("key2", 5);
- cacheAsync.replace("key2", 5, 6);
+ cacheAsync.replace("key2", 5, 6);
- assert cacheAsync.<Boolean>future().get();
+ assert cacheAsync.<Boolean>future().get();
- assertEquals((Integer)6, cache.get("key2"));
+ assertEquals((Integer)6, cache.get("key2"));
+ }
cache.localEvict(Collections.singleton("key"));
- Transaction tx = txEnabled() ? transactions().txStart() : null;
+ Transaction tx = txShouldBeUsed() ? transactions().txStart() : null;
try {
cacheAsync.replace("key", 4, 5);
@@ -2204,17 +2235,19 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assert cache.get("key") == 4;
- putToStore("key2", 5);
+ if (!isMultiJvm()) {
+ putToStore("key2", 5);
- cacheAsync.replace("key2", 6);
+ cacheAsync.replace("key2", 6);
- assert cacheAsync.<Boolean>future().get();
+ assert cacheAsync.<Boolean>future().get();
- assert cache.get("key2") == 6;
+ assert cache.get("key2") == 6;
+ }
cache.localEvict(Collections.singleton("key"));
- Transaction tx = txEnabled() ? transactions().txStart() : null;
+ Transaction tx = txShouldBeUsed() ? transactions().txStart() : null;
try {
cacheAsync.replace("key", 5);
@@ -2255,7 +2288,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
*/
public void testDeletedEntriesFlag() throws Exception {
if (cacheMode() != LOCAL && cacheMode() != REPLICATED && memoryMode() != OFFHEAP_TIERED) {
- int cnt = 3;
+ final int cnt = 3;
IgniteCache<String, Integer> cache = jcache();
@@ -2266,21 +2299,25 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
cache.remove(String.valueOf(i));
for (int g = 0; g < gridCount(); g++) {
- for (int i = 0; i < cnt; i++) {
- String key = String.valueOf(i);
-
- GridCacheContext<String, Integer> cctx = context(g);
-
- GridCacheEntryEx entry = cctx.isNear() ? cctx.near().dht().peekEx(key) :
- cctx.cache().peekEx(key);
-
- if (grid(0).affinity(null).mapKeyToPrimaryAndBackups(key).contains(grid(g).localNode())) {
- assertNotNull(entry);
- assertTrue(entry.deleted());
+ executeOnLocalOrRemoteJvm(g, new TestIgniteIdxRunnable() {
+ @Override public void run(int idx) throws Exception {
+ for (int i = 0; i < cnt; i++) {
+ String key = String.valueOf(i);
+
+ GridCacheContext<String, Integer> cctx = context(idx);
+
+ GridCacheEntryEx entry = cctx.isNear() ? cctx.near().dht().peekEx(key) :
+ cctx.cache().peekEx(key);
+
+ if (grid(idx).affinity(null).mapKeyToPrimaryAndBackups(key).contains(grid(idx).localNode())) {
+ assertNotNull(entry);
+ assertTrue(entry.deleted());
+ }
+ else
+ assertNull(entry);
+ }
}
- else
- assertNull(entry);
- }
+ });
}
}
}
@@ -2289,6 +2326,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testRemoveLoad() throws Exception {
+ if (isMultiJvm())
+ fail("https://issues.apache.org/jira/browse/IGNITE-1088");
+
int cnt = 10;
Set<String> keys = new HashSet<>();
@@ -2542,7 +2582,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception In case of error.
*/
public void testRemoveAllDuplicatesTx() throws Exception {
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
try (Transaction tx = transactions().txStart()) {
jcache().removeAll(ImmutableSet.of("key1", "key1", "key1"));
@@ -2957,7 +2997,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
private void checkPeekTxRemove(TransactionConcurrency concurrency) throws Exception {
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
Ignite ignite = primaryIgnite("key");
IgniteCache<String, Integer> cache = ignite.cache(null);
@@ -3065,7 +3105,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testPeekExpiredTx() throws Exception {
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
IgniteCache<String, Integer> c = jcache();
String key = "1";
@@ -3091,7 +3131,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testTtlTx() throws Exception {
- if (txEnabled())
+ if (txShouldBeUsed())
checkTtl(true, false);
}
@@ -3115,6 +3155,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
private void checkTtl(boolean inTx, boolean oldEntry) throws Exception {
+ if (isMultiJvm())
+ fail("https://issues.apache.org/jira/browse/IGNITE-1089");
+
if (memoryMode() == OFFHEAP_TIERED)
return;
@@ -3610,7 +3653,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testOptimisticTxMissingKey() throws Exception {
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
try (Transaction tx = transactions().txStart(OPTIMISTIC, READ_COMMITTED)) {
// Remove missing key.
assertTrue(jcache().remove(UUID.randomUUID().toString()));
@@ -3626,7 +3669,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testOptimisticTxMissingKeyNoCommit() throws Exception {
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
try (Transaction tx = transactions().txStart(OPTIMISTIC, READ_COMMITTED)) {
// Remove missing key.
assertTrue(jcache().remove(UUID.randomUUID().toString()));
@@ -3670,7 +3713,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
private void checkRemovexInTx(TransactionConcurrency concurrency, TransactionIsolation isolation) throws Exception {
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
final int cnt = 10;
CU.inTx(ignite(0), jcache(), concurrency, isolation, new CIX1<IgniteCache<String, Integer>>() {
@@ -3709,7 +3752,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testPessimisticTxMissingKey() throws Exception {
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
try (Transaction tx = transactions().txStart(PESSIMISTIC, READ_COMMITTED)) {
// Remove missing key.
assertFalse(jcache().remove(UUID.randomUUID().toString()));
@@ -3725,7 +3768,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testPessimisticTxMissingKeyNoCommit() throws Exception {
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
try (Transaction tx = transactions().txStart(PESSIMISTIC, READ_COMMITTED)) {
// Remove missing key.
assertFalse(jcache().remove(UUID.randomUUID().toString()));
@@ -3739,7 +3782,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testPessimisticTxRepeatableRead() throws Exception {
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
try (Transaction ignored = transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
jcache().put("key", 1);
@@ -3752,7 +3795,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testPessimisticTxRepeatableReadOnUpdate() throws Exception {
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
try (Transaction ignored = transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
jcache().put("key", 1);
@@ -3790,7 +3833,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @param keys Expected keys.
* @throws Exception If failed.
*/
- protected void checkSize(Collection<String> keys) throws Exception {
+ protected void checkSize(final Collection<String> keys) throws Exception {
if (memoryMode() == OFFHEAP_TIERED)
return;
@@ -3798,26 +3841,30 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
assertEquals(keys.size(), jcache().localSize(CachePeekMode.ALL));
else {
for (int i = 0; i < gridCount(); i++) {
- GridCacheContext<String, Integer> ctx = context(i);
+ executeOnLocalOrRemoteJvm(i, new TestIgniteIdxRunnable() {
+ @Override public void run(int idx) throws Exception {
+ GridCacheContext<String, Integer> ctx = context(idx);
- if (ctx.cache().configuration().getMemoryMode() == OFFHEAP_TIERED)
- continue;
+ if (ctx.cache().configuration().getMemoryMode() == OFFHEAP_TIERED)
+ return;
- int size = 0;
+ int size = 0;
- for (String key : keys) {
- if (ctx.affinity().localNode(key, ctx.discovery().topologyVersionEx())) {
- GridCacheEntryEx e =
- ctx.isNear() ? ctx.near().dht().peekEx(key) : ctx.cache().peekEx(key);
+ for (String key : keys) {
+ if (ctx.affinity().localNode(key, ctx.discovery().topologyVersionEx())) {
+ GridCacheEntryEx e =
+ ctx.isNear() ? ctx.near().dht().peekEx(key) : ctx.cache().peekEx(key);
- assert e != null : "Entry is null [idx=" + i + ", key=" + key + ", ctx=" + ctx + ']';
- assert !e.deleted() : "Entry is deleted: " + e;
+ assert e != null : "Entry is null [idx=" + idx + ", key=" + key + ", ctx=" + ctx + ']';
+ assert !e.deleted() : "Entry is deleted: " + e;
- size++;
- }
- }
+ size++;
+ }
+ }
- assertEquals("Incorrect size on cache #" + i, size, jcache(i).localSize(ALL));
+ assertEquals("Incorrect size on cache #" + idx, size, jcache(idx).localSize(ALL));
+ }
+ });
}
}
}
@@ -3826,21 +3873,25 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @param keys Expected keys.
* @throws Exception If failed.
*/
- protected void checkKeySize(Collection<String> keys) throws Exception {
+ protected void checkKeySize(final Collection<String> keys) throws Exception {
if (nearEnabled())
assertEquals("Invalid key size: " + jcache().localSize(ALL),
keys.size(), jcache().localSize(ALL));
else {
for (int i = 0; i < gridCount(); i++) {
- GridCacheContext<String, Integer> ctx = context(i);
+ executeOnLocalOrRemoteJvm(i, new TestIgniteIdxRunnable() {
+ @Override public void run(int idx) throws Exception {
+ GridCacheContext<String, Integer> ctx = context(idx);
- int size = 0;
+ int size = 0;
- for (String key : keys)
- if (ctx.affinity().localNode(key, ctx.discovery().topologyVersionEx()))
- size++;
+ for (String key : keys)
+ if (ctx.affinity().localNode(key, ctx.discovery().topologyVersionEx()))
+ size++;
- assertEquals("Incorrect key size on cache #" + i, size, jcache(i).localSize(ALL));
+ assertEquals("Incorrect key size on cache #" + idx, size, jcache(idx).localSize(ALL));
+ }
+ });
}
}
}
@@ -3879,7 +3930,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
UUID nodeId = node.id();
for (int i = 0; i < gridCount(); i++) {
- if (context(i).localNodeId().equals(nodeId))
+ if (grid(i).localNode().id().equals(nodeId))
return ignite(i);
}
@@ -3899,24 +3950,27 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @param cnt Keys count.
* @return Collection of keys for which given cache is primary.
*/
- protected List<String> primaryKeysForCache(IgniteCache<String, Integer> cache, int cnt, int startFrom) {
- List<String> found = new ArrayList<>(cnt);
+ protected List<String> primaryKeysForCache(final IgniteCache<String, Integer> cache, final int cnt, final int startFrom) {
+ return executeOnLocalOrRemoteJvm(cache, new TestCacheCallable<String, Integer, List<String>>() {
+ @Override public List<String> call(Ignite ignite, IgniteCache<String, Integer> cache) throws Exception {
+ List<String> found = new ArrayList<>();
- Ignite ignite = cache.unwrap(Ignite.class);
- Affinity<Object> affinity = ignite.affinity(cache.getName());
+ Affinity<Object> affinity = ignite.affinity(cache.getName());
- for (int i = startFrom; i < startFrom + 100_000; i++) {
- String key = "key" + i;
+ for (int i = startFrom; i < startFrom + 100_000; i++) {
+ String key = "key" + i;
- if (affinity.isPrimary(ignite.cluster().localNode(), key)) {
- found.add(key);
+ if (affinity.isPrimary(ignite.cluster().localNode(), key)) {
+ found.add(key);
- if (found.size() == cnt)
- return found;
- }
- }
+ if (found.size() == cnt)
+ return found;
+ }
+ }
- throw new IgniteException("Unable to find " + cnt + " keys as primary for cache.");
+ throw new IgniteException("Unable to find " + cnt + " keys as primary for cache.");
+ }
+ });
}
/**
@@ -4108,13 +4162,16 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
*/
private void checkIteratorsCleared() {
for (int j = 0; j < gridCount(); j++) {
+ executeOnLocalOrRemoteJvm(j, new TestIgniteIdxRunnable() {
+ @Override public void run(int idx) throws Exception {
+ GridCacheQueryManager queries = context(idx).queries();
- GridCacheQueryManager queries = context(j).queries();
-
- Map map = GridTestUtils.getFieldValue(queries, GridCacheQueryManager.class, "qryIters");
+ Map map = GridTestUtils.getFieldValue(queries, GridCacheQueryManager.class, "qryIters");
- for (Object obj : map.values())
- assertEquals("Iterators not removed for grid " + j, 0, ((Map) obj).size());
+ for (Object obj : map.values())
+ assertEquals("Iterators not removed for grid " + idx, 0, ((Map)obj).size());
+ }
+ });
}
}
@@ -4358,6 +4415,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testWithSkipStore() throws Exception {
+ if(isMultiJvm())
+ fail("https://issues.apache.org/jira/browse/IGNITE-1088");
+
IgniteCache<String, Integer> cache = grid(0).cache(null);
IgniteCache<String, Integer> cacheSkipStore = cache.withSkipStore();
@@ -4567,6 +4627,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testWithSkipStoreRemoveAll() throws Exception {
+ if (isMultiJvm())
+ fail("https://issues.apache.org/jira/browse/IGNITE-1088");
+
if (atomicityMode() == TRANSACTIONAL || (atomicityMode() == ATOMIC && nearEnabled())) // TODO IGNITE-373.
return;
@@ -4608,7 +4671,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
* @throws Exception If failed.
*/
public void testWithSkipStoreTx() throws Exception {
- if (txEnabled()) {
+ if (txShouldBeUsed()) {
IgniteCache<String, Integer> cache = grid(0).cache(null);
IgniteCache<String, Integer> cacheSkipStore = cache.withSkipStore();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
index 468aec1..4cd208d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
@@ -313,12 +313,20 @@ public abstract class GridCacheAbstractSelfTest extends GridCommonAbstractTest {
/**
* @return {@code True} if transactions are enabled.
+ * @see #txShouldBeUsed()
*/
protected boolean txEnabled() {
return true;
}
/**
+ * @return {@code True} if transactions should be used.
+ */
+ protected boolean txShouldBeUsed() {
+ return txEnabled() && !isMultiJvm();
+ }
+
+ /**
* @return {@code True} if locking is enabled.
*/
protected boolean lockingEnabled() {
@@ -360,7 +368,11 @@ public abstract class GridCacheAbstractSelfTest extends GridCommonAbstractTest {
* @param idx Index of grid.
* @return Cache context.
*/
- protected GridCacheContext<String, Integer> context(int idx) {
+ protected GridCacheContext<String, Integer> context(final int idx) {
+ if (isRemoteJvm(idx) && !isRemoteJvm())
+ throw new UnsupportedOperationException("Operation can't be done automatically via proxy. " +
+ "Send task with this logic on remote jvm instead.");
+
return ((IgniteKernal)grid(idx)).<String, Integer>internalCache().context();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java
index ac93adb..c592395 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest.java
@@ -114,6 +114,9 @@ public class GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest extends GridCacheNe
/** {@inheritDoc} */
@Override public void testEvictExpired() throws Exception {
+ if (isMultiJvm())
+ fail("https://issues.apache.org/jira/browse/IGNITE-1113");
+
IgniteCache<String, Integer> cache = jcache();
String key = primaryKeysForCache(cache, 1).get(0);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
index d40e9e3..f30ea71 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearOnlyMultiNodeFullApiSelfTest.java
@@ -125,7 +125,7 @@ public class GridCacheNearOnlyMultiNodeFullApiSelfTest extends GridCachePartitio
return F.view(super.affinityNodes(), new P1<ClusterNode>() {
@Override public boolean apply(ClusterNode n) {
- return !F.eq(G.ignite(n.id()).name(), grid(nearIdx).name());
+ return !F.eq(grid(n).name(), grid(nearIdx).name());
}
});
}
@@ -211,6 +211,9 @@ public class GridCacheNearOnlyMultiNodeFullApiSelfTest extends GridCachePartitio
* @throws Exception If failed.
*/
private void checkReaderTtl(boolean inTx) throws Exception {
+ if (isMultiJvm())
+ fail("https://issues.apache.org/jira/browse/IGNITE-1089");
+
int ttl = 1000;
final ExpiryPolicy expiry = new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS, ttl));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxMultiNodeSelfTest.java
index ef0ab48..962e80d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCacheNearTxMultiNodeSelfTest.java
@@ -104,9 +104,9 @@ public class GridCacheNearTxMultiNodeSelfTest extends GridCommonAbstractTest {
assert backupNode != otherNode;
assert priNode != otherNode;
- Ignite priIgnite = G.ignite(priNode.id());
- Ignite backupIgnite = G.ignite(backupNode.id());
- Ignite otherIgnite = G.ignite(otherNode.id());
+ final Ignite priIgnite = grid(priNode);
+ Ignite backupIgnite = grid(backupNode);
+ Ignite otherIgnite = grid(otherNode);
List<Ignite> ignites = F.asList(otherIgnite, priIgnite, backupIgnite);
@@ -152,8 +152,8 @@ public class GridCacheNearTxMultiNodeSelfTest extends GridCommonAbstractTest {
tx.close();
}
- G.stop(priIgnite.name(), true);
- G.stop(backupIgnite.name(), true);
+ stopGrid(priIgnite.name(), true);
+ stopGrid(backupIgnite.name(), true);
Ignite newIgnite = startGrid(GRID_CNT);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
index 30c9e8a..a5e7a31 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedMultiNodeFullApiSelfTest.java
@@ -28,7 +28,6 @@ import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.lang.*;
import java.util.*;
-import java.util.concurrent.atomic.*;
import static org.apache.ignite.cache.CacheMode.*;
import static org.apache.ignite.cache.CachePeekMode.*;
@@ -135,7 +134,7 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
for (int i = 0; i < gridCount(); i++)
info(">>>>> Grid" + i + ": " + grid(i).localNode().id());
- int size = 10;
+ final int size = 10;
IgniteCache<Object, Object> chache0 = grid(0).cache(null);
@@ -148,16 +147,20 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
}
for (int i = 0; i < gridCount(); i++) {
- assertEquals(0, context(i).tm().idMapSize());
+ executeOnLocalOrRemoteJvm(i, new TestIgniteIdxRunnable() {
+ @Override public void run(int idx) throws Exception {
+ assertEquals(0, context(idx).tm().idMapSize());
- IgniteCache<Object, Object> cache = grid(i).cache(null);
- ClusterNode node = grid(i).localNode();
+ IgniteCache<Object, Object> cache = grid(idx).cache(null);
+ ClusterNode node = grid(idx).localNode();
- for (int k = 0; k < size; k++) {
- if (affinity(cache).isPrimaryOrBackup(node, k))
- assertEquals("Check failed for node: " + node.id(), k,
- cache.localPeek(k, CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP));
- }
+ for (int k = 0; k < size; k++) {
+ if (affinity(cache).isPrimaryOrBackup(node, k))
+ assertEquals("Check failed for node: " + node.id(), k,
+ cache.localPeek(k, CachePeekMode.ONHEAP, CachePeekMode.OFFHEAP));
+ }
+ }
+ });
}
for (int i = 0; i < size; i++) {
@@ -179,21 +182,24 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
if (memoryMode() == CacheMemoryMode.OFFHEAP_TIERED)
return;
- final AtomicInteger swapEvts = new AtomicInteger(0);
- final AtomicInteger unswapEvts = new AtomicInteger(0);
+ final IgniteAtomicLong swapEvts = grid(0).atomicLong("swapEvts", 0, true);
+
+ final IgniteAtomicLong unswapEvts = grid(0).atomicLong("unswapEvts", 0, true);
for (int i = 0; i < gridCount(); i++) {
+ final int iCopy = i;
+
grid(i).events().localListen(new IgnitePredicate<Event>() {
@Override public boolean apply(Event evt) {
info("Received event: " + evt);
switch (evt.type()) {
case EVT_CACHE_OBJECT_SWAPPED:
- swapEvts.incrementAndGet();
+ grid(iCopy).atomicLong("swapEvts", 0, false).incrementAndGet();
break;
case EVT_CACHE_OBJECT_UNSWAPPED:
- unswapEvts.incrementAndGet();
+ grid(iCopy).atomicLong("unswapEvts", 0, false).incrementAndGet();
break;
}
@@ -235,8 +241,13 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
boolean nearEnabled = nearEnabled(c);
- if (nearEnabled)
- assertTrue(((IgniteKernal)ignite(i)).internalCache().context().isNear());
+ if (nearEnabled) {
+ executeOnLocalOrRemoteJvm(i, new TestIgniteIdxRunnable() {
+ @Override public void run(int idx) throws Exception {
+ assertTrue(((IgniteKernal)ignite(idx)).internalCache().context().isNear());
+ }
+ });
+ }
Integer nearPeekVal = nearEnabled ? 1 : null;
@@ -306,7 +317,7 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
for (int i = 0; i < gridCount(); i++) {
IgniteEx ignite = grid(i);
- if (!ignite.configuration().isClientMode()) {
+ if (!Boolean.TRUE.equals(ignite.configuration().isClientMode())) {
if (ignite0 == null)
ignite0 = ignite;
else if (ignite1 == null)
@@ -396,7 +407,8 @@ public class GridCachePartitionedMultiNodeFullApiSelfTest extends GridCacheParti
}
};
- info("All affinity nodes: " + affinityNodes());
+ if (!isMultiJvm())
+ info("All affinity nodes: " + affinityNodes());
IgniteCache<Object, Object> cache = grid(0).cache(null);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicClientOnlyFairAffinityMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicClientOnlyFairAffinityMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicClientOnlyFairAffinityMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..e2ac8a7
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicClientOnlyFairAffinityMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicClientOnlyFairAffinityMultiJvmFullApiSelfTest
+ extends GridCacheAtomicClientOnlyFairAffinityMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicClientOnlyMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicClientOnlyMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicClientOnlyMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..dfffc70
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicClientOnlyMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicClientOnlyMultiJvmFullApiSelfTest extends
+ GridCacheAtomicClientOnlyMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicClientOnlyMultiJvmP2PDisabledFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicClientOnlyMultiJvmP2PDisabledFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicClientOnlyMultiJvmP2PDisabledFullApiSelfTest.java
new file mode 100644
index 0000000..2d8b9a5
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicClientOnlyMultiJvmP2PDisabledFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicClientOnlyMultiJvmP2PDisabledFullApiSelfTest extends
+ GridCacheAtomicClientOnlyMultiNodeP2PDisabledFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicCopyOnReadDisabledMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicCopyOnReadDisabledMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicCopyOnReadDisabledMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..1388a75
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicCopyOnReadDisabledMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicCopyOnReadDisabledMultiJvmFullApiSelfTest extends
+ GridCacheAtomicCopyOnReadDisabledMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicFairAffinityMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicFairAffinityMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicFairAffinityMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..5808f28
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicFairAffinityMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicFairAffinityMultiJvmFullApiSelfTest extends
+ GridCacheAtomicFairAffinityMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..0d6a1ce
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicMultiJvmFullApiSelfTest.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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicMultiJvmFullApiSelfTest extends GridCacheAtomicMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicMultiJvmP2PDisabledFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicMultiJvmP2PDisabledFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicMultiJvmP2PDisabledFullApiSelfTest.java
new file mode 100644
index 0000000..0f35862
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicMultiJvmP2PDisabledFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicMultiJvmP2PDisabledFullApiSelfTest extends
+ GridCacheAtomicMultiNodeP2PDisabledFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearEnabledFairAffinityMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearEnabledFairAffinityMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearEnabledFairAffinityMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..44e0a6d
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearEnabledFairAffinityMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicNearEnabledFairAffinityMultiJvmFullApiSelfTest extends
+ GridCacheAtomicNearEnabledFairAffinityMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearEnabledMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearEnabledMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearEnabledMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..44f3c6f
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearEnabledMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicNearEnabledMultiJvmFullApiSelfTest extends
+ GridCacheAtomicNearEnabledMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearEnabledPrimaryWriteOrderMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearEnabledPrimaryWriteOrderMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearEnabledPrimaryWriteOrderMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..e23ab52
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearEnabledPrimaryWriteOrderMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicNearEnabledPrimaryWriteOrderMultiJvmFullApiSelfTest extends
+ GridCacheAtomicNearEnabledPrimaryWriteOrderMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearOnlyMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearOnlyMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearOnlyMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..a2850c2
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearOnlyMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicNearOnlyMultiJvmFullApiSelfTest extends
+ GridCacheAtomicNearOnlyMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearOnlyMultiJvmP2PDisabledFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearOnlyMultiJvmP2PDisabledFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearOnlyMultiJvmP2PDisabledFullApiSelfTest.java
new file mode 100644
index 0000000..f07d51d
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicNearOnlyMultiJvmP2PDisabledFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicNearOnlyMultiJvmP2PDisabledFullApiSelfTest extends
+ GridCacheAtomicNearOnlyMultiNodeP2PDisabledFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicOffHeapMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicOffHeapMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicOffHeapMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..8eb4db1
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicOffHeapMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicOffHeapMultiJvmFullApiSelfTest extends
+ GridCacheAtomicOffHeapMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicOffHeapTieredMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicOffHeapTieredMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicOffHeapTieredMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..185e8c7
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicOffHeapTieredMultiJvmFullApiSelfTest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicOffHeapTieredMultiJvmFullApiSelfTest
+ extends GridCacheAtomicOffHeapTieredMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testLocalClearKeys() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-1107");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWriteOrderFairAffinityMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWriteOrderFairAffinityMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWriteOrderFairAffinityMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..421ce32
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWriteOrderFairAffinityMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicPrimaryWriteOrderFairAffinityMultiJvmFullApiSelfTest extends
+ GridCacheAtomicPrimaryWriteOrderFairAffinityMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWriteOrderMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWriteOrderMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWriteOrderMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..928b955
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWriteOrderMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicPrimaryWriteOrderMultiJvmFullApiSelfTest extends
+ GridCacheAtomicPrimaryWriteOrderMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWriteOrderMultiJvmP2PDisabledFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWriteOrderMultiJvmP2PDisabledFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWriteOrderMultiJvmP2PDisabledFullApiSelfTest.java
new file mode 100644
index 0000000..c805377
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWriteOrderMultiJvmP2PDisabledFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicPrimaryWriteOrderMultiJvmP2PDisabledFullApiSelfTest extends
+ GridCacheAtomicPrimaryWriteOrderMultiNodeP2PDisabledFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
[23/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-mys-26'
Posted by av...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-mys-26'
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7147f3d8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7147f3d8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7147f3d8
Branch: refs/heads/ignite-630
Commit: 7147f3d8ec736e013e6b2945f3ad6359d01c6ea7
Parents: de7e06f 322e5df
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Jul 15 09:18:51 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jul 15 09:18:51 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/processors/query/GridQueryProcessor.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[35/50] [abbrv] incubator-ignite git commit: # ignite-901 client
reconnect support
Posted by av...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientReconnectQueriesTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientReconnectQueriesTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientReconnectQueriesTest.java
new file mode 100644
index 0000000..547adcb
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientReconnectQueriesTest.java
@@ -0,0 +1,427 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.query.*;
+import org.apache.ignite.cache.query.annotations.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.cache.query.*;
+import org.apache.ignite.internal.processors.query.h2.twostep.messages.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.testframework.*;
+
+import javax.cache.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import static java.util.concurrent.TimeUnit.*;
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectQueriesTest extends IgniteClientReconnectAbstractTest {
+ /** */
+ public static final String QUERY_CACHE = "query";
+
+ /** {@inheritDoc} */
+ @Override protected int serverCount() {
+ return 3;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int clientCount() {
+ return 1;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ CacheConfiguration<Integer, Person> ccfg = new CacheConfiguration<Integer, Person>(QUERY_CACHE)
+ .setCacheMode(PARTITIONED)
+ .setAtomicityMode(ATOMIC)
+ .setBackups(1)
+ .setIndexedTypes(Integer.class, Person.class);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ super.afterTest();
+
+ grid(0).getOrCreateCache(QUERY_CACHE).removeAll();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testQueryReconnect() throws Exception {
+ Ignite cln = grid(serverCount());
+
+ assertTrue(cln.cluster().localNode().isClient());
+
+ final Ignite srv = clientRouter(cln);
+
+ final IgniteCache<Integer, Person> clnCache = cln.getOrCreateCache(QUERY_CACHE);
+
+ final IgniteCache<Integer, Person> srvCache = srv.getOrCreateCache(QUERY_CACHE);
+
+ clnCache.put(1, new Person(1, "name1", "surname1"));
+ clnCache.put(2, new Person(2, "name2", "surname2"));
+ clnCache.put(3, new Person(3, "name3", "surname3"));
+
+ final SqlQuery<Integer, Person> qry = new SqlQuery<>(Person.class, "_key <> 0");
+
+ qry.setPageSize(1);
+
+ QueryCursor<Cache.Entry<Integer, Person>> cur = clnCache.query(qry);
+
+ reconnectClientNode(cln, srv, new Runnable() {
+ @Override public void run() {
+ srvCache.put(4, new Person(4, "name4", "surname4"));
+
+ try {
+ clnCache.query(qry);
+
+ fail();
+ } catch (CacheException e) {
+ check(e);
+ }
+ }
+ });
+
+ List<Cache.Entry<Integer, Person>> res = cur.getAll();
+
+ assertNotNull(res);
+ assertEquals(4, res.size());
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectQueryInProgress() throws Exception {
+ Ignite cln = grid(serverCount());
+
+ assertTrue(cln.cluster().localNode().isClient());
+
+ final Ignite srv = clientRouter(cln);
+
+ final IgniteCache<Integer, Person> clnCache = cln.getOrCreateCache(QUERY_CACHE);
+
+ clnCache.put(1, new Person(1, "name1", "surname1"));
+ clnCache.put(2, new Person(2, "name2", "surname2"));
+ clnCache.put(3, new Person(3, "name3", "surname3"));
+
+ blockMessage(GridQueryNextPageResponse.class);
+
+ final SqlQuery<Integer, Person> qry = new SqlQuery<>(Person.class, "_key <> 0");
+
+ qry.setPageSize(1);
+
+ final QueryCursor<Cache.Entry<Integer, Person>> cur1 = clnCache.query(qry);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ cur1.getAll();
+ }
+ catch (CacheException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ unblockMessage();
+
+ reconnectClientNode(cln, srv, null);
+
+ assertTrue((Boolean) fut.get(2, SECONDS));
+
+ QueryCursor<Cache.Entry<Integer, Person>> cur2 = clnCache.query(qry);
+
+ assertEquals(3, cur2.getAll().size());
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testScanQueryReconnect() throws Exception {
+ Ignite cln = grid(serverCount());
+
+ assertTrue(cln.cluster().localNode().isClient());
+
+ final Ignite srv = clientRouter(cln);
+
+ final IgniteCache<Integer, Person> clnCache = cln.getOrCreateCache(QUERY_CACHE);
+
+ final IgniteCache<Integer, Person> srvCache = srv.getOrCreateCache(QUERY_CACHE);
+
+ for (int i = 0; i < 10_000; i++)
+ clnCache.put(i, new Person(i, "name-" + i, "surname-" + i));
+
+ final ScanQuery<Integer, Person> scanQry = new ScanQuery<>();
+
+ scanQry.setPageSize(1);
+
+ scanQry.setFilter(new IgniteBiPredicate<Integer, Person>() {
+ @Override public boolean apply(Integer integer, Person person) {
+ return true;
+ }
+ });
+
+ QueryCursor<Cache.Entry<Integer, Person>> qryCursor = clnCache.query(scanQry);
+
+ reconnectClientNode(cln, srv, new Runnable() {
+ @Override public void run() {
+ srvCache.put(10_001, new Person(10_001, "name", "surname"));
+
+ try {
+ clnCache.query(scanQry);
+
+ fail();
+ } catch (CacheException e) {
+ check(e);
+ }
+ }
+ });
+
+ try {
+ qryCursor.getAll();
+
+ fail();
+ }
+ catch (CacheException e) {
+ checkAndWait(e);
+ }
+
+ qryCursor = clnCache.query(scanQry);
+
+ assertEquals(10_001, qryCursor.getAll().size());
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testScanQueryReconnectInProgress1() throws Exception {
+ scanQueryReconnectInProgress(false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testScanQueryReconnectInProgress2() throws Exception {
+ scanQueryReconnectInProgress(true);
+ }
+
+ /**
+ * @param setPart If {@code true} sets partition for scan query.
+ * @throws Exception If failed.
+ */
+ private void scanQueryReconnectInProgress(boolean setPart) throws Exception {
+ Ignite cln = grid(serverCount());
+
+ assertTrue(cln.cluster().localNode().isClient());
+
+ final Ignite srv = clientRouter(cln);
+
+ final IgniteCache<Integer, Person> clnCache = cln.getOrCreateCache(QUERY_CACHE);
+
+ clnCache.put(1, new Person(1, "name1", "surname1"));
+ clnCache.put(2, new Person(2, "name2", "surname2"));
+ clnCache.put(3, new Person(3, "name3", "surname3"));
+
+ final ScanQuery<Integer, Person> scanQry = new ScanQuery<>();
+
+ scanQry.setPageSize(1);
+
+ scanQry.setFilter(new IgniteBiPredicate<Integer, Person>() {
+ @Override public boolean apply(Integer integer, Person person) {
+ return true;
+ }
+ });
+
+ if (setPart)
+ scanQry.setPartition(1);
+
+ blockMessage(GridCacheQueryResponse.class);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ QueryCursor<Cache.Entry<Integer, Person>> qryCursor = clnCache.query(scanQry);
+
+ qryCursor.getAll();
+ }
+ catch (CacheException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ unblockMessage();
+
+ reconnectClientNode(cln, srv, null);
+
+ assertTrue((Boolean)fut.get(2, SECONDS));
+
+ QueryCursor<Cache.Entry<Integer, Person>> qryCursor2 = clnCache.query(scanQry);
+
+ assertEquals(setPart ? 1 : 3, qryCursor2.getAll().size());
+ }
+
+ /**
+ * @param clazz Message class.
+ */
+ private void blockMessage(Class<?> clazz) {
+ for (int i = 0; i < serverCount(); i++) {
+ BlockTpcCommunicationSpi commSpi = commSpi(grid(i));
+
+ commSpi.blockMessage(clazz);
+ }
+ }
+
+ /**
+ *
+ */
+ private void unblockMessage() {
+ for (int i = 0; i < serverCount(); i++) {
+ BlockTpcCommunicationSpi commSpi = commSpi(grid(i));
+
+ commSpi.unblockMessage();
+ }
+ }
+
+ /**
+ *
+ */
+ public static class Person {
+ /** */
+ @QuerySqlField
+ public int id;
+
+ /** */
+ @QuerySqlField
+ public String name;
+
+ /** */
+ @QuerySqlField
+ public String surname;
+
+ /**
+ * @param id Id.
+ * @param name Name.
+ * @param surname Surname.
+ */
+ public Person(int id, String name, String surname) {
+ this.id = id;
+ this.name = name;
+ this.surname = surname;
+ }
+
+ /**
+ * @return Id.
+ */
+ public int getId() {
+ return id;
+ }
+
+ /**
+ * @param id Set id.
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ /**
+ * @return Name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name Name.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return Surname.
+ */
+ public String getSurname() {
+ return surname;
+ }
+
+ /**
+ * @param surname Surname.
+ */
+ public void setSurname(String surname) {
+ this.surname = surname;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ return this == o || !(o == null || getClass() != o.getClass()) && id == ((Person)o).id;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ return id;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(Person.class, this);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
index 8ab2485..ca80acf 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/reducefields/GridCacheAbstractReduceFieldsQuerySelfTest.java
@@ -375,6 +375,7 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCom
/** */
private int cnt;
+ /** {@inheritDoc} */
@Override public boolean collect(List<?> e) {
sum += (Integer)e.get(0);
@@ -383,6 +384,7 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCom
return true;
}
+ /** {@inheritDoc} */
@Override public IgniteBiTuple<Integer, Integer> reduce() {
return F.t(sum, cnt);
}
@@ -398,6 +400,7 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCom
/** */
private int cnt;
+ /** {@inheritDoc} */
@Override public boolean collect(IgniteBiTuple<Integer, Integer> t) {
sum += t.get1();
cnt += t.get2();
@@ -405,6 +408,7 @@ public abstract class GridCacheAbstractReduceFieldsQuerySelfTest extends GridCom
return true;
}
+ /** {@inheritDoc} */
@Override public Integer reduce() {
return cnt == 0 ? 0 : sum / cnt;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
index 67ebda9..cc01540 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheWithIndexingTestSuite.java
@@ -52,6 +52,7 @@ public class IgniteCacheWithIndexingTestSuite extends TestSuite {
suite.addTestSuite(CacheConfigurationP2PTest.class);
suite.addTestSuite(IgniteCacheConfigurationPrimitiveTypesSelfTest.class);
+ suite.addTestSuite(IgniteClientReconnectQueriesTest.class);
return suite;
}
[02/50] [abbrv] incubator-ignite git commit: Merge branches
'ignite-1.3' and 'ignite-1067' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-1.3_
Posted by av...@apache.org.
Merge branches 'ignite-1.3' and 'ignite-1067' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-1.3_
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4da2ff27
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4da2ff27
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4da2ff27
Branch: refs/heads/ignite-630
Commit: 4da2ff277c6fbae556d3ecc2fa33780d5a1fe963
Parents: 5f28cce 3dcda26
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri Jul 10 17:57:12 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri Jul 10 17:57:12 2015 +0300
----------------------------------------------------------------------
assembly/LICENSE_FABRIC | 317 +++++++++++++++++++
assembly/LICENSE_HADOOP | 270 ++++++++++++++++
assembly/NOTICE_FABRIC | 13 +
assembly/NOTICE_HADOOP | 12 +
assembly/dependencies-fabric.xml | 13 +
assembly/dependencies-hadoop.xml | 12 +
assembly/dependencies-visor-console.xml | 20 +-
assembly/release-base.xml | 10 -
assembly/release-fabric.xml | 12 +
assembly/release-hadoop.xml | 12 +
modules/aop/licenses/aspectj-epl-license.txt | 69 ----
modules/apache-license-gen/pom.xml | 48 +++
.../src/main/resources/META-INF/licenses.txt.vm | 44 +++
.../geospatial/licenses/jts-lgpl-license.txt | 165 ----------
.../licenses/hibernate-lgpl-2.1-license.txt | 174 ----------
modules/indexing/licenses/h2-epl-license.txt | 69 ----
modules/mesos/licenses/jetty-epl-license.txt | 69 ----
modules/rest-http/pom.xml | 6 +-
.../scalar-2.10/licenses/scala-bsd-license.txt | 18 --
modules/scalar/licenses/scala-bsd-license.txt | 18 --
.../licenses/cron4j-lgpl-2.1-license.txt | 174 ----------
modules/slf4j/licenses/sl4j-mit-license.txt | 21 --
.../spark-2.10/licenses/scala-bsd-license.txt | 18 --
modules/spark/licenses/scala-bsd-license.txt | 18 --
modules/ssh/licenses/jcraft-revised-bsd.txt | 28 --
modules/tools/licenses/jodd-revised-bsd.txt | 21 --
.../urideploy/licenses/jtidy-mit-license.txt | 50 ---
modules/urideploy/pom.xml | 6 +-
.../licenses/jline-bsd-license.txt | 18 --
.../licenses/scala-bsd-license.txt | 18 --
.../licenses/slf4j-mit-license.txt | 21 --
modules/web/pom.xml | 6 +-
parent/pom.xml | 51 +++
pom.xml | 1 +
34 files changed, 833 insertions(+), 989 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4da2ff27/parent/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4da2ff27/pom.xml
----------------------------------------------------------------------
[39/50] [abbrv] incubator-ignite git commit: # ignite-901 client
reconnect support
Posted by av...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
index 4ca2995..2bce637 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java
@@ -228,6 +228,9 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
/** */
public static final byte HANDSHAKE_MSG_TYPE = -3;
+ /** */
+ private ConnectGateway connectGate;
+
/** Server listener. */
private final GridNioServerListener<Message> srvLsnr =
new GridNioServerListenerAdapter<Message>() {
@@ -248,7 +251,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
if (log.isDebugEnabled())
log.debug("Sending local node ID to newly accepted session: " + ses);
- ses.send(nodeIdMsg);
+ ses.send(nodeIdMessage());
}
}
@@ -289,136 +292,163 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
}
}
- @Override public void onMessage(GridNioSession ses, Message msg) {
- UUID sndId = ses.meta(NODE_ID_META);
+ /**
+ * @param ses Session.
+ * @param msg Message.
+ */
+ private void onFirstMessage(GridNioSession ses, Message msg) {
+ UUID sndId;
- if (sndId == null) {
- assert ses.accepted();
+ if (msg instanceof NodeIdMessage)
+ sndId = U.bytesToUuid(((NodeIdMessage)msg).nodeIdBytes, 0);
+ else {
+ assert msg instanceof HandshakeMessage : msg;
- if (msg instanceof NodeIdMessage)
- sndId = U.bytesToUuid(((NodeIdMessage)msg).nodeIdBytes, 0);
- else {
- assert msg instanceof HandshakeMessage : msg;
+ sndId = ((HandshakeMessage)msg).nodeId();
+ }
- sndId = ((HandshakeMessage)msg).nodeId();
- }
+ if (log.isDebugEnabled())
+ log.debug("Remote node ID received: " + sndId);
- if (log.isDebugEnabled())
- log.debug("Remote node ID received: " + sndId);
+ final UUID old = ses.addMeta(NODE_ID_META, sndId);
- final UUID old = ses.addMeta(NODE_ID_META, sndId);
+ assert old == null;
- assert old == null;
+ final ClusterNode rmtNode = getSpiContext().node(sndId);
- final ClusterNode rmtNode = getSpiContext().node(sndId);
+ if (rmtNode == null) {
+ if (log.isDebugEnabled())
+ log.debug("Close incoming connection, unknown node: " + sndId);
- if (rmtNode == null) {
- ses.close();
+ ses.close();
- return;
- }
+ return;
+ }
- ClusterNode locNode = getSpiContext().localNode();
+ ClusterNode locNode = getSpiContext().localNode();
- if (ses.remoteAddress() == null)
- return;
+ if (ses.remoteAddress() == null)
+ return;
- GridCommunicationClient oldClient = clients.get(sndId);
+ GridCommunicationClient oldClient = clients.get(sndId);
- boolean hasShmemClient = false;
+ boolean hasShmemClient = false;
- if (oldClient != null) {
- if (oldClient instanceof GridTcpNioCommunicationClient) {
- if (log.isDebugEnabled())
- log.debug("Received incoming connection when already connected " +
+ if (oldClient != null) {
+ if (oldClient instanceof GridTcpNioCommunicationClient) {
+ if (log.isDebugEnabled())
+ log.debug("Received incoming connection when already connected " +
"to this node, rejecting [locNode=" + locNode.id() +
", rmtNode=" + sndId + ']');
- ses.send(new RecoveryLastReceivedMessage(-1));
+ ses.send(new RecoveryLastReceivedMessage(-1));
- return;
- }
- else {
- assert oldClient instanceof GridShmemCommunicationClient;
+ return;
+ }
+ else {
+ assert oldClient instanceof GridShmemCommunicationClient;
- hasShmemClient = true;
- }
+ hasShmemClient = true;
}
+ }
- GridFutureAdapter<GridCommunicationClient> fut = new GridFutureAdapter<>();
+ GridFutureAdapter<GridCommunicationClient> fut = new GridFutureAdapter<>();
- GridFutureAdapter<GridCommunicationClient> oldFut = clientFuts.putIfAbsent(sndId, fut);
+ GridFutureAdapter<GridCommunicationClient> oldFut = clientFuts.putIfAbsent(sndId, fut);
- assert msg instanceof HandshakeMessage : msg;
+ assert msg instanceof HandshakeMessage : msg;
- HandshakeMessage msg0 = (HandshakeMessage)msg;
+ HandshakeMessage msg0 = (HandshakeMessage)msg;
- final GridNioRecoveryDescriptor recoveryDesc = recoveryDescriptor(rmtNode);
+ final GridNioRecoveryDescriptor recoveryDesc = recoveryDescriptor(rmtNode);
- if (oldFut == null) {
- oldClient = clients.get(sndId);
+ if (oldFut == null) {
+ oldClient = clients.get(sndId);
- if (oldClient != null) {
- if (oldClient instanceof GridTcpNioCommunicationClient) {
- if (log.isDebugEnabled())
- log.debug("Received incoming connection when already connected " +
+ if (oldClient != null) {
+ if (oldClient instanceof GridTcpNioCommunicationClient) {
+ if (log.isDebugEnabled())
+ log.debug("Received incoming connection when already connected " +
"to this node, rejecting [locNode=" + locNode.id() +
", rmtNode=" + sndId + ']');
- ses.send(new RecoveryLastReceivedMessage(-1));
+ ses.send(new RecoveryLastReceivedMessage(-1));
- return;
- }
- else {
- assert oldClient instanceof GridShmemCommunicationClient;
+ return;
+ }
+ else {
+ assert oldClient instanceof GridShmemCommunicationClient;
- hasShmemClient = true;
- }
+ hasShmemClient = true;
}
+ }
- boolean reserved = recoveryDesc.tryReserve(msg0.connectCount(),
+ boolean reserved = recoveryDesc.tryReserve(msg0.connectCount(),
new ConnectClosure(ses, recoveryDesc, rmtNode, msg0, !hasShmemClient, fut));
- if (log.isDebugEnabled())
- log.debug("Received incoming connection from remote node " +
+ if (log.isDebugEnabled())
+ log.debug("Received incoming connection from remote node " +
"[rmtNode=" + rmtNode.id() + ", reserved=" + reserved + ']');
- if (reserved) {
- try {
- GridTcpNioCommunicationClient client =
+ if (reserved) {
+ try {
+ GridTcpNioCommunicationClient client =
connected(recoveryDesc, ses, rmtNode, msg0.received(), true, !hasShmemClient);
- fut.onDone(client);
- }
- finally {
- clientFuts.remove(rmtNode.id(), fut);
- }
+ fut.onDone(client);
+ }
+ finally {
+ clientFuts.remove(rmtNode.id(), fut);
}
}
- else {
- if (oldFut instanceof ConnectFuture && locNode.order() < rmtNode.order()) {
- if (log.isDebugEnabled()) {
- log.debug("Received incoming connection from remote node while " +
+ }
+ else {
+ if (oldFut instanceof ConnectFuture && locNode.order() < rmtNode.order()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Received incoming connection from remote node while " +
"connecting to this node, rejecting [locNode=" + locNode.id() +
", locNodeOrder=" + locNode.order() + ", rmtNode=" + rmtNode.id() +
", rmtNodeOrder=" + rmtNode.order() + ']');
- }
-
- ses.send(new RecoveryLastReceivedMessage(-1));
}
- else {
- boolean reserved = recoveryDesc.tryReserve(msg0.connectCount(),
+
+ ses.send(new RecoveryLastReceivedMessage(-1));
+ }
+ else {
+ boolean reserved = recoveryDesc.tryReserve(msg0.connectCount(),
new ConnectClosure(ses, recoveryDesc, rmtNode, msg0, !hasShmemClient, fut));
- if (reserved) {
- GridTcpNioCommunicationClient client =
+ if (reserved) {
+ GridTcpNioCommunicationClient client =
connected(recoveryDesc, ses, rmtNode, msg0.received(), true, !hasShmemClient);
- fut.onDone(client);
- }
+ fut.onDone(client);
}
}
}
+ }
+
+ @Override public void onMessage(GridNioSession ses, Message msg) {
+ UUID sndId = ses.meta(NODE_ID_META);
+
+ if (sndId == null) {
+ assert ses.accepted() : ses;
+
+ if (!connectGate.tryEnter()) {
+ if (log.isDebugEnabled())
+ log.debug("Close incoming connection, failed to enter gateway.");
+
+ ses.close();
+
+ return;
+ }
+
+ try {
+ onFirstMessage(ses, msg);
+ }
+ finally {
+ connectGate.leave();
+ }
+ }
else {
rcvdMsgsCnt.increment();
@@ -700,9 +730,6 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
/** Address resolver. */
private AddressResolver addrRslvr;
- /** Local node ID message. */
- private NodeIdMessage nodeIdMsg;
-
/** Received messages count. */
private final LongAdder8 rcvdMsgsCnt = new LongAdder8();
@@ -739,8 +766,8 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
/** Discovery listener. */
private final GridLocalEventListener discoLsnr = new GridLocalEventListener() {
@Override public void onEvent(Event evt) {
- assert evt instanceof DiscoveryEvent;
- assert evt.type() == EVT_NODE_LEFT || evt.type() == EVT_NODE_FAILED;
+ assert evt instanceof DiscoveryEvent : evt;
+ assert evt.type() == EVT_NODE_LEFT || evt.type() == EVT_NODE_FAILED ;
onNodeLeft(((DiscoveryEvent)evt).eventNode().id());
}
@@ -1237,8 +1264,6 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
/** {@inheritDoc} */
@Override public Map<String, Object> getNodeAttributes() throws IgniteSpiException {
- nodeIdMsg = new NodeIdMessage(getLocalNodeId());
-
assertParameter(locPort > 1023, "locPort > 1023");
assertParameter(locPort <= 0xffff, "locPort < 0xffff");
assertParameter(locPortRange >= 0, "locPortRange >= 0");
@@ -1346,6 +1371,8 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
registerMBean(gridName, this, TcpCommunicationSpiMBean.class);
+ connectGate = new ConnectGateway();
+
if (shmemSrv != null) {
shmemAcceptWorker = new ShmemAcceptWorker(shmemSrv);
@@ -1608,6 +1635,9 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
// Safety.
ctxInitLatch.countDown();
+ if (connectGate != null)
+ connectGate.stopped();
+
// Force closing.
for (GridCommunicationClient client : clients.values())
client.forceClose();
@@ -1617,6 +1647,27 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
getSpiContext().removeLocalEventListener(discoLsnr);
}
+ /** {@inheritDoc} */
+ @Override public void onClientDisconnected(IgniteFuture<?> reconnectFut) {
+ connectGate.disconnected(reconnectFut);
+
+ for (GridCommunicationClient client : clients.values())
+ client.forceClose();
+
+ IgniteClientDisconnectedCheckedException err = new IgniteClientDisconnectedCheckedException(reconnectFut,
+ "Failed to connect client node disconnected.");
+
+ for (GridFutureAdapter<GridCommunicationClient> clientFut : clientFuts.values())
+ clientFut.onDone(err);
+
+ recoveryDescs.clear();
+ }
+
+ /** {@inheritDoc} */
+ @Override public void onClientReconnected(boolean clusterRestarted) {
+ connectGate.reconnected();
+ }
+
/**
* @param nodeId Left node ID.
*/
@@ -1666,10 +1717,8 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
if (log.isTraceEnabled())
log.trace("Sending message to node [node=" + node + ", msg=" + msg + ']');
- UUID locNodeId = getLocalNodeId();
-
- if (node.id().equals(locNodeId))
- notifyListener(locNodeId, msg, NOOP);
+ if (node.id().equals(getLocalNode().id()))
+ notifyListener(node.id(), msg, NOOP);
else {
GridCommunicationClient client = null;
@@ -1834,7 +1883,14 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
}
}
- return createTcpClient(node);
+ connectGate.enter();
+
+ try {
+ return createTcpClient(node);
+ }
+ finally {
+ connectGate.leave();
+ }
}
/**
@@ -2208,7 +2264,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
ch.write(ByteBuffer.wrap(U.IGNITE_HEADER));
if (recovery != null) {
- HandshakeMessage msg = new HandshakeMessage(getLocalNodeId(),
+ HandshakeMessage msg = new HandshakeMessage(getLocalNode().id(),
recovery.incrementConnectCount(),
recovery.receivedCount());
@@ -2228,7 +2284,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
ch.write(buf);
}
else
- ch.write(ByteBuffer.wrap(nodeIdMsg.nodeIdBytesWithType));
+ ch.write(ByteBuffer.wrap(nodeIdMessage().nodeIdBytesWithType));
if (recovery != null) {
if (log.isDebugEnabled())
@@ -2355,6 +2411,13 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
getExceptionRegistry().onException(msg, e);
}
+ /**
+ * @return Node ID message.
+ */
+ private NodeIdMessage nodeIdMessage() {
+ return new NodeIdMessage(getLocalNode().id());
+ }
+
/** {@inheritDoc} */
@Override public String toString() {
return S.toString(TcpCommunicationSpi.class, this);
@@ -2692,10 +2755,18 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
private void processRecovery(GridNioRecoveryDescriptor recoveryDesc) {
ClusterNode node = recoveryDesc.node();
- if (clients.containsKey(node.id()) ||
- !recoveryDesc.nodeAlive(getSpiContext().node(node.id())) ||
- !getSpiContext().pingNode(node.id()))
+ try {
+ if (clients.containsKey(node.id()) ||
+ !recoveryDesc.nodeAlive(getSpiContext().node(node.id())) ||
+ !getSpiContext().pingNode(node.id()))
+ return;
+ }
+ catch (IgniteClientDisconnectedException e) {
+ if (log.isDebugEnabled())
+ log.debug("Failed to ping node, client disconnected.");
+
return;
+ }
try {
if (log.isDebugEnabled())
@@ -2860,15 +2931,18 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
}
try {
+ UUID id = getLocalNode().id();
+
+ NodeIdMessage msg = new NodeIdMessage(id);
+
out.write(U.IGNITE_HEADER);
out.write(NODE_ID_MSG_TYPE);
- out.write(nodeIdMsg.nodeIdBytes);
+ out.write(msg.nodeIdBytes);
out.flush();
if (log.isDebugEnabled())
- log.debug("Sent local node ID [locNodeId=" + getLocalNodeId() + ", rmtNodeId="
- + rmtNodeId + ']');
+ log.debug("Sent local node ID [locNodeId=" + id + ", rmtNodeId=" + rmtNodeId + ']');
}
catch (IOException e) {
throw new IgniteCheckedException("Failed to perform handshake.", e);
@@ -3082,6 +3156,8 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
* @param nodeId Node ID.
*/
private NodeIdMessage(UUID nodeId) {
+ assert nodeId != null;
+
nodeIdBytes = U.uuidToBytes(nodeId);
nodeIdBytesWithType = new byte[nodeIdBytes.length + 1];
@@ -3131,4 +3207,86 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
return S.toString(NodeIdMessage.class, this);
}
}
+
+ /**
+ *
+ */
+ private class ConnectGateway {
+ /** */
+ private GridSpinReadWriteLock lock = new GridSpinReadWriteLock();
+
+ /** */
+ private IgniteException err;
+
+ /**
+ *
+ */
+ void enter() {
+ lock.readLock();
+
+ if (err != null) {
+ lock.readUnlock();
+
+ throw err;
+ }
+ }
+
+ /**
+ * @return {@code True} if entered gateway.
+ */
+ boolean tryEnter() {
+ lock.readLock();
+
+ boolean res = err == null;
+
+ if (!res)
+ lock.readUnlock();
+
+ return res;
+ }
+
+ /**
+ *
+ */
+ void leave() {
+ lock.readUnlock();
+ }
+
+ /**
+ * @param reconnectFut Reconnect future.
+ */
+ void disconnected(IgniteFuture<?> reconnectFut) {
+ lock.writeLock();
+
+ err = new IgniteClientDisconnectedException(reconnectFut, "Failed to connect, client node disconnected.");
+
+ lock.writeUnlock();
+ }
+
+ /**
+ *
+ */
+ void reconnected() {
+ lock.writeLock();
+
+ try {
+ if (err instanceof IgniteClientDisconnectedException)
+ err = null;
+ }
+ finally {
+ lock.writeUnlock();
+ }
+ }
+
+ /**
+ *
+ */
+ void stopped() {
+ lock.readLock();
+
+ err = new IgniteException("Failed to connect, node stopped.");
+
+ lock.readUnlock();
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java
index 46d6716..038ea59 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java
@@ -39,7 +39,8 @@ public interface DiscoverySpiDataExchange {
/**
* Notifies discovery manager about data received from remote node.
*
- * @param joiningNodeId Remote node ID.
+ * @param joiningNodeId ID of new node that joins topology.
+ * @param nodeId ID of the node provided data.
* @param data Collection of discovery data objects from different components.
*/
public void onExchange(UUID joiningNodeId, UUID nodeId, Map<Integer, Serializable> data);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 3f05f59..572ba2c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -22,6 +22,7 @@ import org.apache.ignite.cache.*;
import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.future.*;
+import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
@@ -41,6 +42,7 @@ import java.util.concurrent.atomic.*;
import static java.util.concurrent.TimeUnit.*;
import static org.apache.ignite.events.EventType.*;
import static org.apache.ignite.internal.events.DiscoveryCustomEvent.*;
+import static org.apache.ignite.spi.discovery.tcp.ClientImpl.State.*;
/**
*
@@ -71,7 +73,7 @@ class ClientImpl extends TcpDiscoveryImpl {
private SocketReader sockReader;
/** */
- private boolean segmented;
+ private volatile State state;
/** Last message ID. */
private volatile IgniteUuid lastMsgId;
@@ -94,6 +96,10 @@ class ClientImpl extends TcpDiscoveryImpl {
/** */
protected MessageWorker msgWorker;
+ /** */
+ @GridToStringExclude
+ private int joinCnt;
+
/**
* @param adapter Adapter.
*/
@@ -157,6 +163,9 @@ class ClientImpl extends TcpDiscoveryImpl {
locNode = spi.locNode;
+ // Marshal credentials for backward compatibility and security.
+ marshalCredentials(locNode);
+
sockWriter = new SocketWriter();
sockWriter.start();
@@ -258,23 +267,36 @@ class ClientImpl extends TcpDiscoveryImpl {
if (oldFut != null)
fut = oldFut;
else {
- if (spi.getSpiContext().isStopping()) {
+ State state = this.state;
+
+ if (spi.getSpiContext().isStopping() || state == STOPPED || state == SEGMENTED) {
if (pingFuts.remove(nodeId, fut))
fut.onDone(false);
return false;
}
+ else if (state == DISCONNECTED) {
+ if (pingFuts.remove(nodeId, fut))
+ fut.onDone(new IgniteClientDisconnectedCheckedException(null,
+ "Failed to ping node, client node disconnected."));
+ }
+ else {
+ final GridFutureAdapter<Boolean> finalFut = fut;
- final GridFutureAdapter<Boolean> finalFut = fut;
-
- timer.schedule(new TimerTask() {
- @Override public void run() {
- if (pingFuts.remove(nodeId, finalFut))
- finalFut.onDone(false);
- }
- }, spi.netTimeout);
+ timer.schedule(new TimerTask() {
+ @Override public void run() {
+ if (pingFuts.remove(nodeId, finalFut)) {
+ if (ClientImpl.this.state == DISCONNECTED)
+ finalFut.onDone(new IgniteClientDisconnectedCheckedException(null,
+ "Failed to ping node, client node disconnected."));
+ else
+ finalFut.onDone(false);
+ }
+ }
+ }, spi.netTimeout);
- sockWriter.sendMessage(new TcpDiscoveryClientPingRequest(getLocalNodeId(), nodeId));
+ sockWriter.sendMessage(new TcpDiscoveryClientPingRequest(getLocalNodeId(), nodeId));
+ }
}
}
@@ -285,7 +307,7 @@ class ClientImpl extends TcpDiscoveryImpl {
return false;
}
catch (IgniteCheckedException e) {
- throw new IgniteSpiException(e); // Should newer occur.
+ throw new IgniteSpiException(e);
}
}
@@ -325,8 +347,13 @@ class ClientImpl extends TcpDiscoveryImpl {
/** {@inheritDoc} */
@Override public void sendCustomEvent(DiscoverySpiCustomMessage evt) {
- if (segmented)
- throw new IgniteException("Failed to send custom message: client is disconnected");
+ State state = this.state;
+
+ if (state == SEGMENTED)
+ throw new IgniteException("Failed to send custom message: client is segmented.");
+
+ if (state == DISCONNECTED)
+ throw new IgniteClientDisconnectedException(null, "Failed to send custom message: client is disconnected.");
try {
sockWriter.sendMessage(new TcpDiscoveryCustomEventMessage(getLocalNodeId(), evt,
@@ -361,14 +388,11 @@ class ClientImpl extends TcpDiscoveryImpl {
* @see TcpDiscoverySpi#joinTimeout
*/
@SuppressWarnings("BusyWait")
- @Nullable private Socket joinTopology(boolean recon, long timeout) throws IgniteSpiException, InterruptedException {
+ @Nullable private T2<Socket, Boolean> joinTopology(boolean recon, long timeout) throws IgniteSpiException, InterruptedException {
Collection<InetSocketAddress> addrs = null;
long startTime = U.currentTimeMillis();
- // Marshal credentials for backward compatibility and security.
- marshalCredentials(locNode);
-
while (true) {
if (Thread.currentThread().isInterrupted())
throw new InterruptedException();
@@ -400,7 +424,7 @@ class ClientImpl extends TcpDiscoveryImpl {
InetSocketAddress addr = it.next();
- T2<Socket, Integer> sockAndRes = sendJoinRequest(recon, addr);
+ T3<Socket, Integer, Boolean> sockAndRes = sendJoinRequest(recon, addr);
if (sockAndRes == null) {
it.remove();
@@ -414,7 +438,7 @@ class ClientImpl extends TcpDiscoveryImpl {
switch (sockAndRes.get2()) {
case RES_OK:
- return sock;
+ return new T2<>(sock, sockAndRes.get3());
case RES_CONTINUE_JOIN:
case RES_WAIT:
@@ -445,9 +469,9 @@ class ClientImpl extends TcpDiscoveryImpl {
/**
* @param recon {@code True} if reconnects.
* @param addr Address.
- * @return Socket and connect response.
+ * @return Socket, connect response and client acknowledge support flag.
*/
- @Nullable private T2<Socket, Integer> sendJoinRequest(boolean recon, InetSocketAddress addr) {
+ @Nullable private T3<Socket, Integer, Boolean> sendJoinRequest(boolean recon, InetSocketAddress addr) {
assert addr != null;
if (log.isDebugEnabled())
@@ -493,9 +517,18 @@ class ClientImpl extends TcpDiscoveryImpl {
tstamp = U.currentTimeMillis();
- TcpDiscoveryAbstractMessage msg = recon ?
- new TcpDiscoveryClientReconnectMessage(getLocalNodeId(), rmtNodeId, lastMsgId) :
- new TcpDiscoveryJoinRequestMessage(locNode, spi.collectExchangeData(getLocalNodeId()));
+ TcpDiscoveryAbstractMessage msg;
+
+ if (!recon) {
+ TcpDiscoveryNode node = locNode;
+
+ if (locNode.order() > 0)
+ node = locNode.clientReconnectNode();
+
+ msg = new TcpDiscoveryJoinRequestMessage(node, spi.collectExchangeData(getLocalNodeId()));
+ }
+ else
+ msg = new TcpDiscoveryClientReconnectMessage(getLocalNodeId(), rmtNodeId, lastMsgId);
msg.client(true);
@@ -507,7 +540,7 @@ class ClientImpl extends TcpDiscoveryImpl {
log.debug("Message has been sent to address [msg=" + msg + ", addr=" + addr +
", rmtNodeId=" + rmtNodeId + ']');
- return new T2<>(sock, spi.readReceipt(sock, ackTimeout0));
+ return new T3<>(sock, spi.readReceipt(sock, ackTimeout0), res.clientAck());
}
catch (IOException | IgniteCheckedException e) {
U.closeQuiet(sock);
@@ -786,10 +819,16 @@ class ClientImpl extends TcpDiscoveryImpl {
spi.stats.onMessageReceived(msg);
- if (spi.ensured(msg) && joinLatch.getCount() == 0L)
- lastMsgId = msg.id();
+ boolean ack = msg instanceof TcpDiscoveryClientAckResponse;
+
+ if (!ack) {
+ if (spi.ensured(msg) && joinLatch.getCount() == 0L)
+ lastMsgId = msg.id();
- msgWorker.addMessage(msg);
+ msgWorker.addMessage(msg);
+ }
+ else
+ sockWriter.ackReceived((TcpDiscoveryClientAckResponse)msg);
}
}
catch (IOException e) {
@@ -823,8 +862,14 @@ class ClientImpl extends TcpDiscoveryImpl {
private Socket sock;
/** */
+ private boolean clientAck;
+
+ /** */
private final Queue<TcpDiscoveryAbstractMessage> queue = new ArrayDeque<>();
+ /** */
+ private TcpDiscoveryAbstractMessage unackedMsg;
+
/**
*
*/
@@ -845,11 +890,16 @@ class ClientImpl extends TcpDiscoveryImpl {
/**
* @param sock Socket.
+ * @param clientAck {@code True} is server supports client message acknowlede.
*/
- private void setSocket(Socket sock) {
+ private void setSocket(Socket sock, boolean clientAck) {
synchronized (mux) {
this.sock = sock;
+ this.clientAck = clientAck;
+
+ unackedMsg = null;
+
mux.notifyAll();
}
}
@@ -863,6 +913,21 @@ class ClientImpl extends TcpDiscoveryImpl {
}
}
+ /**
+ * @param res Acknowledge response.
+ */
+ void ackReceived(TcpDiscoveryClientAckResponse res) {
+ synchronized (mux) {
+ if (unackedMsg != null) {
+ assert unackedMsg.id().equals(res.messageId()) : unackedMsg;
+
+ unackedMsg = null;
+ }
+
+ mux.notifyAll();
+ }
+ }
+
/** {@inheritDoc} */
@Override protected void body() throws InterruptedException {
TcpDiscoveryAbstractMessage msg = null;
@@ -892,10 +957,43 @@ class ClientImpl extends TcpDiscoveryImpl {
for (IgniteInClosure<TcpDiscoveryAbstractMessage> msgLsnr : spi.sendMsgLsnrs)
msgLsnr.apply(msg);
+ boolean ack = clientAck && !(msg instanceof TcpDiscoveryPingResponse);
+
try {
+ if (ack) {
+ synchronized (mux) {
+ assert unackedMsg == null : unackedMsg;
+
+ unackedMsg = msg;
+ }
+ }
+
spi.writeToSocket(sock, msg);
msg = null;
+
+ if (ack) {
+ long waitEnd = U.currentTimeMillis() + spi.ackTimeout;
+
+ TcpDiscoveryAbstractMessage unacked;
+
+ synchronized (mux) {
+ while (unackedMsg != null && U.currentTimeMillis() < waitEnd)
+ mux.wait(waitEnd);
+
+ unacked = unackedMsg;
+
+ unackedMsg = null;
+ }
+
+ if (unacked != null) {
+ if (log.isDebugEnabled())
+ log.debug("Failed to get acknowledge for message, will try to reconnect " +
+ "[msg=" + unacked + ", timeout=" + spi.ackTimeout + ']');
+
+ throw new IOException("Failed to get acknowledge for message: " + unacked);
+ }
+ }
}
catch (IOException e) {
if (log.isDebugEnabled())
@@ -926,6 +1024,9 @@ class ClientImpl extends TcpDiscoveryImpl {
private volatile Socket sock;
/** */
+ private boolean clientAck;
+
+ /** */
private boolean join;
/**
@@ -948,8 +1049,6 @@ class ClientImpl extends TcpDiscoveryImpl {
/** {@inheritDoc} */
@Override protected void body() throws InterruptedException {
- assert !segmented;
-
boolean success = false;
Exception err = null;
@@ -958,11 +1057,14 @@ class ClientImpl extends TcpDiscoveryImpl {
long startTime = U.currentTimeMillis();
+ if (log.isDebugEnabled())
+ log.debug("Started reconnect process [join=" + join + ", timeout=" + timeout + ']');
+
try {
while (true) {
- sock = joinTopology(true, timeout);
+ T2<Socket, Boolean> joinRes = joinTopology(true, timeout);
- if (sock == null) {
+ if (joinRes == null) {
if (join) {
joinError(new IgniteSpiException("Join process timed out, connection failed and " +
"failed to reconnect (consider increasing 'joinTimeout' configuration property) " +
@@ -970,11 +1072,14 @@ class ClientImpl extends TcpDiscoveryImpl {
}
else
U.error(log, "Failed to reconnect to cluster (consider increasing 'networkTimeout' " +
- "configuration property) [networkTimeout=" + spi.netTimeout + ", sock=" + sock + ']');
+ "configuration property) [networkTimeout=" + spi.netTimeout + ", sock=" + sock + ']');
return;
}
+ sock = joinRes.get1();
+ clientAck = joinRes.get2();
+
if (isInterrupted())
throw new InterruptedException();
@@ -999,6 +1104,10 @@ class ClientImpl extends TcpDiscoveryImpl {
TcpDiscoveryClientReconnectMessage res = (TcpDiscoveryClientReconnectMessage)msg;
if (res.creatorNodeId().equals(getLocalNodeId())) {
+ if (log.isDebugEnabled())
+ log.debug("Received reconnect response [success=" + res.success() +
+ ", msg=" + msg + ']');
+
if (res.success()) {
msgWorker.addMessage(res);
@@ -1008,9 +1117,11 @@ class ClientImpl extends TcpDiscoveryImpl {
}
success = true;
- }
- return;
+ return;
+ }
+ else
+ return;
}
}
else if (spi.ensured(msg)) {
@@ -1081,6 +1192,9 @@ class ClientImpl extends TcpDiscoveryImpl {
/** */
private Reconnector reconnector;
+ /** */
+ private boolean nodeAdded;
+
/**
*
*/
@@ -1091,45 +1205,37 @@ class ClientImpl extends TcpDiscoveryImpl {
/** {@inheritDoc} */
@SuppressWarnings("InfiniteLoopStatement")
@Override protected void body() throws InterruptedException {
+ state = STARTING;
+
spi.stats.onJoinStarted();
try {
- final Socket sock = joinTopology(false, spi.joinTimeout);
-
- if (sock == null) {
- joinError(new IgniteSpiException("Join process timed out."));
-
- return;
- }
-
- currSock = sock;
-
- sockWriter.setSocket(sock);
-
- if (spi.joinTimeout > 0) {
- timer.schedule(new TimerTask() {
- @Override public void run() {
- if (joinLatch.getCount() > 0)
- queue.add(JOIN_TIMEOUT);
- }
- }, spi.joinTimeout);
- }
-
- sockReader.setSocket(sock, locNode.clientRouterNodeId());
+ tryJoin();
while (true) {
Object msg = queue.take();
if (msg == JOIN_TIMEOUT) {
- if (joinLatch.getCount() > 0) {
+ if (state == STARTING) {
joinError(new IgniteSpiException("Join process timed out, did not receive response for " +
"join request (consider increasing 'joinTimeout' configuration property) " +
- "[joinTimeout=" + spi.joinTimeout + ", sock=" + sock + ']'));
+ "[joinTimeout=" + spi.joinTimeout + ", sock=" + currSock + ']'));
break;
}
+ else if (state == DISCONNECTED) {
+ if (log.isDebugEnabled())
+ log.debug("Failed to reconnect, local node segmented " +
+ "[joinTimeout=" + spi.joinTimeout + ']');
+
+ state = SEGMENTED;
+
+ notifyDiscovery(EVT_NODE_SEGMENTED, topVer, locNode, allVisibleNodes());
+ }
}
else if (msg == SPI_STOP) {
+ state = STOPPED;
+
assert spi.getSpiContext().isStopping();
if (currSock != null) {
@@ -1148,7 +1254,7 @@ class ClientImpl extends TcpDiscoveryImpl {
boolean join = joinLatch.getCount() > 0;
- if (spi.getSpiContext().isStopping() || segmented) {
+ if (spi.getSpiContext().isStopping() || state == SEGMENTED) {
leaveLatch.countDown();
if (join) {
@@ -1158,6 +1264,9 @@ class ClientImpl extends TcpDiscoveryImpl {
}
}
else {
+ if (log.isDebugEnabled())
+ log.debug("Connection closed, will try to restore connection.");
+
assert reconnector == null;
final Reconnector reconnector = new Reconnector(join);
@@ -1167,19 +1276,64 @@ class ClientImpl extends TcpDiscoveryImpl {
}
}
else if (msg == SPI_RECONNECT_FAILED) {
- if (!segmented) {
- segmented = true;
+ reconnector.cancel();
+ reconnector.join();
- reconnector.cancel();
- reconnector.join();
+ reconnector = null;
- notifyDiscovery(EVT_NODE_SEGMENTED, topVer, locNode, allVisibleNodes());
+ if (spi.isClientReconnectDisabled()) {
+ if (state != SEGMENTED && state != STOPPED) {
+ if (log.isDebugEnabled()) {
+ log.debug("Failed to restore closed connection, reconnect disabled, " +
+ "local node segmented [networkTimeout=" + spi.netTimeout + ']');
+ }
+
+ state = SEGMENTED;
+
+ notifyDiscovery(EVT_NODE_SEGMENTED, topVer, locNode, allVisibleNodes());
+ }
+ }
+ else {
+ if (state == STARTING || state == CONNECTED) {
+ if (log.isDebugEnabled()) {
+ log.debug("Failed to restore closed connection, will try to reconnect " +
+ "[networkTimeout=" + spi.netTimeout + ", joinTimeout=" + spi.joinTimeout + ']');
+ }
+
+ state = DISCONNECTED;
+
+ nodeAdded = false;
+
+ IgniteClientDisconnectedCheckedException err =
+ new IgniteClientDisconnectedCheckedException(null, "Failed to ping node, " +
+ "client node disconnected.");
+
+ for (Map.Entry<UUID, GridFutureAdapter<Boolean>> e : pingFuts.entrySet()) {
+ GridFutureAdapter<Boolean> fut = e.getValue();
+
+ if (pingFuts.remove(e.getKey(), fut))
+ fut.onDone(err);
+ }
+
+ notifyDiscovery(EVT_CLIENT_NODE_DISCONNECTED, topVer, locNode, allVisibleNodes());
+ }
+
+ UUID newId = UUID.randomUUID();
+
+ if (log.isInfoEnabled()) {
+ log.info("Client node disconnected from cluster, will try to reconnect with new id " +
+ "[newId=" + newId + ", prevId=" + locNode.id() + ", locNode=" + locNode + ']');
+ }
+
+ locNode.onClientDisconnected(newId);
+
+ tryJoin();
}
}
else {
TcpDiscoveryAbstractMessage discoMsg = (TcpDiscoveryAbstractMessage)msg;
- if (joinLatch.getCount() > 0) {
+ if (joining()) {
IgniteSpiException err = null;
if (discoMsg instanceof TcpDiscoveryDuplicateIdMessage)
@@ -1190,7 +1344,15 @@ class ClientImpl extends TcpDiscoveryImpl {
err = spi.checkFailedError((TcpDiscoveryCheckFailedMessage)msg);
if (err != null) {
- joinError(err);
+ if (state == DISCONNECTED) {
+ U.error(log, "Failed to reconnect, segment local node.", err);
+
+ state = SEGMENTED;
+
+ notifyDiscovery(EVT_NODE_SEGMENTED, topVer, locNode, allVisibleNodes());
+ }
+ else
+ joinError(err);
break;
}
@@ -1215,6 +1377,48 @@ class ClientImpl extends TcpDiscoveryImpl {
}
/**
+ * @throws InterruptedException If interrupted.
+ */
+ private void tryJoin() throws InterruptedException {
+ assert state == DISCONNECTED || state == STARTING : state;
+
+ boolean join = state == STARTING;
+
+ joinCnt++;
+
+ T2<Socket, Boolean> joinRes = joinTopology(false, spi.joinTimeout);
+
+ if (joinRes == null) {
+ if (join)
+ joinError(new IgniteSpiException("Join process timed out."));
+ else {
+ state = SEGMENTED;
+
+ notifyDiscovery(EVT_NODE_SEGMENTED, topVer, locNode, allVisibleNodes());
+ }
+
+ return;
+ }
+
+ currSock = joinRes.get1();
+
+ sockWriter.setSocket(joinRes.get1(), joinRes.get2());
+
+ if (spi.joinTimeout > 0) {
+ final int joinCnt0 = joinCnt;
+
+ timer.schedule(new TimerTask() {
+ @Override public void run() {
+ if (joinCnt == joinCnt0 && joining())
+ queue.add(JOIN_TIMEOUT);
+ }
+ }, spi.joinTimeout);
+ }
+
+ sockReader.setSocket(joinRes.get1(), locNode.clientRouterNodeId());
+ }
+
+ /**
* @param msg Message.
*/
protected void processDiscoveryMessage(TcpDiscoveryAbstractMessage msg) {
@@ -1246,6 +1450,22 @@ class ClientImpl extends TcpDiscoveryImpl {
}
/**
+ * @return {@code True} if client in process of join.
+ */
+ private boolean joining() {
+ ClientImpl.State state = ClientImpl.this.state;
+
+ return state == STARTING || state == DISCONNECTED;
+ }
+
+ /**
+ * @return {@code True} if client disconnected.
+ */
+ private boolean disconnected() {
+ return state == DISCONNECTED;
+ }
+
+ /**
* @param msg Message.
*/
private void processNodeAddedMessage(TcpDiscoveryNodeAddedMessage msg) {
@@ -1257,12 +1477,15 @@ class ClientImpl extends TcpDiscoveryImpl {
UUID newNodeId = node.id();
if (getLocalNodeId().equals(newNodeId)) {
- if (joinLatch.getCount() > 0) {
+ if (joining()) {
Collection<TcpDiscoveryNode> top = msg.topology();
if (top != null) {
spi.gridStartTime = msg.gridStartTime();
+ if (disconnected())
+ rmtNodes.clear();
+
for (TcpDiscoveryNode n : top) {
if (n.order() > 0)
n.visible(true);
@@ -1272,6 +1495,8 @@ class ClientImpl extends TcpDiscoveryImpl {
topHist.clear();
+ nodeAdded = true;
+
if (msg.topologyHistory() != null)
topHist.putAll(msg.topologyHistory());
}
@@ -1309,7 +1534,7 @@ class ClientImpl extends TcpDiscoveryImpl {
return;
if (getLocalNodeId().equals(msg.nodeId())) {
- if (joinLatch.getCount() > 0) {
+ if (joining()) {
Map<UUID, Map<Integer, byte[]>> dataMap = msg.clientDiscoData();
if (dataMap != null) {
@@ -1324,13 +1549,22 @@ class ClientImpl extends TcpDiscoveryImpl {
locNode.order(topVer);
- notifyDiscovery(EVT_NODE_JOINED, topVer, locNode, updateTopologyHistory(topVer, msg));
+ Collection<ClusterNode> nodes = updateTopologyHistory(topVer, msg);
+
+ notifyDiscovery(EVT_NODE_JOINED, topVer, locNode, nodes);
+
+ boolean disconnected = disconnected();
+
+ state = CONNECTED;
+
+ if (disconnected)
+ notifyDiscovery(EVT_CLIENT_NODE_RECONNECTED, topVer, locNode, nodes);
+ else
+ spi.stats.onJoinFinished();
joinErr.set(null);;
joinLatch.countDown();
-
- spi.stats.onJoinFinished();
}
else if (log.isDebugEnabled())
log.debug("Discarding node add finished message (this message has already been processed) " +
@@ -1438,7 +1672,7 @@ class ClientImpl extends TcpDiscoveryImpl {
* @return {@code True} if received node added message for local node.
*/
private boolean nodeAdded() {
- return !topHist.isEmpty();
+ return nodeAdded;
}
/**
@@ -1539,7 +1773,7 @@ class ClientImpl extends TcpDiscoveryImpl {
currSock = reconnector.sock;
- sockWriter.setSocket(currSock);
+ sockWriter.setSocket(currSock, reconnector.clientAck);
sockReader.setSocket(currSock, locNode.clientRouterNodeId());
reconnector = null;
@@ -1583,7 +1817,7 @@ class ClientImpl extends TcpDiscoveryImpl {
* @param msg Message.
*/
private void processCustomMessage(TcpDiscoveryCustomEventMessage msg) {
- if (msg.verified() && joinLatch.getCount() == 0) {
+ if (msg.verified() && state == CONNECTED) {
DiscoverySpiListener lsnr = spi.lsnr;
if (lsnr != null) {
@@ -1719,4 +1953,24 @@ class ClientImpl extends TcpDiscoveryImpl {
this.sock = sock;
}
}
+
+ /**
+ *
+ */
+ enum State {
+ /** */
+ STARTING,
+
+ /** */
+ CONNECTED,
+
+ /** */
+ DISCONNECTED,
+
+ /** */
+ SEGMENTED,
+
+ /** */
+ STOPPED
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/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 d51293e..1a28e86 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
@@ -1447,6 +1447,8 @@ class ServerImpl extends TcpDiscoveryImpl {
if (log.isDebugEnabled())
log.debug("Heartbeats sender has been started.");
+ UUID nodeId = getConfiguredNodeId();
+
while (!isInterrupted()) {
if (spiStateCopy() != CONNECTED) {
if (log.isDebugEnabled())
@@ -1455,7 +1457,7 @@ class ServerImpl extends TcpDiscoveryImpl {
return;
}
- TcpDiscoveryHeartbeatMessage msg = new TcpDiscoveryHeartbeatMessage(getLocalNodeId());
+ TcpDiscoveryHeartbeatMessage msg = new TcpDiscoveryHeartbeatMessage(nodeId);
msg.verify(getLocalNodeId());
@@ -1593,39 +1595,47 @@ class ServerImpl extends TcpDiscoveryImpl {
// Addresses registered in IP finder.
Collection<InetSocketAddress> regAddrs = spi.registeredAddresses();
- // Remove all addresses that belong to alive nodes, leave dead-node addresses.
- Collection<InetSocketAddress> rmvAddrs = F.view(
- regAddrs,
- F.notContains(currAddrs),
- new P1<InetSocketAddress>() {
- private final Map<InetSocketAddress, Boolean> pingResMap = new HashMap<>();
+ P1<InetSocketAddress> p = new P1<InetSocketAddress>() {
+ private final Map<InetSocketAddress, Boolean> pingResMap = new HashMap<>();
- @Override public boolean apply(InetSocketAddress addr) {
- Boolean res = pingResMap.get(addr);
+ @Override public boolean apply(InetSocketAddress addr) {
+ Boolean res = pingResMap.get(addr);
- if (res == null) {
- try {
- res = pingNode(addr, null).get1() != null;
- }
- catch (IgniteCheckedException e) {
- if (log.isDebugEnabled())
- log.debug("Failed to ping node [addr=" + addr +
- ", err=" + e.getMessage() + ']');
-
- res = false;
- }
- finally {
- pingResMap.put(addr, res);
- }
+ if (res == null) {
+ try {
+ res = pingNode(addr, null).get1() != null;
}
+ catch (IgniteCheckedException e) {
+ if (log.isDebugEnabled())
+ log.debug("Failed to ping node [addr=" + addr +
+ ", err=" + e.getMessage() + ']');
- return !res;
+ res = false;
+ }
+ finally {
+ pingResMap.put(addr, res);
+ }
}
+
+ return !res;
}
- );
+ };
+
+ ArrayList<InetSocketAddress> rmvAddrs = null;
+
+ for (InetSocketAddress addr : regAddrs) {
+ boolean rmv = !F.contains(currAddrs, addr) && p.apply(addr);
+
+ if (rmv) {
+ if (rmvAddrs == null)
+ rmvAddrs = new ArrayList<>();
+
+ rmvAddrs.add(addr);
+ }
+ }
// Unregister dead-nodes addresses.
- if (!rmvAddrs.isEmpty()) {
+ if (rmvAddrs != null) {
spi.ipFinder.unregisterAddresses(rmvAddrs);
if (log.isDebugEnabled())
@@ -4077,7 +4087,7 @@ class ServerImpl extends TcpDiscoveryImpl {
/** {@inheritDoc} */
@Override protected void body() throws InterruptedException {
- UUID locNodeId = getLocalNodeId();
+ UUID locNodeId = getConfiguredNodeId();
ClientMessageWorker clientMsgWrk = null;
@@ -4170,6 +4180,9 @@ class ServerImpl extends TcpDiscoveryImpl {
TcpDiscoveryHandshakeResponse res =
new TcpDiscoveryHandshakeResponse(locNodeId, locNode.internalOrder());
+ if (req.client())
+ res.clientAck(true);
+
spi.writeToSocket(sock, res);
// It can happen if a remote node is stopped and it has a loopback address in the list of addresses,
@@ -4313,7 +4326,7 @@ class ServerImpl extends TcpDiscoveryImpl {
if (state == CONNECTED) {
spi.writeToSocket(msg, sock, RES_OK);
- if (clientMsgWrk != null && clientMsgWrk.getState() == State.NEW)
+ if (clientMsgWrk.getState() == State.NEW)
clientMsgWrk.start();
msgWorker.addMessage(msg);
@@ -4457,7 +4470,14 @@ class ServerImpl extends TcpDiscoveryImpl {
msgWorker.addMessage(msg);
// Send receipt back.
- if (clientMsgWrk == null)
+ if (clientMsgWrk != null) {
+ TcpDiscoveryClientAckResponse ack = new TcpDiscoveryClientAckResponse(locNodeId, msg.id());
+
+ ack.verify(locNodeId);
+
+ clientMsgWrk.addMessage(ack);
+ }
+ else
spi.writeToSocket(msg, sock, RES_OK);
}
catch (IgniteCheckedException e) {
@@ -4567,8 +4587,11 @@ class ServerImpl extends TcpDiscoveryImpl {
msg.responded(true);
- if (clientMsgWrk != null && clientMsgWrk.getState() == State.NEW)
+ if (clientMsgWrk != null && clientMsgWrk.getState() == State.NEW) {
+ clientMsgWrk.clientVersion(U.productVersion(msg.node()));
+
clientMsgWrk.start();
+ }
msgWorker.addMessage(msg);
@@ -4679,6 +4702,9 @@ class ServerImpl extends TcpDiscoveryImpl {
/** */
private final AtomicReference<GridFutureAdapter<Boolean>> pingFut = new AtomicReference<>();
+ /** */
+ private IgniteProductVersion clientVer;
+
/**
* @param sock Socket.
* @param clientNodeId Node ID.
@@ -4691,6 +4717,13 @@ class ServerImpl extends TcpDiscoveryImpl {
}
/**
+ * @param clientVer Client version.
+ */
+ void clientVersion(IgniteProductVersion clientVer) {
+ this.clientVer = clientVer;
+ }
+
+ /**
* @return Current client metrics.
*/
ClusterMetrics metrics() {
@@ -4709,17 +4742,40 @@ class ServerImpl extends TcpDiscoveryImpl {
try {
assert msg.verified() : msg;
- if (log.isDebugEnabled())
- log.debug("Redirecting message to client [sock=" + sock + ", locNodeId="
- + getLocalNodeId() + ", rmtNodeId=" + clientNodeId + ", msg=" + msg + ']');
+ if (msg instanceof TcpDiscoveryClientAckResponse) {
+ if (clientVer == null) {
+ ClusterNode node = spi.getNode(clientNodeId);
- try {
- prepareNodeAddedMessage(msg, clientNodeId, null, null);
+ if (node != null)
+ clientVer = IgniteUtils.productVersion(node);
+ else if (log.isDebugEnabled())
+ log.debug("Skip sending message ack to client, fail to get client node " +
+ "[sock=" + sock + ", locNodeId=" + getLocalNodeId() +
+ ", rmtNodeId=" + clientNodeId + ", msg=" + msg + ']');
+ }
+
+ if (clientVer != null &&
+ clientVer.compareTo(TcpDiscoveryClientAckResponse.CLIENT_ACK_SINCE_VERSION) >= 0) {
+ if (log.isDebugEnabled())
+ log.debug("Sending message ack to client [sock=" + sock + ", locNodeId="
+ + getLocalNodeId() + ", rmtNodeId=" + clientNodeId + ", msg=" + msg + ']');
- writeToSocket(sock, msg);
+ writeToSocket(sock, msg);
+ }
}
- finally {
- clearNodeAddedMessage(msg);
+ else {
+ try {
+ if (log.isDebugEnabled())
+ log.debug("Redirecting message to client [sock=" + sock + ", locNodeId="
+ + getLocalNodeId() + ", rmtNodeId=" + clientNodeId + ", msg=" + msg + ']');
+
+ prepareNodeAddedMessage(msg, clientNodeId, null, null);
+
+ writeToSocket(sock, msg);
+ }
+ finally {
+ clearNodeAddedMessage(msg);
+ }
}
}
catch (IgniteCheckedException | IOException e) {
@@ -4829,7 +4885,7 @@ class ServerImpl extends TcpDiscoveryImpl {
/** {@inheritDoc} */
@Override protected void body() throws InterruptedException {
if (log.isDebugEnabled())
- log.debug("Message worker started [locNodeId=" + getLocalNodeId() + ']');
+ log.debug("Message worker started [locNodeId=" + getConfiguredNodeId() + ']');
while (!isInterrupted()) {
TcpDiscoveryAbstractMessage msg = queue.poll(2000, TimeUnit.MILLISECONDS);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/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 ace917f..c271b7c 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
@@ -112,7 +112,14 @@ abstract class TcpDiscoveryImpl {
* @return Local node ID.
*/
public UUID getLocalNodeId() {
- return spi.getLocalNodeId();
+ return spi.locNode.id();
+ }
+
+ /**
+ * @return Configured node ID (actual node ID can be different if client reconnects).
+ */
+ public UUID getConfiguredNodeId() {
+ return spi.cfgNodeId;
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/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 7663fe6..431d198 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
@@ -260,6 +260,9 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi, T
/** Local node. */
protected TcpDiscoveryNode locNode;
+ /** */
+ protected UUID cfgNodeId;
+
/** Local host. */
protected InetAddress locHost;
@@ -327,6 +330,9 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi, T
/** */
private boolean forceSrvMode;
+ /** */
+ private boolean clientReconnectDisabled;
+
/** {@inheritDoc} */
@Override public String getSpiState() {
return impl.getSpiState();
@@ -417,6 +423,29 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi, T
}
/**
+ * If {@code true} client does not try to reconnect after
+ * server detected client node failure.
+ *
+ * @return Client reconnect disabled flag.
+ */
+ public boolean isClientReconnectDisabled() {
+ return clientReconnectDisabled;
+ }
+
+ /**
+ * Sets client reconnect disabled flag.
+ * <p>
+ * If {@code true} client does not try to reconnect after
+ * server detected client node failure.
+ *
+ * @param clientReconnectDisabled Client reconnect disabled flag.
+ */
+ @IgniteSpiConfiguration(optional = true)
+ public void setClientReconnectDisabled(boolean clientReconnectDisabled) {
+ this.clientReconnectDisabled = clientReconnectDisabled;
+ }
+
+ /**
* Inject resources
*
* @param ignite Ignite.
@@ -844,7 +873,7 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi, T
}
locNode = new TcpDiscoveryNode(
- getLocalNodeId(),
+ ignite.configuration().getNodeId(),
addrs.get1(),
addrs.get2(),
srvPort,
@@ -1615,6 +1644,8 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi, T
mcastIpFinder.setLocalAddress(locAddr);
}
+ cfgNodeId = ignite.configuration().getNodeId();
+
impl.spiStart(gridName);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/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 22f56c3..032cf01 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
@@ -441,6 +441,25 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements Cluste
this.clientRouterNodeId = clientRouterNodeId;
}
+ /**
+ * @param newId New node ID.
+ */
+ public void onClientDisconnected(UUID newId) {
+ id = newId;
+ }
+
+ /**
+ * @return Copy of local node for client reconnect request.
+ */
+ public TcpDiscoveryNode clientReconnectNode() {
+ TcpDiscoveryNode node = new TcpDiscoveryNode(id, addrs, hostNames, discPort, metricsProvider, ver);
+
+ node.attrs = attrs;
+ node.clientRouterNodeId = clientRouterNodeId;
+
+ return node;
+ }
+
/** {@inheritDoc} */
@Override public int compareTo(@Nullable TcpDiscoveryNode node) {
if (node == null)
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
index 21dbf4f..6f52152 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java
@@ -40,6 +40,9 @@ public abstract class TcpDiscoveryAbstractMessage implements Serializable {
/** */
protected static final int CLIENT_RECON_SUCCESS_FLAG_POS = 2;
+ /** */
+ protected static final int CLIENT_ACK_FLAG_POS = 4;
+
/** Sender of the message (transient). */
private transient UUID sndNodeId;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientAckResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientAckResponse.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientAckResponse.java
new file mode 100644
index 0000000..ce3943a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientAckResponse.java
@@ -0,0 +1,64 @@
+/*
+ * 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.spi.discovery.tcp.messages;
+
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+
+import java.util.*;
+
+/**
+ *
+ */
+public class TcpDiscoveryClientAckResponse extends TcpDiscoveryAbstractMessage {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** */
+ public static final IgniteProductVersion CLIENT_ACK_SINCE_VERSION = IgniteProductVersion.fromString("1.4.1");
+
+ /** */
+ private final IgniteUuid msgId;
+
+ /**
+ * @param creatorNodeId Creator node ID.
+ * @param msgId Message ID to ack.
+ */
+ public TcpDiscoveryClientAckResponse(UUID creatorNodeId, IgniteUuid msgId) {
+ super(creatorNodeId);
+
+ this.msgId = msgId;
+ }
+
+ /**
+ * @return Acknowledged message ID.
+ */
+ public IgniteUuid messageId() {
+ return msgId;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean highPriority() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(TcpDiscoveryClientAckResponse.class, this, "super", super.toString());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeResponse.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeResponse.java
index 5c2f798..ac4be50 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryHandshakeResponse.java
@@ -61,6 +61,20 @@ public class TcpDiscoveryHandshakeResponse extends TcpDiscoveryAbstractMessage {
this.order = order;
}
+ /**
+ * @return {@code True} if server supports client message acknowledge.
+ */
+ public boolean clientAck() {
+ return getFlag(CLIENT_ACK_FLAG_POS);
+ }
+
+ /**
+ * @param clientAck {@code True} if server supports client message acknowledge.
+ */
+ public void clientAck(boolean clientAck) {
+ setFlag(CLIENT_ACK_FLAG_POS, clientAck);
+ }
+
/** {@inheritDoc} */
@Override public String toString() {
return S.toString(TcpDiscoveryHandshakeResponse.class, this, "super", super.toString());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
index 7a88426..000782a 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/swapspace/file/FileSwapSpaceSpi.java
@@ -257,7 +257,7 @@ public class FileSwapSpaceSpi extends IgniteSpiAdapter implements SwapSpaceSpi,
registerMBean(gridName, this, FileSwapSpaceSpiMBean.class);
- String path = baseDir + File.separator + gridName + File.separator + getLocalNodeId();
+ String path = baseDir + File.separator + gridName + File.separator + ignite.configuration().getNodeId();
try {
dir = U.resolveWorkDirectory(path, true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java
index abc9109..bf499c3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridUpdateNotifierSelfTest.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal;
import org.apache.ignite.*;
+import org.apache.ignite.internal.util.future.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
import org.apache.ignite.plugin.*;
@@ -104,8 +105,6 @@ public class GridUpdateNotifierSelfTest extends GridCommonAbstractTest {
* Test kernal gateway that always return uninitialized user stack trace.
*/
private static final GridKernalGateway TEST_GATEWAY = new GridKernalGateway() {
- @Override public void lightCheck() throws IllegalStateException {}
-
@Override public void readLock() throws IllegalStateException {}
@Override public void readLockAnyway() {}
@@ -122,10 +121,6 @@ public class GridUpdateNotifierSelfTest extends GridCommonAbstractTest {
@Override public void writeUnlock() {}
- @Override public void addStopListener(Runnable lsnr) {}
-
- @Override public void removeStopListener(Runnable lsnr) {}
-
@Override public String userStackTrace() {
return null;
}
@@ -133,5 +128,13 @@ public class GridUpdateNotifierSelfTest extends GridCommonAbstractTest {
@Override public boolean tryWriteLock(long timeout) {
return false;
}
+
+ @Override public GridFutureAdapter<?> onDisconnected() {
+ return null;
+ }
+
+ @Override public void onReconnected() {
+ // No-op.
+ }
};
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAbstractTest.java
new file mode 100644
index 0000000..fbaea11
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAbstractTest.java
@@ -0,0 +1,363 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.internal.managers.communication.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.spi.*;
+import org.apache.ignite.spi.communication.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.internal.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.spi.discovery.tcp.messages.*;
+import org.apache.ignite.testframework.junits.common.*;
+import org.jetbrains.annotations.*;
+
+import javax.cache.*;
+import java.io.*;
+import java.net.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+import static java.util.concurrent.TimeUnit.*;
+import static org.apache.ignite.events.EventType.*;
+
+/**
+ *
+ */
+public abstract class IgniteClientReconnectAbstractTest extends GridCommonAbstractTest {
+ /** */
+ private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** */
+ private static final long RECONNECT_TIMEOUT = 10_000;
+
+ /** */
+ protected boolean clientMode;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ TestTcpDiscoverySpi disco = new TestTcpDiscoverySpi();
+
+ disco.setIpFinder(ipFinder);
+ disco.setJoinTimeout(2 * 60_000);
+ disco.setSocketTimeout(1000);
+ disco.setNetworkTimeout(2000);
+
+ cfg.setDiscoverySpi(disco);
+
+ BlockTpcCommunicationSpi commSpi = new BlockTpcCommunicationSpi();
+
+ commSpi.setSharedMemoryPort(-1);
+
+ cfg.setCommunicationSpi(commSpi);
+
+ if (clientMode)
+ cfg.setClientMode(true);
+
+ return cfg;
+ }
+
+ /**
+ * @param latch Latch.
+ * @throws Exception If failed.
+ */
+ protected void waitReconnectEvent(CountDownLatch latch) throws Exception {
+ if (!latch.await(RECONNECT_TIMEOUT, MILLISECONDS)) {
+ log.error("Failed to wait for reconnect event, will dump threads, latch count: " + latch.getCount());
+
+ U.dumpThreads(log);
+
+ fail("Failed to wait for disconnect/reconnect event.");
+ }
+ }
+
+ /**
+ * @return Number of server nodes started before tests.
+ */
+ protected abstract int serverCount();
+
+ /**
+ * @return Number of client nodes started before tests.
+ */
+ protected int clientCount() {
+ return 0;
+ }
+
+ /**
+ * @param ignite Node.
+ * @return Discovery SPI.
+ */
+ protected TestTcpDiscoverySpi spi(Ignite ignite) {
+ return ((TestTcpDiscoverySpi)ignite.configuration().getDiscoverySpi());
+ }
+
+ /**
+ * @param ignite Node.
+ * @return Communication SPI.
+ */
+ protected BlockTpcCommunicationSpi commSpi(Ignite ignite) {
+ return ((BlockTpcCommunicationSpi)ignite.configuration().getCommunicationSpi());
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ super.beforeTestsStarted();
+
+ int srvs = serverCount();
+
+ if (srvs > 0)
+ startGrids(srvs);
+
+ int clients = clientCount();
+
+ if (clients > 0) {
+ clientMode = true;
+
+ startGridsMultiThreaded(srvs, clients);
+
+ clientMode = false;
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ super.afterTestsStopped();
+
+ stopAllGrids();
+ }
+
+ /**
+ * @param client Client.
+ * @return Server node client connected to.
+ */
+ protected Ignite clientRouter(Ignite client) {
+ TcpDiscoveryNode node = (TcpDiscoveryNode)client.cluster().localNode();
+
+ assertTrue(node.isClient());
+ assertNotNull(node.clientRouterNodeId());
+
+ Ignite srv = G.ignite(node.clientRouterNodeId());
+
+ assertNotNull(srv);
+
+ return srv;
+ }
+
+ /**
+ * @param fut Future.
+ * @throws Exception If failed.
+ */
+ protected void assertNotDone(IgniteInternalFuture<?> fut) throws Exception {
+ assertNotNull(fut);
+
+ if (fut.isDone())
+ fail("Future completed with result: " + fut.get());
+ }
+
+ /**
+ * Reconnect client node.
+ *
+ * @param client Client.
+ * @param srv Server.
+ * @param disconnectedC Closure which will be run when client node disconnected.
+ * @throws Exception If failed.
+ */
+ protected void reconnectClientNode(Ignite client, Ignite srv, @Nullable Runnable disconnectedC)
+ throws Exception {
+ final TestTcpDiscoverySpi clientSpi = spi(client);
+ final TestTcpDiscoverySpi srvSpi = spi(srv);
+
+ final CountDownLatch disconnectLatch = new CountDownLatch(1);
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+ log.info("Block reconnect.");
+
+ clientSpi.writeLatch = new CountDownLatch(1);
+
+ IgnitePredicate<Event> p = new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+ info("Disconnected: " + evt);
+
+ disconnectLatch.countDown();
+ }
+ else if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ info("Reconnected: " + evt);
+
+ reconnectLatch.countDown();
+ }
+
+ return true;
+ }
+ };
+
+ client.events().localListen(p, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED);
+
+ srvSpi.failNode(client.cluster().localNode().id(), null);
+
+ waitReconnectEvent(disconnectLatch);
+
+ if (disconnectedC != null)
+ disconnectedC.run();
+
+ log.info("Allow reconnect.");
+
+ clientSpi.writeLatch.countDown();
+
+ waitReconnectEvent(reconnectLatch);
+
+ client.events().stopLocalListen(p);
+ }
+
+ /**
+ * @param e Client disconnected exception.
+ * @return Reconnect future.
+ */
+ protected IgniteFuture<?> check(CacheException e) {
+ log.info("Expected exception: " + e);
+
+ if (!(e.getCause() instanceof IgniteClientDisconnectedException))
+ log.error("Unexpected cause: " + e.getCause(), e);
+
+ assertTrue("Unexpected cause: " + e.getCause(), e.getCause() instanceof IgniteClientDisconnectedException);
+
+ IgniteClientDisconnectedException e0 = (IgniteClientDisconnectedException)e.getCause();
+
+ assertNotNull(e0.reconnectFuture());
+
+ return e0.reconnectFuture();
+ }
+
+ /**
+ * @param e Client disconnected exception.
+ */
+ protected void checkAndWait(CacheException e) {
+ check(e).get();
+ }
+
+ /**
+ * @param e Client disconnected exception.
+ */
+ protected void checkAndWait(IgniteClientDisconnectedException e) {
+ log.info("Expected exception: " + e);
+
+ assertNotNull(e.reconnectFuture());
+
+ e.reconnectFuture().get();
+ }
+
+ /**
+ *
+ */
+ protected static class TestTcpDiscoverySpi extends TcpDiscoverySpi {
+ /** */
+ volatile CountDownLatch writeLatch;
+
+ /** {@inheritDoc} */
+ @Override protected void writeToSocket(Socket sock, TcpDiscoveryAbstractMessage msg)
+ throws IOException, IgniteCheckedException {
+ if (msg instanceof TcpDiscoveryJoinRequestMessage) {
+ CountDownLatch writeLatch0 = writeLatch;
+
+ if (writeLatch0 != null) {
+ log.info("Block join request send: " + msg);
+
+ U.await(writeLatch0);
+ }
+ }
+
+ super.writeToSocket(sock, msg);
+ }
+ }
+
+ /**
+ *
+ */
+ protected static class BlockTpcCommunicationSpi extends TcpCommunicationSpi {
+ /** */
+ volatile Class msgCls;
+
+ /** */
+ AtomicBoolean collectStart = new AtomicBoolean(false);
+
+ /** */
+ ConcurrentHashMap<String, ClusterNode> classes = new ConcurrentHashMap<>();
+
+ /** */
+ @LoggerResource
+ private IgniteLogger log;
+
+ /** {@inheritDoc} */
+ @Override public void sendMessage(ClusterNode node, Message msg) throws IgniteSpiException {
+ Class msgCls0 = msgCls;
+
+ if (collectStart.get() && msg instanceof GridIoMessage)
+ classes.put(((GridIoMessage)msg).message().getClass().getName(), node);
+
+ if (msgCls0 != null && msg instanceof GridIoMessage
+ && ((GridIoMessage)msg).message().getClass().equals(msgCls)) {
+ log.info("Block message: " + msg);
+
+ return;
+ }
+
+ super.sendMessage(node, msg);
+ }
+
+ /**
+ * @param clazz Class of messages which will be block.
+ */
+ public void blockMessage(Class clazz) {
+ msgCls = clazz;
+ }
+
+ /**
+ * Unlock all message.
+ */
+ public void unblockMessage() {
+ msgCls = null;
+ }
+
+ /**
+ * Start collect messages.
+ */
+ public void start() {
+ collectStart.set(true);
+ }
+
+ /**
+ * Print collected messages.
+ */
+ public void print() {
+ for (String s : classes.keySet())
+ log.error(s);
+ }
+ }
+}
[09/50] [abbrv] incubator-ignite git commit: Fixed build.
Posted by av...@apache.org.
Fixed build.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8870668c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8870668c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8870668c
Branch: refs/heads/ignite-630
Commit: 8870668c586c3faf52b23a4e14252438b0623c47
Parents: cf78f23
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Mon Jul 13 13:29:30 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Mon Jul 13 13:34:03 2015 +0300
----------------------------------------------------------------------
modules/mesos/pom.xml | 2 ++
modules/yarn/pom.xml | 2 ++
2 files changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8870668c/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index 15a6c0c..331083e 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -78,11 +78,13 @@
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
+ <finalName>${project.artifactId}-${project.version}-full</finalName>
<archive>
<manifest>
<mainClass>org.apache.ignite.mesos.IgniteFramework</mainClass>
</manifest>
</archive>
+ <appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8870668c/modules/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yarn/pom.xml b/modules/yarn/pom.xml
index 8ac1aea..e87c7df 100644
--- a/modules/yarn/pom.xml
+++ b/modules/yarn/pom.xml
@@ -78,11 +78,13 @@
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
+ <finalName>${project.artifactId}-${project.version}-full</finalName>
<archive>
<manifest>
<mainClass>org.apache.ignite.yarn.IgniteYarnClient</mainClass>
</manifest>
</archive>
+ <appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
[49/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/master' into ignite-630
Posted by av...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-630
Conflicts:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dc18c3da
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dc18c3da
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dc18c3da
Branch: refs/heads/ignite-630
Commit: dc18c3da2c7f19e27af42f48617db1bcde97746c
Parents: fd541fc fbc38d7
Author: Anton Vinogradov <av...@gridgain.com>
Authored: Thu Jul 16 18:34:40 2015 +0300
Committer: Anton Vinogradov <av...@gridgain.com>
Committed: Thu Jul 16 18:34:40 2015 +0300
----------------------------------------------------------------------
.gitignore | 3 +-
DEVNOTES.txt | 71 +-
LICENSE | 238 +
LICENSE.txt | 238 -
NOTICE | 12 +
NOTICE.txt | 12 -
RELEASE_NOTES.txt | 26 +
assembly/LICENSE_FABRIC | 306 +
assembly/LICENSE_HADOOP | 259 +
assembly/NOTICE_FABRIC | 13 +
assembly/NOTICE_HADOOP | 12 +
assembly/dependencies-fabric.xml | 15 +
assembly/dependencies-hadoop.xml | 12 +
assembly/dependencies-visor-console.xml | 23 +-
assembly/release-base.xml | 10 -
assembly/release-fabric.xml | 12 +
assembly/release-hadoop.xml | 12 +
bin/ignite.bat | 8 +-
bin/ignite.sh | 6 +-
bin/include/parseargs.bat | 1 +
bin/include/parseargs.sh | 3 +
dev-tools/build.gradle | 35 +-
.../gradle/wrapper/gradle-wrapper.properties | 20 +
dev-tools/gradlew | 233 +
dev-tools/slurp.sh | 76 +
dev-tools/src/main/groovy/jiraslurp.groovy | 592 +-
examples/config/example-cache.xml | 2 +
examples/pom.xml | 36 +-
.../hibernate/CacheHibernatePersonStore.java | 202 +-
.../hibernate/CacheHibernateStoreExample.java | 17 +
.../store/jdbc/CacheJdbcPersonStore.java | 180 +-
.../store/jdbc/CacheJdbcStoreExample.java | 13 +
.../store/spring/CacheSpringPersonStore.java | 128 +
.../store/spring/CacheSpringStoreExample.java | 143 +
.../datagrid/store/spring/package-info.java | 22 +
.../client/memcache/MemcacheRestExample.java | 32 +-
.../streaming/StreamTransformerExample.java | 4 +-
.../streaming/StreamVisitorExample.java | 4 +-
.../ignite/examples/streaming/package-info.java | 1 -
.../streaming/wordcount/CacheConfig.java | 2 +-
.../streaming/wordcount/QueryWords.java | 12 +-
.../streaming/wordcount/StreamWords.java | 12 +-
.../streaming/wordcount/package-info.java | 1 -
.../socket/WordsSocketStreamerClient.java | 82 +
.../socket/WordsSocketStreamerServer.java | 124 +
.../wordcount/socket/package-info.java | 21 +
.../examples/ScalarCacheAffinityExample.scala | 2 +-
.../scalar/examples/ScalarCacheExample.scala | 2 +-
.../ScalarCachePopularNumbersExample.scala | 2 +-
.../examples/ScalarCacheQueryExample.scala | 2 +-
.../examples/ScalarSnowflakeSchemaExample.scala | 4 +-
idea/ignite_codeStyle.xml | 147 +
modules/aop/licenses/aspectj-epl-license.txt | 69 -
modules/aop/pom.xml | 2 +-
modules/apache-license-gen/pom.xml | 48 +
.../src/main/resources/META-INF/licenses.txt.vm | 42 +
modules/aws/pom.xml | 2 +-
.../s3/S3CheckpointManagerSelfTest.java | 2 +-
.../checkpoint/s3/S3CheckpointSpiSelfTest.java | 4 +-
.../s3/S3CheckpointSpiStartStopSelfTest.java | 2 +-
.../s3/S3SessionCheckpointSelfTest.java | 2 +-
.../s3/TcpDiscoveryS3IpFinderSelfTest.java | 2 +-
modules/clients/pom.xml | 2 +-
.../ClientAbstractConnectivitySelfTest.java | 18 +-
.../client/router/TcpSslRouterSelfTest.java | 5 +
.../client/suite/IgniteClientTestSuite.java | 3 +-
modules/cloud/pom.xml | 2 +-
.../cloud/TcpDiscoveryCloudIpFinder.java | 25 +-
.../TcpDiscoveryCloudIpFinderSelfTest.java | 3 +-
modules/codegen/pom.xml | 2 +-
modules/core/licenses/jsr166-license.txt | 3 +
modules/core/licenses/snaptree-bsd-license.txt | 2 +-
modules/core/pom.xml | 14 +-
modules/core/src/main/java/META-INF/LICENSE | 238 +
modules/core/src/main/java/META-INF/NOTICE | 12 +
.../src/main/java/org/apache/ignite/Ignite.java | 10 +-
.../java/org/apache/ignite/IgniteCache.java | 60 +-
.../IgniteClientDisconnectedException.java | 61 +
.../java/org/apache/ignite/IgniteCluster.java | 8 +
.../java/org/apache/ignite/IgniteServices.java | 5 +-
.../apache/ignite/IgniteSystemProperties.java | 9 +
.../main/java/org/apache/ignite/Ignition.java | 18 +-
.../org/apache/ignite/cache/CacheManager.java | 13 +-
.../org/apache/ignite/cache/CacheMetrics.java | 187 +-
.../apache/ignite/cache/CacheTypeMetadata.java | 53 +-
.../affinity/fair/FairAffinityFunction.java | 5 +-
.../ignite/cache/eviction/EvictableEntry.java | 7 +
.../ignite/cache/eviction/EvictionPolicy.java | 2 +
.../cache/eviction/fifo/FifoEvictionPolicy.java | 112 +-
.../eviction/fifo/FifoEvictionPolicyMBean.java | 22 +
.../cache/eviction/lru/LruEvictionPolicy.java | 130 +-
.../eviction/lru/LruEvictionPolicyMBean.java | 38 +
.../eviction/random/RandomEvictionPolicy.java | 10 +-
.../eviction/sorted/SortedEvictionPolicy.java | 146 +-
.../sorted/SortedEvictionPolicyMBean.java | 22 +
.../apache/ignite/cache/query/QueryMetrics.java | 6 +-
.../apache/ignite/cache/query/ScanQuery.java | 48 +-
.../apache/ignite/cache/store/CacheStore.java | 2 +
.../ignite/cache/store/CacheStoreSession.java | 22 +
.../cache/store/CacheStoreSessionListener.java | 133 +
.../cache/store/jdbc/CacheJdbcBlobStore.java | 22 +-
.../store/jdbc/CacheJdbcBlobStoreFactory.java | 290 +
.../cache/store/jdbc/CacheJdbcPojoStore.java | 6 +-
.../store/jdbc/CacheJdbcPojoStoreFactory.java | 148 +
.../jdbc/CacheJdbcStoreSessionListener.java | 141 +
.../org/apache/ignite/cluster/ClusterGroup.java | 18 +-
.../org/apache/ignite/cluster/ClusterNode.java | 26 +-
.../configuration/CacheConfiguration.java | 179 +-
.../configuration/IgniteConfiguration.java | 48 +-
.../configuration/IgniteReflectionFactory.java | 81 +-
.../configuration/NearCacheConfiguration.java | 10 +-
.../configuration/TransactionConfiguration.java | 23 +
.../org/apache/ignite/igfs/IgfsUserContext.java | 119 +
.../igfs/secondary/IgfsSecondaryFileSystem.java | 7 +
.../ignite/internal/ClusterMetricsSnapshot.java | 14 +
.../apache/ignite/internal/GridComponent.java | 18 +
.../internal/GridEventConsumeHandler.java | 126 +-
.../ignite/internal/GridJobSiblingImpl.java | 2 +-
.../ignite/internal/GridKernalContext.java | 10 +
.../ignite/internal/GridKernalContextImpl.java | 44 +-
.../ignite/internal/GridKernalGateway.java | 46 +-
.../ignite/internal/GridKernalGatewayImpl.java | 85 +-
.../apache/ignite/internal/GridKernalState.java | 3 +
.../ignite/internal/GridPluginComponent.java | 11 +
.../ignite/internal/GridPluginContext.java | 6 +
...gniteClientDisconnectedCheckedException.java | 49 +
.../apache/ignite/internal/IgniteKernal.java | 336 +-
.../ignite/internal/IgniteNodeAttributes.java | 5 +-
.../org/apache/ignite/internal/IgnitionEx.java | 166 +-
.../internal/MarshallerContextAdapter.java | 82 +-
.../ignite/internal/MarshallerContextImpl.java | 38 +-
.../client/GridClientConfiguration.java | 2 +-
.../GridClientOptimizedMarshaller.java | 26 +
.../impl/GridTcpRouterNioListenerAdapter.java | 2 +-
.../internal/cluster/ClusterGroupAdapter.java | 50 +-
.../cluster/IgniteClusterAsyncImpl.java | 17 +-
.../internal/cluster/IgniteClusterImpl.java | 18 +
.../internal/events/DiscoveryCustomEvent.java | 18 +-
.../internal/igfs/common/IgfsMarshaller.java | 35 +-
.../igfs/common/IgfsPathControlRequest.java | 22 +
.../interop/InteropAwareEventFilter.java | 37 +
.../internal/interop/InteropBootstrap.java | 35 +
.../interop/InteropBootstrapFactory.java | 39 +
.../internal/interop/InteropException.java | 71 +
.../internal/interop/InteropIgnition.java | 241 +
.../interop/InteropLocalEventListener.java | 28 +
.../interop/InteropNoCallbackException.java | 50 +
.../internal/interop/InteropProcessor.java | 51 +
.../internal/managers/GridManagerAdapter.java | 95 +-
.../checkpoint/GridCheckpointManager.java | 52 +-
.../managers/communication/GridIoManager.java | 294 +-
.../managers/communication/GridIoMessage.java | 15 +-
.../managers/communication/GridIoPolicy.java | 32 +-
.../GridLifecycleAwareMessageFilter.java | 5 +-
.../deployment/GridDeploymentCommunication.java | 2 +-
.../deployment/GridDeploymentManager.java | 95 +-
.../managers/discovery/CustomEventListener.java | 31 +
.../discovery/CustomMessageWrapper.java | 63 +
.../discovery/DiscoveryCustomMessage.java | 54 +
.../discovery/GridDiscoveryManager.java | 530 +-
.../eventstorage/GridEventStorageManager.java | 26 +-
.../managers/indexing/GridIndexingManager.java | 4 -
.../processors/GridProcessorAdapter.java | 11 +
.../affinity/AffinityTopologyVersion.java | 7 -
.../affinity/GridAffinityAssignment.java | 12 +
.../affinity/GridAffinityAssignmentCache.java | 66 +-
.../affinity/GridAffinityProcessor.java | 23 +-
.../cache/CacheEvictableEntryImpl.java | 31 +
.../processors/cache/CacheMetricsImpl.java | 367 +-
.../cache/CacheMetricsMXBeanImpl.java | 100 +
.../processors/cache/CacheMetricsSnapshot.java | 380 +-
.../processors/cache/CacheObjectImpl.java | 1 -
.../processors/cache/CacheOperationContext.java | 44 +-
.../cache/CacheOsConflictResolutionManager.java | 6 +
.../internal/processors/cache/CacheType.java | 8 +-
.../cache/DynamicCacheChangeBatch.java | 46 +-
.../cache/DynamicCacheChangeRequest.java | 39 +-
.../cache/DynamicCacheDescriptor.java | 19 +
.../processors/cache/GridCacheAdapter.java | 203 +-
.../cache/GridCacheAffinityManager.java | 35 +-
.../processors/cache/GridCacheAtomicFuture.java | 12 +-
.../processors/cache/GridCacheAttributes.java | 3 +
.../cache/GridCacheConcurrentMap.java | 36 +-
.../processors/cache/GridCacheContext.java | 50 +-
.../cache/GridCacheDeploymentManager.java | 10 +-
.../processors/cache/GridCacheEntryEx.java | 7 +
.../processors/cache/GridCacheGateway.java | 122 +-
.../processors/cache/GridCacheIoManager.java | 96 +-
.../processors/cache/GridCacheManager.java | 6 +
.../cache/GridCacheManagerAdapter.java | 6 +
.../processors/cache/GridCacheMapEntry.java | 105 +-
.../processors/cache/GridCacheMessage.java | 51 -
.../processors/cache/GridCacheMvccManager.java | 81 +-
.../GridCachePartitionExchangeManager.java | 261 +-
.../processors/cache/GridCachePreloader.java | 11 +-
.../cache/GridCachePreloaderAdapter.java | 16 +-
.../processors/cache/GridCacheProcessor.java | 739 ++-
.../processors/cache/GridCacheProxyImpl.java | 36 +-
.../cache/GridCacheSharedContext.java | 168 +-
.../cache/GridCacheSharedManager.java | 11 +-
.../cache/GridCacheSharedManagerAdapter.java | 20 +-
.../processors/cache/GridCacheSwapManager.java | 394 +-
.../processors/cache/GridCacheTtlManager.java | 9 +-
.../processors/cache/GridCacheUtils.java | 348 +-
.../processors/cache/IgniteCacheFutureImpl.java | 53 +
.../processors/cache/IgniteCacheProxy.java | 574 +-
.../processors/cache/IgniteInternalCache.java | 43 +-
.../processors/cache/KeyCacheObjectImpl.java | 11 +-
.../processors/cache/QueryCursorImpl.java | 23 +-
.../cache/affinity/GridCacheAffinityImpl.java | 10 +-
.../CacheDataStructuresManager.java | 37 +-
.../distributed/GridCacheTxFinishSync.java | 46 +
.../distributed/GridCacheTxRecoveryRequest.java | 26 +-
.../GridCacheTxRecoveryResponse.java | 14 +-
.../distributed/GridDistributedBaseMessage.java | 77 +-
.../distributed/GridDistributedCacheEntry.java | 7 -
.../distributed/GridDistributedLockRequest.java | 123 +-
.../GridDistributedLockResponse.java | 14 +-
.../GridDistributedTxFinishRequest.java | 101 +-
.../distributed/GridDistributedTxMapping.java | 22 +-
.../GridDistributedTxPrepareRequest.java | 137 +-
.../GridDistributedTxPrepareResponse.java | 64 +-
.../GridDistributedTxRemoteAdapter.java | 33 +-
.../GridDistributedUnlockRequest.java | 6 +-
.../dht/GridClientPartitionTopology.java | 10 +-
.../dht/GridDhtAssignmentFetchFuture.java | 4 +-
.../distributed/dht/GridDhtCacheAdapter.java | 47 +-
.../distributed/dht/GridDhtCacheEntry.java | 10 +-
.../cache/distributed/dht/GridDhtGetFuture.java | 11 +-
.../distributed/dht/GridDhtLocalPartition.java | 66 +-
.../distributed/dht/GridDhtLockFuture.java | 14 +-
.../distributed/dht/GridDhtLockRequest.java | 101 +-
.../distributed/dht/GridDhtLockResponse.java | 18 +-
.../dht/GridDhtPartitionTopologyImpl.java | 66 +-
.../dht/GridDhtPartitionsReservation.java | 292 +
.../dht/GridDhtTransactionalCacheAdapter.java | 230 +-
.../distributed/dht/GridDhtTxFinishFuture.java | 3 -
.../distributed/dht/GridDhtTxFinishRequest.java | 46 +-
.../cache/distributed/dht/GridDhtTxLocal.java | 9 +-
.../distributed/dht/GridDhtTxLocalAdapter.java | 79 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 22 +-
.../dht/GridDhtTxPrepareRequest.java | 60 +-
.../dht/GridDhtTxPrepareResponse.java | 22 +-
.../cache/distributed/dht/GridDhtTxRemote.java | 13 +-
.../distributed/dht/GridDhtUnlockRequest.java | 6 +-
.../dht/GridPartitionedGetFuture.java | 26 +-
.../cache/distributed/dht/GridReservable.java | 35 +
.../dht/atomic/GridDhtAtomicCache.java | 70 +-
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 23 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 297 +-
.../dht/atomic/GridNearAtomicUpdateRequest.java | 134 +-
.../dht/colocated/GridDhtColocatedCache.java | 12 +-
.../colocated/GridDhtColocatedLockFuture.java | 223 +-
.../dht/preloader/GridDhtForceKeysFuture.java | 44 +-
.../preloader/GridDhtPartitionDemandPool.java | 26 +-
.../dht/preloader/GridDhtPartitionMap.java | 28 +-
.../preloader/GridDhtPartitionSupplyPool.java | 29 +-
.../GridDhtPartitionsExchangeFuture.java | 529 +-
.../preloader/GridDhtPartitionsFullMessage.java | 4 +-
.../GridDhtPartitionsSingleMessage.java | 33 +-
.../dht/preloader/GridDhtPreloader.java | 55 +-
.../preloader/GridDhtPreloaderAssignments.java | 3 +-
.../distributed/near/GridNearAtomicCache.java | 5 +
.../distributed/near/GridNearCacheAdapter.java | 10 +-
.../distributed/near/GridNearCacheEntry.java | 2 +-
.../distributed/near/GridNearGetFuture.java | 19 +-
.../distributed/near/GridNearLockFuture.java | 277 +-
.../distributed/near/GridNearLockRequest.java | 91 +-
.../distributed/near/GridNearLockResponse.java | 30 +-
.../near/GridNearOptimisticTxPrepareFuture.java | 98 +-
.../GridNearPessimisticTxPrepareFuture.java | 7 +-
.../near/GridNearTransactionalCache.java | 8 +-
.../near/GridNearTxFinishRequest.java | 31 +-
.../cache/distributed/near/GridNearTxLocal.java | 71 +-
.../near/GridNearTxPrepareFutureAdapter.java | 9 +-
.../near/GridNearTxPrepareRequest.java | 86 +-
.../near/GridNearTxPrepareResponse.java | 94 +-
.../distributed/near/GridNearTxRemote.java | 29 +-
.../distributed/near/GridNearUnlockRequest.java | 2 +-
.../cache/dr/GridOsCacheDrManager.java | 7 +-
.../cache/jta/CacheJtaManagerAdapter.java | 17 +-
.../cache/jta/CacheNoopJtaManager.java | 2 +-
.../processors/cache/local/GridLocalCache.java | 6 +-
.../local/atomic/GridLocalAtomicCache.java | 31 +-
.../processors/cache/query/CacheQuery.java | 2 +-
.../query/GridCacheDistributedQueryManager.java | 25 +
.../cache/query/GridCacheQueryAdapter.java | 205 +-
.../cache/query/GridCacheQueryErrorFuture.java | 2 +
.../query/GridCacheQueryFutureAdapter.java | 2 +-
.../cache/query/GridCacheQueryManager.java | 243 +-
.../cache/query/GridCacheQueryRequest.java | 47 +-
.../cache/query/GridCacheTwoStepQuery.java | 22 +-
.../processors/cache/query/QueryCursorEx.java | 8 +
.../continuous/CacheContinuousQueryHandler.java | 17 +-
.../continuous/CacheContinuousQueryManager.java | 28 +-
.../cache/store/CacheOsStoreManager.java | 1 -
.../cache/store/CacheStoreManager.java | 7 +-
.../store/GridCacheStoreManagerAdapter.java | 202 +-
.../cache/transactions/IgniteInternalTx.java | 18 +-
.../transactions/IgniteTransactionsImpl.java | 61 +-
.../cache/transactions/IgniteTxAdapter.java | 125 +-
.../cache/transactions/IgniteTxEntry.java | 48 +-
.../cache/transactions/IgniteTxHandler.java | 157 +-
.../transactions/IgniteTxLocalAdapter.java | 346 +-
.../cache/transactions/IgniteTxLocalEx.java | 21 +-
.../cache/transactions/IgniteTxManager.java | 108 +-
.../transactions/TransactionProxyImpl.java | 2 +-
.../cache/version/GridCacheVersionManager.java | 9 +-
.../cacheobject/IgniteCacheObjectProcessor.java | 14 +-
.../IgniteCacheObjectProcessorImpl.java | 14 +-
.../processors/clock/GridClockServer.java | 21 +-
.../clock/GridClockSyncProcessor.java | 6 +-
.../processors/cluster/ClusterProcessor.java | 11 +
.../continuous/AbstractContinuousMessage.java | 63 +
.../continuous/GridContinuousHandler.java | 9 +-
.../continuous/GridContinuousMessageType.java | 12 -
.../continuous/GridContinuousProcessor.java | 932 +--
.../processors/continuous/StartRequestData.java | 267 +
.../StartRoutineAckDiscoveryMessage.java | 63 +
.../StartRoutineDiscoveryMessage.java | 85 +
.../StopRoutineAckDiscoveryMessage.java | 49 +
.../continuous/StopRoutineDiscoveryMessage.java | 49 +
.../datastreamer/DataStreamProcessor.java | 27 +-
.../datastreamer/DataStreamerCacheUpdaters.java | 2 +-
.../datastreamer/DataStreamerImpl.java | 192 +-
.../datastructures/DataStructuresProcessor.java | 306 +-
.../datastructures/GridCacheAtomicLongImpl.java | 58 +-
.../GridCacheAtomicReferenceImpl.java | 34 +-
.../GridCacheAtomicSequenceImpl.java | 44 +-
.../GridCacheAtomicStampedImpl.java | 54 +-
.../GridCacheCountDownLatchImpl.java | 82 +-
.../datastructures/GridCacheRemovable.java | 6 +-
.../datastructures/GridCacheSetImpl.java | 19 +-
.../datastructures/GridCacheSetProxy.java | 47 +-
.../dr/IgniteDrDataStreamerCacheUpdater.java | 7 +-
.../internal/processors/hadoop/HadoopJob.java | 2 +-
.../processors/hadoop/HadoopJobInfo.java | 4 +-
.../processors/hadoop/HadoopTaskContext.java | 14 +-
.../hadoop/counter/HadoopCounterWriter.java | 5 +-
.../internal/processors/igfs/IgfsContext.java | 5 +-
.../ignite/internal/processors/igfs/IgfsEx.java | 8 +-
.../internal/processors/igfs/IgfsImpl.java | 8 +-
.../processors/igfs/IgfsIpcHandler.java | 184 +-
.../processors/igfs/IgfsMetaManager.java | 2 +-
.../igfs/IgfsSecondaryFileSystemImpl.java | 9 +-
.../internal/processors/igfs/IgfsServer.java | 4 +-
.../internal/processors/igfs/IgfsUtils.java | 16 +
.../processors/job/GridJobProcessor.java | 2 +-
.../internal/processors/job/GridJobWorker.java | 2 +-
.../offheap/GridOffHeapProcessor.java | 19 +-
.../processors/plugin/CachePluginManager.java | 10 +-
.../plugin/IgnitePluginProcessor.java | 19 +-
.../portable/GridPortableInputStream.java | 10 +
.../processors/query/GridQueryIndexing.java | 33 +-
.../processors/query/GridQueryProcessor.java | 443 +-
.../messages/GridQueryNextPageResponse.java | 35 +-
.../h2/twostep/messages/GridQueryRequest.java | 111 +-
.../processors/rest/GridRestProcessor.java | 4 +-
.../rest/client/message/GridRouterRequest.java | 18 +
.../rest/client/message/GridRouterResponse.java | 18 +
.../handlers/task/GridTaskCommandHandler.java | 12 +-
.../rest/protocols/tcp/GridTcpRestProtocol.java | 3 +-
.../service/GridServiceProcessor.java | 170 +-
.../processors/service/GridServiceProxy.java | 13 +-
.../processors/task/GridTaskProcessor.java | 78 +-
.../processors/task/GridTaskWorker.java | 63 +-
.../timeout/GridSpiTimeoutObject.java | 73 +
.../timeout/GridTimeoutProcessor.java | 105 +-
.../IgniteTxRollbackCheckedException.java | 9 +
.../internal/util/GridConfigurationFinder.java | 55 +-
.../apache/ignite/internal/util/GridDebug.java | 48 +-
.../ignite/internal/util/GridJavaProcess.java | 30 +-
.../ignite/internal/util/IgniteUtils.java | 68 +-
.../internal/util/future/GridFutureAdapter.java | 4 +-
.../util/future/GridFutureChainListener.java | 4 -
.../internal/util/future/IgniteFutureImpl.java | 30 +-
.../shmem/IpcSharedMemoryClientEndpoint.java | 7 +-
.../ipc/shmem/IpcSharedMemoryNativeLoader.java | 151 +-
.../shmem/IpcSharedMemoryServerEndpoint.java | 14 +-
.../util/ipc/shmem/IpcSharedMemoryUtils.java | 4 +-
.../ignite/internal/util/lang/GridFunc.java | 2 +
.../internal/util/nio/GridBufferedParser.java | 4 -
.../util/nio/GridCommunicationClient.java | 30 +-
.../internal/util/nio/GridDelimitedParser.java | 91 +
.../util/nio/GridNioDelimitedBuffer.java | 106 +
.../util/nio/GridNioMessageTracker.java | 23 +-
.../util/nio/GridNioRecoveryDescriptor.java | 13 +-
.../ignite/internal/util/nio/GridNioServer.java | 64 +-
.../util/nio/GridShmemCommunicationClient.java | 146 +
.../util/nio/GridTcpCommunicationClient.java | 554 --
.../util/nio/GridTcpNioCommunicationClient.java | 8 -
.../util/spring/IgniteSpringHelper.java | 10 +
.../apache/ignite/internal/visor/VisorJob.java | 2 +
.../internal/visor/VisorMultiNodeTask.java | 2 +-
.../ignite/internal/visor/cache/VisorCache.java | 2 +-
.../visor/cache/VisorCacheConfiguration.java | 11 -
.../VisorCacheConfigurationCollectorJob.java | 6 +-
.../internal/visor/cache/VisorCacheMetrics.java | 19 +-
.../cache/VisorCacheMetricsCollectorTask.java | 10 +-
.../visor/cache/VisorCacheStopTask.java | 2 +-
.../cache/VisorCacheStoreConfiguration.java | 5 +-
.../internal/visor/log/VisorLogSearchTask.java | 2 +-
.../visor/node/VisorNodeDataCollectorJob.java | 4 +
.../visor/node/VisorNodeDataCollectorTask.java | 9 +-
.../node/VisorNodeDataCollectorTaskResult.java | 17 +-
.../node/VisorNodeSuppressedErrorsTask.java | 12 +-
.../visor/query/VisorQueryCleanupTask.java | 14 +
.../internal/visor/query/VisorQueryJob.java | 13 +-
.../internal/visor/query/VisorQueryTask.java | 3 +-
.../util/VisorClusterGroupEmptyException.java | 37 +
.../visor/util/VisorExceptionWrapper.java | 81 +
.../internal/visor/util/VisorTaskUtils.java | 6 +-
.../ignite/marshaller/MarshallerContext.java | 8 +
.../ignite/mxbean/CacheMetricsMXBean.java | 80 +
.../org/apache/ignite/plugin/PluginContext.java | 6 +
.../apache/ignite/plugin/PluginProvider.java | 26 +-
.../plugin/extensions/communication/IoPool.java | 42 +
.../plugin/security/SecuritySubjectType.java | 3 +-
.../SpringApplicationContextResource.java | 4 +-
.../apache/ignite/resources/SpringResource.java | 6 +-
.../org/apache/ignite/services/Service.java | 5 +-
.../java/org/apache/ignite/spi/IgniteSpi.java | 15 +
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 142 +-
.../org/apache/ignite/spi/IgniteSpiContext.java | 66 +-
.../ignite/spi/IgniteSpiTimeoutObject.java | 44 +
.../spi/checkpoint/noop/NoopCheckpointSpi.java | 3 +-
.../communication/tcp/TcpCommunicationSpi.java | 1337 ++--
.../tcp/TcpCommunicationSpiMBean.java | 29 +-
.../ignite/spi/discovery/DiscoverySpi.java | 23 +-
.../discovery/DiscoverySpiCustomMessage.java | 40 +
.../spi/discovery/DiscoverySpiDataExchange.java | 3 +-
.../spi/discovery/DiscoverySpiListener.java | 5 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 1976 ++++++
.../ignite/spi/discovery/tcp/ServerImpl.java | 4952 +++++++++++++++
.../discovery/tcp/TcpClientDiscoverySpi.java | 1264 ----
.../tcp/TcpClientDiscoverySpiMBean.java | 164 -
.../spi/discovery/tcp/TcpDiscoveryImpl.java | 286 +
.../spi/discovery/tcp/TcpDiscoverySpi.java | 5823 ++++--------------
.../discovery/tcp/TcpDiscoverySpiAdapter.java | 1160 ----
.../spi/discovery/tcp/TcpDiscoverySpiMBean.java | 9 +
.../tcp/internal/TcpDiscoveryNode.java | 54 +-
.../tcp/internal/TcpDiscoveryNodesRing.java | 10 +-
.../tcp/internal/TcpDiscoveryStatistics.java | 10 +-
.../tcp/ipfinder/TcpDiscoveryIpFinder.java | 10 +-
.../ipfinder/TcpDiscoveryIpFinderAdapter.java | 34 +-
.../TcpDiscoveryMulticastIpFinder.java | 114 +-
.../messages/TcpDiscoveryAbstractMessage.java | 37 +-
.../messages/TcpDiscoveryClientAckResponse.java | 64 +
.../TcpDiscoveryClientHeartbeatMessage.java | 67 +
.../messages/TcpDiscoveryClientPingRequest.java | 56 +
.../TcpDiscoveryClientPingResponse.java | 67 +
.../TcpDiscoveryCustomEventMessage.java | 41 +-
.../messages/TcpDiscoveryHandshakeResponse.java | 14 +
.../messages/TcpDiscoveryHeartbeatMessage.java | 28 +-
.../TcpDiscoveryNodeAddFinishedMessage.java | 43 +
.../messages/TcpDiscoveryNodeAddedMessage.java | 2 +-
.../messages/TcpDiscoveryNodeFailedMessage.java | 18 +
.../tcp/messages/TcpDiscoveryPingRequest.java | 6 +
.../tcp/messages/TcpDiscoveryPingResponse.java | 15 +-
.../RoundRobinGlobalLoadBalancer.java | 2 +-
.../spi/swapspace/file/FileSwapSpaceSpi.java | 10 +-
.../startup/cmdline/CommandLineStartup.java | 3 +-
.../startup/cmdline/CommandLineTransformer.java | 9 +
.../org/apache/ignite/stream/StreamAdapter.java | 111 +
.../ignite/stream/StreamTupleExtractor.java | 33 +
.../stream/socket/SocketMessageConverter.java | 31 +
.../ignite/stream/socket/SocketStreamer.java | 218 +
.../ignite/stream/socket/package-info.java | 21 +
.../java/org/jsr166/ConcurrentHashMap8.java | 8 +-
.../java/org/jsr166/ConcurrentLinkedDeque8.java | 586 +-
.../src/main/java/org/jsr166/LongAdder8.java | 35 +-
.../core/src/main/java/org/jsr166/README.txt | 11 +
.../src/main/java/org/jsr166/Striped64_8.java | 22 +-
.../java/org/jsr166/ThreadLocalRandom8.java | 19 +-
.../src/main/java/org/jsr166/package-info.java | 12 +-
.../META-INF/classnames-jdk.properties | 3 +
.../core/src/main/resources/ignite.properties | 2 +-
.../core/src/test/config/spark/spark-config.xml | 46 +
modules/core/src/test/config/tests.properties | 8 +-
.../ignite/GridSuppressedExceptionSelfTest.java | 4 +-
.../affinity/IgniteClientNodeAffinityTest.java | 192 +
.../IgniteFairAffinityDynamicCacheSelfTest.java | 3 +-
...cheStoreSessionListenerAbstractSelfTest.java | 333 +
...heStoreSessionListenerLifecycleSelfTest.java | 395 ++
.../CacheJdbcStoreSessionListenerSelfTest.java | 175 +
.../internal/ClusterGroupAbstractTest.java | 777 +++
.../internal/ClusterGroupHostsSelfTest.java | 141 +
.../ignite/internal/ClusterGroupSelfTest.java | 251 +
.../ignite/internal/GridAffinitySelfTest.java | 1 +
.../internal/GridDiscoveryEventSelfTest.java | 13 +-
...ridFailFastNodeFailureDetectionSelfTest.java | 22 +-
.../GridFailoverTaskWithPredicateSelfTest.java | 3 -
.../GridJobMasterLeaveAwareSelfTest.java | 2 -
.../internal/GridJobStealingSelfTest.java | 3 -
.../internal/GridProjectionAbstractTest.java | 768 ---
.../GridProjectionForCachesSelfTest.java | 11 +-
...ectionLocalJobMultipleArgumentsSelfTest.java | 2 -
.../ignite/internal/GridProjectionSelfTest.java | 251 -
.../internal/GridReleaseTypeSelfTest.java | 77 +-
.../apache/ignite/internal/GridSelfTest.java | 30 +-
.../GridTaskExecutionContextSelfTest.java | 9 -
.../GridTaskFailoverAffinityRunTest.java | 170 +
.../internal/GridUpdateNotifierSelfTest.java | 15 +-
.../IgniteClientReconnectAbstractTest.java | 363 ++
.../IgniteClientReconnectApiExceptionTest.java | 846 +++
.../IgniteClientReconnectAtomicsTest.java | 672 ++
.../IgniteClientReconnectCacheTest.java | 1202 ++++
.../IgniteClientReconnectCollectionsTest.java | 443 ++
.../IgniteClientReconnectComputeTest.java | 192 +
...eClientReconnectContinuousProcessorTest.java | 372 ++
...IgniteClientReconnectDiscoveryStateTest.java | 123 +
...niteClientReconnectFailoverAbstractTest.java | 231 +
.../IgniteClientReconnectFailoverTest.java | 212 +
.../IgniteClientReconnectServicesTest.java | 260 +
.../internal/IgniteClientReconnectStopTest.java | 106 +
.../IgniteClientReconnectStreamerTest.java | 233 +
.../IgniteComputeEmptyClusterGroupTest.java | 3 -
.../IgniteComputeTopologyExceptionTest.java | 9 -
.../IgniteSlowClientDetectionSelfTest.java | 188 +
.../communication/GridIoManagerSelfTest.java | 2 +-
.../GridDeploymentManagerStopSelfTest.java | 7 +
.../GridDiscoveryManagerAliveCacheSelfTest.java | 82 +-
.../GridDiscoveryManagerAttributesSelfTest.java | 122 +-
.../discovery/GridDiscoveryManagerSelfTest.java | 46 +-
.../IgniteTopologyPrintFormatSelfTest.java | 289 +
.../GridCacheTxLoadFromStoreOnLockSelfTest.java | 34 +-
.../GridAffinityProcessorAbstractSelfTest.java | 1 +
.../cache/CacheClientStoreSelfTest.java | 228 +
.../cache/CacheFutureExceptionSelfTest.java | 158 +
.../CacheMetricsForClusterGroupSelfTest.java | 10 +-
.../cache/CacheOffheapMapEntrySelfTest.java | 7 +-
.../CacheReadThroughAtomicRestartSelfTest.java | 32 +
...heReadThroughLocalAtomicRestartSelfTest.java | 32 +
.../CacheReadThroughLocalRestartSelfTest.java | 32 +
...dThroughReplicatedAtomicRestartSelfTest.java | 32 +
...cheReadThroughReplicatedRestartSelfTest.java | 32 +
.../cache/CacheReadThroughRestartSelfTest.java | 133 +
.../cache/CacheRemoveAllSelfTest.java | 2 +-
.../cache/CacheStopAndDestroySelfTest.java | 859 +++
.../CacheStoreUsageMultinodeAbstractTest.java | 305 +
...eUsageMultinodeDynamicStartAbstractTest.java | 169 +
...oreUsageMultinodeDynamicStartAtomicTest.java | 32 +
...heStoreUsageMultinodeDynamicStartTxTest.java | 32 +
...reUsageMultinodeStaticStartAbstractTest.java | 158 +
...toreUsageMultinodeStaticStartAtomicTest.java | 32 +
...cheStoreUsageMultinodeStaticStartTxTest.java | 32 +
.../GridCacheAbstractFailoverSelfTest.java | 10 +-
.../cache/GridCacheAbstractFullApiSelfTest.java | 507 +-
.../cache/GridCacheAbstractMetricsSelfTest.java | 48 +-
.../GridCacheAbstractRemoveFailureTest.java | 23 +
.../cache/GridCacheAbstractSelfTest.java | 21 +-
.../cache/GridCacheAffinityRoutingSelfTest.java | 4 +-
.../GridCacheAtomicMessageCountSelfTest.java | 1 +
.../GridCacheConcurrentTxMultiNodeTest.java | 8 +-
...idCacheConfigurationConsistencySelfTest.java | 14 +-
.../cache/GridCacheDeploymentSelfTest.java | 3 -
.../cache/GridCacheEntryMemorySizeSelfTest.java | 91 +-
.../GridCacheExAbstractFullApiSelfTest.java | 103 -
.../cache/GridCacheMemoryModeSelfTest.java | 25 +-
...GridCacheMixedPartitionExchangeSelfTest.java | 2 +-
...ridCacheMultinodeUpdateAbstractSelfTest.java | 9 +
...inodeUpdateNearEnabledNoBackupsSelfTest.java | 2 +-
...CacheMultinodeUpdateNearEnabledSelfTest.java | 2 +-
.../processors/cache/GridCacheOffHeapTest.java | 33 +-
.../cache/GridCachePutAllFailoverSelfTest.java | 1 +
.../GridCacheReferenceCleanupSelfTest.java | 3 -
.../cache/GridCacheReloadSelfTest.java | 6 +-
.../GridCacheReturnValueTransferSelfTest.java | 3 +
.../processors/cache/GridCacheStopSelfTest.java | 5 +
...acheTcpClientDiscoveryMultiThreadedTest.java | 190 +
.../processors/cache/GridCacheTestEntryEx.java | 4 +
.../GridCacheVariableTopologySelfTest.java | 12 +-
.../cache/GridCacheVersionMultinodeTest.java | 6 +-
...ProjectionForCachesOnDaemonNodeSelfTest.java | 2 +-
.../IgniteCacheAbstractStopBusySelfTest.java | 38 +-
.../cache/IgniteCacheAbstractTest.java | 5 +-
.../IgniteCacheAtomicStopBusySelfTest.java | 8 +-
.../IgniteCacheConfigurationTemplateTest.java | 28 +-
.../cache/IgniteCacheDynamicStopSelfTest.java | 6 +-
.../IgniteCacheEntryListenerAbstractTest.java | 14 +-
.../IgniteCacheInterceptorSelfTestSuite.java | 2 +-
.../cache/IgniteCacheInvokeReadThroughTest.java | 5 +
.../cache/IgniteCacheNearLockValueSelfTest.java | 148 +
.../IgniteCacheP2pUnmarshallingErrorTest.java | 29 +-
...gniteCacheP2pUnmarshallingNearErrorTest.java | 13 +-
...CacheP2pUnmarshallingRebalanceErrorTest.java | 15 +-
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 25 +-
.../IgniteCachePartitionMapUpdateTest.java | 226 +
.../cache/IgniteCachePeekModesAbstractTest.java | 5 +-
...gniteCacheTransactionalStopBusySelfTest.java | 13 +-
.../IgniteDaemonNodeMarshallerCacheTest.java | 192 +
...eDynamicCacheStartNoExchangeTimeoutTest.java | 466 ++
.../cache/IgniteDynamicCacheStartSelfTest.java | 286 +-
...niteDynamicCacheWithConfigStartSelfTest.java | 97 +
.../IgniteDynamicClientCacheStartSelfTest.java | 284 +
.../cache/IgniteInternalCacheTypesTest.java | 3 +-
...teStartCacheInTransactionAtomicSelfTest.java | 32 +
.../IgniteStartCacheInTransactionSelfTest.java | 254 +
.../cache/IgniteSystemCacheOnClientTest.java | 97 +
.../IgniteTxExceptionAbstractSelfTest.java | 1 +
.../IgniteTxMultiThreadedAbstractTest.java | 4 +-
...cheAtomicReferenceMultiNodeAbstractTest.java | 11 -
.../GridCacheQueueApiSelfAbstractTest.java | 4 +-
...GridCacheQueueMultiNodeAbstractSelfTest.java | 6 +-
...dCacheQueueMultiNodeConsistencySelfTest.java | 5 +
...CacheQueueRotativeMultiNodeAbstractTest.java | 10 -
.../GridCacheSetAbstractSelfTest.java | 31 +-
.../IgniteClientDataStructuresAbstractTest.java | 340 +
.../IgniteClientDataStructuresTest.java | 28 +
...IgniteClientDiscoveryDataStructuresTest.java | 28 +
.../IgniteCountDownLatchAbstractSelfTest.java | 114 +-
.../IgniteDataStructureWithJobTest.java | 111 +
...omicOffheapQueueCreateMultiNodeSelfTest.java | 5 +
...ionedAtomicQueueCreateMultiNodeSelfTest.java | 5 +
...rtitionedDataStructuresFailoverSelfTest.java | 5 +
...edOffheapDataStructuresFailoverSelfTest.java | 5 +
...PartitionedQueueCreateMultiNodeSelfTest.java | 5 +
...dCachePartitionedQueueEntryMoveSelfTest.java | 5 +
...nedQueueFailoverDataConsistencySelfTest.java | 5 +
...eplicatedDataStructuresFailoverSelfTest.java | 5 +
...CacheLoadingConcurrentGridStartSelfTest.java | 5 +
.../GridCacheAbstractJobExecutionTest.java | 3 -
.../GridCacheAbstractNodeRestartSelfTest.java | 12 +-
.../GridCacheClientModesAbstractSelfTest.java | 94 +-
...ientModesTcpClientDiscoveryAbstractTest.java | 168 +
.../distributed/GridCacheMixedModeSelfTest.java | 3 +
...ridCachePartitionNotLoadedEventSelfTest.java | 82 +
.../GridCachePreloadLifecycleAbstractTest.java | 2 -
.../distributed/IgniteCache150ClientsTest.java | 189 +
...niteCacheClientNodeChangingTopologyTest.java | 1803 ++++++
.../IgniteCacheClientNodeConcurrentStart.java | 113 +
...teCacheClientNodePartitionsExchangeTest.java | 656 ++
.../distributed/IgniteCacheManyClientsTest.java | 318 +
.../IgniteCacheMessageRecoveryAbstractTest.java | 1 +
.../IgniteCacheSystemTransactionsSelfTest.java | 2 +-
.../IgniteCacheTxMessageRecoveryTest.java | 5 +
.../IgniteCrossCacheTxStoreSelfTest.java | 147 +-
...heAbstractTransformWriteThroughSelfTest.java | 3 -
.../dht/GridCacheClientOnlySelfTest.java | 60 +-
.../GridCacheColocatedTxExceptionSelfTest.java | 5 +
.../GridCacheDhtClientRemoveFailureTest.java | 28 +
...GridCacheDhtEvictionNearReadersSelfTest.java | 11 +-
.../dht/GridCacheDhtEvictionSelfTest.java | 11 +-
.../GridCacheExColocatedFullApiSelfTest.java | 33 -
...ePartitionedNearDisabledMetricsSelfTest.java | 4 +-
...dCachePartitionedTopologyChangeSelfTest.java | 5 +
.../dht/IgniteCacheMultiTxLockSelfTest.java | 53 +-
.../IgniteCachePutRetryAbstractSelfTest.java | 147 +
.../dht/IgniteCachePutRetryAtomicSelfTest.java | 34 +
...gniteCachePutRetryTransactionalSelfTest.java | 74 +
...cClientInvalidPartitionHandlingSelfTest.java | 29 +
.../GridCacheAtomicClientRemoveFailureTest.java | 28 +
...eAtomicInvalidPartitionHandlingSelfTest.java | 30 +-
...unctionExcludeNeighborsAbstractSelfTest.java | 3 +-
...eAtomicNearOnlyMultiNodeFullApiSelfTest.java | 3 +
.../near/GridCacheAtomicNearOnlySelfTest.java | 32 -
.../near/GridCacheExNearFullApiSelfTest.java | 39 -
.../near/GridCacheNearEvictionSelfTest.java | 3 -
...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 12 +-
.../near/GridCacheNearOnlySelfTest.java | 63 +-
.../near/GridCacheNearOnlyTopologySelfTest.java | 1 +
.../near/GridCacheNearTxExceptionSelfTest.java | 5 +
.../near/GridCacheNearTxMultiNodeSelfTest.java | 10 +-
...ionedClientOnlyNoPrimaryFullApiSelfTest.java | 5 +-
.../GridCachePartitionedEvictionSelfTest.java | 11 +-
.../GridCachePartitionedFailoverSelfTest.java | 5 +
...PartitionedFullApiMultithreadedSelfTest.java | 5 +
.../GridCachePartitionedFullApiSelfTest.java | 32 +
...idCachePartitionedHitsAndMissesSelfTest.java | 3 -
...achePartitionedMultiNodeFullApiSelfTest.java | 99 +-
...ePartitionedMultiThreadedPutGetSelfTest.java | 6 +-
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 2 +-
...ePartitionedOptimisticTxNodeRestartTest.java | 5 +
...achePartitionedPreloadLifecycleSelfTest.java | 2 +-
...CachePartitionedTxMultiThreadedSelfTest.java | 5 +
.../GridCachePartitionedTxSalvageSelfTest.java | 37 +-
...idCacheRendezvousAffinityClientSelfTest.java | 4 +
.../near/IgniteCacheNearOnlyTxTest.java | 190 +
.../GridCacheExReplicatedFullApiSelfTest.java | 33 -
.../GridCacheReplicatedClientOnlySelfTest.java | 43 -
...eReplicatedFullApiMultithreadedSelfTest.java | 5 +
.../GridCacheReplicatedInvalidateSelfTest.java | 7 +-
...ridCacheReplicatedMultiNodeLockSelfTest.java | 5 +
.../GridCacheReplicatedMultiNodeSelfTest.java | 5 +
.../GridCacheReplicatedNearOnlySelfTest.java | 43 -
.../GridCacheReplicatedTxExceptionSelfTest.java | 5 +
.../GridCacheSyncReplicatedPreloadSelfTest.java | 1 -
.../replicated/GridReplicatedTxPreloadTest.java | 2 +
...acheAtomicReplicatedNodeRestartSelfTest.java | 5 +
...CacheReplicatedPreloadLifecycleSelfTest.java | 6 +-
.../cache/eviction/EvictionAbstractTest.java | 1056 ++++
.../GridCacheBatchEvictUnswapSelfTest.java | 5 +-
...heConcurrentEvictionConsistencySelfTest.java | 97 +-
.../GridCacheConcurrentEvictionsSelfTest.java | 29 +-
.../GridCacheDistributedEvictionsSelfTest.java | 5 +-
.../GridCacheEmptyEntriesAbstractSelfTest.java | 11 +-
.../eviction/GridCacheEvictionAbstractTest.java | 484 --
.../GridCacheEvictionFilterSelfTest.java | 2 +-
.../GridCacheEvictionTouchSelfTest.java | 22 +-
.../cache/eviction/GridCacheMockEntry.java | 5 +
...cheSynchronousEvictionsFailoverSelfTest.java | 5 +
.../fifo/FifoEvictionPolicySelfTest.java | 262 +
...ridCacheFifoBatchEvictionPolicySelfTest.java | 384 --
.../GridCacheFifoEvictionPolicySelfTest.java | 372 --
.../lru/GridCacheLruEvictionPolicySelfTest.java | 417 --
.../GridCacheLruNearEvictionPolicySelfTest.java | 136 -
...heNearOnlyLruNearEvictionPolicySelfTest.java | 171 -
.../eviction/lru/LruEvictionPolicySelfTest.java | 353 ++
.../lru/LruNearEvictionPolicySelfTest.java | 140 +
.../LruNearOnlyNearEvictionPolicySelfTest.java | 172 +
.../GridCacheRandomEvictionPolicySelfTest.java | 258 -
.../RandomEvictionPolicyCacheSizeSelfTest.java | 78 +
.../random/RandomEvictionPolicySelfTest.java | 357 ++
...dCacheSortedBatchEvictionPolicySelfTest.java | 385 --
...acheSortedEvictionPolicyPerformanceTest.java | 135 -
.../GridCacheSortedEvictionPolicySelfTest.java | 373 --
.../SortedEvictionPolicyPerformanceTest.java | 134 +
.../sorted/SortedEvictionPolicySelfTest.java | 266 +
.../IgniteCacheClientNearCacheExpiryTest.java | 103 +
.../IgniteCacheExpiryPolicyAbstractTest.java | 10 +-
.../IgniteCacheExpiryPolicyTestSuite.java | 2 +
...eCacheExpiryPolicyWithStoreAbstractTest.java | 4 +-
.../IgniteCacheTxStoreSessionTest.java | 4 +
...CacheLocalOffHeapAndSwapMetricsSelfTest.java | 412 ++
.../local/GridCacheExLocalFullApiSelfTest.java | 30 -
...dCacheLocalFullApiMultithreadedSelfTest.java | 5 +
.../GridCacheLocalTxExceptionSelfTest.java | 5 +
...OnlyFairAffinityMultiJvmFullApiSelfTest.java | 31 +
...AtomicClientOnlyMultiJvmFullApiSelfTest.java | 31 +
...tOnlyMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...pyOnReadDisabledMultiJvmFullApiSelfTest.java | 31 +
...omicFairAffinityMultiJvmFullApiSelfTest.java | 31 +
.../GridCacheAtomicMultiJvmFullApiSelfTest.java | 30 +
...tomicMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...bledFairAffinityMultiJvmFullApiSelfTest.java | 31 +
...tomicNearEnabledMultiJvmFullApiSelfTest.java | 31 +
...rimaryWriteOrderMultiJvmFullApiSelfTest.java | 31 +
...heAtomicNearOnlyMultiJvmFullApiSelfTest.java | 31 +
...rOnlyMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...cheAtomicOffHeapMultiJvmFullApiSelfTest.java | 31 +
...micOffHeapTieredMultiJvmFullApiSelfTest.java | 36 +
...rderFairAffinityMultiJvmFullApiSelfTest.java | 31 +
...rimaryWriteOrderMultiJvmFullApiSelfTest.java | 31 +
...OrderMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...rityOrderOffHeapMultiJvmFullApiSelfTest.java | 31 +
...derOffHeapTieredMultiJvmFullApiSelfTest.java | 36 +
...OnlyFairAffinityMultiJvmFullApiSelfTest.java | 31 +
...ridCacheNearOnlyMultiJvmFullApiSelfTest.java | 30 +
...rOnlyMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...pyOnReadDisabledMultiJvmFullApiSelfTest.java | 31 +
...onedFairAffinityMultiJvmFullApiSelfTest.java | 31 +
...CachePartitionedMultiJvmFullApiSelfTest.java | 30 +
...ionedMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...micOffHeapTieredMultiJvmFullApiSelfTest.java | 36 +
...bledFairAffinityMultiJvmFullApiSelfTest.java | 31 +
...onedNearDisabledMultiJvmFullApiSelfTest.java | 31 +
...abledMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...rDisabledOffHeapMultiJvmFullApiSelfTest.java | 31 +
...ledOffHeapTieredMultiJvmFullApiSelfTest.java | 36 +
...rtitionedOffHeapMultiJvmFullApiSelfTest.java | 31 +
...nedOffHeapTieredMultiJvmFullApiSelfTest.java | 36 +
...ReplicatedAtomicMultiJvmFullApiSelfTest.java | 31 +
...rimaryWriteOrderMultiJvmFullApiSelfTest.java | 31 +
...dCacheReplicatedMultiJvmFullApiSelfTest.java | 30 +
...catedMultiJvmP2PDisabledFullApiSelfTest.java | 31 +
...plicatedNearOnlyMultiJvmFullApiSelfTest.java | 37 +
...eplicatedOffHeapMultiJvmFullApiSelfTest.java | 31 +
...tedOffHeapTieredMultiJvmFullApiSelfTest.java | 36 +
.../GridCacheSwapScanQueryAbstractSelfTest.java | 115 +-
...ridCacheContinuousQueryAbstractSelfTest.java | 8 +-
...CacheClientWriteBehindStoreAbstractTest.java | 104 +
...teCacheClientWriteBehindStoreAtomicTest.java | 38 +
.../IgnteCacheClientWriteBehindStoreTxTest.java | 32 +
.../closure/GridClosureProcessorSelfTest.java | 29 +-
.../continuous/GridEventConsumeSelfTest.java | 98 +-
.../DataStreamProcessorSelfTest.java | 48 +-
.../DataStreamerMultiThreadedSelfTest.java | 62 +-
.../DataStreamerMultinodeCreateCacheTest.java | 99 +
.../igfs/IgfsClientCacheSelfTest.java | 12 +-
.../processors/igfs/IgfsCommonAbstractTest.java | 10 -
.../processors/igfs/IgfsModesSelfTest.java | 4 +-
.../processors/igfs/IgfsOneClientNodeTest.java | 8 +-
.../service/ClosureServiceClientsNodesTest.java | 251 +
.../service/GridServiceClientNodeTest.java | 81 +
.../internal/util/IgniteUtilsSelfTest.java | 22 +
.../ipc/shmem/IgfsSharedMemoryTestServer.java | 2 +
.../IpcSharedMemoryCrashDetectionSelfTest.java | 2 +-
.../ipc/shmem/IpcSharedMemorySpaceSelfTest.java | 2 +-
.../ipc/shmem/IpcSharedMemoryUtilsSelfTest.java | 2 +-
.../LoadWithCorruptedLibFileTestRunner.java | 2 +-
.../IpcSharedMemoryBenchmarkReader.java | 2 +-
.../IpcSharedMemoryBenchmarkWriter.java | 2 +-
.../nio/GridNioDelimitedBufferSelfTest.java | 112 +
.../internal/util/nio/GridNioSelfTest.java | 15 +-
.../internal/util/nio/GridNioSslSelfTest.java | 2 +
.../unsafe/GridUnsafeMemorySelfTest.java | 4 +-
.../tostring/GridToStringBuilderSelfTest.java | 4 +-
.../loadtests/GridCacheMultiNodeLoadTest.java | 5 +-
.../communication/GridIoManagerBenchmark0.java | 1 +
.../GridCachePartitionedAtomicLongLoadTest.java | 6 +-
.../loadtests/hashmap/GridCacheTestContext.java | 6 +-
.../swap/GridSwapEvictAllBenchmark.java | 6 +-
.../marshaller/MarshallerContextTestImpl.java | 29 +-
.../OptimizedMarshallerNodeFailoverTest.java | 4 +-
...GridMessagingNoPeerClassLoadingSelfTest.java | 7 +-
.../ignite/messaging/GridMessagingSelfTest.java | 16 +-
.../IgniteMessagingWithClientTest.java | 166 +
.../p2p/GridP2PLocalDeploymentSelfTest.java | 6 +-
.../p2p/GridP2PRemoteClassLoadersSelfTest.java | 31 +-
.../spi/GridTcpSpiForwardingSelfTest.java | 4 +-
.../GridTcpCommunicationSpiAbstractTest.java | 17 +-
...mmunicationSpiConcurrentConnectSelfTest.java | 6 +-
.../GridTcpCommunicationSpiConfigSelfTest.java | 3 -
...cpCommunicationSpiMultithreadedSelfTest.java | 23 +-
...pCommunicationSpiMultithreadedShmemTest.java | 28 +
...dTcpCommunicationSpiRecoveryAckSelfTest.java | 1 +
...GridTcpCommunicationSpiRecoverySelfTest.java | 1 +
.../GridTcpCommunicationSpiShmemSelfTest.java | 38 +
.../tcp/GridTcpCommunicationSpiTcpSelfTest.java | 7 +
.../discovery/AbstractDiscoverySelfTest.java | 21 +-
...pClientDiscoveryMarshallerCheckSelfTest.java | 76 +
.../tcp/TcpClientDiscoverySelfTest.java | 700 ---
.../tcp/TcpClientDiscoverySpiMulticastTest.java | 129 +
.../tcp/TcpClientDiscoverySpiSelfTest.java | 2174 +++++++
.../tcp/TcpDiscoveryConcurrentStartTest.java | 61 +-
.../tcp/TcpDiscoveryMultiThreadedTest.java | 56 +-
.../TcpDiscoveryNodeConsistentIdSelfTest.java | 80 +
.../spi/discovery/tcp/TcpDiscoverySelfTest.java | 46 +-
.../inmemory/GridTestSwapSpaceSpi.java | 3 +-
.../GridCommandLineTransformerSelfTest.java | 12 +-
.../stream/socket/SocketStreamerSelfTest.java | 310 +
.../ignite/stream/socket/package-info.java | 21 +
.../testframework/GridSpiTestContext.java | 42 +-
.../ignite/testframework/GridTestUtils.java | 31 +-
.../config/GridTestProperties.java | 14 +-
.../testframework/junits/GridAbstractTest.java | 410 +-
.../junits/GridTestKernalContext.java | 3 +-
.../junits/IgniteTestResources.java | 16 +-
.../junits/cache/TestCacheSession.java | 18 +
.../cache/TestThreadLocalCacheSession.java | 15 +
.../junits/common/GridCommonAbstractTest.java | 148 +-
.../junits/multijvm/AffinityProcessProxy.java | 195 +
.../multijvm/IgniteCacheProcessProxy.java | 602 ++
.../multijvm/IgniteClusterProcessProxy.java | 325 +
.../multijvm/IgniteEventsProcessProxy.java | 148 +
.../junits/multijvm/IgniteNodeRunner.java | 184 +
.../junits/multijvm/IgniteProcessProxy.java | 571 ++
.../ignite/testsuites/IgniteBasicTestSuite.java | 37 +-
.../IgniteCacheDataStructuresSelfTestSuite.java | 28 +-
.../IgniteCacheEvictionSelfTestSuite.java | 18 +-
.../IgniteCacheFailoverTestSuite.java | 27 +-
.../IgniteCacheFailoverTestSuite2.java | 47 +
...IgniteCacheFullApiMultiJvmSelfTestSuite.java | 89 +
.../IgniteCacheFullApiSelfTestSuite.java | 14 +-
.../IgniteCacheMetricsSelfTestSuite.java | 1 +
.../IgniteCacheNearOnlySelfTestSuite.java | 16 +-
...gniteCacheP2pUnmarshallingErrorTestSuit.java | 41 -
...niteCacheP2pUnmarshallingErrorTestSuite.java | 53 +
.../testsuites/IgniteCacheRestartTestSuite.java | 10 +-
.../IgniteCacheTcpClientDiscoveryTestSuite.java | 47 +
.../ignite/testsuites/IgniteCacheTestSuite.java | 56 +-
.../testsuites/IgniteCacheTestSuite2.java | 16 +-
.../testsuites/IgniteCacheTestSuite3.java | 14 +-
.../testsuites/IgniteCacheTestSuite4.java | 37 +-
.../IgniteCacheWriteBehindTestSuite.java | 2 +
.../IgniteClientReconnectTestSuite.java | 48 +
.../testsuites/IgniteClientTestSuite.java | 38 +
.../testsuites/IgniteComputeGridTestSuite.java | 1 +
.../testsuites/IgniteKernalSelfTestSuite.java | 24 +-
.../IgniteMarshallerSelfTestSuite.java | 28 +-
.../IgniteSpiCommunicationSelfTestSuite.java | 2 +
.../IgniteSpiDiscoverySelfTestSuite.java | 9 +-
.../testsuites/IgniteStreamSelfTestSuite.java | 39 +
.../testsuites/IgniteUtilSelfTestSuite.java | 19 +-
.../apache/ignite/util/GridRandomSelfTest.java | 4 +-
.../ignite/util/TestTcpCommunicationSpi.java | 21 +
modules/core/src/test/resources/helloworld.gar | Bin 6092 -> 0 bytes
modules/core/src/test/resources/helloworld1.gar | Bin 6092 -> 0 bytes
modules/core/src/test/resources/readme.txt | 6 -
modules/docker/Dockerfile | 55 +
modules/docker/README.txt | 11 +
modules/docker/build_users_libs.sh | 39 +
modules/docker/download_ignite.sh | 49 +
modules/docker/execute.sh | 62 +
modules/docker/run.sh | 34 +
modules/extdata/p2p/pom.xml | 4 +-
.../p2p/GridP2PContinuousDeploymentTask1.java | 2 +-
.../tests/p2p/P2PTestTaskExternalPath1.java | 10 +-
.../tests/p2p/P2PTestTaskExternalPath2.java | 8 +-
.../CacheConfigurationP2PTestClient.java | 4 +-
modules/extdata/uri/META-INF/ignite.xml | 38 +
.../extdata/uri/modules/uri-dependency/pom.xml | 40 +
.../deployment/uri/tasks/GarHelloWorldBean.java | 60 +
.../src/main/resources/gar-example.properties | 18 +
modules/extdata/uri/pom.xml | 50 +-
.../deployment/uri/tasks/GarHelloWorldTask.java | 81 +
.../deployment/uri/tasks/gar-spring-bean.xml | 29 +
modules/gce/pom.xml | 2 +-
.../gce/TcpDiscoveryGoogleStorageIpFinder.java | 43 +-
.../geospatial/licenses/jts-lgpl-license.txt | 165 -
modules/geospatial/pom.xml | 2 +-
.../query/h2/GridH2IndexingGeoSelfTest.java | 20 +-
modules/hadoop/pom.xml | 81 +-
.../fs/IgniteHadoopFileSystemCounterWriter.java | 21 +-
.../fs/IgniteHadoopIgfsSecondaryFileSystem.java | 165 +-
.../hadoop/fs/v1/IgniteHadoopFileSystem.java | 137 +-
.../hadoop/fs/v2/IgniteHadoopFileSystem.java | 32 +-
.../processors/hadoop/HadoopClassLoader.java | 29 +
.../processors/hadoop/HadoopDefaultJobInfo.java | 27 +-
.../internal/processors/hadoop/HadoopUtils.java | 51 +-
.../hadoop/SecondaryFileSystemProvider.java | 58 +-
.../hadoop/fs/HadoopDistributedFileSystem.java | 91 -
.../hadoop/fs/HadoopFileSystemCacheUtils.java | 241 +
.../hadoop/fs/HadoopFileSystemsUtils.java | 26 +-
.../hadoop/fs/HadoopLazyConcurrentMap.java | 209 +
.../processors/hadoop/igfs/HadoopIgfsEx.java | 6 +
.../hadoop/igfs/HadoopIgfsInProc.java | 170 +-
.../processors/hadoop/igfs/HadoopIgfsIpcIo.java | 2 +-
.../hadoop/igfs/HadoopIgfsOutProc.java | 33 +-
.../hadoop/igfs/HadoopIgfsWrapper.java | 19 +-
.../hadoop/jobtracker/HadoopJobTracker.java | 25 +-
.../hadoop/taskexecutor/HadoopRunnableTask.java | 20 +-
.../child/HadoopChildProcessRunner.java | 3 +-
.../processors/hadoop/v2/HadoopV2Context.java | 10 +-
.../processors/hadoop/v2/HadoopV2Job.java | 111 +-
.../hadoop/v2/HadoopV2JobResourceManager.java | 40 +-
.../hadoop/v2/HadoopV2TaskContext.java | 85 +-
.../hadoop/HadoopClientProtocolSelfTest.java | 6 +-
.../HadoopIgfs20FileSystemAbstractSelfTest.java | 73 +-
...oopSecondaryFileSystemConfigurationTest.java | 18 +-
.../apache/ignite/igfs/IgfsEventsTestSuite.java | 5 +-
.../igfs/IgfsNearOnlyMultiNodeSelfTest.java | 5 +-
.../IgniteHadoopFileSystemAbstractSelfTest.java | 65 +-
.../IgniteHadoopFileSystemClientSelfTest.java | 2 +-
...IgniteHadoopFileSystemHandshakeSelfTest.java | 7 +
.../IgniteHadoopFileSystemIpcCacheSelfTest.java | 9 +
.../hadoop/HadoopAbstractSelfTest.java | 19 +-
.../hadoop/HadoopCommandLineTest.java | 14 +-
.../hadoop/HadoopFileSystemsTest.java | 23 +-
.../processors/hadoop/HadoopMapReduceTest.java | 185 +-
.../hadoop/HadoopTaskExecutionSelfTest.java | 2 +-
.../hadoop/HadoopTasksAllVersionsTest.java | 15 +-
.../processors/hadoop/HadoopTasksV1Test.java | 8 +-
.../processors/hadoop/HadoopTasksV2Test.java | 8 +-
.../processors/hadoop/HadoopV2JobSelfTest.java | 8 +-
.../collections/HadoopAbstractMapTest.java | 15 +-
.../collections/HadoopHashMapSelfTest.java | 4 +-
.../collections/HadoopSkipListSelfTest.java | 4 +-
.../HadoopExternalTaskExecutionSelfTest.java | 2 +
.../HadoopExternalCommunicationSelfTest.java | 5 +
.../testsuites/IgniteHadoopTestSuite.java | 11 +-
.../IgniteIgfsLinuxAndMacOSTestSuite.java | 3 +-
.../licenses/hibernate-lgpl-2.1-license.txt | 174 -
modules/hibernate/pom.xml | 16 +-
.../HibernateTransactionalDataRegion.java | 12 +-
.../hibernate/CacheHibernateBlobStore.java | 87 +-
.../CacheHibernateBlobStoreFactory.java | 235 +
.../CacheHibernateStoreSessionListener.java | 216 +
.../hibernate/src/test/config/factory-cache.xml | 59 +
.../src/test/config/factory-cache1.xml | 61 +
.../config/factory-incorrect-store-cache.xml | 56 +
.../hibernate/HibernateL2CacheSelfTest.java | 2 +
.../CacheHibernateStoreFactorySelfTest.java | 273 +
...heHibernateStoreSessionListenerSelfTest.java | 228 +
.../testsuites/IgniteHibernateTestSuite.java | 8 +-
modules/indexing/licenses/h2-epl-license.txt | 69 -
modules/indexing/pom.xml | 18 +-
.../processors/query/h2/IgniteH2Indexing.java | 145 +-
.../query/h2/opt/GridH2AbstractKeyValueRow.java | 18 +-
.../query/h2/opt/GridH2KeyValueRowOffheap.java | 12 +-
.../processors/query/h2/opt/GridH2Table.java | 2 +-
.../query/h2/sql/GridSqlOperationType.java | 2 +-
.../query/h2/sql/GridSqlQuerySplitter.java | 53 +-
.../query/h2/twostep/GridMapQueryExecutor.java | 321 +-
.../query/h2/twostep/GridMergeIndex.java | 62 +-
.../h2/twostep/GridMergeIndexUnsorted.java | 7 +-
.../h2/twostep/GridReduceQueryExecutor.java | 714 ++-
.../query/h2/twostep/GridResultPage.java | 21 +-
.../CacheAbstractQueryMetricsSelfTest.java | 358 ++
.../cache/CacheLocalQueryMetricsSelfTest.java | 33 +
...titionedQueryMetricsDistributedSelfTest.java | 33 +
...chePartitionedQueryMetricsLocalSelfTest.java | 33 +
...plicatedQueryMetricsDistributedSelfTest.java | 33 +
...acheReplicatedQueryMetricsLocalSelfTest.java | 33 +
...CacheScanPartitionQueryFallbackSelfTest.java | 408 ++
.../cache/GridCacheCrossCacheQuerySelfTest.java | 25 +-
.../cache/GridCacheOffHeapSelfTest.java | 1 -
.../GridCacheOffheapIndexEntryEvictTest.java | 200 +
.../cache/GridCacheOffheapIndexGetSelfTest.java | 80 +-
.../cache/GridCacheQueryMetricsSelfTest.java | 152 -
...idCacheReduceQueryMultithreadedSelfTest.java | 10 -
.../processors/cache/GridCacheSwapSelfTest.java | 3 -
.../cache/GridIndexingWithNoopSwapSelfTest.java | 6 +-
.../IgniteCacheAbstractFieldsQuerySelfTest.java | 13 +-
.../cache/IgniteCacheAbstractQuerySelfTest.java | 85 +-
...acheConfigurationPrimitiveTypesSelfTest.java | 104 +
.../cache/IgniteCacheOffheapEvictQueryTest.java | 196 +
...niteCacheP2pUnmarshallingQueryErrorTest.java | 3 +-
...hePartitionedQueryMultiThreadedSelfTest.java | 40 +-
...QueryMultiThreadedOffHeapTieredSelfTest.java | 37 +
...eQueryMultiThreadedOffHeapTiredSelfTest.java | 37 -
.../IgniteCacheQueryMultiThreadedSelfTest.java | 19 +-
...ClientReconnectCacheQueriesFailoverTest.java | 225 +
.../cache/IgniteClientReconnectQueriesTest.java | 427 ++
...lientQueryReplicatedNodeRestartSelfTest.java | 419 ++
.../IgniteCacheQueryNodeRestartSelfTest.java | 41 +-
.../IgniteCacheQueryNodeRestartSelfTest2.java | 388 ++
.../local/IgniteCacheLocalQuerySelfTest.java | 6 +
...dCacheAbstractReduceFieldsQuerySelfTest.java | 5 +-
.../cache/ttl/CacheTtlAbstractSelfTest.java | 6 +-
.../h2/GridIndexingSpiAbstractSelfTest.java | 4 +-
.../query/h2/sql/BaseH2CompareQueryTest.java | 22 +-
.../query/h2/sql/GridQueryParsingTest.java | 5 +-
.../IgniteCacheQuerySelfTestSuite.java | 16 +-
.../IgniteCacheWithIndexingTestSuite.java | 4 +
modules/jcl/pom.xml | 2 +-
modules/jta/licenses/jta-license.txt | 2 +
modules/jta/pom.xml | 2 +-
.../apache/ignite/cache/jta/CacheTmLookup.java | 3 +-
.../processors/cache/jta/CacheJtaManager.java | 76 +-
.../cache/jta/GridCacheXAResource.java | 34 +-
.../processors/cache/GridCacheJtaSelfTest.java | 52 +-
.../GridTmLookupLifecycleAwareSelfTest.java | 29 +-
modules/kafka/licenses/apache-2.0.txt | 202 +
modules/kafka/pom.xml | 105 +
.../ignite/stream/kafka/KafkaStreamer.java | 220 +
.../kafka/IgniteKafkaStreamerSelfTestSuite.java | 37 +
.../stream/kafka/KafkaEmbeddedBroker.java | 378 ++
.../kafka/KafkaIgniteStreamerSelfTest.java | 227 +
.../ignite/stream/kafka/SimplePartitioner.java | 53 +
modules/log4j/pom.xml | 2 +-
modules/mesos/README.txt | 28 +
modules/mesos/licenses/apache-2.0.txt | 202 +
modules/mesos/pom.xml | 101 +
.../apache/ignite/mesos/ClusterProperties.java | 548 ++
.../apache/ignite/mesos/IgniteFramework.java | 119 +
.../apache/ignite/mesos/IgniteScheduler.java | 379 ++
.../org/apache/ignite/mesos/IgniteTask.java | 86 +
.../org/apache/ignite/mesos/package-info.java | 22 +
.../ignite/mesos/resource/IgniteProvider.java | 234 +
.../ignite/mesos/resource/JettyServer.java | 61 +
.../ignite/mesos/resource/ResourceHandler.java | 142 +
.../ignite/mesos/resource/ResourceProvider.java | 120 +
.../ignite/mesos/resource/package-info.java | 22 +
.../main/resources/ignite-default-config.xml | 35 +
.../org/apache/ignite/IgniteMesosTestSuite.java | 38 +
.../ignite/mesos/IgniteSchedulerSelfTest.java | 464 ++
modules/rest-http/pom.xml | 20 +-
modules/scalar-2.10/README.txt | 4 +
modules/scalar-2.10/licenses/apache-2.0.txt | 202 +
modules/scalar-2.10/pom.xml | 197 +
modules/scalar/licenses/scala-bsd-license.txt | 18 -
modules/scalar/pom.xml | 2 +-
.../licenses/cron4j-lgpl-2.1-license.txt | 174 -
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
.../ignite/schema/model/PojoDescriptor.java | 2 +
.../apache/ignite/schema/model/PojoField.java | 1 +
.../parser/dialect/OracleMetadataDialect.java | 2 +-
modules/slf4j/licenses/sl4j-mit-license.txt | 21 -
modules/slf4j/pom.xml | 2 +-
modules/spark-2.10/README.txt | 4 +
modules/spark-2.10/licenses/apache-2.0.txt | 202 +
modules/spark-2.10/pom.xml | 120 +
modules/spark/README.txt | 8 +
modules/spark/licenses/apache-2.0.txt | 202 +
modules/spark/pom.xml | 110 +
.../org/apache/ignite/spark/IgniteContext.scala | 161 +
.../org/apache/ignite/spark/IgniteRDD.scala | 244 +
.../apache/ignite/spark/JavaIgniteContext.scala | 63 +
.../org/apache/ignite/spark/JavaIgniteRDD.scala | 99 +
.../ignite/spark/impl/IgniteAbstractRDD.scala | 39 +
.../ignite/spark/impl/IgnitePartition.scala | 24 +
.../ignite/spark/impl/IgniteQueryIterator.scala | 27 +
.../apache/ignite/spark/impl/IgniteSqlRDD.scala | 41 +
.../spark/impl/JavaIgniteAbstractRDD.scala | 34 +
.../ignite/spark/JavaIgniteRDDSelfTest.java | 298 +
.../scala/org/apache/ignite/spark/Entity.scala | 28 +
.../org/apache/ignite/spark/IgniteRddSpec.scala | 249 +
modules/spring/pom.xml | 23 +-
.../apache/ignite/cache/spring/SpringCache.java | 2 +-
.../ignite/cache/spring/SpringCacheManager.java | 22 +-
.../spring/CacheSpringStoreSessionListener.java | 207 +
.../GridResourceSpringBeanInjector.java | 2 +-
.../util/spring/IgniteSpringHelperImpl.java | 89 +-
.../src/test/config/incorrect-store-cache.xml | 57 +
modules/spring/src/test/config/node.xml | 43 +
modules/spring/src/test/config/node1.xml | 45 +
.../test/config/pojo-incorrect-store-cache.xml | 56 +
modules/spring/src/test/config/store-cache.xml | 59 +
modules/spring/src/test/config/store-cache1.xml | 62 +
.../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 172 +
.../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 193 +
...CacheSpringStoreSessionListenerSelfTest.java | 197 +
.../IgniteExcludeInConfigurationTest.java | 81 +
.../org/apache/ignite/spring/sprint-exclude.xml | 76 +
.../testsuites/IgniteSpringTestSuite.java | 10 +
modules/ssh/licenses/jcraft-revised-bsd.txt | 28 -
modules/ssh/pom.xml | 2 +-
modules/tools/licenses/jodd-revised-bsd.txt | 21 -
modules/tools/pom.xml | 2 +-
.../ignite/tools/classgen/ClassesGenerator.java | 30 +-
.../urideploy/licenses/jtidy-mit-license.txt | 50 -
modules/urideploy/pom.xml | 16 +-
.../GridTaskUriDeploymentDeadlockSelfTest.java | 13 +-
.../ignite/p2p/GridP2PDisabledSelfTest.java | 2 +-
modules/visor-console-2.10/README.txt | 4 +
modules/visor-console-2.10/pom.xml | 174 +
.../licenses/jcraft-revised-bsd.txt | 28 -
.../licenses/jline-bsd-license.txt | 18 -
.../licenses/scala-bsd-license.txt | 18 -
modules/visor-console/pom.xml | 2 +-
.../ignite/visor/commands/VisorConsole.scala | 3 +-
.../commands/cache/VisorCacheCommand.scala | 9 +-
.../commands/cache/VisorCacheScanCommand.scala | 2 +-
.../visor/commands/node/VisorNodeCommand.scala | 2 +-
.../visor/commands/open/VisorOpenCommand.scala | 319 +
.../commands/tasks/VisorTasksCommand.scala | 2 +-
.../scala/org/apache/ignite/visor/visor.scala | 291 +-
.../ignite/visor/VisorRuntimeBaseSpec.scala | 2 +
.../commands/kill/VisorKillCommandSpec.scala | 1 +
.../commands/start/VisorStartCommandSpec.scala | 1 +
.../commands/tasks/VisorTasksCommandSpec.scala | 1 +
.../commands/vvm/VisorVvmCommandSpec.scala | 1 +
.../licenses/slf4j-mit-license.txt | 21 -
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 12 +-
.../IgniteWebSessionSelfTestSuite.java | 2 +-
.../config/benchmark-client-mode.properties | 89 +
.../config/benchmark-put-indexed-val.properties | 64 +
modules/yardstick/config/ignite-base-config.xml | 23 +
modules/yardstick/pom.xml | 2 +-
.../cache/IgnitePutIndexedValue1Benchmark.java | 42 +
.../cache/IgnitePutIndexedValue2Benchmark.java | 42 +
.../cache/IgnitePutIndexedValue8Benchmark.java | 42 +
.../ignite/yardstick/cache/model/Person1.java | 55 +
.../ignite/yardstick/cache/model/Person2.java | 67 +
.../ignite/yardstick/cache/model/Person8.java | 109 +
modules/yarn/README.txt | 28 +
modules/yarn/licenses/apache-2.0.txt | 202 +
modules/yarn/pom.xml | 101 +
.../apache/ignite/yarn/ApplicationMaster.java | 400 ++
.../apache/ignite/yarn/ClusterProperties.java | 432 ++
.../org/apache/ignite/yarn/IgniteContainer.java | 84 +
.../org/apache/ignite/yarn/IgniteProvider.java | 339 +
.../apache/ignite/yarn/IgniteYarnClient.java | 178 +
.../org/apache/ignite/yarn/package-info.java | 22 +
.../ignite/yarn/utils/IgniteYarnUtils.java | 81 +
.../main/resources/ignite-default-config.xml | 35 +
.../org/apache/ignite/IgniteYarnTestSuite.java | 38 +
.../yarn/IgniteApplicationMasterSelfTest.java | 532 ++
parent/pom.xml | 110 +-
pom.xml | 79 +-
scripts/git-apply-patch.sh | 8 +-
scripts/git-format-patch.sh | 16 +-
scripts/git-patch-functions.sh | 36 +-
scripts/git-patch-prop.sh | 2 +-
1157 files changed, 79870 insertions(+), 24888 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc18c3da/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheEvictableEntryImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc18c3da/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc18c3da/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
index 9a3f1a6,3857b35..f50d6b2
--- 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
@@@ -942,5 -943,10 +943,11 @@@ public interface GridCacheEntryEx
* @param <V> Value type.
* @return {@code True} if value was removed, {@code false} otherwise.
*/
+ public <V> boolean removeMeta(UUID name, V val);
+
+ /**
+ * Calls {@link GridDhtLocalPartition#onUnlock()} for this entry's partition.
+ */
+ public void onUnlock();
+ public <V> boolean removeMeta(int key, V val);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc18c3da/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc18c3da/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc18c3da/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc18c3da/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteInternalTx.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc18c3da/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc18c3da/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java
index 989ad0a,5d183bf..333fae5
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java
@@@ -80,7 -83,13 +80,12 @@@ public class GridCacheMockEntry<K, V> e
return !evicted;
}
+ /** {@inheritDoc} */
+ @Override public int size() {
+ return 0;
+ }
+
/**
- *
* @return Evicted or not.
*/
public boolean isEvicted() {
[41/50] [abbrv] incubator-ignite git commit: # ignite-901 client
reconnect support
Posted by av...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 29e3551..84e4dc2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -893,6 +893,14 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
}
/**
+ * @param cacheId Cache ID to remove handlers for.
+ * @param type Message type.
+ */
+ public void removeHandler(int cacheId, Class<? extends GridCacheMessage> type) {
+ clsHandlers.remove(new ListenerKey(cacheId, type));
+ }
+
+ /**
* @param msgCls Message class to check.
* @return Message index.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManager.java
index 775daf5..ae7e9d7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManager.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
+import org.apache.ignite.lang.*;
/**
* Interface for cache managers.
@@ -49,6 +50,11 @@ public interface GridCacheManager<K, V> {
public void onKernalStop(boolean cancel);
/**
+ * @param reconnectFut Reconnect future.
+ */
+ public void onDisconnected(IgniteFuture<?> reconnectFut);
+
+ /**
* Prints memory statistics (sizes of internal data structures, etc.).
*
* NOTE: this method is for testing and profiling purposes only.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManagerAdapter.java
index 52fade8..54b1915 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheManagerAdapter.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
import java.util.concurrent.atomic.*;
@@ -127,6 +128,11 @@ public class GridCacheManagerAdapter<K, V> implements GridCacheManager<K, V> {
}
/** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
@Override public void printMemoryStats() {
// No-op.
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
index f24cf01..36e108f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java
@@ -208,10 +208,7 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter {
exchLog = cctx.logger(getClass().getName() + ".exchange");
pendingExplicit = GridConcurrentFactory.newMap();
- }
- /** {@inheritDoc} */
- @Override public void onKernalStart0() throws IgniteCheckedException {
cctx.gridEvents().addLocalEventListener(discoLsnr, EVT_NODE_FAILED, EVT_NODE_LEFT);
}
@@ -295,15 +292,39 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter {
* Cancels all client futures.
*/
public void cancelClientFutures() {
- IgniteCheckedException e = new IgniteCheckedException("Operation has been cancelled (grid is stopping).");
+ cancelClientFutures(new IgniteCheckedException("Operation has been cancelled (node is stopping)."));
+ }
+
+ /** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture reconnectFut) {
+ IgniteClientDisconnectedCheckedException err = disconnectedError(reconnectFut);
+
+ cancelClientFutures(err);
+ }
+ /**
+ * @param err Error.
+ */
+ private void cancelClientFutures(IgniteCheckedException err) {
for (Collection<GridCacheFuture<?>> futures : futs.values()) {
for (GridCacheFuture<?> future : futures)
- ((GridFutureAdapter)future).onDone(e);
+ ((GridFutureAdapter)future).onDone(err);
}
for (GridCacheAtomicFuture<?> future : atomicFuts.values())
- ((GridFutureAdapter)future).onDone(e);
+ ((GridFutureAdapter)future).onDone(err);
+ }
+
+ /**
+ * @param reconnectFut Reconnect future.
+ * @return Client disconnected exception.
+ */
+ private IgniteClientDisconnectedCheckedException disconnectedError(@Nullable IgniteFuture<?> reconnectFut) {
+ if (reconnectFut == null)
+ reconnectFut = cctx.kernalContext().cluster().clientReconnectFuture();
+
+ return new IgniteClientDisconnectedCheckedException(reconnectFut,
+ "Operation has been cancelled (client node disconnected).");
}
/**
@@ -339,6 +360,9 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter {
IgniteInternalFuture<?> old = atomicFuts.put(futVer, fut);
assert old == null : "Old future is not null [futVer=" + futVer + ", fut=" + fut + ", old=" + old + ']';
+
+ if (cctx.kernalContext().clientDisconnected())
+ ((GridFutureAdapter)fut).onDone(disconnectedError(null));
}
/**
@@ -459,7 +483,10 @@ public class GridCacheMvccManager extends GridCacheSharedManagerAdapter {
fut.onNodeLeft(n.id());
}
- // Just in case if future was complete before it was added.
+ if (cctx.kernalContext().clientDisconnected())
+ ((GridFutureAdapter)fut).onDone(disconnectedError(null));
+
+ // Just in case if future was completed before it was added.
if (fut.isDone())
removeFuture(fut);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
index 4398b4c..1f6a8bb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePartitionExchangeManager.java
@@ -97,6 +97,9 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
private final AtomicReference<AffinityTopologyVersion> readyTopVer =
new AtomicReference<>(AffinityTopologyVersion.NONE);
+ /** */
+ private GridFutureAdapter<?> reconnectExchangeFut;
+
/**
* Partition map futures.
* This set also contains already completed exchange futures to address race conditions when coordinator
@@ -237,9 +240,16 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
});
}
+ /**
+ * @return Reconnect partition exchange future.
+ */
+ public IgniteInternalFuture<?> reconnectExchangeFuture() {
+ return reconnectExchangeFut;
+ }
+
/** {@inheritDoc} */
- @Override protected void onKernalStart0() throws IgniteCheckedException {
- super.onKernalStart0();
+ @Override protected void onKernalStart0(boolean reconnect) throws IgniteCheckedException {
+ super.onKernalStart0(reconnect);
ClusterNode loc = cctx.localNode();
@@ -260,6 +270,9 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
GridDhtPartitionsExchangeFuture fut = exchangeFuture(exchId, discoEvt, null);
+ if (reconnect)
+ reconnectExchangeFut = new GridFutureAdapter<>();
+
new IgniteThread(cctx.gridName(), "exchange-worker", exchWorker).start();
onDiscoveryEvent(cctx.localNodeId(), fut);
@@ -267,10 +280,30 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
// Allow discovery events to get processed.
locExchFut.onDone();
- if (log.isDebugEnabled())
- log.debug("Beginning to wait on local exchange future: " + fut);
+ if (reconnect) {
+ fut.listen(new CI1<IgniteInternalFuture<AffinityTopologyVersion>>() {
+ @Override public void apply(IgniteInternalFuture<AffinityTopologyVersion> fut) {
+ try {
+ fut.get();
+
+ for (GridCacheContext cacheCtx : cctx.cacheContexts())
+ cacheCtx.preloader().onInitialExchangeComplete(null);
+
+ reconnectExchangeFut.onDone();
+ }
+ catch (IgniteCheckedException e) {
+ for (GridCacheContext cacheCtx : cctx.cacheContexts())
+ cacheCtx.preloader().onInitialExchangeComplete(e);
+
+ reconnectExchangeFut.onDone(e);
+ }
+ }
+ });
+ }
+ else {
+ if (log.isDebugEnabled())
+ log.debug("Beginning to wait on local exchange future: " + fut);
- try {
boolean first = true;
while (true) {
@@ -296,28 +329,35 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
for (GridCacheContext cacheCtx : cctx.cacheContexts())
cacheCtx.preloader().onInitialExchangeComplete(null);
- }
- catch (IgniteFutureTimeoutCheckedException e) {
- IgniteCheckedException err = new IgniteCheckedException("Timed out waiting for exchange future: " + fut, e);
- for (GridCacheContext cacheCtx : cctx.cacheContexts())
- cacheCtx.preloader().onInitialExchangeComplete(err);
-
- throw err;
+ if (log.isDebugEnabled())
+ log.debug("Finished waiting for initial exchange: " + fut.exchangeId());
}
-
- if (log.isDebugEnabled())
- log.debug("Finished waiting on local exchange: " + fut.exchangeId());
}
/** {@inheritDoc} */
@Override protected void onKernalStop0(boolean cancel) {
+ cctx.gridEvents().removeLocalEventListener(discoLsnr);
+
+ cctx.io().removeHandler(0, GridDhtPartitionsSingleMessage.class);
+ cctx.io().removeHandler(0, GridDhtPartitionsFullMessage.class);
+ cctx.io().removeHandler(0, GridDhtPartitionsSingleRequest.class);
+
+ IgniteCheckedException err = cctx.kernalContext().clientDisconnected() ?
+ new IgniteClientDisconnectedCheckedException(cctx.kernalContext().cluster().clientReconnectFuture(),
+ "Client node disconnected: " + cctx.gridName()) :
+ new IgniteInterruptedCheckedException("Node is stopping: " + cctx.gridName());
+
// Finish all exchange futures.
- for (GridDhtPartitionsExchangeFuture f : exchFuts.values())
- f.onDone(new IgniteInterruptedCheckedException("Grid is stopping: " + cctx.gridName()));
+ ExchangeFutureSet exchFuts0 = exchFuts;
+
+ if (exchFuts0 != null) {
+ for (GridDhtPartitionsExchangeFuture f : exchFuts.values())
+ f.onDone(err);
+ }
for (AffinityReadyFuture f : readyFuts.values())
- f.onDone(new IgniteInterruptedCheckedException("Grid is stopping: " + cctx.gridName()));
+ f.onDone(err);
U.cancel(exchWorker);
@@ -634,7 +674,7 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
node.id() + ", msg=" + m + ']');
}
catch (IgniteCheckedException e) {
- U.error(log, "Failed to send partitions full message [node=" + node + ']', e);
+ U.warn(log, "Failed to send partitions full message [node=" + node + ", err=" + e + ']');
}
}
@@ -1097,6 +1137,9 @@ public class GridCachePartitionExchangeManager<K, V> extends GridCacheSharedMana
catch (IgniteInterruptedCheckedException e) {
throw e;
}
+ catch (IgniteClientDisconnectedCheckedException e) {
+ return;
+ }
catch (IgniteCheckedException e) {
U.error(log, "Failed to wait for completion of partition map exchange " +
"(preloading will not start): " + exchFut, e);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java
index e0f6181..b8bb08e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloader.java
@@ -56,6 +56,11 @@ public interface GridCachePreloader {
public void onKernalStop();
/**
+ * Client reconnected callback.
+ */
+ public void onReconnected();
+
+ /**
* Callback by exchange manager when initial partition exchange is complete.
*
* @param err Error, if any happened on initial exchange.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java
index b4f386f..0adf510 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCachePreloaderAdapter.java
@@ -87,6 +87,11 @@ public class GridCachePreloaderAdapter implements GridCachePreloader {
}
/** {@inheritDoc} */
+ @Override public void onReconnected() {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
@Override public void preloadPredicate(IgnitePredicate<GridCacheEntryInfo> preloadPred) {
this.preloadPred = preloadPred;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index bb87a86..bda0485 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -127,6 +127,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
/** Count down latch for caches. */
private final CountDownLatch cacheStartedLatch = new CountDownLatch(1);
+ /** */
+ private Map<String, DynamicCacheDescriptor> cachesOnDisconnect;
+
/**
* @param ctx Kernal context.
*/
@@ -704,7 +707,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
});
for (GridCacheSharedManager<?, ?> mgr : sharedCtx.managers())
- mgr.onKernalStart();
+ mgr.onKernalStart(false);
for (GridCacheAdapter<?, ?> cache : caches.values())
onKernalStart(cache);
@@ -796,7 +799,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
// Must call onKernalStart on shared managers after creation of fetched caches.
for (GridCacheSharedManager<?, ?> mgr : sharedCtx.managers())
- mgr.onKernalStart();
+ mgr.onKernalStart(false);
for (Map.Entry<String, GridCacheAdapter<?, ?>> e : caches.entrySet()) {
GridCacheAdapter cache = e.getValue();
@@ -911,6 +914,90 @@ public class GridCacheProcessor extends GridProcessorAdapter {
}
}
+ /** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException {
+ cachesOnDisconnect = new HashMap<>(registeredCaches);
+
+ IgniteClientDisconnectedCheckedException err = new IgniteClientDisconnectedCheckedException(
+ ctx.cluster().clientReconnectFuture(),
+ "Failed to execute dynamic cache change request, client node disconnected.");
+
+ for (IgniteInternalFuture fut : pendingFuts.values())
+ ((GridFutureAdapter)fut).onDone(err);
+
+ for (IgniteInternalFuture fut : pendingTemplateFuts.values())
+ ((GridFutureAdapter)fut).onDone(err);
+
+ for (GridCacheAdapter cache : caches.values()) {
+ GridCacheContext cctx = cache.context();
+
+ cctx.gate().onDisconnected(reconnectFut);
+
+ List<GridCacheManager> mgrs = cache.context().managers();
+
+ for (ListIterator<GridCacheManager> it = mgrs.listIterator(mgrs.size()); it.hasPrevious();) {
+ GridCacheManager mgr = it.previous();
+
+ mgr.onDisconnected(reconnectFut);
+ }
+ }
+
+ sharedCtx.onDisconnected(reconnectFut);
+
+ registeredCaches.clear();
+
+ registeredTemplates.clear();
+ }
+
+ /** {@inheritDoc} */
+ @Override public void onReconnected(boolean clusterRestarted) throws IgniteCheckedException {
+ List<GridCacheAdapter> reconnected = new ArrayList<>(caches.size());
+
+ for (GridCacheAdapter cache : caches.values()) {
+ String name = cache.name();
+
+ boolean stopped;
+
+ boolean sysCache = CU.isMarshallerCache(name) || CU.isUtilityCache(name) || CU.isAtomicsCache(name);
+
+ if (!sysCache) {
+ DynamicCacheDescriptor oldDesc = cachesOnDisconnect.get(maskNull(name));
+
+ assert oldDesc != null : "No descriptor for cache: " + name;
+
+ DynamicCacheDescriptor newDesc = registeredCaches.get(maskNull(name));
+
+ stopped = newDesc == null || !oldDesc.deploymentId().equals(newDesc.deploymentId());
+ }
+ else
+ stopped = false;
+
+ if (stopped) {
+ cache.context().gate().reconnected(true);
+
+ sharedCtx.removeCacheContext(cache.ctx);
+
+ caches.remove(maskNull(cache.name()));
+ jCacheProxies.remove(maskNull(cache.name()));
+
+ onKernalStop(cache, true);
+ stopCache(cache, true);
+ }
+ else {
+ cache.onReconnected();
+
+ reconnected.add(cache);
+ }
+ }
+
+ sharedCtx.onReconnected();
+
+ for (GridCacheAdapter cache : reconnected)
+ cache.context().gate().reconnected(false);
+
+ cachesOnDisconnect = null;
+ }
+
/**
* @param cache Cache to start.
* @throws IgniteCheckedException If failed to start cache.
@@ -1529,7 +1616,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (proxy != null) {
if (req.stop())
- proxy.gate().block();
+ proxy.gate().stopped();
else
proxy.closeProxy();
}
@@ -1673,8 +1760,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
depMgr,
exchMgr,
ioMgr,
- storeSesLsnrs,
- jta
+ jta,
+ storeSesLsnrs
);
}
@@ -1689,7 +1776,11 @@ public class GridCacheProcessor extends GridProcessorAdapter {
Collection<DynamicCacheChangeRequest> reqs =
new ArrayList<>(registeredCaches.size() + registeredTemplates.size());
- for (DynamicCacheDescriptor desc : registeredCaches.values()) {
+ boolean reconnect = ctx.localNodeId().equals(nodeId) && cachesOnDisconnect != null;
+
+ Map<String, DynamicCacheDescriptor> descs = reconnect ? cachesOnDisconnect : registeredCaches;
+
+ for (DynamicCacheDescriptor desc : descs.values()) {
if (!desc.cancelled()) {
DynamicCacheChangeRequest req = new DynamicCacheChangeRequest(desc.cacheConfiguration().getName(), null);
@@ -1717,7 +1808,25 @@ public class GridCacheProcessor extends GridProcessorAdapter {
DynamicCacheChangeBatch req = new DynamicCacheChangeBatch(reqs);
- req.clientNodes(ctx.discovery().clientNodesMap());
+ Map<String, Map<UUID, Boolean>> clientNodesMap = ctx.discovery().clientNodesMap();
+
+ if (reconnect) {
+ clientNodesMap = U.newHashMap(caches.size());
+
+ for (GridCacheAdapter<?, ?> cache : caches.values()) {
+ Boolean nearEnabled = cache.isNear();
+
+ Map<UUID, Boolean> map = U.newHashMap(1);
+
+ map.put(nodeId, nearEnabled);
+
+ clientNodesMap.put(cache.name(), map);
+ }
+ }
+
+ req.clientNodes(clientNodesMap);
+
+ req.clientReconnect(reconnect);
return req;
}
@@ -1727,38 +1836,86 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (data instanceof DynamicCacheChangeBatch) {
DynamicCacheChangeBatch batch = (DynamicCacheChangeBatch)data;
- for (DynamicCacheChangeRequest req : batch.requests()) {
- if (req.template()) {
- CacheConfiguration ccfg = req.startCacheConfiguration();
+ if (batch.clientReconnect()) {
+ for (DynamicCacheChangeRequest req : batch.requests()) {
+ assert !req.template() : req;
- assert ccfg != null : req;
+ String name = req.cacheName();
- DynamicCacheDescriptor existing = registeredTemplates.get(maskNull(req.cacheName()));
+ boolean sysCache = CU.isMarshallerCache(name) || CU.isUtilityCache(name) || CU.isAtomicsCache(name);
- if (existing == null) {
- DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
- ctx,
- ccfg,
- req.cacheType(),
- true,
- req.deploymentId());
+ if (!sysCache) {
+ DynamicCacheDescriptor desc = registeredCaches.get(maskNull(req.cacheName()));
- registeredTemplates.put(maskNull(req.cacheName()), desc);
- }
+ if (desc != null && !desc.cancelled() && desc.deploymentId().equals(req.deploymentId())) {
+ Map<UUID, Boolean> nodes = batch.clientNodes().get(name);
- continue;
+ assert nodes != null : req;
+ assert nodes.containsKey(joiningNodeId) : nodes;
+
+ ctx.discovery().addClientNode(req.cacheName(), joiningNodeId, nodes.get(joiningNodeId));
+ }
+ }
+ else
+ ctx.discovery().addClientNode(req.cacheName(), joiningNodeId, false);
}
+ }
+ else {
+ for (DynamicCacheChangeRequest req : batch.requests()) {
+ if (req.template()) {
+ CacheConfiguration ccfg = req.startCacheConfiguration();
- DynamicCacheDescriptor existing = registeredCaches.get(maskNull(req.cacheName()));
+ assert ccfg != null : req;
- if (req.start() && !req.clientStartOnly()) {
- CacheConfiguration ccfg = req.startCacheConfiguration();
+ DynamicCacheDescriptor existing = registeredTemplates.get(maskNull(req.cacheName()));
- if (existing != null) {
- if (existing.locallyConfigured()) {
- existing.deploymentId(req.deploymentId());
+ if (existing == null) {
+ DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
+ ctx,
+ ccfg,
+ req.cacheType(),
+ true,
+ req.deploymentId());
+
+ registeredTemplates.put(maskNull(req.cacheName()), desc);
+ }
+
+ continue;
+ }
- existing.addRemoteConfiguration(rmtNodeId, req.startCacheConfiguration());
+ DynamicCacheDescriptor existing = registeredCaches.get(maskNull(req.cacheName()));
+
+ if (req.start() && !req.clientStartOnly()) {
+ CacheConfiguration ccfg = req.startCacheConfiguration();
+
+ if (existing != null) {
+ if (existing.locallyConfigured()) {
+ existing.deploymentId(req.deploymentId());
+
+ existing.addRemoteConfiguration(rmtNodeId, req.startCacheConfiguration());
+
+ ctx.discovery().setCacheFilter(
+ req.cacheName(),
+ ccfg.getNodeFilter(),
+ ccfg.getNearConfiguration() != null,
+ ccfg.getCacheMode() == LOCAL);
+ }
+ }
+ else {
+ assert req.cacheType() != null : req;
+
+ DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
+ ctx,
+ ccfg,
+ req.cacheType(),
+ false,
+ req.deploymentId());
+
+ // Received statically configured cache.
+ if (req.initiatingNodeId() == null)
+ desc.staticallyConfigured(true);
+
+ registeredCaches.put(maskNull(req.cacheName()), desc);
ctx.discovery().setCacheFilter(
req.cacheName(),
@@ -1767,37 +1924,15 @@ public class GridCacheProcessor extends GridProcessorAdapter {
ccfg.getCacheMode() == LOCAL);
}
}
- else {
- assert req.cacheType() != null : req;
-
- DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
- ctx,
- ccfg,
- req.cacheType(),
- false,
- req.deploymentId());
-
- // Received statically configured cache.
- if (req.initiatingNodeId() == null)
- desc.staticallyConfigured(true);
-
- registeredCaches.put(maskNull(req.cacheName()), desc);
-
- ctx.discovery().setCacheFilter(
- req.cacheName(),
- ccfg.getNodeFilter(),
- ccfg.getNearConfiguration() != null,
- ccfg.getCacheMode() == LOCAL);
- }
}
- }
- if (!F.isEmpty(batch.clientNodes())) {
- for (Map.Entry<String, Map<UUID, Boolean>> entry : batch.clientNodes().entrySet()) {
- String cacheName = entry.getKey();
+ if (!F.isEmpty(batch.clientNodes())) {
+ for (Map.Entry<String, Map<UUID, Boolean>> entry : batch.clientNodes().entrySet()) {
+ String cacheName = entry.getKey();
- for (Map.Entry<UUID, Boolean> tup : entry.getValue().entrySet())
- ctx.discovery().addClientNode(cacheName, tup.getKey(), tup.getValue());
+ for (Map.Entry<UUID, Boolean> tup : entry.getValue().entrySet())
+ ctx.discovery().addClientNode(cacheName, tup.getKey(), tup.getValue());
+ }
}
}
}
@@ -2152,8 +2287,25 @@ public class GridCacheProcessor extends GridProcessorAdapter {
}
}
- if (!sndReqs.isEmpty())
- ctx.discovery().sendCustomEvent(new DynamicCacheChangeBatch(sndReqs));
+ Exception err = null;
+
+ if (!sndReqs.isEmpty()) {
+ try {
+ ctx.discovery().sendCustomEvent(new DynamicCacheChangeBatch(sndReqs));
+
+ if (ctx.clientDisconnected())
+ err = new IgniteClientDisconnectedCheckedException(ctx.cluster().clientReconnectFuture(),
+ "Failed to execute dynamic cache change request, client node disconnected.");
+ }
+ catch (IgniteCheckedException e) {
+ err = e;
+ }
+ }
+
+ if (err != null) {
+ for (DynamicCacheStartFuture fut : res)
+ fut.onDone(err);
+ }
return res;
}
@@ -2666,8 +2818,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
*
* @return Utility cache.
*/
- public <K, V> GridCacheAdapter<K, V> utilityCache() {
- return internalCache(CU.UTILITY_CACHE_NAME);
+ public <K, V> IgniteInternalCache<K, V> utilityCache() {
+ return internalCacheEx(CU.UTILITY_CACHE_NAME);
}
/**
@@ -2676,7 +2828,23 @@ public class GridCacheProcessor extends GridProcessorAdapter {
* @return Utility cache for atomic data structures.
*/
public <K, V> IgniteInternalCache<K, V> atomicsCache() {
- return cache(CU.ATOMICS_CACHE_NAME);
+ return internalCacheEx(CU.ATOMICS_CACHE_NAME);
+ }
+
+ /**
+ * @param name Cache name.
+ * @return Cache.
+ */
+ private <K, V> IgniteInternalCache<K, V> internalCacheEx(String name) {
+ if (ctx.discovery().localNode().isClient()) {
+ IgniteCacheProxy<K, V> proxy = (IgniteCacheProxy<K, V>)jCacheProxies.get(name);
+
+ assert proxy != null;
+
+ return proxy.internalProxy();
+ }
+
+ return internalCache(name);
}
/**
@@ -2796,7 +2964,21 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (old != null)
fut = old;
- ctx.discovery().sendCustomEvent(new DynamicCacheChangeBatch(Collections.singleton(req)));
+ Exception err = null;
+
+ try {
+ ctx.discovery().sendCustomEvent(new DynamicCacheChangeBatch(Collections.singleton(req)));
+
+ if (ctx.clientDisconnected())
+ err = new IgniteClientDisconnectedCheckedException(ctx.cluster().clientReconnectFuture(),
+ "Failed to execute dynamic cache change request, client node disconnected.");
+ }
+ catch (IgniteCheckedException e) {
+ err = e;
+ }
+
+ if (err != null)
+ fut.onDone(err);
fut.get();
}
@@ -2856,8 +3038,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
* Cancel all user operations.
*/
public void cancelUserOperations() {
- for (GridCacheAdapter<?, ?> cache : caches.values())
- cache.ctx.mvcc().cancelClientFutures();
+ sharedCtx.mvcc().cancelClientFutures();
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
index 7f4daff..4075d79 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java
@@ -35,6 +35,7 @@ import org.apache.ignite.internal.processors.timeout.*;
import org.apache.ignite.internal.util.future.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.lang.*;
import org.apache.ignite.marshaller.*;
import org.jetbrains.annotations.*;
@@ -86,9 +87,15 @@ public class GridCacheSharedContext<K, V> {
private Collection<CacheStoreSessionListener> storeSesLsnrs;
/**
+ * @param kernalCtx Context.
* @param txMgr Transaction manager.
* @param verMgr Version manager.
* @param mvccMgr MVCC manager.
+ * @param depMgr Deployment manager.
+ * @param exchMgr Exchange manager.
+ * @param ioMgr IO manager.
+ * @param jtaMgr JTA manager.
+ * @param storeSesLsnrs Store session listeners.
*/
public GridCacheSharedContext(
GridKernalContext kernalCtx,
@@ -98,17 +105,13 @@ public class GridCacheSharedContext<K, V> {
GridCacheDeploymentManager<K, V> depMgr,
GridCachePartitionExchangeManager<K, V> exchMgr,
GridCacheIoManager ioMgr,
- Collection<CacheStoreSessionListener> storeSesLsnrs,
- CacheJtaManagerAdapter jtaMgr
+ CacheJtaManagerAdapter jtaMgr,
+ Collection<CacheStoreSessionListener> storeSesLsnrs
) {
this.kernalCtx = kernalCtx;
- this.mvccMgr = add(mvccMgr);
- this.verMgr = add(verMgr);
- this.txMgr = add(txMgr);
- this.jtaMgr = add(jtaMgr);
- this.depMgr = add(depMgr);
- this.exchMgr = add(exchMgr);
- this.ioMgr = add(ioMgr);
+
+ setManagers(mgrs, txMgr, jtaMgr, verMgr, mvccMgr, depMgr, exchMgr, ioMgr);
+
this.storeSesLsnrs = storeSesLsnrs;
txMetrics = new TransactionMetricsAdapter();
@@ -117,6 +120,89 @@ public class GridCacheSharedContext<K, V> {
}
/**
+ * @param reconnectFut Reconnect future.
+ * @throws IgniteCheckedException If failed.
+ */
+ void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException {
+ for (ListIterator<? extends GridCacheSharedManager<?, ?>> it = mgrs.listIterator(mgrs.size());
+ it.hasPrevious();) {
+ GridCacheSharedManager<?, ?> mgr = it.previous();
+
+ mgr.onDisconnected(reconnectFut);
+
+ if (restartOnDisconnect(mgr))
+ mgr.onKernalStop(true);
+ }
+
+ for (ListIterator<? extends GridCacheSharedManager<?, ?>> it = mgrs.listIterator(mgrs.size()); it.hasPrevious();) {
+ GridCacheSharedManager<?, ?> mgr = it.previous();
+
+ if (restartOnDisconnect(mgr))
+ mgr.stop(true);
+ }
+ }
+
+ /**
+ * @throws IgniteCheckedException If failed.
+ */
+ void onReconnected() throws IgniteCheckedException {
+ List<GridCacheSharedManager<K, V>> mgrs = new LinkedList<>();
+
+ setManagers(mgrs, txMgr,
+ jtaMgr,
+ verMgr,
+ mvccMgr,
+ new GridCacheDeploymentManager<K, V>(),
+ new GridCachePartitionExchangeManager<K, V>(),
+ ioMgr);
+
+ this.mgrs = mgrs;
+
+ for (GridCacheSharedManager<K, V> mgr : mgrs) {
+ if (restartOnDisconnect(mgr))
+ mgr.start(this);
+ }
+
+ for (GridCacheSharedManager<?, ?> mgr : mgrs)
+ mgr.onKernalStart(true);
+ }
+
+ /**
+ * @param mgr Manager.
+ * @return {@code True} if manager is restarted cn reconnect.
+ */
+ private boolean restartOnDisconnect(GridCacheSharedManager<?, ?> mgr) {
+ return mgr instanceof GridCacheDeploymentManager || mgr instanceof GridCachePartitionExchangeManager;
+ }
+
+ /**
+ * @param mgrs Managers list.
+ * @param txMgr Transaction manager.
+ * @param verMgr Version manager.
+ * @param mvccMgr MVCC manager.
+ * @param depMgr Deployment manager.
+ * @param exchMgr Exchange manager.
+ * @param ioMgr IO manager.
+ * @param jtaMgr JTA manager.
+ */
+ private void setManagers(List<GridCacheSharedManager<K, V>> mgrs,
+ IgniteTxManager txMgr,
+ CacheJtaManagerAdapter jtaMgr,
+ GridCacheVersionManager verMgr,
+ GridCacheMvccManager mvccMgr,
+ GridCacheDeploymentManager<K, V> depMgr,
+ GridCachePartitionExchangeManager<K, V> exchMgr,
+ GridCacheIoManager ioMgr) {
+ this.mvccMgr = add(mgrs, mvccMgr);
+ this.verMgr = add(mgrs, verMgr);
+ this.txMgr = add(mgrs, txMgr);
+ this.jtaMgr = add(mgrs, jtaMgr);
+ this.depMgr = add(mgrs, depMgr);
+ this.exchMgr = add(mgrs, exchMgr);
+ this.ioMgr = add(mgrs, ioMgr);
+ }
+
+ /**
* Gets all cache contexts for local node.
*
* @return Collection of all cache contexts.
@@ -136,6 +222,7 @@ public class GridCacheSharedContext<K, V> {
* Adds cache context to shared cache context.
*
* @param cacheCtx Cache context to add.
+ * @throws IgniteCheckedException If cache ID conflict detected.
*/
@SuppressWarnings("unchecked")
public void addCacheContext(GridCacheContext cacheCtx) throws IgniteCheckedException {
@@ -230,7 +317,7 @@ public class GridCacheSharedContext<K, V> {
*/
public byte dataCenterId() {
// Data center ID is same for all caches, so grab the first one.
- GridCacheContext<K, V> cacheCtx = F.first(cacheContexts());
+ GridCacheContext<?, ?> cacheCtx = F.first(cacheContexts());
return cacheCtx.dataCenterId();
}
@@ -242,7 +329,7 @@ public class GridCacheSharedContext<K, V> {
if (preloadersStartFut == null) {
GridCompoundFuture<Object, Object> compound = null;
- for (GridCacheContext<K, V> cacheCtx : cacheContexts()) {
+ for (GridCacheContext<?, ?> cacheCtx : cacheContexts()) {
IgniteInternalFuture<Object> startFut = cacheCtx.preloader().startFuture();
if (!startFut.isDone()) {
@@ -551,10 +638,12 @@ public class GridCacheSharedContext<K, V> {
}
/**
+ * @param mgrs Managers list.
* @param mgr Manager to add.
* @return Added manager.
*/
- @Nullable private <T extends GridCacheSharedManager<K, V>> T add(@Nullable T mgr) {
+ @Nullable private <T extends GridCacheSharedManager<K, V>> T add(List<GridCacheSharedManager<K, V>> mgrs,
+ @Nullable T mgr) {
if (mgr != null)
mgrs.add(mgr);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManager.java
index d45052c..668bd00 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManager.java
@@ -18,11 +18,12 @@
package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
+import org.apache.ignite.lang.*;
/**
* Cache manager shared across all caches.
*/
-public interface GridCacheSharedManager <K, V> {
+public interface GridCacheSharedManager<K, V> {
/**
* Starts manager.
*
@@ -39,9 +40,10 @@ public interface GridCacheSharedManager <K, V> {
public void stop(boolean cancel);
/**
+ * @param reconnect {@code True} if manager restarted after client reconnect.
* @throws IgniteCheckedException If failed.
*/
- public void onKernalStart() throws IgniteCheckedException;
+ public void onKernalStart(boolean reconnect) throws IgniteCheckedException;
/**
* @param cancel Cancel flag.
@@ -49,6 +51,11 @@ public interface GridCacheSharedManager <K, V> {
public void onKernalStop(boolean cancel);
/**
+ * @param reconnectFut Reconnect future.
+ */
+ public void onDisconnected(IgniteFuture<?> reconnectFut);
+
+ /**
* Prints memory statistics (sizes of internal data structures, etc.).
*
* NOTE: this method is for testing and profiling purposes only.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManagerAdapter.java
index 2cf7051..6ad76ca 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedManagerAdapter.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
import java.util.concurrent.atomic.*;
@@ -35,6 +36,9 @@ public class GridCacheSharedManagerAdapter<K, V> implements GridCacheSharedManag
/** Starting flag. */
private final AtomicBoolean starting = new AtomicBoolean(false);
+ /** */
+ private final AtomicBoolean stop = new AtomicBoolean(false);
+
/** {@inheritDoc} */
@Override public final void start(GridCacheSharedContext<K, V> cctx) throws IgniteCheckedException {
if (!starting.compareAndSet(false, true))
@@ -75,7 +79,7 @@ public class GridCacheSharedManagerAdapter<K, V> implements GridCacheSharedManag
/** {@inheritDoc} */
@Override public final void stop(boolean cancel) {
- if (!starting.get())
+ if (!starting.get() || !stop.compareAndSet(false, true))
// Ignoring attempt to stop manager that has never been started.
return;
@@ -93,10 +97,10 @@ public class GridCacheSharedManagerAdapter<K, V> implements GridCacheSharedManag
}
/** {@inheritDoc} */
- @Override public final void onKernalStart() throws IgniteCheckedException {
- onKernalStart0();
+ @Override public final void onKernalStart(boolean reconnect) throws IgniteCheckedException {
+ onKernalStart0(reconnect);
- if (log != null && log.isDebugEnabled())
+ if (!reconnect && log != null && log.isDebugEnabled())
log.debug(kernalStartInfo());
}
@@ -113,9 +117,10 @@ public class GridCacheSharedManagerAdapter<K, V> implements GridCacheSharedManag
}
/**
+ * @param reconnect {@code True} if manager restarted after client reconnect.
* @throws IgniteCheckedException If failed.
*/
- protected void onKernalStart0() throws IgniteCheckedException {
+ protected void onKernalStart0(boolean reconnect) throws IgniteCheckedException {
// No-op.
}
@@ -127,6 +132,11 @@ public class GridCacheSharedManagerAdapter<K, V> implements GridCacheSharedManag
}
/** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
@Override public void printMemoryStats() {
// No-op.
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/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 f88e288..bd2623d 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
@@ -1560,6 +1560,17 @@ public class GridCacheUtils {
* @return CacheException runtime exception, never null.
*/
@NotNull public static RuntimeException convertToCacheException(IgniteCheckedException e) {
+ IgniteClientDisconnectedCheckedException disconnectedErr =
+ e instanceof IgniteClientDisconnectedCheckedException ?
+ (IgniteClientDisconnectedCheckedException)e
+ : e.getCause(IgniteClientDisconnectedCheckedException.class);
+
+ if (disconnectedErr != null) {
+ assert disconnectedErr.reconnectFuture() != null : disconnectedErr;
+
+ e = disconnectedErr;
+ }
+
if (e.hasCause(CacheWriterException.class))
return new CacheWriterException(U.convertExceptionNoWrap(e));
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheFutureImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheFutureImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheFutureImpl.java
index 42e31d2..9233f24 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheFutureImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheFutureImpl.java
@@ -43,6 +43,11 @@ public class IgniteCacheFutureImpl<V> extends IgniteFutureImpl<V> {
/** {@inheritDoc} */
@Override protected RuntimeException convertException(IgniteCheckedException e) {
+ if (e instanceof IgniteFutureCancelledCheckedException ||
+ e instanceof IgniteInterruptedCheckedException ||
+ e instanceof IgniteFutureTimeoutCheckedException)
+ return U.convertException(e);
+
return CU.convertToCacheException(e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index bb7714a..0b2eba0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -1751,7 +1751,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
assert false;
}
- @Override public void block() {
+ @Override public void stopped() {
// No-op.
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
index b5c5161..78bd0eb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
@@ -106,6 +106,41 @@ public class CacheDataStructuresManager extends GridCacheManagerAdapter {
}
/**
+ * @param set Set.
+ */
+ public void onRemoved(GridCacheSetProxy set) {
+ setsMap.remove(set.delegate().id(), set);
+ }
+
+ /**
+ * @param clusterRestarted Cluster restarted flag.
+ * @throws IgniteCheckedException If failed.
+ */
+ public void onReconnected(boolean clusterRestarted) throws IgniteCheckedException {
+ for (Map.Entry<IgniteUuid, GridCacheSetProxy> e : setsMap.entrySet()) {
+ GridCacheSetProxy set = e.getValue();
+
+ if (clusterRestarted) {
+ set.blockOnRemove();
+
+ setsMap.remove(e.getKey(), set);
+ }
+ else
+ set.needCheckNotRemoved();
+ }
+
+ for (Map.Entry<IgniteUuid, GridCacheQueueProxy> e : queuesMap.entrySet()) {
+ GridCacheQueueProxy queue = e.getValue();
+
+ if (clusterRestarted) {
+ queue.delegate().onRemoved(false);
+
+ queuesMap.remove(e.getKey(), queue);
+ }
+ }
+ }
+
+ /**
* @throws IgniteCheckedException If thread is interrupted or manager
* was not successfully initialized.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxFinishSync.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxFinishSync.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxFinishSync.java
index 2838838..0b351b7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxFinishSync.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheTxFinishSync.java
@@ -22,6 +22,7 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.util.future.*;
import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.lang.*;
import org.jetbrains.annotations.*;
import org.jsr166.*;
@@ -81,6 +82,16 @@ public class GridCacheTxFinishSync<K, V> {
}
/**
+ * @param reconnectFut Reconnect future.
+ */
+ public void onDisconnected(IgniteFuture<?> reconnectFut) {
+ for (ThreadFinishSync threadSync : threadMap.values())
+ threadSync.onDisconnected(reconnectFut);
+
+ threadMap.clear();
+ }
+
+ /**
* Callback invoked when finish response is received from remote node.
*
* @param nodeId Node ID response was received from.
@@ -139,6 +150,11 @@ public class GridCacheTxFinishSync<K, V> {
nodeMap.remove(nodeId);
}
+ else if (cctx.kernalContext().clientDisconnected()) {
+ sync.onDisconnected(cctx.kernalContext().cluster().clientReconnectFuture());
+
+ nodeMap.remove(nodeId);
+ }
}
sync.onSend();
@@ -160,6 +176,16 @@ public class GridCacheTxFinishSync<K, V> {
}
/**
+ * @param reconnectFut Reconnect future.
+ */
+ public void onDisconnected(IgniteFuture<?> reconnectFut) {
+ for (TxFinishSync sync : nodeMap.values())
+ sync.onDisconnected(reconnectFut);
+
+ nodeMap.clear();
+ }
+
+ /**
* @param nodeId Node ID response received from.
*/
public void onReceive(UUID nodeId) {
@@ -288,5 +314,25 @@ public class GridCacheTxFinishSync<K, V> {
}
}
}
+
+ /**
+ * Client disconnected callback.
+ *
+ * @param reconnectFut Reconnect future.
+ */
+ public void onDisconnected(IgniteFuture<?> reconnectFut) {
+ synchronized (this) {
+ nodeLeft = true;
+
+ if (pendingFut != null) {
+ IgniteClientDisconnectedCheckedException err = new IgniteClientDisconnectedCheckedException(
+ reconnectFut,
+ "Failed to wait for transaction synchronizer, client node disconnected: " + nodeId);
+ pendingFut.onDone(err);
+
+ pendingFut = null;
+ }
+ }
+ }
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index adea9e0..22a5287 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -51,7 +51,7 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
private static final long serialVersionUID = 0L;
/** Topology. */
- private GridDhtPartitionTopology top;
+ private GridDhtPartitionTopologyImpl top;
/** Preloader. */
protected GridCachePreloader preldr;
@@ -134,6 +134,18 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
}
/** {@inheritDoc} */
+ @Override public void onReconnected() {
+ super.onReconnected();
+
+ ctx.affinity().onReconnected();
+
+ top.onReconnected();
+
+ if (preldr != null)
+ preldr.onReconnected();
+ }
+
+ /** {@inheritDoc} */
@Override public void onKernalStart() throws IgniteCheckedException {
super.onKernalStart();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
index de7f876..facf329 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionTopologyImpl.java
@@ -94,6 +94,30 @@ class GridDhtPartitionTopologyImpl implements GridDhtPartitionTopology {
}
/**
+ *
+ */
+ public void onReconnected() {
+ lock.writeLock().lock();
+
+ try {
+ node2part = null;
+
+ part2node = new HashMap<>();
+
+ lastExchangeId = null;
+
+ updateSeq.set(1);
+
+ topReadyFut = null;
+
+ topVer = AffinityTopologyVersion.NONE;
+ }
+ finally {
+ lock.writeLock().unlock();
+ }
+ }
+
+ /**
* @return Full map string representation.
*/
@SuppressWarnings( {"ConstantConditions"})
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
index 79d5e75..bb3673d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
@@ -639,10 +639,17 @@ public class GridPartitionedGetFuture<K, V> extends GridCompoundIdentityFuture<M
if (timeout.finish()) {
cctx.kernalContext().timeout().removeTimeoutObject(timeout);
- // Remap.
- map(keys.keySet(), F.t(node, keys), updTopVer);
+ try {
+ fut.get();
- onDone(Collections.<K, V>emptyMap());
+ // Remap.
+ map(keys.keySet(), F.t(node, keys), updTopVer);
+
+ onDone(Collections.<K, V>emptyMap());
+ }
+ catch (IgniteCheckedException e) {
+ GridPartitionedGetFuture.this.onDone(e);
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index 0355bb3..a43ebe2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -67,7 +67,7 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
private GridDhtPartitionDemandPool demandPool;
/** Start future. */
- private final GridFutureAdapter<Object> startFut;
+ private GridFutureAdapter<Object> startFut;
/** Busy lock to prevent activities from accessing exchanger while it's stopping. */
private final ReadWriteLock busyLock = new ReentrantReadWriteLock();
@@ -180,13 +180,6 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
topVer.setIfGreater(startTopVer);
- // Generate dummy discovery event for local node joining.
- DiscoveryEvent discoEvt = cctx.discovery().localJoinEvent();
-
- assert discoEvt != null;
-
- assert discoEvt.topologyVersion() == startTopVer;
-
supplyPool.start();
demandPool.start();
}
@@ -230,7 +223,7 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
final CacheConfiguration cfg = cctx.config();
- if (cfg.getRebalanceDelay() >= 0) {
+ if (cfg.getRebalanceDelay() >= 0 && !cctx.kernalContext().clientNode()) {
U.log(log, "Starting rebalancing in " + cfg.getRebalanceMode() + " mode: " + cctx.name());
demandPool.syncFuture().listen(new CI1<Object>() {
@@ -246,6 +239,11 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
}
/** {@inheritDoc} */
+ @Override public void onReconnected() {
+ startFut = new GridFutureAdapter<>();
+ }
+
+ /** {@inheritDoc} */
@Override public void onExchangeFutureAdded() {
demandPool.onExchangeFutureAdded();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index 351d6cd..79b7c1a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -90,6 +90,14 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
public abstract GridDhtCacheAdapter<K, V> dht();
/** {@inheritDoc} */
+ @Override public void onReconnected() {
+ map = new GridCacheConcurrentMap(ctx,
+ ctx.config().getNearConfiguration().getNearStartSize(),
+ 0.75F,
+ map.getEntryFactory());
+ }
+
+ /** {@inheritDoc} */
@Override public boolean isNear() {
return true;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
index 58f6fe5..0691d39 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
@@ -764,10 +764,17 @@ public final class GridNearGetFuture<K, V> extends GridCompoundIdentityFuture<Ma
if (timeout.finish()) {
cctx.kernalContext().timeout().removeTimeoutObject(timeout);
- // Remap.
- map(keys.keySet(), F.t(node, keys), updTopVer);
+ try {
+ fut.get();
- onDone(Collections.<K, V>emptyMap());
+ // Remap.
+ map(keys.keySet(), F.t(node, keys), updTopVer);
+
+ onDone(Collections.<K, V>emptyMap());
+ }
+ catch (IgniteCheckedException e) {
+ GridNearGetFuture.this.onDone(e);
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/dr/GridOsCacheDrManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/dr/GridOsCacheDrManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/dr/GridOsCacheDrManager.java
index 00ed020..7f0a568 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/dr/GridOsCacheDrManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/dr/GridOsCacheDrManager.java
@@ -20,9 +20,9 @@ package org.apache.ignite.internal.processors.cache.dr;
import org.apache.ignite.*;
import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.*;
-import org.apache.ignite.internal.processors.cache.dr.*;
import org.apache.ignite.internal.processors.cache.version.*;
import org.apache.ignite.internal.processors.dr.*;
+import org.apache.ignite.lang.*;
import org.jetbrains.annotations.*;
/**
@@ -103,4 +103,9 @@ public class GridOsCacheDrManager implements GridCacheDrManager {
@Override public boolean receiveEnabled() {
return false;
}
+
+ /** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture reconnectFut) {
+ // No-op.
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
index 2b93144..316713f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
@@ -110,6 +110,20 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
}
/** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) {
+ IgniteClientDisconnectedCheckedException err = new IgniteClientDisconnectedCheckedException(reconnectFut,
+ "Query was cancelled, client node disconnected.");
+
+ for (Map.Entry<Long, GridCacheDistributedQueryFuture<?, ?, ?>> e : futs.entrySet()) {
+ GridCacheDistributedQueryFuture<?, ?, ?> fut = e.getValue();
+
+ fut.onPage(null, null, err, true);
+
+ futs.remove(e.getKey(), fut);
+ }
+ }
+
+ /** {@inheritDoc} */
@Override public void printMemoryStats() {
super.printMemoryStats();
@@ -125,6 +139,14 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
*/
protected void addQueryFuture(long reqId, GridCacheDistributedQueryFuture<?, ?, ?> fut) {
futs.put(reqId, fut);
+
+ if (cctx.kernalContext().clientDisconnected()) {
+ IgniteClientDisconnectedCheckedException err = new IgniteClientDisconnectedCheckedException(
+ cctx.kernalContext().cluster().clientReconnectFuture(),
+ "Query was cancelled, client node disconnected.");
+
+ fut.onDone(err);
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/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 c2425f0..953cb9a 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
@@ -578,6 +578,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
/**
* @param nodes Nodes.
+ * @return Nodes for query execution.
*/
private Queue<ClusterNode> fallbacks(Collection<ClusterNode> nodes) {
Queue<ClusterNode> fallbacks = new LinkedList<>();
@@ -595,18 +596,22 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
/**
*
*/
+ @SuppressWarnings("unchecked")
private void init() {
ClusterNode node = nodes.poll();
- GridCacheQueryFutureAdapter<?, ?, R> fut0 =
- (GridCacheQueryFutureAdapter<?, ?, R>)(node.isLocal() ? qryMgr.queryLocal(bean) :
- qryMgr.queryDistributed(bean, Collections.singleton(node)));
+ GridCacheQueryFutureAdapter<?, ?, R> fut0 = (GridCacheQueryFutureAdapter<?, ?, R>)(node.isLocal() ?
+ qryMgr.queryLocal(bean) :
+ qryMgr.queryDistributed(bean, Collections.singleton(node)));
fut0.listen(new IgniteInClosure<IgniteInternalFuture<Collection<R>>>() {
@Override public void apply(IgniteInternalFuture<Collection<R>> fut) {
try {
onDone(fut.get());
}
+ catch (IgniteClientDisconnectedCheckedException e) {
+ onDone(e);
+ }
catch (IgniteCheckedException e) {
if (F.isEmpty(nodes))
onDone(e);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
index a8bace0..53017c9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
@@ -163,7 +163,7 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
return null;
}
catch (IgniteCheckedException e) {
- throw new IgniteException(e);
+ throw CU.convertToCacheException(e);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
index e059760..879c30c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
@@ -396,6 +396,11 @@ class CacheContinuousQueryHandler<K, V> implements GridContinuousHandler {
}
/** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(CacheContinuousQueryHandler.class, this);
+ }
+
+ /** {@inheritDoc} */
@Override public void writeExternal(ObjectOutput out) throws IOException {
U.writeString(out, cacheName);
out.writeObject(topic);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java
index 99907e4..7d9bcf0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTransactionsImpl.java
@@ -140,32 +140,39 @@ public class IgniteTransactionsImpl<K, V> implements IgniteTransactionsEx {
@SuppressWarnings("unchecked")
private IgniteInternalTx txStart0(TransactionConcurrency concurrency, TransactionIsolation isolation,
long timeout, int txSize, @Nullable GridCacheContext sysCacheCtx) {
- TransactionConfiguration cfg = cctx.gridConfig().getTransactionConfiguration();
-
- if (!cfg.isTxSerializableEnabled() && isolation == SERIALIZABLE)
- throw new IllegalArgumentException("SERIALIZABLE isolation level is disabled (to enable change " +
- "'txSerializableEnabled' configuration property)");
-
- IgniteInternalTx tx = cctx.tm().userTx(sysCacheCtx);
-
- if (tx != null)
- throw new IllegalStateException("Failed to start new transaction " +
- "(current thread already has a transaction): " + tx);
-
- tx = cctx.tm().newTx(
- false,
- false,
- sysCacheCtx,
- concurrency,
- isolation,
- timeout,
- true,
- txSize
- );
-
- assert tx != null;
-
- return tx;
+ cctx.kernalContext().gateway().readLock();
+
+ try {
+ TransactionConfiguration cfg = cctx.gridConfig().getTransactionConfiguration();
+
+ if (!cfg.isTxSerializableEnabled() && isolation == SERIALIZABLE)
+ throw new IllegalArgumentException("SERIALIZABLE isolation level is disabled (to enable change " +
+ "'txSerializableEnabled' configuration property)");
+
+ IgniteInternalTx tx = cctx.tm().userTx(sysCacheCtx);
+
+ if (tx != null)
+ throw new IllegalStateException("Failed to start new transaction " +
+ "(current thread already has a transaction): " + tx);
+
+ tx = cctx.tm().newTx(
+ false,
+ false,
+ sysCacheCtx,
+ concurrency,
+ isolation,
+ timeout,
+ true,
+ txSize
+ );
+
+ assert tx != null;
+
+ return tx;
+ }
+ finally {
+ cctx.kernalContext().gateway().readUnlock();
+ }
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/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 b6c77f6..82543c2 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
@@ -115,7 +115,10 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
new ConcurrentHashMap8<>(5120);
/** {@inheritDoc} */
- @Override protected void onKernalStart0() {
+ @Override protected void onKernalStart0(boolean reconnect) {
+ if (reconnect)
+ return;
+
cctx.gridEvents().addLocalEventListener(
new GridLocalEventListener() {
@Override public void onEvent(Event evt) {
@@ -149,6 +152,14 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
txHandler = new IgniteTxHandler(cctx);
}
+ /** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture reconnectFut) {
+ txFinishSync.onDisconnected(reconnectFut);
+
+ for (Map.Entry<Long, IgniteInternalTx> e : threadMap.entrySet())
+ rollbackTx(e.getValue());
+ }
+
/**
* @return TX handler.
*/
@@ -764,11 +775,11 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
throw new IgniteTxTimeoutCheckedException("Transaction timed out: " + this);
}
- boolean txSerializableEnabled = cctx.txConfig().isTxSerializableEnabled();
+ boolean txSerEnabled = cctx.txConfig().isTxSerializableEnabled();
// Clean up committed transactions queue.
if (tx.pessimistic() && tx.local()) {
- if (tx.enforceSerializable() && txSerializableEnabled) {
+ if (tx.enforceSerializable() && txSerEnabled) {
for (Iterator<IgniteInternalTx> it = committedQ.iterator(); it.hasNext();) {
IgniteInternalTx committedTx = it.next();
@@ -784,7 +795,7 @@ public class IgniteTxManager extends GridCacheSharedManagerAdapter {
return;
}
- if (txSerializableEnabled && tx.optimistic() && tx.enforceSerializable()) {
+ if (txSerEnabled && tx.optimistic() && tx.enforceSerializable()) {
Set<IgniteTxKey> readSet = tx.readSet();
Set<IgniteTxKey> writeSet = tx.writeSet();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TransactionProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TransactionProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TransactionProxyImpl.java
index 5099b42..9346e43 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TransactionProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/TransactionProxyImpl.java
@@ -89,7 +89,7 @@ public class TransactionProxyImpl<K, V> implements TransactionProxy, Externaliza
try {
cctx.kernalContext().gateway().readLock();
}
- catch (IllegalStateException e) {
+ catch (IllegalStateException | IgniteClientDisconnectedException e) {
throw e;
}
catch (RuntimeException | Error e) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/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 c776361..90919c7 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
@@ -78,13 +78,6 @@ public class GridCacheVersionManager extends GridCacheSharedManagerAdapter {
}
};
- /**
- * @return Pre-generated UUID.
- */
- private IgniteUuid uuid() {
- return IgniteUuid.randomUuid();
- }
-
/** {@inheritDoc} */
@Override public void start0() throws IgniteCheckedException {
txSerEnabled = cctx.gridConfig().getTransactionConfiguration().isTxSerializableEnabled();
@@ -95,7 +88,7 @@ public class GridCacheVersionManager extends GridCacheSharedManagerAdapter {
}
/** {@inheritDoc} */
- @Override protected void onKernalStart0() throws IgniteCheckedException {
+ @Override protected void onKernalStart0(boolean reconnect) throws IgniteCheckedException {
for (ClusterNode n : cctx.discovery().remoteNodes())
onReceived(n.id(), n.metrics().getLastDataVersion());
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/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 2920176..3ac44f2 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
@@ -57,7 +57,7 @@ public class GridClockSyncProcessor extends GridProcessorAdapter {
/** Time coordinator thread. */
private volatile TimeCoordinator timeCoord;
- /** Time delta history. Constructed on coorinator. */
+ /** Time delta history. Constructed on coordinator. */
private NavigableMap<GridClockDeltaVersion, GridClockDeltaSnapshot> timeSyncHist =
new GridBoundedConcurrentOrderedMap<>(MAX_TIME_SYNC_HISTORY);
@@ -222,7 +222,7 @@ public class GridClockSyncProcessor extends GridProcessorAdapter {
minNodeOrder = node.order();
}
- ClusterNode locNode = ctx.grid().localNode();
+ ClusterNode locNode = ctx.discovery().localNode();
if (locNode.order() == minNodeOrder) {
if (log.isDebugEnabled())
@@ -295,7 +295,7 @@ public class GridClockSyncProcessor extends GridProcessorAdapter {
ctx.io().send(n, TOPIC_TIME_SYNC, msg, SYSTEM_POOL);
}
catch (IgniteCheckedException e) {
- if (ctx.discovery().pingNode(n.id()))
+ if (ctx.discovery().pingNodeNoError(n.id()))
U.error(log, "Failed to send time sync snapshot to remote node (did not leave grid?) " +
"[nodeId=" + n.id() + ", msg=" + msg + ", err=" + e.getMessage() + ']');
else if (log.isDebugEnabled())
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
index 0ee00f1..1f5589f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ClusterProcessor.java
@@ -20,6 +20,8 @@ package org.apache.ignite.internal.processors.cluster;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.cluster.*;
import org.apache.ignite.internal.processors.*;
+import org.apache.ignite.internal.util.future.*;
+import org.apache.ignite.lang.*;
/**
*
@@ -43,4 +45,13 @@ public class ClusterProcessor extends GridProcessorAdapter {
public IgniteClusterImpl get() {
return cluster;
}
+
+ /**
+ * @return Client reconnect future.
+ */
+ public IgniteFuture<?> clientReconnectFuture() {
+ IgniteFuture<?> fut = cluster.clientReconnectFuture();
+
+ return fut != null ? fut : new IgniteFinishedFutureImpl<>();
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousHandler.java
index ce9b7c0..79020da 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousHandler.java
@@ -33,7 +33,14 @@ public interface GridContinuousHandler extends Externalizable, Cloneable {
* Listener registration status.
*/
public enum RegisterStatus {
- REGISTERED, NOT_REGISTERED, DELAYED
+ /** */
+ REGISTERED,
+
+ /** */
+ NOT_REGISTERED,
+
+ /** */
+ DELAYED
}
/**
[10/50] [abbrv] incubator-ignite git commit: Fixed build.
Posted by av...@apache.org.
Fixed build.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ee8820a7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ee8820a7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ee8820a7
Branch: refs/heads/ignite-630
Commit: ee8820a7dee18759bd94a083e1359cf3ac7088f5
Parents: 8870668
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Mon Jul 13 13:47:02 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Mon Jul 13 13:47:02 2015 +0300
----------------------------------------------------------------------
modules/mesos/pom.xml | 1 -
modules/yarn/pom.xml | 1 -
2 files changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ee8820a7/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index 331083e..a8061ad 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -78,7 +78,6 @@
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
- <finalName>${project.artifactId}-${project.version}-full</finalName>
<archive>
<manifest>
<mainClass>org.apache.ignite.mesos.IgniteFramework</mainClass>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ee8820a7/modules/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yarn/pom.xml b/modules/yarn/pom.xml
index e87c7df..2679603 100644
--- a/modules/yarn/pom.xml
+++ b/modules/yarn/pom.xml
@@ -78,7 +78,6 @@
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
- <finalName>${project.artifactId}-${project.version}-full</finalName>
<archive>
<manifest>
<mainClass>org.apache.ignite.yarn.IgniteYarnClient</mainClass>
[04/50] [abbrv] incubator-ignite git commit: # ignite-648:
Implemented.
Posted by av...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWrityOrderOffHeapMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWrityOrderOffHeapMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWrityOrderOffHeapMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..3732cd2
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWrityOrderOffHeapMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicPrimaryWrityOrderOffHeapMultiJvmFullApiSelfTest extends
+ GridCacheAtomicPrimaryWrityOrderOffHeapMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..02e6857
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiJvmFullApiSelfTest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiJvmFullApiSelfTest
+ extends GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testLocalClearKeys() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-1107");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheNearOnlyFairAffinityMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheNearOnlyFairAffinityMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheNearOnlyFairAffinityMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..c8829a1
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheNearOnlyFairAffinityMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheNearOnlyFairAffinityMultiJvmFullApiSelfTest extends
+ GridCacheNearOnlyFairAffinityMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheNearOnlyMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheNearOnlyMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheNearOnlyMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..40504d8
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheNearOnlyMultiJvmFullApiSelfTest.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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheNearOnlyMultiJvmFullApiSelfTest extends GridCacheNearOnlyMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheNearOnlyMultiJvmP2PDisabledFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheNearOnlyMultiJvmP2PDisabledFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheNearOnlyMultiJvmP2PDisabledFullApiSelfTest.java
new file mode 100644
index 0000000..5e48504
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheNearOnlyMultiJvmP2PDisabledFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheNearOnlyMultiJvmP2PDisabledFullApiSelfTest extends
+ GridCacheNearOnlyMultiNodeP2PDisabledFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedCopyOnReadDisabledMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedCopyOnReadDisabledMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedCopyOnReadDisabledMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..2aa8ed8
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedCopyOnReadDisabledMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCachePartitionedCopyOnReadDisabledMultiJvmFullApiSelfTest extends
+ GridCachePartitionedCopyOnReadDisabledMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedFairAffinityMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedFairAffinityMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedFairAffinityMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..7bd0043
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedFairAffinityMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCachePartitionedFairAffinityMultiJvmFullApiSelfTest extends
+ GridCachePartitionedFairAffinityMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..c88f360
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmFullApiSelfTest.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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCachePartitionedMultiJvmFullApiSelfTest extends GridCachePartitionedMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmP2PDisabledFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmP2PDisabledFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmP2PDisabledFullApiSelfTest.java
new file mode 100644
index 0000000..1e619eb
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedMultiJvmP2PDisabledFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCachePartitionedMultiJvmP2PDisabledFullApiSelfTest extends
+ GridCachePartitionedMultiNodeP2PDisabledFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..ff249a7
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiJvmFullApiSelfTest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiJvmFullApiSelfTest
+ extends GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testLocalClearKeys() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-1107");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledFairAffinityMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledFairAffinityMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledFairAffinityMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..b3e45ad
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledFairAffinityMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCachePartitionedNearDisabledFairAffinityMultiJvmFullApiSelfTest extends
+ GridCachePartitionedNearDisabledFairAffinityMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..6cdd3be
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCachePartitionedNearDisabledMultiJvmFullApiSelfTest extends
+ GridCachePartitionedNearDisabledMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledMultiJvmP2PDisabledFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledMultiJvmP2PDisabledFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledMultiJvmP2PDisabledFullApiSelfTest.java
new file mode 100644
index 0000000..c873b11
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledMultiJvmP2PDisabledFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCachePartitionedNearDisabledMultiJvmP2PDisabledFullApiSelfTest extends
+ GridCachePartitionedNearDisabledMultiNodeP2PDisabledFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledOffHeapMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledOffHeapMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledOffHeapMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..8d0bc7f
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledOffHeapMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCachePartitionedNearDisabledOffHeapMultiJvmFullApiSelfTest extends
+ GridCachePartitionedNearDisabledOffHeapMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledOffHeapTieredMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledOffHeapTieredMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledOffHeapTieredMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..c797d5b
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedNearDisabledOffHeapTieredMultiJvmFullApiSelfTest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCachePartitionedNearDisabledOffHeapTieredMultiJvmFullApiSelfTest
+ extends GridCachePartitionedNearDisabledOffHeapTieredMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testLocalClearKeys() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-1107");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedOffHeapMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedOffHeapMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedOffHeapMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..5cf5d8a
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedOffHeapMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCachePartitionedOffHeapMultiJvmFullApiSelfTest extends
+ GridCachePartitionedOffHeapMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedOffHeapTieredMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedOffHeapTieredMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedOffHeapTieredMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..f843ae5
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCachePartitionedOffHeapTieredMultiJvmFullApiSelfTest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCachePartitionedOffHeapTieredMultiJvmFullApiSelfTest
+ extends GridCachePartitionedOffHeapTieredMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testLocalClearKeys() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-1107");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedAtomicMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedAtomicMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedAtomicMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..7f8bfa1
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedAtomicMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheReplicatedAtomicMultiJvmFullApiSelfTest extends
+ GridCacheReplicatedAtomicMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedAtomicPrimaryWriteOrderMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedAtomicPrimaryWriteOrderMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedAtomicPrimaryWriteOrderMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..fb87c9c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedAtomicPrimaryWriteOrderMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheReplicatedAtomicPrimaryWriteOrderMultiJvmFullApiSelfTest extends
+ GridCacheReplicatedAtomicPrimaryWriteOrderMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..19a5abd
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedMultiJvmFullApiSelfTest.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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheReplicatedMultiJvmFullApiSelfTest extends GridCacheReplicatedMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedMultiJvmP2PDisabledFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedMultiJvmP2PDisabledFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedMultiJvmP2PDisabledFullApiSelfTest.java
new file mode 100644
index 0000000..7473bdc
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedMultiJvmP2PDisabledFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheReplicatedMultiJvmP2PDisabledFullApiSelfTest extends
+ GridCacheReplicatedMultiNodeP2PDisabledFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedNearOnlyMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedNearOnlyMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedNearOnlyMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..9d7639c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedNearOnlyMultiJvmFullApiSelfTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheReplicatedNearOnlyMultiJvmFullApiSelfTest extends
+ GridCacheReplicatedNearOnlyMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testNearDhtKeySize() throws Exception {
+ if (isMultiJvm())
+ fail("https://issues.apache.org/jira/browse/IGNITE-648");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedOffHeapMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedOffHeapMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedOffHeapMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..f054f4b
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedOffHeapMultiJvmFullApiSelfTest.java
@@ -0,0 +1,31 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheReplicatedOffHeapMultiJvmFullApiSelfTest extends
+ GridCacheReplicatedOffHeapMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedOffHeapTieredMultiJvmFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedOffHeapTieredMultiJvmFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedOffHeapTieredMultiJvmFullApiSelfTest.java
new file mode 100644
index 0000000..2006972
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/multijvm/GridCacheReplicatedOffHeapTieredMultiJvmFullApiSelfTest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.multijvm;
+
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
+
+/**
+ * Multi-JVM tests.
+ */
+public class GridCacheReplicatedOffHeapTieredMultiJvmFullApiSelfTest
+ extends GridCacheReplicatedOffHeapTieredMultiNodeFullApiSelfTest {
+ /** {@inheritDoc} */
+ protected boolean isMultiJvm() {
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void testLocalClearKeys() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-1107");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
index 9a63b3a..06a1523 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/GridAbstractTest.java
@@ -33,10 +33,13 @@ import org.apache.ignite.marshaller.jdk.*;
import org.apache.ignite.spi.checkpoint.sharedfs.*;
import org.apache.ignite.spi.communication.tcp.*;
import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
import org.apache.ignite.testframework.*;
import org.apache.ignite.testframework.config.*;
import org.apache.ignite.testframework.junits.logger.*;
+import org.apache.ignite.testframework.junits.multijvm.*;
import org.apache.log4j.*;
import org.jetbrains.annotations.*;
import org.springframework.beans.*;
@@ -72,6 +75,11 @@ public abstract class GridAbstractTest extends TestCase {
/** Null name for execution map. */
private static final String NULL_NAME = UUID.randomUUID().toString();
+ /** Ip finder for TCP discovery. */
+ public static final TcpDiscoveryIpFinder LOCAL_IP_FINDER = new TcpDiscoveryVmIpFinder(false) {{
+ setAddresses(Collections.singleton("127.0.0.1:47500..47509"));
+ }};
+
/** */
private static final long DFLT_TEST_TIMEOUT = 5 * 60 * 1000;
@@ -203,6 +211,9 @@ public abstract class GridAbstractTest extends TestCase {
* @return logger.
*/
protected IgniteLogger log() {
+ if (isRemoteJvm())
+ return IgniteNodeRunner.startedInstance().log();
+
return log;
}
@@ -464,6 +475,11 @@ public abstract class GridAbstractTest extends TestCase {
}
try {
+ List<Integer> jvmIds = IgniteNodeRunner.killAll();
+
+ if (!jvmIds.isEmpty())
+ log.info("Next processes of IgniteNodeRunner were killed: " + jvmIds);
+
beforeTestsStarted();
}
catch (Exception | Error t) {
@@ -556,6 +572,9 @@ public abstract class GridAbstractTest extends TestCase {
* @throws Exception If failed.
*/
protected final Ignite startGridsMultiThreaded(int init, int cnt) throws Exception {
+ if (isMultiJvm())
+ fail("https://issues.apache.org/jira/browse/IGNITE-648");
+
assert init >= 0;
assert cnt > 0;
@@ -657,14 +676,37 @@ public abstract class GridAbstractTest extends TestCase {
* @throws Exception If failed.
*/
protected Ignite startGrid(String gridName, GridSpringResourceContext ctx) throws Exception {
- startingGrid.set(gridName);
+ if (!isRemoteJvm(gridName)) {
+ startingGrid.set(gridName);
- try {
- return IgnitionEx.start(optimize(getConfiguration(gridName)), ctx);
- }
- finally {
- startingGrid.set(null);
+ try {
+ return IgnitionEx.start(optimize(getConfiguration(gridName)), ctx);
+ }
+ finally {
+ startingGrid.set(null);
+ }
}
+ else
+ return startRemoteGrid(gridName, null, ctx);
+ }
+
+ /**
+ * Starts new grid at another JVM with given name.
+ *
+ * @param gridName Grid name.
+ * @param ctx Spring context.
+ * @return Started grid.
+ * @throws Exception If failed.
+ */
+ protected Ignite startRemoteGrid(String gridName, IgniteConfiguration cfg, GridSpringResourceContext ctx)
+ throws Exception {
+ if (ctx != null)
+ throw new UnsupportedOperationException("Starting of grid at another jvm by context doesn't supported.");
+
+ if (cfg == null)
+ cfg = optimize(getConfiguration(gridName));
+
+ return new IgniteProcessProxy(cfg, log, grid(0));
}
/**
@@ -707,13 +749,16 @@ public abstract class GridAbstractTest extends TestCase {
@SuppressWarnings({"deprecation"})
protected void stopGrid(@Nullable String gridName, boolean cancel) {
try {
- Ignite ignite = G.ignite(gridName);
+ Ignite ignite = grid(gridName);
assert ignite != null : "Ignite returned null grid for name: " + gridName;
info(">>> Stopping grid [name=" + ignite.name() + ", id=" + ignite.cluster().localNode().id() + ']');
- G.stop(gridName, cancel);
+ if (!isRemoteJvm(gridName))
+ G.stop(gridName, cancel);
+ else
+ IgniteProcessProxy.stop(gridName, cancel);
}
catch (IllegalStateException ignored) {
// Ignore error if grid already stopped.
@@ -736,23 +781,28 @@ public abstract class GridAbstractTest extends TestCase {
* @param cancel Cancel flag.
*/
protected void stopAllGrids(boolean cancel) {
- Collection<Ignite> clients = new ArrayList<>();
- Collection<Ignite> srvs = new ArrayList<>();
-
- for (Ignite g : G.allGrids()) {
- if (g.configuration().getDiscoverySpi().isClientMode())
- clients.add(g);
- else
- srvs.add(g);
- }
+ try {
+ Collection<Ignite> clients = new ArrayList<>();
+ Collection<Ignite> srvs = new ArrayList<>();
+
+ for (Ignite g : G.allGrids()) {
+ if (g.configuration().getDiscoverySpi().isClientMode())
+ clients.add(g);
+ else
+ srvs.add(g);
+ }
- for (Ignite g : clients)
- stopGrid(g.name(), cancel);
+ for (Ignite g : clients)
+ stopGrid(g.name(), cancel);
- for (Ignite g : srvs)
- stopGrid(g.name(), cancel);
+ for (Ignite g : srvs)
+ stopGrid(g.name(), cancel);
- assert G.allGrids().isEmpty();
+ assert G.allGrids().isEmpty();
+ }
+ finally {
+ IgniteProcessProxy.killAll(); // In multi-JVM case.
+ }
}
/**
@@ -821,7 +871,14 @@ public abstract class GridAbstractTest extends TestCase {
* @return Grid instance.
*/
protected IgniteEx grid(String name) {
- return (IgniteEx)G.ignite(name);
+ if (!isRemoteJvm(name))
+ return (IgniteEx)G.ignite(name);
+ else {
+ if (isRemoteJvm())
+ return IgniteNodeRunner.startedInstance();
+ else
+ return IgniteProcessProxy.ignite(name);
+ }
}
/**
@@ -831,7 +888,7 @@ public abstract class GridAbstractTest extends TestCase {
* @return Grid instance.
*/
protected IgniteEx grid(int idx) {
- return (IgniteEx)G.ignite(getTestGridName(idx));
+ return grid(getTestGridName(idx));
}
/**
@@ -839,7 +896,7 @@ public abstract class GridAbstractTest extends TestCase {
* @return Ignite instance.
*/
protected Ignite ignite(int idx) {
- return G.ignite(getTestGridName(idx));
+ return grid(idx);
}
/**
@@ -848,7 +905,10 @@ public abstract class GridAbstractTest extends TestCase {
* @return Grid for given test.
*/
protected IgniteEx grid() {
- return (IgniteEx)G.ignite(getTestGridName());
+ if (!isMultiJvm())
+ return (IgniteEx)G.ignite(getTestGridName());
+ else
+ throw new UnsupportedOperationException("Operation doesn't supported yet.");
}
/**
@@ -856,7 +916,17 @@ public abstract class GridAbstractTest extends TestCase {
* @return Ignite instance with given local node.
*/
protected final Ignite grid(ClusterNode node) {
- return G.ignite(node.id());
+ if (!isMultiJvm())
+ return G.ignite(node.id());
+ else {
+ try {
+ return IgniteProcessProxy.ignite(node.id());
+ }
+ catch (Exception ignore) {
+ // A hack if it is local grid.
+ return G.ignite(node.id());
+ }
+ }
}
/**
@@ -886,7 +956,10 @@ public abstract class GridAbstractTest extends TestCase {
protected Ignite startGrid(String gridName, IgniteConfiguration cfg) throws Exception {
cfg.setGridName(gridName);
- return G.start(cfg);
+ if (!isRemoteJvm(gridName))
+ return G.start(cfg);
+ else
+ return startRemoteGrid(gridName, cfg, null);
}
/**
@@ -1015,6 +1088,9 @@ public abstract class GridAbstractTest extends TestCase {
cfg.setNodeId(UUID.fromString(new String(chars)));
}
+ if (isMultiJvm())
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(LOCAL_IP_FINDER);
+
return cfg;
}
@@ -1286,6 +1362,183 @@ public abstract class GridAbstractTest extends TestCase {
}
/**
+ * Gets flag whether nodes will run in one JVM or in separate JVMs.
+ *
+ * @return <code>True</code> to run nodes in separate JVMs.
+ * @see IgniteNodeRunner
+ * @see IgniteProcessProxy
+ * @see #isRemoteJvm()
+ * @see #isRemoteJvm(int)
+ * @see #isRemoteJvm(String)
+ * @see #executeOnLocalOrRemoteJvm(int, TestIgniteIdxCallable)
+ * @see #executeOnLocalOrRemoteJvm(Ignite, TestIgniteCallable)
+ * @see #executeOnLocalOrRemoteJvm(IgniteCache, TestCacheCallable)
+ */
+ protected boolean isMultiJvm() {
+ return false;
+ }
+
+ /**
+ * @param gridName Grid name.
+ * @return <code>True</code> if test was run in multi-JVM mode and grid with this name was started at another JVM.
+ */
+ protected boolean isRemoteJvm(String gridName) {
+ return isMultiJvm() && !"0".equals(gridName.substring(getTestGridName().length()));
+ }
+
+ /**
+ * @param idx Grid index.
+ * @return <code>True</code> if test was run in multi-JVM mode and grid with this ID was started at another JVM.
+ */
+ protected boolean isRemoteJvm(int idx) {
+ return isMultiJvm() && idx != 0;
+ }
+
+ /**
+ * @return <code>True</code> if current JVM contains remote started node
+ * (It differs from JVM where tests executing).
+ */
+ protected boolean isRemoteJvm() {
+ return IgniteNodeRunner.hasStartedInstance();
+ }
+
+ /**
+ * @param cache Cache.
+ * @return <code>True</code> if cache is an instance of {@link IgniteCacheProcessProxy}
+ */
+ public static boolean isMultiJvmObject(IgniteCache cache) {
+ return cache instanceof IgniteCacheProcessProxy;
+ }
+
+ /**
+ * @param ignite Ignite.
+ * @return <code>True</code> if cache is an instance of {@link IgniteProcessProxy}
+ */
+ public static boolean isMultiJvmObject(Ignite ignite) {
+ return ignite instanceof IgniteProcessProxy;
+ }
+
+ /**
+ * Calls job on local JVM or on remote JVM in multi-JVM case.
+ *
+ * @param idx Grid index.
+ * @param job Job.
+ */
+ public <R> R executeOnLocalOrRemoteJvm(final int idx, final TestIgniteIdxCallable<R> job) {
+ IgniteEx ignite = grid(idx);
+
+ if (!isMultiJvmObject(ignite))
+ try {
+ return job.call(idx);
+ }
+ catch (Exception e) {
+ throw new IgniteException(e);
+ }
+ else
+ return executeRemotely(idx, job);
+ }
+
+ /**
+ * Calls job on local JVM or on remote JVM in multi-JVM case.
+ *
+ * @param ignite Ignite.
+ * @param job Job.
+ */
+ public static <R> R executeOnLocalOrRemoteJvm(Ignite ignite, final TestIgniteCallable<R> job) {
+ if (!isMultiJvmObject(ignite))
+ try {
+ return job.call(ignite);
+ }
+ catch (Exception e) {
+ throw new IgniteException(e);
+ }
+ else
+ return executeRemotely((IgniteProcessProxy)ignite, job);
+ }
+
+ /**
+ * Calls job on local JVM or on remote JVM in multi-JVM case.
+ *
+ * @param cache Cache.
+ * @param job Job.
+ */
+ public static <K,V,R> R executeOnLocalOrRemoteJvm(IgniteCache<K,V> cache, TestCacheCallable<K,V,R> job) {
+ Ignite ignite = cache.unwrap(Ignite.class);
+
+ if (!isMultiJvmObject(ignite))
+ try {
+ return job.call(ignite, cache);
+ }
+ catch (Exception e) {
+ throw new IgniteException(e);
+ }
+ else
+ return executeRemotely((IgniteCacheProcessProxy<K, V>)cache, job);
+ }
+
+ /**
+ * Calls job on remote JVM.
+ *
+ * @param idx Grid index.
+ * @param job Job.
+ */
+ public <R> R executeRemotely(final int idx, final TestIgniteIdxCallable<R> job) {
+ IgniteEx ignite = grid(idx);
+
+ if (!isMultiJvmObject(ignite))
+ throw new IllegalArgumentException("Ignite have to be process proxy.");
+
+ IgniteProcessProxy proxy = (IgniteProcessProxy)ignite;
+
+ return proxy.remoteCompute().call(new IgniteCallable<R>() {
+ @Override public R call() throws Exception {
+ return job.call(idx);
+ }
+ });
+ }
+
+ /**
+ * Calls job on remote JVM.
+ *
+ * @param proxy Ignite.
+ * @param job Job.
+ */
+ public static <R> R executeRemotely(IgniteProcessProxy proxy, final TestIgniteCallable<R> job) {
+ final UUID id = proxy.getId();
+
+ return proxy.remoteCompute().call(new IgniteCallable<R>() {
+ @Override public R call() throws Exception {
+ Ignite ignite = Ignition.ignite(id);
+
+ return job.call(ignite);
+ }
+ });
+ }
+
+ /**
+ * Runs job on remote JVM.
+ *
+ * @param cache Cache.
+ * @param job Job.
+ */
+ public static <K, V, R> R executeRemotely(IgniteCacheProcessProxy<K, V> cache,
+ final TestCacheCallable<K, V, R> job) {
+ IgniteProcessProxy proxy = (IgniteProcessProxy)cache.unwrap(Ignite.class);
+
+ final UUID id = proxy.getId();
+ final String cacheName = cache.getName();
+
+ return proxy.remoteCompute().call(new IgniteCallable<R>() {
+ @Override public R call() throws Exception {
+ Ignite ignite = Ignition.ignite(id);
+ IgniteCache<K,V> cache = ignite.cache(cacheName);
+
+ return job.call(ignite, cache);
+ }
+ });
+ }
+
+ /**
* @return Test counters.
*/
protected synchronized TestCounters getTestCounters() throws IgniteCheckedException {
@@ -1598,4 +1851,75 @@ public abstract class GridAbstractTest extends TestCase {
return numOfTests;
}
}
+
+ /** */
+ public static interface TestIgniteCallable<R> extends Serializable {
+ /**
+ * @param ignite Ignite.
+ */
+ R call(Ignite ignite) throws Exception;
+ }
+
+ /** */
+ public abstract static class TestIgniteRunnable implements TestIgniteCallable<Object> {
+ /** {@inheritDoc} */
+ @Override public Object call(Ignite ignite) throws Exception {
+ run(ignite);
+
+ return null;
+ }
+
+ /**
+ * @param ignite Ignite.
+ */
+ public abstract void run(Ignite ignite) throws Exception;
+ }
+
+ /** */
+ public static interface TestIgniteIdxCallable<R> extends Serializable {
+ /**
+ * @param idx Grid index.
+ */
+ R call(int idx) throws Exception;
+ }
+
+ /** */
+ public abstract static class TestIgniteIdxRunnable implements TestIgniteIdxCallable<Object> {
+ /** {@inheritDoc} */
+ @Override public Object call(int idx) throws Exception {
+ run(idx);
+
+ return null;
+ }
+
+ /**
+ * @param idx Index.
+ */
+ public abstract void run(int idx) throws Exception;
+ }
+
+ /** */
+ public static interface TestCacheCallable<K, V, R> extends Serializable {
+ /**
+ * @param ignite Ignite.
+ * @param cache Cache.
+ */
+ R call(Ignite ignite, IgniteCache<K, V> cache) throws Exception;
+ }
+
+ /** */
+ public abstract static class TestCacheRunnable<K, V> implements TestCacheCallable<K, V, Object> {
+ /** {@inheritDoc} */
+ @Override public Object call(Ignite ignite, IgniteCache cache) throws Exception {
+ run(ignite, cache);
+
+ return null;
+ }
+
+ /**
+ * @param ignite Ignite.
+ * @param cache Cache.
+ */
+ public abstract void run(Ignite ignite, IgniteCache<K, V> cache) throws Exception;
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
index 9941ca8..8698b4a 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java
@@ -116,6 +116,10 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
* @return Cache.
*/
protected <K, V> GridCacheAdapter<K, V> internalCache(IgniteCache<K, V> cache) {
+ if (isMultiJvmObject(cache))
+ throw new UnsupportedOperationException("Oparetion can't be supported automatically for multi jvm " +
+ "(send closure instead).");
+
return ((IgniteKernal)cache.unwrap(Ignite.class)).internalCache(cache.getName());
}
@@ -201,9 +205,13 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
* @param cache Cache.
* @return {@code True} if near cache is enabled.
*/
- protected static <K, V> boolean nearEnabled(IgniteCache<K,V> cache) {
- CacheConfiguration cfg = ((IgniteKernal)cache.unwrap(Ignite.class)).
- <K, V>internalCache(cache.getName()).context().config();
+ protected static <K, V> boolean nearEnabled(final IgniteCache<K,V> cache) {
+ CacheConfiguration cfg = GridAbstractTest.executeOnLocalOrRemoteJvm(cache,
+ new TestCacheCallable<K, V, CacheConfiguration>() {
+ @Override public CacheConfiguration call(Ignite ignite, IgniteCache<K, V> cache) throws Exception {
+ return ((IgniteKernal)ignite).<K, V>internalCache(cache.getName()).context().config();
+ }
+ });
return isNearEnabled(cfg);
}
@@ -238,27 +246,33 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
* @param replaceExistingValues Replace existing values.
* @throws Exception If failed.
*/
- protected static <K> void loadAll(Cache<K, ?> cache, Set<K> keys, boolean replaceExistingValues) throws Exception {
- final AtomicReference<Exception> ex = new AtomicReference<>();
+ protected static <K> void loadAll(Cache<K, ?> cache, final Set<K> keys, final boolean replaceExistingValues) throws Exception {
+ IgniteCache<K, Object> cacheCp = (IgniteCache<K, Object>)cache;
- final CountDownLatch latch = new CountDownLatch(1);
+ GridAbstractTest.executeOnLocalOrRemoteJvm(cacheCp, new TestCacheRunnable<K, Object>() {
+ @Override public void run(Ignite ignite, IgniteCache<K, Object> cache) throws Exception {
+ final AtomicReference<Exception> ex = new AtomicReference<>();
- cache.loadAll(keys, replaceExistingValues, new CompletionListener() {
- @Override public void onCompletion() {
- latch.countDown();
- }
+ final CountDownLatch latch = new CountDownLatch(1);
- @Override public void onException(Exception e) {
- ex.set(e);
+ cache.loadAll(keys, replaceExistingValues, new CompletionListener() {
+ @Override public void onCompletion() {
+ latch.countDown();
+ }
- latch.countDown();
- }
- });
+ @Override public void onException(Exception e) {
+ ex.set(e);
+
+ latch.countDown();
+ }
+ });
- latch.await();
+ latch.await();
- if (ex.get() != null)
- throw ex.get();
+ if (ex.get() != null)
+ throw ex.get();
+ }
+ });
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/AffinityProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/AffinityProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/AffinityProcessProxy.java
new file mode 100644
index 0000000..e87895d
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/AffinityProcessProxy.java
@@ -0,0 +1,195 @@
+/*
+ * 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.testframework.junits.multijvm;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.lang.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+
+/**
+ * Proxy class for affinity at another JVM.
+ */
+@SuppressWarnings("TransientFieldInNonSerializableClass")
+public class AffinityProcessProxy<K> implements Affinity<K> {
+ /** Compute. */
+ private final transient IgniteCompute compute;
+
+ /** Cache name. */
+ private final String cacheName;
+
+ /** Grid id. */
+ private final UUID gridId;
+
+ /**
+ * @param cacheName Cache name.
+ * @param proxy Ignite ptocess proxy.
+ */
+ public AffinityProcessProxy(String cacheName, IgniteProcessProxy proxy) {
+ this.cacheName = cacheName;
+ gridId = proxy.getId();
+ compute = proxy.remoteCompute();
+ }
+
+ /**
+ * Returns cache instance. Method to be called from closure at another JVM.
+ *
+ * @return Cache.
+ */
+ private Affinity<Object> affinity() {
+ return Ignition.ignite(gridId).affinity(cacheName);
+ }
+
+ /** {@inheritDoc} */
+ @Override public int partitions() {
+ return (int)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().partitions();
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public int partition(final K key) {
+ return (int)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().partition(key);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isPrimary(final ClusterNode n, final K key) {
+ return (boolean)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().isPrimary(n, key);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isBackup(final ClusterNode n, final K key) {
+ return (boolean)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().isBackup(n, key);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isPrimaryOrBackup(final ClusterNode n, final K key) {
+ return (boolean)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().isPrimaryOrBackup(n, key);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public int[] primaryPartitions(final ClusterNode n) {
+ return (int[])compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().primaryPartitions(n);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public int[] backupPartitions(final ClusterNode n) {
+ return (int[])compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().backupPartitions(n);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public int[] allPartitions(final ClusterNode n) {
+ return (int[])compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().allPartitions(n);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public Object affinityKey(final K key) {
+ return compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().affinityKey(key);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<ClusterNode, Collection<K>> mapKeysToNodes(final Collection<? extends K> keys) {
+ return (Map<ClusterNode, Collection<K>>)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().mapKeysToNodes(keys);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public ClusterNode mapKeyToNode(final K key) {
+ return (ClusterNode)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().mapKeyToNode(key);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<ClusterNode> mapKeyToPrimaryAndBackups(final K key) {
+ return (Collection<ClusterNode>)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().mapKeyToPrimaryAndBackups(key);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterNode mapPartitionToNode(final int part) {
+ return (ClusterNode)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().mapPartitionToNode(part);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<Integer, ClusterNode> mapPartitionsToNodes(final Collection<Integer> parts) {
+ return (Map<Integer, ClusterNode>)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().mapPartitionsToNodes(parts);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<ClusterNode> mapPartitionToPrimaryAndBackups(final int part) {
+ return (Collection<ClusterNode>)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return affinity().mapPartitionToPrimaryAndBackups(part);
+ }
+ });
+ }
+}
[07/50] [abbrv] incubator-ignite git commit: Merge branches
'ignite-1.3' and 'ignite-1076' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-1.3
Posted by av...@apache.org.
Merge branches 'ignite-1.3' and 'ignite-1076' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-1.3
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d1f5102f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d1f5102f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d1f5102f
Branch: refs/heads/ignite-630
Commit: d1f5102fa6eeaa68d8cb0d262615511126135d31
Parents: 4da2ff2 297d250
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Sun Jul 12 15:01:48 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Sun Jul 12 15:01:48 2015 -0700
----------------------------------------------------------------------
.../core/src/main/resources/META-INF/classnames-jdk.properties | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
[06/50] [abbrv] incubator-ignite git commit: Merge branches
'ignite-1076' and 'master' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite
Posted by av...@apache.org.
Merge branches 'ignite-1076' and 'master' of https://git-wip-us.apache.org/repos/asf/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/aa2d7cb4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/aa2d7cb4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/aa2d7cb4
Branch: refs/heads/ignite-630
Commit: aa2d7cb4a5c9f17d6a7a5b739feee7a2b84aad2b
Parents: 8218fe6 297d250
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Sun Jul 12 14:59:31 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Sun Jul 12 14:59:31 2015 -0700
----------------------------------------------------------------------
.../core/src/main/resources/META-INF/classnames-jdk.properties | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
[17/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/ignite-1.3' into ignite-1.3_
Posted by av...@apache.org.
Merge remote-tracking branch 'origin/ignite-1.3' into ignite-1.3_
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c559692d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c559692d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c559692d
Branch: refs/heads/ignite-630
Commit: c559692d6b3aa96316dc0c9b2874c67179489a87
Parents: 10c8a71 24f8961
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jul 14 16:41:51 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jul 14 16:41:51 2015 +0300
----------------------------------------------------------------------
.../dht/atomic/GridDhtAtomicCache.java | 4 ++--
.../dht/atomic/GridNearAtomicUpdateFuture.java | 20 +++++++++++++++-----
...eAtomicInvalidPartitionHandlingSelfTest.java | 2 +-
...acheAtomicReplicatedNodeRestartSelfTest.java | 15 ---------------
4 files changed, 18 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
[46/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/master'
Posted by av...@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/17f8c85d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/17f8c85d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/17f8c85d
Branch: refs/heads/ignite-630
Commit: 17f8c85de3cc62f4556190805354f6dcc75b7ccf
Parents: 9e52912 dd246e5
Author: sboikov <sb...@gridgain.com>
Authored: Thu Jul 16 13:26:44 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Jul 16 13:26:44 2015 +0300
----------------------------------------------------------------------
pom.xml | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
[22/50] [abbrv] incubator-ignite git commit: # master - javadoc fix.
Posted by av...@apache.org.
# master - 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/de7e06f3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/de7e06f3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/de7e06f3
Branch: refs/heads/ignite-630
Commit: de7e06f3f873428ae8db8cf1dcc3a72d9f433e5b
Parents: b464548
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Tue Jul 14 16:44:13 2015 -0700
Committer: Dmitiry Setrakyan <ds...@gridgain.com>
Committed: Tue Jul 14 16:44:13 2015 -0700
----------------------------------------------------------------------
.../src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/de7e06f3/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
index 608cc39..93ce9dd 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
@@ -26,7 +26,7 @@ import java.io.*;
import java.util.*;
/**
- * Type metadata.
+ * Cache type metadata need for configuration of indexes or automatic persistence.
*/
public class CacheTypeMetadata implements Serializable {
/** */
[40/50] [abbrv] incubator-ignite git commit: # ignite-901 client
reconnect support
Posted by av...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/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 dd04bf4..daa9494 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
@@ -153,21 +153,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
ctx.event().addLocalEventListener(new GridLocalEventListener() {
@Override public void onEvent(Event evt) {
- for (Iterator<StartFuture> itr = startFuts.values().iterator(); itr.hasNext(); ) {
- StartFuture fut = itr.next();
-
- itr.remove();
-
- fut.onDone(new IgniteException("Topology segmented"));
- }
-
- for (Iterator<StopFuture> itr = stopFuts.values().iterator(); itr.hasNext(); ) {
- StopFuture fut = itr.next();
-
- itr.remove();
-
- fut.onDone(new IgniteException("Topology segmented"));
- }
+ cancelFutures(new IgniteCheckedException("Topology segmented"));
}
}, EVT_NODE_SEGMENTED);
@@ -263,6 +249,27 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
}
/**
+ * @param e Error.
+ */
+ private void cancelFutures(IgniteCheckedException e) {
+ for (Iterator<StartFuture> itr = startFuts.values().iterator(); itr.hasNext(); ) {
+ StartFuture fut = itr.next();
+
+ itr.remove();
+
+ fut.onDone(e);
+ }
+
+ for (Iterator<StopFuture> itr = stopFuts.values().iterator(); itr.hasNext(); ) {
+ StopFuture fut = itr.next();
+
+ itr.remove();
+
+ fut.onDone(e);
+ }
+ }
+
+ /**
* @return {@code true} if lock successful, {@code false} if processor already stopped.
*/
@SuppressWarnings("LockAcquiredButNotSafelyReleased")
@@ -318,27 +325,30 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
/** {@inheritDoc} */
@Override @Nullable public Serializable collectDiscoveryData(UUID nodeId) {
- if (!nodeId.equals(ctx.localNodeId())) {
+ if (!nodeId.equals(ctx.localNodeId()) || !locInfos.isEmpty()) {
DiscoveryData data = new DiscoveryData(ctx.localNodeId(), clientInfos);
- // Collect listeners information (will be sent to
- // joining node during discovery process).
+ // Collect listeners information (will be sent to joining node during discovery process).
for (Map.Entry<UUID, LocalRoutineInfo> e : locInfos.entrySet()) {
UUID routineId = e.getKey();
LocalRoutineInfo info = e.getValue();
- data.addItem(new DiscoveryDataItem(routineId, info.prjPred,
- info.hnd, info.bufSize, info.interval));
+ data.addItem(new DiscoveryDataItem(routineId,
+ info.prjPred,
+ info.hnd,
+ info.bufSize,
+ info.interval,
+ info.autoUnsubscribe));
}
return data;
}
- else
- return null;
+
+ return null;
}
/** {@inheritDoc} */
- @Override public void onDiscoveryDataReceived(UUID nodeId, UUID rmtNodeId, Serializable obj) {
+ @Override public void onDiscoveryDataReceived(UUID joiningNodeId, UUID rmtNodeId, Serializable obj) {
DiscoveryData data = (DiscoveryData)obj;
if (!ctx.isDaemon() && data != null) {
@@ -377,6 +387,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
* Callback invoked when cache is started.
*
* @param ctx Cache context.
+ * @throws IgniteCheckedException If failed.
*/
public void onCacheStart(GridCacheContext ctx) throws IgniteCheckedException {
for (Map.Entry<UUID, RemoteRoutineInfo> entry : rmtInfos.entrySet()) {
@@ -491,7 +502,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
}
// Register routine locally.
- locInfos.put(routineId, new LocalRoutineInfo(prjPred, hnd, bufSize, interval));
+ locInfos.put(routineId, new LocalRoutineInfo(prjPred, hnd, bufSize, interval, autoUnsubscribe));
StartFuture fut = new StartFuture(ctx, routineId);
@@ -500,7 +511,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
try {
ctx.discovery().sendCustomEvent(new StartRoutineDiscoveryMessage(routineId, reqData));
}
- catch (IgniteException e) { // Marshaller exception may occurs if user pass unmarshallable filter.
+ catch (IgniteCheckedException e) { // Marshaller exception may occurs if user pass unmarshallable filter.
startFuts.remove(routineId);
locInfos.remove(routineId);
@@ -565,7 +576,12 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
// Unregister handler locally.
unregisterHandler(routineId, routine.hnd, true);
- ctx.discovery().sendCustomEvent(new StopRoutineDiscoveryMessage(routineId));
+ try {
+ ctx.discovery().sendCustomEvent(new StopRoutineDiscoveryMessage(routineId));
+ }
+ catch (IgniteCheckedException e) {
+ fut.onDone(e);
+ }
if (ctx.isStopping())
fut.onDone();
@@ -580,6 +596,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
* @param obj Notification object.
* @param orderedTopic Topic for ordered notifications. If {@code null}, non-ordered message will be sent.
* @param sync If {@code true} then waits for event acknowledgment.
+ * @param msg If {@code true} then sent data is message.
* @throws IgniteCheckedException In case of error.
*/
public void addNotification(UUID nodeId,
@@ -630,6 +647,18 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
}
}
+ /** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException {
+ cancelFutures(new IgniteClientDisconnectedCheckedException(reconnectFut, "Client node disconnected."));
+
+ for (UUID rmtId : rmtInfos.keySet())
+ unregisterRemote(rmtId);
+
+ rmtInfos.clear();
+
+ clientInfos.clear();
+ }
+
/**
* @param nodeId Node ID.
* @param routineId Routine ID.
@@ -637,6 +666,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
* @param toSnd Notification object to send.
* @param orderedTopic Topic for ordered notifications.
* If {@code null}, non-ordered message will be sent.
+ * @param msg If {@code true} then sent data is collection of messages.
* @throws IgniteCheckedException In case of error.
*/
private void sendNotification(UUID nodeId,
@@ -703,8 +733,11 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
assert old == null;
}
- clientRouteMap.put(routineId, new LocalRoutineInfo(data.projectionPredicate(), hnd, data.bufferSize(),
- data.interval()));
+ clientRouteMap.put(routineId, new LocalRoutineInfo(data.projectionPredicate(),
+ hnd,
+ data.bufferSize(),
+ data.interval(),
+ data.autoUnsubscribe()));
}
boolean registered = false;
@@ -1022,14 +1055,22 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
/** Time interval. */
private final long interval;
+ /** Automatic unsubscribe flag. */
+ private boolean autoUnsubscribe;
+
/**
* @param prjPred Projection predicate.
* @param hnd Continuous routine handler.
* @param bufSize Buffer size.
* @param interval Interval.
+ * @param autoUnsubscribe Automatic unsubscribe flag.
*/
- LocalRoutineInfo(@Nullable IgnitePredicate<ClusterNode> prjPred, GridContinuousHandler hnd, int bufSize,
- long interval) {
+ LocalRoutineInfo(@Nullable IgnitePredicate<ClusterNode> prjPred,
+ GridContinuousHandler hnd,
+ int bufSize,
+ long interval,
+ boolean autoUnsubscribe)
+ {
assert hnd != null;
assert bufSize > 0;
assert interval >= 0;
@@ -1038,6 +1079,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
this.hnd = hnd;
this.bufSize = bufSize;
this.interval = interval;
+ this.autoUnsubscribe = autoUnsubscribe;
}
/**
@@ -1046,6 +1088,11 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
GridContinuousHandler handler() {
return hnd;
}
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(LocalRoutineInfo.class, this);
+ }
}
/**
@@ -1053,7 +1100,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
*/
private static class RemoteRoutineInfo {
/** Master node ID. */
- private final UUID nodeId;
+ private UUID nodeId;
/** Continuous routine handler. */
private final GridContinuousHandler hnd;
@@ -1205,6 +1252,11 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
return F.t(toSnd, diff < interval ? interval - diff : interval);
}
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(RemoteRoutineInfo.class, this);
+ }
}
/**
@@ -1221,6 +1273,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
@GridToStringInclude
private Collection<DiscoveryDataItem> items;
+ /** */
private Map<UUID, Map<UUID, LocalRoutineInfo>> clientInfos;
/**
@@ -1232,6 +1285,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
/**
* @param nodeId Node ID.
+ * @param clientInfos Client information.
*/
DiscoveryData(UUID nodeId, Map<UUID, Map<UUID, LocalRoutineInfo>> clientInfos) {
assert nodeId != null;
@@ -1308,9 +1362,15 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
* @param hnd Handler.
* @param bufSize Buffer size.
* @param interval Time interval.
+ * @param autoUnsubscribe Automatic unsubscribe flag.
*/
- DiscoveryDataItem(UUID routineId, @Nullable IgnitePredicate<ClusterNode> prjPred,
- GridContinuousHandler hnd, int bufSize, long interval) {
+ DiscoveryDataItem(UUID routineId,
+ @Nullable IgnitePredicate<ClusterNode> prjPred,
+ GridContinuousHandler hnd,
+ int bufSize,
+ long interval,
+ boolean autoUnsubscribe)
+ {
assert routineId != null;
assert hnd != null;
assert bufSize > 0;
@@ -1321,6 +1381,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
this.hnd = hnd;
this.bufSize = bufSize;
this.interval = interval;
+ this.autoUnsubscribe = autoUnsubscribe;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
index 54478f8..4f75e0c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamProcessor.java
@@ -27,6 +27,7 @@ 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.internal.util.worker.*;
+import org.apache.ignite.lang.*;
import org.apache.ignite.marshaller.*;
import org.apache.ignite.stream.*;
import org.apache.ignite.thread.*;
@@ -63,13 +64,15 @@ public class DataStreamProcessor<K, V> extends GridProcessorAdapter {
public DataStreamProcessor(GridKernalContext ctx) {
super(ctx);
- ctx.io().addMessageListener(TOPIC_DATASTREAM, new GridMessageListener() {
- @Override public void onMessage(UUID nodeId, Object msg) {
- assert msg instanceof DataStreamerRequest;
+ if (!ctx.clientNode()) {
+ ctx.io().addMessageListener(TOPIC_DATASTREAM, new GridMessageListener() {
+ @Override public void onMessage(UUID nodeId, Object msg) {
+ assert msg instanceof DataStreamerRequest;
- processRequest(nodeId, (DataStreamerRequest)msg);
- }
- });
+ processRequest(nodeId, (DataStreamerRequest)msg);
+ }
+ });
+ }
marsh = ctx.config().getMarshaller();
}
@@ -113,7 +116,8 @@ public class DataStreamProcessor<K, V> extends GridProcessorAdapter {
if (ctx.config().isDaemon())
return;
- ctx.io().removeMessageListener(TOPIC_DATASTREAM);
+ if (!ctx.clientNode())
+ ctx.io().removeMessageListener(TOPIC_DATASTREAM);
busyLock.block();
@@ -139,6 +143,12 @@ public class DataStreamProcessor<K, V> extends GridProcessorAdapter {
log.debug("Stopped data streamer processor.");
}
+ /** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException {
+ for (DataStreamerImpl<?, ?> ldr : ldrs)
+ ldr.onDisconnected(reconnectFut);
+ }
+
/**
* @param cacheName Cache name ({@code null} for default cache).
* @return Data loader.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
index 26b0568..605f478 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerImpl.java
@@ -145,6 +145,9 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
/** Busy lock. */
private final GridSpinBusyLock busyLock = new GridSpinBusyLock();
+ /** */
+ private CacheException disconnectErr;
+
/** Closed flag. */
private final AtomicBoolean closed = new AtomicBoolean();
@@ -245,7 +248,7 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
fut = new DataStreamerFuture(this);
- publicFut = new IgniteFutureImpl<>(fut);
+ publicFut = new IgniteCacheFutureImpl<>(fut);
}
/**
@@ -284,8 +287,12 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
* Enters busy lock.
*/
private void enterBusy() {
- if (!busyLock.enterBusy())
+ if (!busyLock.enterBusy()) {
+ if (disconnectErr != null)
+ throw disconnectErr;
+
throw new IllegalStateException("Data streamer has been closed.");
+ }
}
/**
@@ -435,7 +442,7 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
load0(entries0, resFut, keys, 0);
- return new IgniteFutureImpl<>(resFut);
+ return new IgniteCacheFutureImpl<>(resFut);
}
catch (IgniteException e) {
return new IgniteFinishedFutureImpl<>(e);
@@ -487,7 +494,7 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
load0(entries, resFut, keys, 0);
- return new IgniteFutureImpl<>(resFut);
+ return new IgniteCacheFutureImpl<>(resFut);
}
catch (Throwable e) {
resFut.onDone(e);
@@ -631,6 +638,12 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
resFut.onDone();
}
}
+ catch (IgniteClientDisconnectedCheckedException e1) {
+ if (log.isDebugEnabled())
+ log.debug("Future finished with disconnect error [nodeId=" + nodeId + ", err=" + e1 + ']');
+
+ resFut.onDone(e1);
+ }
catch (IgniteCheckedException e1) {
if (log.isDebugEnabled())
log.debug("Future finished with error [nodeId=" + nodeId + ", err=" + e1 + ']');
@@ -757,6 +770,12 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
try {
fut.get();
}
+ catch (IgniteClientDisconnectedCheckedException e) {
+ if (log.isDebugEnabled())
+ log.debug("Failed to flush buffer: " + e);
+
+ throw CU.convertToCacheException(e);
+ }
catch (IgniteCheckedException e) {
if (log.isDebugEnabled())
log.debug("Failed to flush buffer: " + e);
@@ -802,7 +821,7 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
doFlush();
}
catch (IgniteCheckedException e) {
- throw GridCacheUtils.convertToCacheException(e);
+ throw CU.convertToCacheException(e);
}
finally {
leaveBusy();
@@ -843,7 +862,7 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
closeEx(cancel);
}
catch (IgniteCheckedException e) {
- throw GridCacheUtils.convertToCacheException(e);
+ throw CU.convertToCacheException(e);
}
}
@@ -852,6 +871,15 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
* @throws IgniteCheckedException If failed.
*/
public void closeEx(boolean cancel) throws IgniteCheckedException {
+ closeEx(cancel, null);
+ }
+
+ /**
+ * @param cancel {@code True} to close with cancellation.
+ * @param err Error.
+ * @throws IgniteCheckedException If failed.
+ */
+ public void closeEx(boolean cancel, IgniteCheckedException err) throws IgniteCheckedException {
if (!closed.compareAndSet(false, true))
return;
@@ -868,7 +896,7 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
cancelled = true;
for (Buffer buf : bufMappings.values())
- buf.cancelAll();
+ buf.cancelAll(err);
}
else
doFlush();
@@ -881,13 +909,29 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
e = e0;
}
- fut.onDone(null, e);
+ fut.onDone(null, e != null ? e : err);
if (e != null)
throw e;
}
/**
+ * @param reconnectFut Reconnect future.
+ * @throws IgniteCheckedException If failed.
+ */
+ public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException {
+ IgniteClientDisconnectedCheckedException err = new IgniteClientDisconnectedCheckedException(reconnectFut,
+ "Data streamer has been closed, client node disconnected.");
+
+ disconnectErr = (CacheException)CU.convertToCacheException(err);
+
+ for (Buffer buf : bufMappings.values())
+ buf.cancelAll(err);
+
+ closeEx(true, err);
+ }
+
+ /**
* @return {@code true} If the loader is closed.
*/
boolean isClosed() {
@@ -1027,7 +1071,11 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
submit(entries0, topVer, curFut0);
if (cancelled)
- curFut0.onDone(new IgniteCheckedException("Data streamer has been cancelled: " + DataStreamerImpl.this));
+ curFut0.onDone(new IgniteCheckedException("Data streamer has been cancelled: " +
+ DataStreamerImpl.this));
+ else if (ctx.clientDisconnected())
+ curFut0.onDone(new IgniteClientDisconnectedCheckedException(ctx.cluster().clientReconnectFuture(),
+ "Client node disconnected."));
}
return curFut0;
@@ -1227,11 +1275,18 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
log.debug("Sent request to node [nodeId=" + node.id() + ", req=" + req + ']');
}
catch (IgniteCheckedException e) {
- if (ctx.discovery().alive(node) && ctx.discovery().pingNode(node.id()))
- ((GridFutureAdapter<Object>)fut).onDone(e);
- else
- ((GridFutureAdapter<Object>)fut).onDone(new ClusterTopologyCheckedException("Failed to send " +
- "request (node has left): " + node.id()));
+ GridFutureAdapter<Object> fut0 = ((GridFutureAdapter<Object>)fut);
+
+ try {
+ if (ctx.discovery().alive(node) && ctx.discovery().pingNode(node.id()))
+ fut0.onDone(e);
+ else
+ fut0.onDone(new ClusterTopologyCheckedException("Failed to send request (node has left): "
+ + node.id()));
+ }
+ catch (IgniteClientDisconnectedCheckedException e0) {
+ fut0.onDone(e0);
+ }
}
}
}
@@ -1304,10 +1359,11 @@ public class DataStreamerImpl<K, V> implements IgniteDataStreamer<K, V>, Delayed
}
/**
- *
+ * @param err Error.
*/
- void cancelAll() {
- IgniteCheckedException err = new IgniteCheckedException("Data streamer has been cancelled: " + DataStreamerImpl.this);
+ void cancelAll(@Nullable IgniteCheckedException err) {
+ if (err == null)
+ err = new IgniteCheckedException("Data streamer has been cancelled: " + DataStreamerImpl.this);
for (IgniteInternalFuture<?> f : locFuts) {
try {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
index 5c171e8..57b16f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
@@ -185,6 +185,32 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
}
/**
+ * @param key Key.
+ * @param obj Object.
+ */
+ void onRemoved(GridCacheInternal key, GridCacheRemovable obj) {
+ dsMap.remove(key, obj);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void onReconnected(boolean clusterRestarted) throws IgniteCheckedException {
+ for (Map.Entry<GridCacheInternal, GridCacheRemovable> e : dsMap.entrySet()) {
+ GridCacheRemovable obj = e.getValue();
+
+ if (clusterRestarted) {
+ obj.onRemoved();
+
+ dsMap.remove(e.getKey(), obj);
+ }
+ else
+ obj.needCheckNotRemoved();
+ }
+
+ for (GridCacheContext cctx : ctx.cache().context().cacheContexts())
+ cctx.dataStructures().onReconnected(clusterRestarted);
+ }
+
+ /**
* Gets a sequence from cache or creates one if it's not cached.
*
* @param name Sequence name.
@@ -1001,8 +1027,11 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
dsView.put(key, val);
}
- latch = new GridCacheCountDownLatchImpl(name, val.get(), val.initialCount(),
- val.autoDelete(), key, cntDownLatchView, dsCacheCtx);
+ latch = new GridCacheCountDownLatchImpl(name, val.initialCount(),
+ val.autoDelete(),
+ key,
+ cntDownLatchView,
+ dsCacheCtx);
dsMap.put(key, latch);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
index 5e9245d..1d6e735 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
@@ -57,6 +57,9 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
/** Removed flag.*/
private volatile boolean rmvd;
+ /** Check removed flag. */
+ private boolean rmvCheck;
+
/** Atomic long key. */
private GridCacheInternalKey key;
@@ -336,7 +339,31 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
*/
private void checkRemoved() throws IllegalStateException {
if (rmvd)
- throw new IllegalStateException("Atomic long was removed from cache: " + name);
+ throw removedError();
+
+ if (rmvCheck) {
+ try {
+ rmvd = atomicView.get(key) == null;
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
+
+ rmvCheck = false;
+
+ if (rmvd) {
+ ctx.kernalContext().dataStructures().onRemoved(key, this);
+
+ throw removedError();
+ }
+ }
+ }
+
+ /**
+ * @return Error.
+ */
+ private IllegalStateException removedError() {
+ return new IllegalStateException("Atomic long was removed from cache: " + name);
}
/** {@inheritDoc} */
@@ -345,8 +372,8 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
}
/** {@inheritDoc} */
- @Override public void onInvalid(@Nullable Exception err) {
- // No-op.
+ @Override public void needCheckNotRemoved() {
+ rmvCheck = true;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
index 0c4e5e6..f740c4e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
@@ -24,7 +24,6 @@ import org.apache.ignite.internal.processors.cache.transactions.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
-import org.jetbrains.annotations.*;
import java.io.*;
import java.util.concurrent.*;
@@ -56,6 +55,9 @@ public final class GridCacheAtomicReferenceImpl<T> implements GridCacheAtomicRef
/** Status.*/
private volatile boolean rmvd;
+ /** Check removed flag. */
+ private boolean rmvCheck;
+
/** Atomic reference key. */
private GridCacheInternalKey key;
@@ -156,8 +158,8 @@ public final class GridCacheAtomicReferenceImpl<T> implements GridCacheAtomicRef
}
/** {@inheritDoc} */
- @Override public void onInvalid(@Nullable Exception err) {
- // No-op.
+ @Override public void needCheckNotRemoved() {
+ rmvCheck = true;
}
/** {@inheritDoc} */
@@ -293,7 +295,31 @@ public final class GridCacheAtomicReferenceImpl<T> implements GridCacheAtomicRef
*/
private void checkRemoved() throws IllegalStateException {
if (rmvd)
- throw new IllegalStateException("Atomic reference was removed from cache: " + name);
+ throw removedError();
+
+ if (rmvCheck) {
+ try {
+ rmvd = atomicView.get(key) == null;
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
+
+ rmvCheck = false;
+
+ if (rmvd) {
+ ctx.kernalContext().dataStructures().onRemoved(key, this);
+
+ throw removedError();
+ }
+ }
+ }
+
+ /**
+ * @return Error.
+ */
+ private IllegalStateException removedError() {
+ return new IllegalStateException("Atomic reference was removed from cache: " + name);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
index 2400a7e..31f4f24 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
@@ -61,6 +61,9 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
/** Removed flag. */
private volatile boolean rmvd;
+ /** Check removed flag. */
+ private boolean rmvCheck;
+
/** Sequence key. */
private GridCacheInternalKey key;
@@ -391,7 +394,31 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
*/
private void checkRemoved() throws IllegalStateException {
if (rmvd)
- throw new IllegalStateException("Sequence was removed from cache: " + name);
+ throw removedError();
+
+ if (rmvCheck) {
+ try {
+ rmvd = seqView.get(key) == null;
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
+
+ rmvCheck = false;
+
+ if (rmvd) {
+ ctx.kernalContext().dataStructures().onRemoved(key, this);
+
+ throw removedError();
+ }
+ }
+ }
+
+ /**
+ * @return Error.
+ */
+ private IllegalStateException removedError() {
+ return new IllegalStateException("Sequence was removed from cache: " + name);
}
/** {@inheritDoc} */
@@ -400,8 +427,8 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
}
/** {@inheritDoc} */
- @Override public void onInvalid(@Nullable Exception err) {
- // No-op.
+ @Override public void needCheckNotRemoved() {
+ rmvCheck = true;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
index 76ea7ca..d2dedeb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
@@ -59,6 +59,9 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
/** Removed flag.*/
private volatile boolean rmvd;
+ /** Check removed flag. */
+ private boolean rmvCheck;
+
/** Atomic stamped key. */
private GridCacheInternalKey key;
@@ -206,8 +209,8 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
}
/** {@inheritDoc} */
- @Override public void onInvalid(@Nullable Exception err) {
- // No-op.
+ @Override public void needCheckNotRemoved() {
+ rmvCheck = true;
}
/** {@inheritDoc} */
@@ -369,7 +372,31 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
*/
private void checkRemoved() throws IllegalStateException {
if (rmvd)
- throw new IllegalStateException("Atomic stamped was removed from cache: " + name);
+ throw removedError();
+
+ if (rmvCheck) {
+ try {
+ rmvd = atomicView.get(key) == null;
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
+
+ rmvCheck = false;
+
+ if (rmvd) {
+ ctx.kernalContext().dataStructures().onRemoved(key, this);
+
+ throw removedError();
+ }
+ }
+ }
+
+ /**
+ * @return Error.
+ */
+ private IllegalStateException removedError() {
+ return new IllegalStateException("Atomic stamped was removed from cache: " + name);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
index 85b6cfd..95b970a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
@@ -67,9 +67,6 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
/** Cache context. */
private GridCacheContext ctx;
- /** Current count. */
- private int cnt;
-
/** Initial count. */
private int initCnt;
@@ -96,7 +93,6 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
* Constructor.
*
* @param name Latch name.
- * @param cnt Current count.
* @param initCnt Initial count.
* @param autoDel Auto delete flag.
* @param key Latch key.
@@ -104,7 +100,6 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
* @param ctx Cache context.
*/
public GridCacheCountDownLatchImpl(String name,
- int cnt,
int initCnt,
boolean autoDel,
GridCacheInternalKey key,
@@ -112,14 +107,12 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
GridCacheContext ctx)
{
assert name != null;
- assert cnt >= 0;
assert initCnt >= 0;
assert key != null;
assert latchView != null;
assert ctx != null;
this.name = name;
- this.cnt = cnt;
this.initCnt = initCnt;
this.autoDel = autoDel;
this.key = key;
@@ -136,7 +129,12 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
/** {@inheritDoc} */
@Override public int count() {
- return cnt;
+ try {
+ return CU.outTx(new GetCountCallable(), ctx);
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
}
/** {@inheritDoc} */
@@ -207,13 +205,11 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
/** {@inheritDoc} */
@Override public boolean onRemoved() {
- assert cnt == 0;
-
return rmvd = true;
}
/** {@inheritDoc} */
- @Override public void onInvalid(@Nullable Exception err) {
+ @Override public void needCheckNotRemoved() {
// No-op.
}
@@ -231,8 +227,6 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
@Override public void onUpdate(int cnt) {
assert cnt >= 0;
- this.cnt = cnt;
-
while (internalLatch != null && internalLatch.getCount() > cnt)
internalLatch.countDown();
}
@@ -253,9 +247,7 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
if (log.isDebugEnabled())
log.debug("Failed to find count down latch with given name: " + name);
- assert cnt == 0;
-
- return new CountDownLatch(cnt);
+ return new CountDownLatch(0);
}
tx.commit();
@@ -337,6 +329,29 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
/**
*
*/
+ private class GetCountCallable implements Callable<Integer> {
+ /** {@inheritDoc} */
+ @Override public Integer call() throws Exception {
+ Integer val;
+
+ try (IgniteInternalTx tx = CU.txStartInternal(ctx, latchView, PESSIMISTIC, REPEATABLE_READ)) {
+ GridCacheCountDownLatchValue latchVal = latchView.get(key);
+
+ if (latchVal == null)
+ return 0;
+
+ val = latchVal.get();
+
+ tx.rollback();
+ }
+
+ return val;
+ }
+ }
+
+ /**
+ *
+ */
private class CountDownCallable implements Callable<Integer> {
/** Value to count down on (if 0 then latch is counted down to 0). */
private final int val;
@@ -359,9 +374,7 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
if (log.isDebugEnabled())
log.debug("Failed to find count down latch with given name: " + name);
- assert cnt == 0;
-
- return cnt;
+ return 0;
}
int retVal;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheRemovable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheRemovable.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheRemovable.java
index 48d8644..dd4f2cc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheRemovable.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheRemovable.java
@@ -17,8 +17,6 @@
package org.apache.ignite.internal.processors.datastructures;
-import org.jetbrains.annotations.*;
-
/**
* Provides callback for marking object as removed.
*/
@@ -31,7 +29,7 @@ public interface GridCacheRemovable {
public boolean onRemoved();
/**
- * @param err Error which cause data structure to become invalid.
+ *
*/
- public void onInvalid(@Nullable Exception err);
+ public void needCheckNotRemoved();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java
index f74fe95..6d920fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetImpl.java
@@ -101,6 +101,19 @@ public class GridCacheSetImpl<T> extends AbstractCollection<T> implements Ignite
return rmvd;
}
+ /**
+ * @return {@code True} if set header found in cache.
+ * @throws IgniteCheckedException If failed.
+ */
+ @SuppressWarnings("unchecked")
+ public boolean checkHeader() throws IgniteCheckedException {
+ IgniteInternalCache<GridCacheSetHeaderKey, GridCacheSetHeader> cache0 = ctx.cache();
+
+ GridCacheSetHeader hdr = cache0.get(new GridCacheSetHeaderKey(name));
+
+ return hdr != null && hdr.id().equals(id);
+ }
+
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override public int size() {
@@ -476,7 +489,7 @@ public class GridCacheSetImpl<T> extends AbstractCollection<T> implements Ignite
/**
* @return Set ID.
*/
- IgniteUuid id() {
+ public IgniteUuid id() {
return id;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetProxy.java
index ba43da7..90c26f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheSetProxy.java
@@ -57,6 +57,9 @@ public class GridCacheSetProxy<T> implements IgniteSet<T>, Externalizable {
/** Busy lock. */
private GridSpinBusyLock busyLock;
+ /** Check removed flag. */
+ private boolean rmvCheck;
+
/**
* Required by {@link Externalizable}.
*/
@@ -78,6 +81,13 @@ public class GridCacheSetProxy<T> implements IgniteSet<T>, Externalizable {
}
/**
+ * @return Set delegate.
+ */
+ public GridCacheSetImpl delegate() {
+ return delegate;
+ }
+
+ /**
* Remove callback.
*/
public void blockOnRemove() {
@@ -510,8 +520,43 @@ public class GridCacheSetProxy<T> implements IgniteSet<T>, Externalizable {
* Enters busy state.
*/
private void enterBusy() {
+ boolean rmvd;
+
+ if (rmvCheck) {
+ try {
+ rmvd = !delegate().checkHeader();
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
+
+ rmvCheck = false;
+
+ if (rmvd) {
+ delegate.removed(true);
+
+ cctx.dataStructures().onRemoved(this);
+
+ throw removedError();
+ }
+ }
+
if (!busyLock.enterBusy())
- throw new IllegalStateException("Set has been removed from cache: " + delegate);
+ throw removedError();
+ }
+
+ /**
+ *
+ */
+ public void needCheckNotRemoved() {
+ rmvCheck = true;
+ }
+
+ /**
+ * @return Error.
+ */
+ private IllegalStateException removedError() {
+ return new IllegalStateException("Set has been removed from cache: " + delegate);
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java
index 48e9686..350068a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobProcessor.java
@@ -1413,7 +1413,7 @@ public class GridJobProcessor extends GridProcessorAdapter {
* @return {@code true} if node is dead, {@code false} is node is alive.
*/
private boolean isDeadNode(UUID uid) {
- return ctx.discovery().node(uid) == null || !ctx.discovery().pingNode(uid);
+ return ctx.discovery().node(uid) == null || !ctx.discovery().pingNodeNoError(uid);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java
index d1ee5ad..3a309f6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java
@@ -863,7 +863,7 @@ public class GridJobWorker extends GridWorker implements GridTimeoutObject {
* @return {@code true} if node is dead, {@code false} is node is alive.
*/
private boolean isDeadNode(UUID uid) {
- return ctx.discovery().node(uid) == null || !ctx.discovery().pingNode(uid);
+ return ctx.discovery().node(uid) == null || !ctx.discovery().pingNodeNoError(uid);
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
index 0cbb77a..8639bc8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryIndexing.java
@@ -246,4 +246,11 @@ public interface GridQueryIndexing {
* @return Backup filter.
*/
public IndexingQueryFilter backupFilter(List<String> caches, AffinityTopologyVersion topVer, int[] parts);
+
+ /**
+ * Client disconnected callback.
+ *
+ * @param reconnectFut Reconnect future.
+ */
+ public void onDisconnected(IgniteFuture<?> reconnectFut);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 1ba1fae..f3ad4b2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -234,6 +234,12 @@ public class GridQueryProcessor extends GridProcessorAdapter {
idx.stop();
}
+ /** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException {
+ if (idx != null)
+ idx.onDisconnected(reconnectFut);
+ }
+
/**
* @param cctx Cache context.
* @throws IgniteCheckedException If failed.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
index bb451c7..78b09e6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
@@ -124,7 +124,8 @@ public class GridServiceProcessor extends GridProcessorAdapter {
cache = ctx.cache().utilityCache();
- ctx.event().addLocalEventListener(topLsnr, EVTS_DISCOVERY);
+ if (!ctx.clientNode())
+ ctx.event().addLocalEventListener(topLsnr, EVTS_DISCOVERY);
try {
if (ctx.deploy().enabled())
@@ -165,7 +166,8 @@ public class GridServiceProcessor extends GridProcessorAdapter {
busyLock.block();
- ctx.event().removeLocalEventListener(topLsnr);
+ if (!ctx.clientNode())
+ ctx.event().removeLocalEventListener(topLsnr);
if (cfgQryId != null)
cache.context().continuousQueries().cancelInternalQuery(cfgQryId);
@@ -209,6 +211,27 @@ public class GridServiceProcessor extends GridProcessorAdapter {
log.debug("Stopped service processor.");
}
+ /** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException {
+ for (Map.Entry<String, GridServiceDeploymentFuture> e : depFuts.entrySet()) {
+ GridServiceDeploymentFuture fut = e.getValue();
+
+ fut.onDone(new IgniteClientDisconnectedCheckedException(ctx.cluster().clientReconnectFuture(),
+ "Failed to deploy service, client node disconnected."));
+
+ depFuts.remove(e.getKey(), fut);
+ }
+
+ for (Map.Entry<String, GridFutureAdapter<?>> e : undepFuts.entrySet()) {
+ GridFutureAdapter fut = e.getValue();
+
+ fut.onDone(new IgniteClientDisconnectedCheckedException(ctx.cluster().clientReconnectFuture(),
+ "Failed to undeploy service, client node disconnected."));
+
+ undepFuts.remove(e.getKey(), fut);
+ }
+ }
+
/**
* Validates service configuration.
*
@@ -328,6 +351,13 @@ public class GridServiceProcessor extends GridProcessorAdapter {
return old;
}
+ if (ctx.clientDisconnected()) {
+ fut.onDone(new IgniteClientDisconnectedCheckedException(ctx.cluster().clientReconnectFuture(),
+ "Failed to deploy service, client node disconnected."));
+
+ depFuts.remove(cfg.getName(), fut);
+ }
+
while (true) {
try {
GridServiceDeploymentKey key = new GridServiceDeploymentKey(cfg.getName());
@@ -646,10 +676,9 @@ public class GridServiceProcessor extends GridProcessorAdapter {
}
}
else {
- Collection<ClusterNode> nodes =
- assigns.nodeFilter() == null ?
- ctx.discovery().nodes(topVer) :
- F.view(ctx.discovery().nodes(topVer), assigns.nodeFilter());
+ Collection<ClusterNode> nodes = assigns.nodeFilter() == null ?
+ ctx.discovery().nodes(topVer) :
+ F.view(ctx.discovery().nodes(topVer), assigns.nodeFilter());
if (!nodes.isEmpty()) {
int size = nodes.size();
@@ -1019,7 +1048,7 @@ public class GridServiceProcessor extends GridProcessorAdapter {
cache.getAndRemove(key);
}
catch (IgniteCheckedException ex) {
- log.error("Failed to remove assignments for undeployed service: " + name, ex);
+ U.error(log, "Failed to remove assignments for undeployed service: " + name, ex);
}
}
}
@@ -1164,7 +1193,7 @@ public class GridServiceProcessor extends GridProcessorAdapter {
}
}
catch (IgniteCheckedException ex) {
- log.error("Failed to clean up zombie assignments for service: " + name, ex);
+ U.error(log, "Failed to clean up zombie assignments for service: " + name, ex);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProxy.java
index 8e13bc4..556beea 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProxy.java
@@ -68,9 +68,15 @@ class GridServiceProxy<T> implements Serializable {
* @param name Service name.
* @param svc Service type class.
* @param sticky Whether multi-node request should be done.
+ * @param ctx Context.
*/
- @SuppressWarnings("unchecked") GridServiceProxy(ClusterGroup prj, String name, Class<? super T> svc,
- boolean sticky, GridKernalContext ctx) {
+ @SuppressWarnings("unchecked")
+ GridServiceProxy(ClusterGroup prj,
+ String name,
+ Class<? super T> svc,
+ boolean sticky,
+ GridKernalContext ctx)
+ {
this.prj = prj;
this.ctx = ctx;
hasLocNode = hasLocalNode(prj);
@@ -159,6 +165,9 @@ class GridServiceProxy<T> implements Serializable {
catch (RuntimeException | Error e) {
throw e;
}
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
catch (Exception e) {
throw new IgniteException(e);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
index d59a51d..d3caf5f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java
@@ -76,8 +76,7 @@ public class GridTaskProcessor extends GridProcessorAdapter {
private final LongAdder8 execTasks = new LongAdder8();
/** */
- private final ThreadLocal<Map<GridTaskThreadContextKey, Object>> thCtx =
- new ThreadLocal<>();
+ private final ThreadLocal<Map<GridTaskThreadContextKey, Object>> thCtx = new ThreadLocal<>();
/** */
private final GridSpinReadWriteLock lock = new GridSpinReadWriteLock();
@@ -119,6 +118,24 @@ public class GridTaskProcessor extends GridProcessorAdapter {
}
/** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException {
+ IgniteClientDisconnectedCheckedException err = disconnectedError(reconnectFut);
+
+ for (GridTaskWorker<?, ?> worker : tasks.values())
+ worker.finishTask(null, err);
+ }
+
+ /**
+ * @param reconnectFut Reconnect future.
+ * @return Client disconnected exception.
+ */
+ private IgniteClientDisconnectedCheckedException disconnectedError(@Nullable IgniteFuture<?> reconnectFut) {
+ return new IgniteClientDisconnectedCheckedException(
+ reconnectFut != null ? reconnectFut : ctx.cluster().clientReconnectFuture(),
+ "Failed to execute task, client node disconnected.");
+ }
+
+ /** {@inheritDoc} */
@SuppressWarnings("TooBroadScope")
@Override public void onKernalStop(boolean cancel) {
lock.writeLock();
@@ -552,7 +569,7 @@ public class GridTaskProcessor extends GridProcessorAdapter {
// Creates task session with task name and task version.
GridTaskSessionImpl ses = ctx.session().createTaskSession(
sesId,
- ctx.config().getNodeId(),
+ ctx.localNodeId(),
taskName,
dep,
taskCls == null ? null : taskCls.getName(),
@@ -597,25 +614,29 @@ public class GridTaskProcessor extends GridProcessorAdapter {
assert taskWorker0 == null : "Session ID is not unique: " + sesId;
- if (dep.annotation(taskCls, ComputeTaskMapAsync.class) != null) {
- try {
- // Start task execution in another thread.
- if (sys)
- ctx.getSystemExecutorService().execute(taskWorker);
- else
- ctx.getExecutorService().execute(taskWorker);
- }
- catch (RejectedExecutionException e) {
- tasks.remove(sesId);
+ if (!ctx.clientDisconnected()) {
+ if (dep.annotation(taskCls, ComputeTaskMapAsync.class) != null) {
+ try {
+ // Start task execution in another thread.
+ if (sys)
+ ctx.getSystemExecutorService().execute(taskWorker);
+ else
+ ctx.getExecutorService().execute(taskWorker);
+ }
+ catch (RejectedExecutionException e) {
+ tasks.remove(sesId);
- release(dep);
+ release(dep);
- handleException(new ComputeExecutionRejectedException("Failed to execute task " +
- "due to thread pool execution rejection: " + taskName, e), fut);
+ handleException(new ComputeExecutionRejectedException("Failed to execute task " +
+ "due to thread pool execution rejection: " + taskName, e), fut);
+ }
}
+ else
+ taskWorker.run();
}
else
- taskWorker.run();
+ taskWorker.finishTask(null, disconnectedError(null));
}
}
else {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
index eb5fa77..133a31f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
@@ -1070,10 +1070,17 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
PUBLIC_POOL);
}
catch (IgniteCheckedException e) {
- if (!isDeadNode(nodeId))
- U.error(log, "Failed to send cancel request to node (will ignore) [nodeId=" +
- nodeId + ", taskName=" + ses.getTaskName() +
- ", taskSesId=" + ses.getId() + ", jobSesId=" + res.getJobContext().getJobId() + ']', e);
+ try {
+ if (!isDeadNode(nodeId))
+ U.error(log, "Failed to send cancel request to node (will ignore) [nodeId=" +
+ nodeId + ", taskName=" + ses.getTaskName() +
+ ", taskSesId=" + ses.getId() + ", jobSesId=" + res.getJobContext().getJobId() + ']', e);
+ }
+ catch (IgniteClientDisconnectedCheckedException e0) {
+ if (log.isDebugEnabled())
+ log.debug("Failed to send cancel request to node, client disconnected [nodeId=" +
+ nodeId + ", taskName=" + ses.getTaskName() + ']');
+ }
}
}
}
@@ -1169,24 +1176,39 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
}
}
catch (IgniteCheckedException e) {
- boolean deadNode = isDeadNode(res.getNode().id());
+ IgniteException fakeErr = null;
- // Avoid stack trace if node has left grid.
- if (deadNode)
- U.warn(log, "Failed to send job request because remote node left grid (if failover is enabled, " +
- "will attempt fail-over to another node) [node=" + node + ", taskName=" + ses.getTaskName() +
- ", taskSesId=" + ses.getId() + ", jobSesId=" + res.getJobContext().getJobId() + ']');
- else
- U.error(log, "Failed to send job request: " + req, e);
+ try {
+ boolean deadNode = isDeadNode(res.getNode().id());
+
+ // Avoid stack trace if node has left grid.
+ if (deadNode) {
+ U.warn(log, "Failed to send job request because remote node left grid (if failover is enabled, " +
+ "will attempt fail-over to another node) [node=" + node + ", taskName=" + ses.getTaskName() +
+ ", taskSesId=" + ses.getId() + ", jobSesId=" + res.getJobContext().getJobId() + ']');
+
+ fakeErr = new ClusterTopologyException("Failed to send job due to node failure: " + node, e);
+ }
+ else
+ U.error(log, "Failed to send job request: " + req, e);
+
+ }
+ catch (IgniteClientDisconnectedCheckedException e0) {
+ if (log.isDebugEnabled())
+ log.debug("Failed to send job request, client disconnected [node=" + node +
+ ", taskName=" + ses.getTaskName() + ", taskSesId=" + ses.getId() + ", jobSesId=" +
+ res.getJobContext().getJobId() + ']');
+
+ fakeErr = U.convertException(e0);
+ }
GridJobExecuteResponse fakeRes = new GridJobExecuteResponse(node.id(), ses.getId(),
res.getJobContext().getJobId(), null, null, null, null, null, null, false);
- if (deadNode)
- fakeRes.setFakeException(new ClusterTopologyException("Failed to send job due to node failure: " +
- node, e));
- else
- fakeRes.setFakeException(U.convertException(e));
+ if (fakeErr == null)
+ fakeErr = U.convertException(e);
+
+ fakeRes.setFakeException(fakeErr);
onResponse(fakeRes);
}
@@ -1345,8 +1367,9 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
*
* @param uid UID of node to check.
* @return {@code true} if node is dead, {@code false} is node is alive.
+ * @throws IgniteClientDisconnectedCheckedException if ping failed when client disconnected.
*/
- private boolean isDeadNode(UUID uid) {
+ private boolean isDeadNode(UUID uid) throws IgniteClientDisconnectedCheckedException {
return ctx.discovery().node(uid) == null || !ctx.discovery().pingNode(uid);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/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 f457d6c..66eb596 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
@@ -626,6 +626,15 @@ public abstract class IgniteUtils {
}
});
+ m.put(IgniteClientDisconnectedCheckedException.class, new C1<IgniteCheckedException, IgniteException>() {
+ @Override public IgniteException apply(IgniteCheckedException e) {
+ return new IgniteClientDisconnectedException(
+ ((IgniteClientDisconnectedCheckedException)e).reconnectFuture(),
+ e.getMessage(),
+ e);
+ }
+ });
+
return m;
}
@@ -673,6 +682,25 @@ public abstract class IgniteUtils {
* @return Ignite runtime exception.
*/
public static IgniteException convertException(IgniteCheckedException e) {
+ IgniteClientDisconnectedException e0 = e.getCause(IgniteClientDisconnectedException.class);
+
+ if (e0 != null) {
+ assert e0.reconnectFuture() != null : e0;
+
+ throw e0;
+ }
+
+ IgniteClientDisconnectedCheckedException disconnectedErr =
+ e instanceof IgniteClientDisconnectedCheckedException ?
+ (IgniteClientDisconnectedCheckedException)e
+ : e.getCause(IgniteClientDisconnectedCheckedException.class);
+
+ if (disconnectedErr != null) {
+ assert disconnectedErr.reconnectFuture() != null : disconnectedErr;
+
+ e = disconnectedErr;
+ }
+
C1<IgniteCheckedException, IgniteException> converter = exceptionConverters.get(e.getClass());
if (converter != null)
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryClientEndpoint.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryClientEndpoint.java b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryClientEndpoint.java
index c935c4a..a4f7804 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryClientEndpoint.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryClientEndpoint.java
@@ -59,8 +59,9 @@ public class IpcSharedMemoryClientEndpoint implements IpcEndpoint {
* @param outSpace Out space.
* @param parent Parent logger.
*/
- public IpcSharedMemoryClientEndpoint(IpcSharedMemorySpace inSpace, IpcSharedMemorySpace outSpace,
- IgniteLogger parent) {
+ public IpcSharedMemoryClientEndpoint(IpcSharedMemorySpace inSpace,
+ IpcSharedMemorySpace outSpace,
+ IgniteLogger parent) {
assert inSpace != null;
assert outSpace != null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
index 6f544e0..f3bcab0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
@@ -1570,6 +1570,7 @@ public class GridFunc {
* @param <T> Type of the collection.
* @return Light-weight view on given collection with provided predicate.
*/
+ @SafeVarargs
public static <T> Collection<T> view(@Nullable final Collection<T> c,
@Nullable final IgnitePredicate<? super T>... p) {
if (isEmpty(c) || isAlwaysFalse(p))
@@ -2706,6 +2707,7 @@ public class GridFunc {
* @param <T> Type of the free variable, i.e. the element the predicate is called on.
* @return Negated predicate.
*/
+ @SafeVarargs
public static <T> IgnitePredicate<T> not(@Nullable final IgnitePredicate<? super T>... p) {
return isAlwaysFalse(p) ? F.<T>alwaysTrue() : isAlwaysTrue(p) ? F.<T>alwaysFalse() : new P1<T>() {
@Override public boolean apply(T t) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpi.java
index 968d88d..0f6ed5c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpi.java
@@ -17,6 +17,7 @@
package org.apache.ignite.spi;
+import org.apache.ignite.lang.*;
import org.jetbrains.annotations.*;
import java.util.*;
@@ -106,4 +107,18 @@ public interface IgniteSpi {
* @throws IgniteSpiException Thrown in case of any error during SPI stop.
*/
public void spiStop() throws IgniteSpiException;
+
+ /**
+ * Client node disconnected callback.
+ *
+ * @param reconnectFut Future that will be completed when client reconnected.
+ */
+ public void onClientDisconnected(IgniteFuture<?> reconnectFut);
+
+ /**
+ * Client node reconnected callback.
+ *
+ * @param clusterRestarted {@code True} if all cluster nodes restarted while client was disconnected.
+ */
+ public void onClientReconnected(boolean clusterRestarted);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
index 5e557bd..07b39bb 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
@@ -27,6 +27,7 @@ import org.apache.ignite.internal.processors.timeout.*;
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.plugin.extensions.communication.*;
import org.apache.ignite.plugin.security.*;
import org.apache.ignite.resources.*;
@@ -58,9 +59,6 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
/** Ignite instance. */
protected Ignite ignite;
- /** Local node id. */
- protected UUID nodeId;
-
/** Grid instance name. */
protected String gridName;
@@ -73,6 +71,9 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
/** Discovery listener. */
private GridLocalEventListener paramsLsnr;
+ /** Local node. */
+ private ClusterNode locNode;
+
/**
* Creates new adapter and initializes it from the current (this) class.
* SPI name will be initialized to the simple name of the class
@@ -111,7 +112,19 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
/** {@inheritDoc} */
@Override public UUID getLocalNodeId() {
- return nodeId;
+ return ignite.cluster().localNode().id();
+ }
+
+ /**
+ * @return Local node.
+ */
+ protected ClusterNode getLocalNode() {
+ if (locNode != null)
+ return locNode;
+
+ locNode = getSpiContext().localNode();
+
+ return locNode;
}
/** {@inheritDoc} */
@@ -194,17 +207,27 @@ public abstract class IgniteSpiAdapter implements IgniteSpi, IgniteSpiManagement
spiCtx = new GridDummySpiContext(locNode, true, spiCtx);
}
+ /** {@inheritDoc} */
+ @Override public void onClientDisconnected(IgniteFuture<?> reconnectFut) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void onClientReconnected(boolean clusterRestarted) {
+ // No-op.
+ }
+
/**
* Inject ignite instance.
+ *
+ * @param ignite Ignite instance.
*/
@IgniteInstanceResource
protected void injectResources(Ignite ignite) {
this.ignite = ignite;
- if (ignite != null) {
- nodeId = ignite.configuration().getNodeId();
+ if (ignite != null)
gridName = ignite.name();
- }
}
/**
[33/50] [abbrv] incubator-ignite git commit: 1.4.1-SNAPSHOT
Posted by av...@apache.org.
1.4.1-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/69e0ad2a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/69e0ad2a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/69e0ad2a
Branch: refs/heads/ignite-630
Commit: 69e0ad2a8eb0d834f07a5549e18331325fcc42c7
Parents: 13e55b2
Author: Ignite Teamcity <ig...@apache.org>
Authored: Thu Jul 16 12:35:56 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Thu Jul 16 12:35:56 2015 +0300
----------------------------------------------------------------------
modules/apache-license-gen/pom.xml | 2 +-
modules/yarn/pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/69e0ad2a/modules/apache-license-gen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/apache-license-gen/pom.xml b/modules/apache-license-gen/pom.xml
index 6e22668..3025eab 100644
--- a/modules/apache-license-gen/pom.xml
+++ b/modules/apache-license-gen/pom.xml
@@ -31,7 +31,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-apache-license-gen</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<build>
<plugins>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/69e0ad2a/modules/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yarn/pom.xml b/modules/yarn/pom.xml
index 2679603..63aa3cd 100644
--- a/modules/yarn/pom.xml
+++ b/modules/yarn/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yarn</artifactId>
- <version>1.3.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<properties>
<hadoop.version>2.7.0</hadoop.version>
[43/50] [abbrv] incubator-ignite git commit: checksum spaces fix
Posted by av...@apache.org.
checksum spaces 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/700600d8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/700600d8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/700600d8
Branch: refs/heads/ignite-630
Commit: 700600d82d5b8faa474cbd6686f33f2db36f3c35
Parents: aef4063
Author: Anton Vinogradov <av...@gridgain.com>
Authored: Thu Jul 16 13:16:44 2015 +0300
Committer: Anton Vinogradov <av...@gridgain.com>
Committed: Thu Jul 16 13:16:44 2015 +0300
----------------------------------------------------------------------
pom.xml | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/700600d8/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 344db40..a6ca9f5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -607,14 +607,12 @@
</copy>
<!-- appending filename to md5 and sha1 files. to be improved. -->
- <echo file="${basedir}/target/site/${project.artifactId}-fabric-${project.version}-bin.zip.md5" append="true" message=" ${project.artifactId}-fabric-${project.version}-bin.zip" />
- <echo file="${basedir}/target/site/${project.artifactId}-fabric-${project.version}-bin.zip.sha1" append="true" message=" ${project.artifactId}-fabric-${project.version}-bin.zip" />
- <echo file="${basedir}/target/site/${project.artifactId}-hadoop-${project.version}-bin.zip.md5" append="true" message=" ${project.artifactId}-hadoop-${project.version}-bin.zip" />
- <echo file="${basedir}/target/site/${project.artifactId}-hadoop-${project.version}-bin.zip.sha1" append="true" message=" ${project.artifactId}-hadoop-${project.version}-bin.zip" />
- <echo file="${basedir}/target/site/${project.artifactId}-${project.version}-src.zip.md5" append="true" message=" ${project.artifactId}-${project.version}-src.zip" />
- <echo file="${basedir}/target/site/${project.artifactId}-${project.version}-src.zip.sha1" append="true" message=" ${project.artifactId}-${project.version}-src.zip" />
-
- <copy file="${basedir}/KEYS" todir="${basedir}/target/site" failonerror="false" />
+ <echo file="${basedir}/target/site/${project.artifactId}-fabric-${project.version}-bin.zip.md5" append="true" message=" ${project.artifactId}-fabric-${project.version}-bin.zip" />
+ <echo file="${basedir}/target/site/${project.artifactId}-fabric-${project.version}-bin.zip.sha1" append="true" message=" ${project.artifactId}-fabric-${project.version}-bin.zip" />
+ <echo file="${basedir}/target/site/${project.artifactId}-hadoop-${project.version}-bin.zip.md5" append="true" message=" ${project.artifactId}-hadoop-${project.version}-bin.zip" />
+ <echo file="${basedir}/target/site/${project.artifactId}-hadoop-${project.version}-bin.zip.sha1" append="true" message=" ${project.artifactId}-hadoop-${project.version}-bin.zip" />
+ <echo file="${basedir}/target/site/${project.artifactId}-${project.version}-src.zip.md5" append="true" message=" ${project.artifactId}-${project.version}-src.zip" />
+ <echo file="${basedir}/target/site/${project.artifactId}-${project.version}-src.zip.sha1" append="true" message=" ${project.artifactId}-${project.version}-src.zip" />
</target>
</configuration>
</execution>
[50/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/master' into ignite-630
Posted by av...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-630
Conflicts:
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/79ba5a79
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/79ba5a79
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/79ba5a79
Branch: refs/heads/ignite-630
Commit: 79ba5a7924b1ba5303a31b3c6a44ad3dc2ede9b4
Parents: dc18c3d
Author: Anton Vinogradov <av...@gridgain.com>
Authored: Fri Jul 17 15:49:37 2015 +0300
Committer: Anton Vinogradov <av...@gridgain.com>
Committed: Fri Jul 17 15:49:37 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/internal/processors/cache/GridCacheAdapter.java | 3 ++-
.../apache/ignite/internal/processors/cache/GridCacheEntryEx.java | 3 +--
.../internal/processors/cache/eviction/GridCacheMockEntry.java | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/79ba5a79/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 0c6fcf1..aef1d64 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
@@ -1375,7 +1375,8 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
if (log.isDebugEnabled()) {
log.debug("Set value loaded from store into entry [set=" + set + ", " +
- "newVer=" + nextVer + ", entry=" + entry + ']');
+ "curVer=" +
+ curVer + ", newVer=" + nextVer + ", entry=" + entry + ']');
}
}
else {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/79ba5a79/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 f50d6b2..c2d0271 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
@@ -943,11 +943,10 @@ public interface GridCacheEntryEx {
* @param <V> Value type.
* @return {@code True} if value was removed, {@code false} otherwise.
*/
- public <V> boolean removeMeta(UUID name, V val);
+ public <V> boolean removeMeta(int key, V val);
/**
* Calls {@link GridDhtLocalPartition#onUnlock()} for this entry's partition.
*/
public void onUnlock();
- public <V> boolean removeMeta(int key, V val);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/79ba5a79/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java
index 333fae5..7a32596 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/eviction/GridCacheMockEntry.java
@@ -30,7 +30,7 @@ import javax.cache.*;
*/
public class GridCacheMockEntry<K, V> extends GridMetadataAwareAdapter implements Cache.Entry<K, V>, EvictableEntry<K, V> {
/** */
- private static final int META_KEY = EntryKey.values().length; //+1 to maximum value
+ private static final int META_KEY = EntryKey.values().length; //+1 to maximum value (test only case)
/** */
@GridToStringInclude
[08/50] [abbrv] incubator-ignite git commit: 1.3.1-SNAPSHOT
Posted by av...@apache.org.
1.3.1-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/cf78f231
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cf78f231
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cf78f231
Branch: refs/heads/ignite-630
Commit: cf78f231c9a4df28c4c6f46c06a34ce1d786e4d2
Parents: d1f5102
Author: Ignite Teamcity <ig...@apache.org>
Authored: Mon Jul 13 09:51:23 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Mon Jul 13 09:51:23 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 +-
.../core/src/main/resources/ignite.properties | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
.../extdata/uri/modules/uri-dependency/pom.xml | 6 ++---
modules/extdata/uri/pom.xml | 26 ++++++++------------
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, 51 insertions(+), 59 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 2f292e9..a94b888 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index 704358f..fd3e41b 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/apache-license-gen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/apache-license-gen/pom.xml b/modules/apache-license-gen/pom.xml
index c96ca5a..6e22668 100644
--- a/modules/apache-license-gen/pom.xml
+++ b/modules/apache-license-gen/pom.xml
@@ -31,7 +31,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-apache-license-gen</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<build>
<plugins>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 38d300e..954d19b 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index ca68ef8..fbbf4be 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index d752588..60c87df 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 9a09a69..2471585 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 6c5af02..2c0dfda 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/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 830ca22..3a6aa6f 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.2.1-SNAPSHOT
+ignite.version=1.3.1-SNAPSHOT
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index 5de55f5..19c9a28 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.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/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 c92eb38..2ea01d9 100644
--- a/modules/extdata/uri/modules/uri-dependency/pom.xml
+++ b/modules/extdata/uri/modules/uri-dependency/pom.xml
@@ -16,9 +16,7 @@
limitations under the License.
-->
-<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">
+<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">
<parent>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-parent</artifactId>
@@ -29,7 +27,7 @@
<artifactId>ignite-extdata-uri-dep</artifactId>
<packaging>jar</packaging>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index c7b4067..984c744 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -20,8 +20,7 @@
<!--
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">
+<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>
<packaging>pom</packaging>
@@ -33,7 +32,7 @@
</parent>
<artifactId>ignite-extdata-uri</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
@@ -140,33 +139,28 @@
<!-- copying resources to classes -->
<copy todir="${basedir}/target/classes">
<fileset dir="${basedir}/src/main/java">
- <include name="**/*.xml"/>
- <include name="**/*.properties"/>
+ <include name="**/*.xml" />
+ <include name="**/*.properties" />
</fileset>
</copy>
- <copy
- file="${settings.localRepository}/com/sun/mail/javax.mail/1.5.2/javax.mail-1.5.2.jar"
- todir="${basedir}/target/classes/lib"/>
+ <copy file="${settings.localRepository}/com/sun/mail/javax.mail/1.5.2/javax.mail-1.5.2.jar" todir="${basedir}/target/classes/lib" />
<zip destfile="${basedir}/target/classes/lib/depend.jar" encoding="UTF-8">
- <zipfileset dir="modules/uri-dependency/target/classes"/>
+ <zipfileset dir="modules/uri-dependency/target/classes" />
</zip>
- <taskdef name="gar"
- classname="org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask"/>
+ <taskdef name="gar" classname="org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask" />
- <gar destfile="${basedir}/target/deploy/uri.gar" basedir="${basedir}/target/classes"/>
+ <gar destfile="${basedir}/target/deploy/uri.gar" basedir="${basedir}/target/classes" />
<!--
This is created for test GridTaskUriDeploymentDeadlockSelfTest.
We put two files here to have a collision and make deployment SPI to unregister class loaders.
This is intended to test GG-2852 issue.
-->
- <gar destfile="${basedir}/target/resources/helloworld.gar"
- descrdir="${basedir}/META-INF" basedir="${basedir}/target/classes"/>
- <gar destfile="${basedir}/target/resources/helloworld1.gar"
- descrdir="${basedir}/META-INF" basedir="${basedir}/target/classes"/>
+ <gar destfile="${basedir}/target/resources/helloworld.gar" descrdir="${basedir}/META-INF" basedir="${basedir}/target/classes" />
+ <gar destfile="${basedir}/target/resources/helloworld1.gar" descrdir="${basedir}/META-INF" basedir="${basedir}/target/classes" />
</target>
</configuration>
</execution>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index f132d39..3ee4360 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index 10035c6..a9fbbe8 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index bb46b2a..a07c5b9 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index 3130f4b..54fea68 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 8c02e02..dac173f 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 9f65eb0..3b5a0be 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index 2d4df0b..abe3497 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index c492100..9541bd4 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-kafka</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index 3343438..d1f4823 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index 328e5b8..15a6c0c 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-mesos</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<properties>
<mesos.version>0.22.0</mesos.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 85be48e..cc6cbc7 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.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index b7c9178..2dcaba8 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.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 7a2e243..863aaa4 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 49b75bd..70b38dd 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 7f8fff4..e542bdb 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.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 01ad28f..9eb7958 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index 7463d52..2dedf6d 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.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index 265bb16..4ea1a82 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index ab98384..f772084 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index 708be4f..1d3e4e1 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 17ba197..5179489 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index b896119..8c93df7 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/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 193e676..f37d4ed 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.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 87fa4f9..a2d25bc 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.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 8a80009..4aca66b 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.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<!-- Ignite dependencies -->
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index 8e62a11..45ae1f0 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index a9ee178..4d9adb7 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<properties>
<yardstick.version>0.7.0</yardstick.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/modules/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yarn/pom.xml b/modules/yarn/pom.xml
index 1471ac7..8ac1aea 100644
--- a/modules/yarn/pom.xml
+++ b/modules/yarn/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yarn</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<properties>
<hadoop.version>2.7.0</hadoop.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cf78f231/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9988281..85bfe14 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>apache-ignite</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.3.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
[03/50] [abbrv] incubator-ignite git commit: # ignite-648:
Implemented.
Posted by av...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
new file mode 100644
index 0000000..b15b6ef
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteCacheProcessProxy.java
@@ -0,0 +1,602 @@
+/*
+ * 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.testframework.junits.multijvm;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.query.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.internal.util.future.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.mxbean.*;
+import org.jetbrains.annotations.*;
+
+import javax.cache.*;
+import javax.cache.CacheManager;
+import javax.cache.configuration.*;
+import javax.cache.expiry.*;
+import javax.cache.integration.*;
+import javax.cache.processor.*;
+import java.util.*;
+import java.util.concurrent.locks.*;
+
+/**
+ * Ignite cache proxy for ignite instance at another JVM.
+ */
+@SuppressWarnings("TransientFieldInNonSerializableClass")
+public class IgniteCacheProcessProxy<K, V> implements IgniteCache<K, V> {
+ /** Compute. */
+ private final transient IgniteCompute compute;
+
+ /** Cache name. */
+ private final String cacheName;
+
+ /** Grid id. */
+ private final UUID gridId;
+
+ /** With async. */
+ private final boolean isAsync;
+
+ /** Ignite proxy. */
+ private final transient IgniteProcessProxy igniteProxy;
+
+ /**
+ * @param name Name.
+ * @param proxy Ignite Process Proxy.
+ */
+ public IgniteCacheProcessProxy(String name, IgniteProcessProxy proxy) {
+ this(name, false, proxy);
+ }
+
+ /**
+ * @param name Name.
+ * @param async
+ * @param proxy Ignite Process Proxy.
+ */
+ public IgniteCacheProcessProxy(String name, boolean async, IgniteProcessProxy proxy) {
+ cacheName = name;
+ isAsync = async;
+ gridId = proxy.getId();
+ igniteProxy = proxy;
+ compute = proxy.remoteCompute();
+ }
+
+ /**
+ * Returns cache instance. Method to be called from closure at another JVM.
+ *
+ * @return Cache.
+ */
+ private IgniteCache<Object, Object> cache() {
+ IgniteCache cache = Ignition.ignite(gridId).cache(cacheName);
+
+ if (isAsync)
+ cache = cache.withAsync();
+
+ return cache;
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteCache<K, V> withAsync() {
+ return new IgniteCacheProcessProxy<>(cacheName, true, igniteProxy);
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isAsync() {
+ return isAsync;
+ }
+
+ /** {@inheritDoc} */
+ @Override public <R> IgniteFuture<R> future() {
+ // Return fake future. Future should be called in the same place where operation done.
+ return new IgniteFinishedFutureImpl<>();
+ }
+
+ /** {@inheritDoc} */
+ @Override public <C extends Configuration<K, V>> C getConfiguration(final Class<C> clazz) {
+ final Class cl = clazz;
+
+ return (C)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().getConfiguration(cl);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public Entry<K, V> randomEntry() {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteCache<K, V> withExpiryPolicy(ExpiryPolicy plc) {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteCache<K, V> withSkipStore() {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ @Override public IgniteCache<K, V> withNoRetries() {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void loadCache(@Nullable IgniteBiPredicate<K, V> p, @Nullable Object... args) throws CacheException {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void localLoadCache(@Nullable final IgniteBiPredicate<K, V> p, @Nullable final Object... args) throws CacheException {
+ final IgniteBiPredicate pCopy = p;
+
+ compute.run(new IgniteRunnable() {
+ @Override public void run() {
+ cache().localLoadCache(pCopy, args);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public V getAndPutIfAbsent(final K key, final V val) throws CacheException {
+ return (V)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().getAndPutIfAbsent(key, val);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public Lock lock(K key) {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public Lock lockAll(Collection<? extends K> keys) {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isLocalLocked(final K key, final boolean byCurrThread) {
+ return compute.call(new IgniteCallable<Boolean>() {
+ @Override public Boolean call() throws Exception {
+ return cache().isLocalLocked(key, byCurrThread);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public <R> QueryCursor<R> query(Query<R> qry) {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ @Override public Iterable<Entry<K, V>> localEntries(final CachePeekMode... peekModes) throws CacheException {
+ return (Iterable<Entry<K, V>>)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ Collection<Entry> res = new ArrayList<>();
+
+ for (Entry e : cache().localEntries(peekModes))
+ res.add(e);
+
+ return res;
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public QueryMetrics queryMetrics() {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void localEvict(final Collection<? extends K> keys) {
+ compute.run(new IgniteRunnable() {
+ @Override public void run() {
+ cache().localEvict(keys);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public V localPeek(final K key, final CachePeekMode... peekModes) {
+ return (V)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().localPeek(key, peekModes);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public void localPromote(Set<? extends K> keys) throws CacheException {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public int size(final CachePeekMode... peekModes) throws CacheException {
+ return (int)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().size(peekModes);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public int localSize(final CachePeekMode... peekModes) {
+ return (int)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().localSize(peekModes);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(Map<? extends K, ? extends EntryProcessor<K, V, T>> map,
+ Object... args) {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public V get(final K key) {
+ return (V)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().get(key);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<K, V> getAll(final Set<? extends K> keys) {
+ return (Map<K, V>)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().getAll(keys);
+ }
+ });
+ }
+
+ @Override public Map<K, V> getAllOutTx(final Set<? extends K> keys) {
+ return (Map<K, V>)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().getAllOutTx(keys);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean containsKey(final K key) {
+ return (boolean)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().containsKey(key);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public void loadAll(Set<? extends K> keys, boolean replaceExistingValues, CompletionListener completionLsnr) {
+ throw new UnsupportedOperationException("Oparetion can't be supported automatically.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean containsKeys(final Set<? extends K> keys) {
+ return (boolean)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().containsKeys(keys);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public void put(final K key, final V val) {;
+ compute.run(new IgniteRunnable() {
+ @Override public void run() {
+ cache().put(key, val);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public V getAndPut(final K key, final V val) {
+ return (V)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().getAndPut(key, val);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public void putAll(final Map<? extends K, ? extends V> map) {
+ compute.run(new IgniteRunnable() {
+ @Override public void run() {
+ cache().putAll(map);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean putIfAbsent(final K key, final V val) {
+ return (boolean)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().putIfAbsent(key, val);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean remove(final K key) {
+ return (boolean)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().remove(key);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean remove(final K key, final V oldVal) {
+ return (boolean)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().remove(key, oldVal);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public V getAndRemove(final K key) {
+ return (V)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().getAndRemove(key);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean replace(final K key, final V oldVal, final V newVal) {
+ return (boolean)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().replace(key, oldVal, newVal);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean replace(final K key, final V val) {
+ return (boolean)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().replace(key, val);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public V getAndReplace(final K key, final V val) {
+ return (V)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().getAndReplace(key, val);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public void removeAll(final Set<? extends K> keys) {
+ compute.run(new IgniteRunnable() {
+ @Override public void run() {
+ cache().removeAll(keys);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public void removeAll() {
+ compute.run(new IgniteRunnable() {
+ @Override public void run() {
+ IgniteCache<Object, Object> cache = cache();
+
+ cache.removeAll();
+
+ if (isAsync)
+ cache.future().get();
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public void clear() {
+ compute.run(new IgniteRunnable() {
+ @Override public void run() {
+ cache().clear();
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public void clear(final K key) {
+ compute.run(new IgniteRunnable() {
+ @Override public void run() {
+ cache().clear(key);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public void clearAll(final Set<? extends K> keys) {
+ compute.run(new IgniteRunnable() {
+ @Override public void run() {
+ cache().clearAll(keys);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public void localClear(final K key) {
+ compute.run(new IgniteRunnable() {
+ @Override public void run() {
+ cache().localClear(key);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public void localClearAll(final Set<? extends K> keys) {
+ compute.run(new IgniteRunnable() {
+ @Override public void run() {
+ cache().localClearAll(keys);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T> T invoke(final K key, final EntryProcessor<K, V, T> entryProcessor, final Object... arguments) {
+ return (T)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().invoke(key,
+ (EntryProcessor<Object, Object, Object>)entryProcessor, arguments);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T> T invoke(final K key, final CacheEntryProcessor<K, V, T> entryProcessor, final Object... arguments) {
+ return (T)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().invoke(key,
+ (CacheEntryProcessor<Object, Object, Object>)entryProcessor, arguments);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(final Set<? extends K> keys, final EntryProcessor<K, V, T> entryProcessor,
+ final Object... args) {
+ return (Map<K, EntryProcessorResult<T>>)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().invokeAll(keys,
+ (EntryProcessor<Object, Object, Object>)entryProcessor, args);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public String getName() {
+ return (String)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().getName();
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public CacheManager getCacheManager() {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void close() {
+ compute.run(new IgniteRunnable() {
+ @Override public void run() {
+ cache().close();
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public void destroy() {
+ compute.run(new IgniteRunnable() {
+ @Override public void run() {
+ cache().destroy();
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isClosed() {
+ return (boolean)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().isClosed();
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T> T unwrap(final Class<T> clazz) {
+ if (Ignite.class.equals(clazz))
+ return (T)igniteProxy;
+
+ try {
+ return (T)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return cache().unwrap(clazz);
+ }
+ });
+ }
+ catch (Exception e) {
+ throw new IllegalArgumentException("Looks like class " + clazz + " is unmarshallable. Exception type:" + e.getClass(), e);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public void registerCacheEntryListener(CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration) {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void deregisterCacheEntryListener(CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration) {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public Iterator<Entry<K, V>> iterator() {
+ final Collection<Entry<K, V>> col = (Collection<Entry<K, V>>)compute.call(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ Collection res = new ArrayList();
+
+ for (Object o : cache())
+ res.add(o);
+
+ return res;
+ }
+ });
+
+ return col.iterator();
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T> Map<K, EntryProcessorResult<T>> invokeAll(Set<? extends K> keys,
+ CacheEntryProcessor<K, V, T> entryProcessor, Object... args) {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteFuture<?> rebalance() {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public CacheMetrics metrics() {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public CacheMetrics metrics(ClusterGroup grp) {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public CacheMetricsMXBean mxBean() {
+ throw new UnsupportedOperationException("Method should be supported.");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
new file mode 100644
index 0000000..159c451
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
@@ -0,0 +1,320 @@
+/*
+ * 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.testframework.junits.multijvm;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.internal.cluster.*;
+import org.apache.ignite.lang.*;
+import org.jetbrains.annotations.*;
+
+import java.io.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * Proxy class for cluster at another JVM.
+ */
+@SuppressWarnings("TransientFieldInNonSerializableClass")
+public class IgniteClusterProcessProxy implements IgniteClusterEx {
+ /** Grid id. */
+ private final UUID gridId;
+
+ /** Compute. */
+ private final transient IgniteCompute compute;
+
+ /** */
+ private final IgniteProcessProxy proxy;
+
+ /**
+ * @param proxy Ignite Proxy.
+ */
+ public IgniteClusterProcessProxy(IgniteProcessProxy proxy) {
+ this.proxy = proxy;
+ gridId = proxy.getId();
+ compute = proxy.remoteCompute();
+ }
+
+ /**
+ * Returns cluster instance. Method to be called from closure at another JVM.
+ *
+ * @return Cache.
+ */
+ private IgniteClusterEx cluster() {
+ return (IgniteClusterEx)Ignition.ignite(gridId).cluster();
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroupEx forSubjectId(final UUID subjId) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forCacheNodes(@Nullable String cacheName, boolean affNodes, boolean nearNodes,
+ boolean clientNodes) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterNode localNode() {
+ return compute.call(new IgniteCallable<ClusterNode>() {
+ @Override public ClusterNode call() throws Exception {
+ return cluster().localNode();
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forLocal() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K, V> ConcurrentMap<K, V> nodeLocalMap() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean pingNode(UUID nodeId) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public long topologyVersion() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<ClusterNode> topology(long topVer) throws UnsupportedOperationException {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K> Map<ClusterNode, Collection<K>> mapKeysToNodes(@Nullable String cacheName,
+ @Nullable Collection<? extends K> keys) throws IgniteException {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K> ClusterNode mapKeyToNode(@Nullable String cacheName, K key) throws IgniteException {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<ClusterStartNodeResult> startNodes(File file, boolean restart, int timeout,
+ int maxConn) throws IgniteException {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<ClusterStartNodeResult> startNodes(Collection<Map<String, Object>> hosts,
+ @Nullable Map<String, Object> dflts, boolean restart, int timeout, int maxConn) throws IgniteException {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void stopNodes() throws IgniteException {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void stopNodes(Collection<UUID> ids) throws IgniteException {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void restartNodes() throws IgniteException {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void restartNodes(Collection<UUID> ids) throws IgniteException {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void resetMetrics() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteCluster withAsync() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isAsync() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <R> IgniteFuture<R> future() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public Ignite ignite() {
+ return proxy;
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forNodes(Collection<? extends ClusterNode> nodes) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forNode(ClusterNode node, ClusterNode... nodes) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forOthers(ClusterNode node, ClusterNode... nodes) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forOthers(ClusterGroup prj) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forNodeIds(Collection<UUID> ids) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forNodeId(UUID id, UUID... ids) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forPredicate(IgnitePredicate<ClusterNode> p) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forAttribute(String name, @Nullable Object val) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forServers() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forClients() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forCacheNodes(String cacheName) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forDataNodes(String cacheName) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forClientNodes(String cacheName) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forRemotes() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forHost(ClusterNode node) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forHost(String host, String... hosts) {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forDaemons() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forRandom() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forOldest() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup forYoungest() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<ClusterNode> nodes() {
+ return compute.call(new IgniteCallable<Collection<ClusterNode>>() {
+ @Override public Collection<ClusterNode> call() throws Exception {
+ return cluster().nodes();
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterNode node(final UUID nid) {
+ return compute.call(new IgniteCallable<ClusterNode>() {
+ @Override public ClusterNode call() throws Exception {
+ return cluster().node(nid);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterNode node() {
+ return compute.call(new IgniteCallable<ClusterNode>() {
+ @Override public ClusterNode call() throws Exception {
+ return cluster().node();
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<String> hostNames() {
+ return compute.call(new IgniteCallable<Collection<String>>() {
+ @Override public Collection<String> call() throws Exception {
+ return cluster().hostNames();
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgnitePredicate<ClusterNode> predicate() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterMetrics metrics() throws IgniteException {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteEventsProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteEventsProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteEventsProcessProxy.java
new file mode 100644
index 0000000..018aa8d
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteEventsProcessProxy.java
@@ -0,0 +1,148 @@
+/*
+ * 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.testframework.junits.multijvm;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.lang.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+
+/**
+ * Ignite events proxy for ignite instance at another JVM.
+ */
+@SuppressWarnings("TransientFieldInNonSerializableClass")
+public class IgniteEventsProcessProxy implements IgniteEvents {
+ /** Ignite proxy. */
+ private final transient IgniteProcessProxy igniteProxy;
+
+ /** Grid id. */
+ private final UUID gridId;
+
+ /**
+ * @param igniteProxy Ignite proxy.
+ */
+ public IgniteEventsProcessProxy(IgniteProcessProxy igniteProxy) {
+ this.igniteProxy = igniteProxy;
+
+ gridId = igniteProxy.getId();
+ }
+
+ /**
+ * @return Events instance.
+ */
+ private IgniteEvents events() {
+ return Ignition.ignite(gridId).events();
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterGroup clusterGroup() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T extends Event> List<T> remoteQuery(IgnitePredicate<T> p, long timeout,
+ @Nullable int... types) throws IgniteException {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T extends Event> UUID remoteListen(@Nullable IgniteBiPredicate<UUID, T> locLsnr,
+ @Nullable IgnitePredicate<T> rmtFilter, @Nullable int... types) throws IgniteException {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T extends Event> UUID remoteListen(int bufSize, long interval, boolean autoUnsubscribe,
+ @Nullable IgniteBiPredicate<UUID, T> locLsnr, @Nullable IgnitePredicate<T> rmtFilter,
+ @Nullable int... types) throws IgniteException {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void stopRemoteListen(UUID opId) throws IgniteException {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T extends Event> T waitForLocal(@Nullable IgnitePredicate<T> filter,
+ @Nullable int... types) throws IgniteException {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T extends Event> Collection<T> localQuery(IgnitePredicate<T> p, @Nullable int... types) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void recordLocal(Event evt) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void localListen(final IgnitePredicate<? extends Event> lsnr, final int... types) {
+ igniteProxy.remoteCompute().run(new IgniteRunnable() {
+ @Override public void run() {
+ events().localListen(lsnr, types);
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean stopLocalListen(IgnitePredicate<? extends Event> lsnr, @Nullable int... types) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void enableLocal(int... types) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void disableLocal(int... types) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public int[] enabledEvents() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isEnabled(int type) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteEvents withAsync() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isAsync() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <R> IgniteFuture<R> future() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java
new file mode 100644
index 0000000..2703d2b
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteNodeRunner.java
@@ -0,0 +1,184 @@
+/*
+ * 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.testframework.junits.multijvm;
+
+import com.thoughtworks.xstream.*;
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.util.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.marshaller.optimized.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import sun.jvmstat.monitor.*;
+
+import java.io.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+/**
+ * Run ignite node.
+ */
+public class IgniteNodeRunner {
+ /** */
+ private static final String IGNITE_CONFIGURATION_FILE = System.getProperty("java.io.tmpdir") +
+ File.separator + "igniteConfiguration.tmp_";
+
+ /** */
+ private static volatile Ignite ignite;
+
+ /**
+ * Starts {@link Ignite} instance accorging to given arguments.
+ *
+ * @param args Arguments.
+ * @throws Exception If failed.
+ */
+ public static void main(String[] args) throws Exception {
+ X.println(GridJavaProcess.PID_MSG_PREFIX + U.jvmPid());
+
+ X.println("Starting Ignite Node... Args=" + Arrays.toString(args));
+
+ IgniteConfiguration cfg = readCfgFromFileAndDeleteFile(args[0]);
+
+ ignite = Ignition.start(cfg);
+ }
+
+ /**
+ * @return Ignite instance started at main.
+ */
+ public static IgniteEx startedInstance(){
+ return (IgniteEx)ignite;
+ }
+
+ /**
+ * @return <code>True</code> if there is ignite node started via {@link IgniteNodeRunner} at this JVM.
+ */
+ public static boolean hasStartedInstance() {
+ return ignite != null;
+ }
+
+ /**
+ * Stores {@link IgniteConfiguration} to file as xml.
+ *
+ * @param cfg Ignite Configuration.
+ * @return A name of file where the configuration was stored.
+ * @throws IOException If failed.
+ * @see #readCfgFromFileAndDeleteFile(String)
+ */
+ public static String storeToFile(IgniteConfiguration cfg) throws IOException {
+ String fileName = IGNITE_CONFIGURATION_FILE + cfg.getNodeId();
+
+ // Check marshaller configuration, because read configuration method expect specific marshaller.
+ if (cfg.getMarshaller() instanceof OptimizedMarshaller){
+ OptimizedMarshaller marsh = (OptimizedMarshaller)cfg.getMarshaller();
+
+ try {
+ Field isRequireFiled = marsh.getClass().getDeclaredField("requireSer");
+
+ isRequireFiled.setAccessible(true);
+
+ boolean isRequireSer = isRequireFiled.getBoolean(marsh);
+
+ if (isRequireSer)
+ throw new UnsupportedOperationException("Unsupported marshaller configuration. " +
+ "readCfgFromFileAndDeleteFile method expect " + OptimizedMarshaller.class.getSimpleName() +
+ "with requireSerializeble flag in 'false'.");
+ }
+ catch (NoSuchFieldException|IllegalAccessException e) {
+ throw new IgniteException("Failed to check filed of " + OptimizedMarshaller.class.getSimpleName(), e);
+ }
+ }
+ else
+ throw new UnsupportedOperationException("Unsupported marshaller. " +
+ "readCfgFromFileAndDeleteFile method expect " + OptimizedMarshaller.class.getSimpleName());
+
+ try(OutputStream out = new BufferedOutputStream(new FileOutputStream(fileName))) {
+ cfg.setMBeanServer(null);
+ cfg.setMarshaller(null);
+ cfg.setDiscoverySpi(null);
+ cfg.setGridLogger(null);
+
+ new XStream().toXML(cfg, out);
+ }
+
+ return fileName;
+ }
+
+ /**
+ * Reads configuration from given file and delete the file after.
+ *
+ * @param fileName File name.
+ * @return Readed configuration.
+ * @throws IOException If failed.
+ * @see #storeToFile(IgniteConfiguration)
+ */
+ private static IgniteConfiguration readCfgFromFileAndDeleteFile(String fileName) throws IOException {
+ try(BufferedReader cfgReader = new BufferedReader(new FileReader(fileName))) {
+ IgniteConfiguration cfg = (IgniteConfiguration)new XStream().fromXML(cfgReader);
+
+ cfg.setMarshaller(new OptimizedMarshaller(false));
+
+ TcpDiscoverySpi disco = new TcpDiscoverySpi();
+ disco.setIpFinder(GridCacheAbstractFullApiSelfTest.LOCAL_IP_FINDER);
+ cfg.setDiscoverySpi(disco);
+
+ return cfg;
+ }
+ finally {
+ new File(fileName).delete();
+ }
+ }
+
+ /**
+ * Kill all Jvm runned by {#link IgniteNodeRunner}. Works based on jps command.
+ *
+ * @return List of killed process ids.
+ * @throws Exception If exception.
+ */
+ public static List<Integer> killAll() throws Exception{
+ MonitoredHost monitoredHost = MonitoredHost.getMonitoredHost(new HostIdentifier("localhost"));
+
+ Set<Integer> jvms = monitoredHost.activeVms();
+
+ List<Integer> res = new ArrayList<>();
+
+ for (Integer jvmId : jvms) {
+ try {
+ MonitoredVm vm = monitoredHost.getMonitoredVm(new VmIdentifier("//" + jvmId + "?mode=r"), 0);
+
+ if (IgniteNodeRunner.class.getName().equals(MonitoredVmUtil.mainClass(vm, true))) {
+ Process killProc = U.isWindows() ?
+ Runtime.getRuntime().exec(new String[] {"taskkill", "/pid", jvmId.toString(), "/f", "/t"}) :
+ Runtime.getRuntime().exec(new String[] {"kill", "-9", jvmId.toString()});
+
+ killProc.waitFor();
+
+ res.add(jvmId);
+ }
+ }
+ catch (Exception e) {
+ // Print stack trace just for information.
+ X.printerrln("Could not kill IgniteNodeRunner java processes. Jvm pid = " + jvmId, e);
+ }
+ }
+
+ return res;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
new file mode 100644
index 0000000..220424a
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteProcessProxy.java
@@ -0,0 +1,571 @@
+/*
+ * 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.testframework.junits.multijvm;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.cluster.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.processors.hadoop.*;
+import org.apache.ignite.internal.util.*;
+import org.apache.ignite.internal.util.lang.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.*;
+import org.jetbrains.annotations.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * Ignite proxy for ignite instance at another JVM.
+ */
+@SuppressWarnings("TransientFieldInNonSerializableClass")
+public class IgniteProcessProxy implements IgniteEx {
+ /** Grid proxies. */
+ private static final transient ConcurrentMap<String, IgniteProcessProxy> gridProxies = new ConcurrentHashMap<>();
+
+ /** Jvm process with ignite instance. */
+ private final transient GridJavaProcess proc;
+
+ /** Configuration. */
+ private final transient IgniteConfiguration cfg;
+
+ /** Local JVM grid. */
+ private final transient Ignite locJvmGrid;
+
+ /** Logger. */
+ private final transient IgniteLogger log;
+
+ /** Grid id. */
+ private final UUID id = UUID.randomUUID();
+
+ /**
+ * @param cfg Configuration.
+ * @param log Logger.
+ * @param locJvmGrid Local JVM grid.
+ */
+ public IgniteProcessProxy(final IgniteConfiguration cfg, final IgniteLogger log, final Ignite locJvmGrid)
+ throws Exception {
+ this.cfg = cfg;
+ this.locJvmGrid = locJvmGrid;
+ this.log = log.getLogger("jvm-" + id.toString().substring(0, id.toString().indexOf('-')));
+
+ String cfgFileName = IgniteNodeRunner.storeToFile(cfg.setNodeId(id));
+
+ List<String> jvmArgs = U.jvmArgs();
+
+ Collection<String> filteredJvmArgs = new ArrayList<>();
+
+ for (String arg : jvmArgs) {
+ if(!arg.toLowerCase().startsWith("-agentlib"))
+ filteredJvmArgs.add(arg);
+ }
+
+ final CountDownLatch rmtNodeStartedLatch = new CountDownLatch(1);
+
+ locJvmGrid.events().localListen(new NodeStartedListener(id, rmtNodeStartedLatch), EventType.EVT_NODE_JOINED);
+
+ proc = GridJavaProcess.exec(
+ IgniteNodeRunner.class,
+ cfgFileName, // Params.
+ this.log,
+ // Optional closure to be called each time wrapped process prints line to system.out or system.err.
+ new IgniteInClosure<String>() {
+ @Override public void apply(String s) {
+ IgniteProcessProxy.this.log.info(s);
+ }
+ },
+ null,
+ filteredJvmArgs, // JVM Args.
+ System.getProperty("surefire.test.class.path")
+ );
+
+ assert rmtNodeStartedLatch.await(30, TimeUnit.SECONDS): "Remote node has not joined [id=" + id + ']';
+
+ IgniteProcessProxy prevVal = gridProxies.putIfAbsent(cfg.getGridName(), this);
+
+ if (prevVal != null) {
+ remoteCompute().run(new IgniteRunnable() {
+ @Override public void run() {
+ G.stop(cfg.getGridName(), true);
+ }
+ });
+
+ throw new IllegalStateException("There was found instance assotiated with " + cfg.getGridName() +
+ ", instance= " + prevVal + ". New started node was stopped.");
+ }
+ }
+
+ /**
+ */
+ private static class NodeStartedListener extends IgnitePredicateX<Event> {
+ /** Id. */
+ private final UUID id;
+
+ /** Remote node started latch. */
+ private final CountDownLatch rmtNodeStartedLatch;
+
+ /**
+ * @param id Id.
+ * @param rmtNodeStartedLatch Remote node started latch.
+ */
+ NodeStartedListener(UUID id, CountDownLatch rmtNodeStartedLatch) {
+ this.id = id;
+ this.rmtNodeStartedLatch = rmtNodeStartedLatch;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean applyx(Event e) {
+ if (((DiscoveryEvent)e).eventNode().id().equals(id)) {
+ rmtNodeStartedLatch.countDown();
+
+ return false;
+ }
+
+ return true;
+ }
+ }
+
+ /**
+ * @param gridName Grid name.
+ * @return Instance by name or exception wiil be thrown.
+ */
+ public static IgniteProcessProxy ignite(String gridName) {
+ IgniteProcessProxy res = gridProxies.get(gridName);
+
+ if (res == null)
+ throw new IgniteIllegalStateException("Grid instance was not properly started " +
+ "or was already stopped: " + gridName + ". All known grid instances: " + gridProxies.keySet());
+
+ return res;
+ }
+
+ /**
+ * @param gridName Grid name.
+ * @param cancel Cacnel flag.
+ */
+ public static void stop(final String gridName, final boolean cancel) {
+ IgniteProcessProxy proxy = gridProxies.get(gridName);
+
+ if (proxy != null) {
+ proxy.remoteCompute().run(new IgniteRunnable() {
+ @Override public void run() {
+ G.stop(gridName, cancel);
+ }
+ });
+
+ gridProxies.remove(gridName, proxy);
+ }
+ }
+
+ /**
+ * For usage in closures.
+ *
+ * @return Ignite instance.
+ */
+ private Ignite igniteById() {
+ return Ignition.ignite(id);
+ }
+
+ /**
+ * @param locNodeId ID of local node the requested grid instance is managing.
+ * @return An instance of named grid. This method never returns {@code null}.
+ * @throws IgniteIllegalStateException Thrown if grid was not properly initialized or grid instance was stopped or
+ * was not started.
+ */
+ public static Ignite ignite(UUID locNodeId) {
+ A.notNull(locNodeId, "locNodeId");
+
+ for (IgniteProcessProxy ignite : gridProxies.values()) {
+ if (ignite.getId().equals(locNodeId))
+ return ignite;
+ }
+
+ throw new IgniteIllegalStateException("Grid instance with given local node ID was not properly " +
+ "started or was stopped: " + locNodeId);
+ }
+
+ /**
+ * Kill all running processes.
+ */
+ public static void killAll() {
+ for (IgniteProcessProxy ignite : gridProxies.values()) {
+ try {
+ ignite.getProcess().kill();
+ }
+ catch (Exception e) {
+ U.error(ignite.log, "Killing failed.", e);
+ }
+ }
+
+ gridProxies.clear();
+ }
+
+ /**
+ * @return Local JVM grid instance.
+ */
+ public Ignite localJvmGrid() {
+ return locJvmGrid;
+ }
+
+ /**
+ * @return Grid id.
+ */
+ public UUID getId() {
+ return id;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String name() {
+ return cfg.getGridName();
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteLogger log() {
+ return log;
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteConfiguration configuration() {
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K extends GridCacheUtilityKey, V> IgniteInternalCache<K, V> utilityCache() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public <K, V> IgniteInternalCache<K, V> cachex(@Nullable String name) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public <K, V> IgniteInternalCache<K, V> cachex() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<IgniteInternalCache<?, ?>> cachesx(
+ @Nullable IgnitePredicate<? super IgniteInternalCache<?, ?>>... p) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean eventUserRecordable(int type) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean allEventsUserRecordable(int[] types) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isJmxRemoteEnabled() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isRestartEnabled() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public IgniteFileSystem igfsx(@Nullable String name) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public Hadoop hadoop() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteClusterEx cluster() {
+ return new IgniteClusterProcessProxy(this);
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public String latestVersion() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClusterNode localNode() {
+ return remoteCompute().call(new IgniteCallable<ClusterNode>() {
+ @Override public ClusterNode call() throws Exception {
+ return ((IgniteEx)Ignition.ignite(id)).localNode();
+ }
+ });
+ }
+
+ /** {@inheritDoc} */
+ @Override public GridKernalContext context() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteCompute compute() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteCompute compute(ClusterGroup grp) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteMessaging message() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteMessaging message(ClusterGroup grp) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteEvents events() {
+ return new IgniteEventsProcessProxy(this);
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteEvents events(ClusterGroup grp) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteServices services() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteServices services(ClusterGroup grp) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ExecutorService executorService() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public ExecutorService executorService(ClusterGroup grp) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteProductVersion version() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteScheduler scheduler() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K, V> IgniteCache<K, V> createCache(CacheConfiguration<K, V> cacheCfg) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K, V> IgniteCache<K, V> createCache(String cacheName) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K, V> IgniteCache<K, V> getOrCreateCache(CacheConfiguration<K, V> cacheCfg) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K, V> IgniteCache<K, V> getOrCreateCache(String cacheName) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K, V> void addCacheConfiguration(CacheConfiguration<K, V> cacheCfg) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K, V> IgniteCache<K, V> createCache(CacheConfiguration<K, V> cacheCfg,
+ NearCacheConfiguration<K, V> nearCfg) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K, V> IgniteCache<K, V> getOrCreateCache(CacheConfiguration<K, V> cacheCfg,
+ NearCacheConfiguration<K, V> nearCfg) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K, V> IgniteCache<K, V> createNearCache(@Nullable String cacheName, NearCacheConfiguration<K, V> nearCfg) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K, V> IgniteCache<K, V> getOrCreateNearCache(@Nullable String cacheName,
+ NearCacheConfiguration<K, V> nearCfg) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void destroyCache(String cacheName) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K, V> IgniteCache<K, V> cache(@Nullable final String name) {
+ return new IgniteCacheProcessProxy<>(name, this);
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteTransactions transactions() {
+ throw new UnsupportedOperationException("Transactions can't be supported automatically in multi JVM mode.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K, V> IgniteDataStreamer<K, V> dataStreamer(@Nullable String cacheName) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteFileSystem fileSystem(String name) {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public Collection<IgniteFileSystem> fileSystems() {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteAtomicSequence atomicSequence(String name, long initVal, boolean create) throws IgniteException {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteAtomicLong atomicLong(String name, long initVal, boolean create) throws IgniteException {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T> IgniteAtomicReference<T> atomicReference(String name, @Nullable T initVal,
+ boolean create) throws IgniteException {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T, S> IgniteAtomicStamped<T, S> atomicStamped(String name, @Nullable T initVal, @Nullable S initStamp,
+ boolean create) throws IgniteException {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public IgniteCountDownLatch countDownLatch(String name, int cnt, boolean autoDel,
+ boolean create) throws IgniteException {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T> IgniteQueue<T> queue(String name, int cap,
+ @Nullable CollectionConfiguration cfg) throws IgniteException {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T> IgniteSet<T> set(String name, @Nullable CollectionConfiguration cfg) throws IgniteException {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T extends IgnitePlugin> T plugin(String name) throws PluginNotFoundException {
+ throw new UnsupportedOperationException("Operation isn't supported yet.");
+ }
+
+ /** {@inheritDoc} */
+ @Override public void close() throws IgniteException {
+ final CountDownLatch rmtNodeStoppedLatch = new CountDownLatch(1);
+
+ locJvmGrid.events().localListen(new IgnitePredicateX<Event>() {
+ @Override public boolean applyx(Event e) {
+ if (((DiscoveryEvent)e).eventNode().id().equals(id)) {
+ rmtNodeStoppedLatch.countDown();
+
+ return false;
+ }
+
+ return true;
+ }
+ }, EventType.EVT_NODE_LEFT, EventType.EVT_NODE_FAILED);
+
+ compute().run(new IgniteRunnable() {
+ @Override public void run() {
+ igniteById().close();
+ }
+ });
+
+ try {
+ assert U.await(rmtNodeStoppedLatch, 15, TimeUnit.SECONDS) : "NodeId=" + id;
+ }
+ catch (IgniteInterruptedCheckedException e) {
+ throw new IgniteException(e);
+ }
+
+ try {
+ getProcess().kill();
+ }
+ catch (Exception e) {
+ X.printerr("Could not kill process after close.", e);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override public <K> Affinity<K> affinity(String cacheName) {
+ return new AffinityProcessProxy<>(cacheName, this);
+ }
+
+ /**
+ * @return Jvm process in which grid node started.
+ */
+ public GridJavaProcess getProcess() {
+ return proc;
+ }
+
+ /**
+ * @return {@link IgniteCompute} instance to communicate with remote node.
+ */
+ public IgniteCompute remoteCompute() {
+ ClusterGroup grp = locJvmGrid.cluster().forNodeId(id);
+
+ if (grp.nodes().isEmpty())
+ throw new IllegalStateException("Could not found node with id=" + id + ".");
+
+ return locJvmGrid.compute(grp);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiMultiJvmSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiMultiJvmSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiMultiJvmSelfTestSuite.java
new file mode 100644
index 0000000..272305b
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFullApiMultiJvmSelfTestSuite.java
@@ -0,0 +1,89 @@
+/*
+ * 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.testsuites;
+
+import junit.framework.*;
+import org.apache.ignite.internal.processors.cache.multijvm.*;
+
+/**
+ * Multi-JVM test suite.
+ */
+public class IgniteCacheFullApiMultiJvmSelfTestSuite extends TestSuite {
+ /**
+ * @return Multi-JVM tests suite.
+ * @throws Exception If failed.
+ */
+ public static TestSuite suite() throws Exception {
+ TestSuite suite = new TestSuite("Cache Full API Multi Jvm Test Suite");
+
+ // Multi-node.
+ suite.addTestSuite(GridCacheReplicatedMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedMultiJvmP2PDisabledFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedAtomicMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedAtomicPrimaryWriteOrderMultiJvmFullApiSelfTest.class);
+
+ suite.addTestSuite(GridCachePartitionedMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedCopyOnReadDisabledMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicCopyOnReadDisabledMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedMultiJvmP2PDisabledFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicMultiJvmP2PDisabledFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderMultiJvmP2PDisabledFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicNearEnabledMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicNearEnabledPrimaryWriteOrderMultiJvmFullApiSelfTest.class);
+
+ suite.addTestSuite(GridCachePartitionedNearDisabledMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNearDisabledMultiJvmP2PDisabledFullApiSelfTest.class);
+
+ suite.addTestSuite(GridCacheNearOnlyMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheNearOnlyMultiJvmP2PDisabledFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedNearOnlyMultiJvmFullApiSelfTest.class);
+
+ suite.addTestSuite(GridCacheAtomicClientOnlyMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicClientOnlyMultiJvmP2PDisabledFullApiSelfTest.class);
+
+ suite.addTestSuite(GridCacheAtomicNearOnlyMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicNearOnlyMultiJvmP2PDisabledFullApiSelfTest.class);
+
+ suite.addTestSuite(GridCachePartitionedFairAffinityMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNearDisabledFairAffinityMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicFairAffinityMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicNearEnabledFairAffinityMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderFairAffinityMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheNearOnlyFairAffinityMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicClientOnlyFairAffinityMultiJvmFullApiSelfTest.class);
+
+ // Multi-node with off-heap values.
+ suite.addTestSuite(GridCacheReplicatedOffHeapMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedOffHeapMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicOffHeapMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicPrimaryWrityOrderOffHeapMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapMultiJvmFullApiSelfTest.class);
+
+ // Multi-node with off-heap tiered mode.
+ suite.addTestSuite(GridCacheReplicatedOffHeapTieredMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedOffHeapTieredMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicOffHeapTieredMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicPrimaryWrityOrderOffHeapTieredMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNearDisabledOffHeapTieredMultiJvmFullApiSelfTest.class);
+ suite.addTestSuite(GridCachePartitionedNearDisabledAtomicOffHeapTieredMultiJvmFullApiSelfTest.class);
+
+ return suite;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index bfa9f62..dbaa330 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -720,5 +720,45 @@
</plugins>
</build>
</profile>
+
+ <profile>
+ <id>tools.jar-default</id>
+
+ <activation>
+ <file>
+ <exists>${java.home}/../lib/tools.jar</exists>
+ </file>
+ </activation>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.4.2</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
+
+ <profile>
+ <id>tools.jar-mac</id>
+
+ <activation>
+ <file>
+ <exists>${java.home}/../Classes/classes.jar</exists>
+ </file>
+ </activation>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.4.2</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../Classes/classes.jar</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
</profiles>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8218fe6f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b47d34b..9d1b7d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -678,7 +678,6 @@
</build>
</profile>
-
<profile>
<id>schema-import</id>
<activation>
[20/50] [abbrv] incubator-ignite git commit: # master - javadoc fix.
Posted by av...@apache.org.
# master - 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/d2a1c3c3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d2a1c3c3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d2a1c3c3
Branch: refs/heads/ignite-630
Commit: d2a1c3c3a1d8cb775ef3967c4d290d927f2a311c
Parents: bc036fe
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Tue Jul 14 16:31:36 2015 -0700
Committer: Dmitiry Setrakyan <ds...@gridgain.com>
Committed: Tue Jul 14 16:31:36 2015 -0700
----------------------------------------------------------------------
.../apache/ignite/cache/CacheTypeMetadata.java | 30 ++++++++++----------
1 file changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d2a1c3c3/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
index 1090b0b..ebe7db7 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
@@ -51,15 +51,15 @@ public class CacheTypeMetadata implements Serializable {
@GridToStringInclude
private Collection<CacheTypeFieldMetadata> valFields;
- /** Fields to be queried, in addition to indexed fields. */
+ /** Field name-to-type map to be queried, in addition to indexed fields. */
@GridToStringInclude
private Map<String, Class<?>> qryFlds;
- /** Fields to index in ascending order. */
+ /** Field name-to-type map to index in ascending order. */
@GridToStringInclude
private Map<String, Class<?>> ascFlds;
- /** Fields to index in descending order. */
+ /** Field name-to-type map to index in descending order. */
@GridToStringInclude
private Map<String, Class<?>> descFlds;
@@ -244,54 +244,54 @@ public class CacheTypeMetadata implements Serializable {
}
/**
- * Gets query-enabled fields.
+ * Gets name-to-type map for query-enabled fields.
*
- * @return Collection of fields available for query.
+ * @return Name-to-type map for query-enabled fields.
*/
public Map<String, Class<?>> getQueryFields() {
return qryFlds;
}
/**
- * Sets query fields map.
+ * Sets name-to-type map for query-enabled fields.
*
- * @param qryFlds Query fields.
+ * @param qryFlds Name-to-type map for query-enabled fields.
*/
public void setQueryFields(Map<String, Class<?>> qryFlds) {
this.qryFlds = qryFlds;
}
/**
- * Gets ascending-indexed fields.
+ * Gets name-to-type map for ascending-indexed fields.
*
- * @return Map of ascending-indexed fields.
+ * @return Name-to-type map for ascending-indexed fields.
*/
public Map<String, Class<?>> getAscendingFields() {
return ascFlds;
}
/**
- * Sets ascending-indexed fields.
+ * Sets name-to-type map for ascending-indexed fields.
*
- * @param ascFlds Map of ascending-indexed fields.
+ * @param ascFlds Name-to-type map for ascending-indexed fields.
*/
public void setAscendingFields(Map<String, Class<?>> ascFlds) {
this.ascFlds = ascFlds;
}
/**
- * Gets descending-indexed fields.
+ * Gets name-to-type map for descending-indexed fields.
*
- * @return Map of descending-indexed fields.
+ * @return Name-to-type map of descending-indexed fields.
*/
public Map<String, Class<?>> getDescendingFields() {
return descFlds;
}
/**
- * Sets descending-indexed fields.
+ * Sets name-to-type map for descending-indexed fields.
*
- * @param descFlds Map of descending-indexed fields.
+ * @param descFlds Name-to-type map of descending-indexed fields.
*/
public void setDescendingFields(Map<String, Class<?>> descFlds) {
this.descFlds = descFlds;
[21/50] [abbrv] incubator-ignite git commit: # master - javadoc fix.
Posted by av...@apache.org.
# master - 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/b464548d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b464548d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b464548d
Branch: refs/heads/ignite-630
Commit: b464548dc7a29f7349a0935a5ee54c5380d91d5b
Parents: d2a1c3c
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Tue Jul 14 16:35:42 2015 -0700
Committer: Dmitiry Setrakyan <ds...@gridgain.com>
Committed: Tue Jul 14 16:35:42 2015 -0700
----------------------------------------------------------------------
.../org/apache/ignite/cache/CacheTypeMetadata.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b464548d/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
index ebe7db7..608cc39 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
@@ -17,6 +17,7 @@
package org.apache.ignite.cache;
+import org.apache.ignite.cache.store.jdbc.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.lang.*;
@@ -43,11 +44,11 @@ public class CacheTypeMetadata implements Serializable {
/** Value class used to store value in cache. */
private String valType;
- /** Persistent key fields. */
+ /** Optional persistent key fields (needed only if {@link CacheJdbcPojoStore} is used). */
@GridToStringInclude
private Collection<CacheTypeFieldMetadata> keyFields;
- /** Persistent value fields . */
+ /** Optional persistent value fields (needed only if {@link CacheJdbcPojoStore} is used). */
@GridToStringInclude
private Collection<CacheTypeFieldMetadata> valFields;
@@ -208,7 +209,7 @@ public class CacheTypeMetadata implements Serializable {
}
/**
- * Gets persistent key fields.
+ * Gets optional persistent key fields (needed only if {@link CacheJdbcPojoStore} is used).
*
* @return Persistent key fields.
*/
@@ -217,7 +218,7 @@ public class CacheTypeMetadata implements Serializable {
}
/**
- * Sets persistent key fields.
+ * Sets optional persistent key fields (needed only if {@link CacheJdbcPojoStore} is used).
*
* @param keyFields Persistent key fields.
*/
@@ -226,7 +227,7 @@ public class CacheTypeMetadata implements Serializable {
}
/**
- * Gets persistent value fields.
+ * Gets optional persistent value fields (needed only if {@link CacheJdbcPojoStore} is used).
*
* @return Persistent value fields.
*/
@@ -235,7 +236,7 @@ public class CacheTypeMetadata implements Serializable {
}
/**
- * Sets persistent value fields.
+ * Sets optional persistent value fields (needed only if {@link CacheJdbcPojoStore} is used).
*
* @param valFields Persistent value fields.
*/
[34/50] [abbrv] incubator-ignite git commit: ignite-yarn pom.xml
version fixed
Posted by av...@apache.org.
ignite-yarn pom.xml version fixed
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/aef4063a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/aef4063a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/aef4063a
Branch: refs/heads/ignite-630
Commit: aef4063a7ce743dfc5326cbccdc46312f50eaea4
Parents: 69e0ad2
Author: agura <ag...@gridgain.com>
Authored: Thu Jul 16 12:35:45 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Thu Jul 16 12:36:44 2015 +0300
----------------------------------------------------------------------
modules/yarn/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/aef4063a/modules/yarn/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yarn/pom.xml b/modules/yarn/pom.xml
index 63aa3cd..ad17f6b 100644
--- a/modules/yarn/pom.xml
+++ b/modules/yarn/pom.xml
@@ -98,4 +98,4 @@
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
[12/50] [abbrv] incubator-ignite git commit: # More info in asserts.
Posted by av...@apache.org.
# More info in asserts.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f5a09f4d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f5a09f4d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f5a09f4d
Branch: refs/heads/ignite-630
Commit: f5a09f4d1b2e912b2de25ffc669ca205d34ad0ce
Parents: aa2d7cb
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jul 14 11:39:29 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jul 14 11:39:29 2015 +0300
----------------------------------------------------------------------
.../internal/processors/cache/GridCacheContext.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f5a09f4d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index eb813c3..aec08c6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -533,7 +533,7 @@ public class GridCacheContext<K, V> implements Externalizable {
public void incrementPublicSize(GridCacheMapEntry e) {
assert deferredDelete();
assert e != null;
- assert !e.isInternal();
+ assert !e.isInternal() : e;
cache.map().incrementSize(e);
@@ -551,7 +551,7 @@ public class GridCacheContext<K, V> implements Externalizable {
public void decrementPublicSize(GridCacheMapEntry e) {
assert deferredDelete();
assert e != null;
- assert !e.isInternal();
+ assert !e.isInternal() : e;
cache.map().decrementSize(e);
@@ -765,7 +765,7 @@ public class GridCacheContext<K, V> implements Externalizable {
* @return Partition topology.
*/
public GridDhtPartitionTopology topology() {
- assert isNear() || isDht() || isColocated() || isDhtAtomic();
+ assert isNear() || isDht() || isColocated() || isDhtAtomic() : cache;
return isNear() ? near().dht().topology() : dht().topology();
}
@@ -774,7 +774,7 @@ public class GridCacheContext<K, V> implements Externalizable {
* @return Topology version future.
*/
public GridDhtTopologyFuture topologyVersionFuture() {
- assert isNear() || isDht() || isColocated() || isDhtAtomic();
+ assert isNear() || isDht() || isColocated() || isDhtAtomic() : cache;
GridDhtTopologyFuture fut = null;
@@ -1599,9 +1599,9 @@ public class GridCacheContext<K, V> implements Externalizable {
*/
public void onDeferredDelete(GridCacheEntryEx entry, GridCacheVersion ver) {
assert entry != null;
- assert !Thread.holdsLock(entry);
+ assert !Thread.holdsLock(entry) : entry;
assert ver != null;
- assert deferredDelete();
+ assert deferredDelete() : cache;
cache.onDeferredDelete(entry, ver);
}
@@ -1759,7 +1759,7 @@ public class GridCacheContext<K, V> implements Externalizable {
* @throws IgniteCheckedException If failed.
*/
public CacheObject fromOffheap(long valPtr, boolean tmp) throws IgniteCheckedException {
- assert config().getMemoryMode() == OFFHEAP_TIERED || config().getMemoryMode() == OFFHEAP_VALUES;
+ assert config().getMemoryMode() == OFFHEAP_TIERED || config().getMemoryMode() == OFFHEAP_VALUES : cacheCfg;
assert valPtr != 0;
return ctx.cacheObjects().toCacheObject(this, valPtr, tmp);
[47/50] [abbrv] incubator-ignite git commit: ignite-1067
Posted by av...@apache.org.
ignite-1067
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/954ae154
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/954ae154
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/954ae154
Branch: refs/heads/ignite-630
Commit: 954ae1543116ab538a5a04ee64172fa780debe80
Parents: dd246e5
Author: Anton Vinogradov <av...@gridgain.com>
Authored: Thu Jul 16 15:26:01 2015 +0300
Committer: Anton Vinogradov <av...@gridgain.com>
Committed: Thu Jul 16 15:26:01 2015 +0300
----------------------------------------------------------------------
assembly/LICENSE_FABRIC | 17 +++--------------
assembly/LICENSE_HADOOP | 11 -----------
.../src/main/resources/META-INF/licenses.txt.vm | 4 +---
modules/core/licenses/jsr166-license.txt | 3 +++
modules/core/licenses/snaptree-bsd-license.txt | 2 +-
modules/jta/licenses/jta-license.txt | 2 ++
6 files changed, 10 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954ae154/assembly/LICENSE_FABRIC
----------------------------------------------------------------------
diff --git a/assembly/LICENSE_FABRIC b/assembly/LICENSE_FABRIC
index 794d721..152cc1e 100644
--- a/assembly/LICENSE_FABRIC
+++ b/assembly/LICENSE_FABRIC
@@ -227,17 +227,6 @@ For details, see CC0 1.0 Universal (1.0), Public Domain Dedication,
http://creativecommons.org/publicdomain/zero/1.0/
==============================================================================
-For books used for tests in "org.apache.ignite.internal.processors.hadoop.books"
-==============================================================================
-This code bundles book text files used for testing purposes which contain
-the following header:
-
-This eBook is for the use of anyone anywhere at no cost and with
-almost no restrictions whatsoever. You may copy it, give it away or
-re-use it under the terms of the Project Gutenberg License included
-with this eBook or online at www.gutenberg.org
-
-==============================================================================
For JSR107 API and SPI (https://github.com/jsr107/jsr107spec) javax.cache:cache-api:jar:1.0.0
==============================================================================
This product bundles JSR107 API and SPI which is available under a:
@@ -256,7 +245,7 @@ This product bundles JLine which is available under a:
The BSD License. For details, see http://www.opensource.org/licenses/bsd-license.php.
==============================================================================
-For Scala Library (http://www.scala-lang.org/) org.scala-lang:scala-library:jar:2.11.2
+For Scala Library (http://www.scala-lang.org/) org.scala-lang:scala-library:jar:2.*
==============================================================================
This product bundles Scala Library which is available under a:
BSD 3-Clause. For details, see http://www.scala-lang.org/license.html.
@@ -294,8 +283,8 @@ Eclipse Public License - v 1.0. For details, see http://www.eclipse.org/legal/ep
==============================================================================
For Java Transaction API (http://java.sun.com/products/jta) javax.transaction:jta:jar:1.1
==============================================================================
-This product bundles Java Transaction API which is available under a:
-No licenses.
+This product bundles Java Transaction API which is available under it's own license.
+See http://download.oracle.com/otndocs/jcp/jta-1.1-classes-oth-JSpec/jta-1.1-classes-oth-JSpec-license.html for details.
==============================================================================
For ASM All (http://asm.objectweb.org/asm-all/) org.ow2.asm:asm-all:jar:4.2
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954ae154/assembly/LICENSE_HADOOP
----------------------------------------------------------------------
diff --git a/assembly/LICENSE_HADOOP b/assembly/LICENSE_HADOOP
index f6ed34c..cfbaea3 100644
--- a/assembly/LICENSE_HADOOP
+++ b/assembly/LICENSE_HADOOP
@@ -227,17 +227,6 @@ For details, see CC0 1.0 Universal (1.0), Public Domain Dedication,
http://creativecommons.org/publicdomain/zero/1.0/
==============================================================================
-For books used for tests in "org.apache.ignite.internal.processors.hadoop.books"
-==============================================================================
-This code bundles book text files used for testing purposes which contain
-the following header:
-
-This eBook is for the use of anyone anywhere at no cost and with
-almost no restrictions whatsoever. You may copy it, give it away or
-re-use it under the terms of the Project Gutenberg License included
-with this eBook or online at www.gutenberg.org
-
-==============================================================================
For JSR107 API and SPI (https://github.com/jsr107/jsr107spec) javax.cache:cache-api:jar:1.0.0
==============================================================================
This product bundles JSR107 API and SPI which is available under a:
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954ae154/modules/apache-license-gen/src/main/resources/META-INF/licenses.txt.vm
----------------------------------------------------------------------
diff --git a/modules/apache-license-gen/src/main/resources/META-INF/licenses.txt.vm b/modules/apache-license-gen/src/main/resources/META-INF/licenses.txt.vm
index f02d9bc..ca1988b 100644
--- a/modules/apache-license-gen/src/main/resources/META-INF/licenses.txt.vm
+++ b/modules/apache-license-gen/src/main/resources/META-INF/licenses.txt.vm
@@ -25,7 +25,7 @@
#foreach ( $organizationName in $projectsSortedByOrganization.keySet() )
#foreach ( $project in $projectsSortedByOrganization.get( $organizationName ) )
-#if($project.licenses.size() == 1 && $project.licenses.get(0).url.contains("www.apache.org/licenses/LICENSE-2.0") && !$project.licenses.get(0).url.contains("and"))#else
+#if((!($project.licenses.size() == 1 && $project.licenses.get(0).url.contains("www.apache.org/licenses/LICENSE-2.0") && !$project.licenses.get(0).url.contains("and"))) && $project.licenses.size() > 0)
==============================================================================
For $project.name #if ($project.url)($project.url)#end $project.artifact
==============================================================================
@@ -34,8 +34,6 @@ This product bundles $project.name which is available under a:
$license.name.replaceAll("[ ]{2,}"," ").replaceAll("\n",""). #if ($license.url)For details, see $license.url.replaceAll("[ ]{2,}"," ").replaceAll("\n","").#end
#end
-#if ($project.licenses.size() == 0)No licenses.
-#end
#end
#end
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954ae154/modules/core/licenses/jsr166-license.txt
----------------------------------------------------------------------
diff --git a/modules/core/licenses/jsr166-license.txt b/modules/core/licenses/jsr166-license.txt
new file mode 100644
index 0000000..24cf176
--- /dev/null
+++ b/modules/core/licenses/jsr166-license.txt
@@ -0,0 +1,3 @@
+This product sources bundles JSR-166 classes which are donated to public domain.
+For details, see CC0 1.0 Universal (1.0), Public Domain Dedication,
+http://creativecommons.org/publicdomain/zero/1.0/
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954ae154/modules/core/licenses/snaptree-bsd-license.txt
----------------------------------------------------------------------
diff --git a/modules/core/licenses/snaptree-bsd-license.txt b/modules/core/licenses/snaptree-bsd-license.txt
index 5e7d327..a4bd0d9 100644
--- a/modules/core/licenses/snaptree-bsd-license.txt
+++ b/modules/core/licenses/snaptree-bsd-license.txt
@@ -1,4 +1,4 @@
-SNAPTREE LICENSE
+This product sources bundles SnapTree classes, which is available under a SNAPTREE LICENSE:
Copyright (c) 2009 Stanford University, unless otherwise specified.
All rights reserved.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/954ae154/modules/jta/licenses/jta-license.txt
----------------------------------------------------------------------
diff --git a/modules/jta/licenses/jta-license.txt b/modules/jta/licenses/jta-license.txt
new file mode 100644
index 0000000..77d0633
--- /dev/null
+++ b/modules/jta/licenses/jta-license.txt
@@ -0,0 +1,2 @@
+This product bundles Java Transaction API, which is available under it's own license.
+See http://download.oracle.com/otndocs/jcp/jta-1.1-classes-oth-JSpec/jta-1.1-classes-oth-JSpec-license.html for details.
\ No newline at end of file
[29/50] [abbrv] incubator-ignite git commit: Minor fixes in Spring
Caching
Posted by av...@apache.org.
Minor fixes in Spring Caching
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d38a70d2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d38a70d2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d38a70d2
Branch: refs/heads/ignite-630
Commit: d38a70d2c12c640624c70bd0cb5634bb65b6d041
Parents: de7e06f
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Wed Jul 15 20:04:45 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Wed Jul 15 20:04:45 2015 -0700
----------------------------------------------------------------------
.../apache/ignite/cache/spring/SpringCache.java | 2 +-
.../ignite/cache/spring/SpringCacheManager.java | 22 +++++++++++---------
2 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d38a70d2/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java b/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java
index 7651fbe..08aa38b 100644
--- a/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java
+++ b/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCache.java
@@ -48,7 +48,7 @@ class SpringCache implements Cache {
}
/** {@inheritDoc} */
- @Override public Cache.ValueWrapper get(Object key) {
+ @Override public ValueWrapper get(Object key) {
Object val = cache.get(key);
return val != null ? new SimpleValueWrapper(val) : null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d38a70d2/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCacheManager.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCacheManager.java b/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCacheManager.java
index afadaee..260026e 100644
--- a/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCacheManager.java
+++ b/modules/spring/src/main/java/org/apache/ignite/cache/spring/SpringCacheManager.java
@@ -41,15 +41,17 @@ import java.util.concurrent.*;
* you will need to do the following:
* <ul>
* <li>
- * Start a Ignite node with configured cache in the same JVM
- * where you application is running.
+ * Start an Ignite node with proper configuration in embedded mode
+ * (i.e., in the same JVM where the application is running). It can
+ * already have predefined caches, but it's not required - caches
+ * will be created automatically on first access if needed.
* </li>
* <li>
- * Configure {@code GridSpringCacheManager} as a cache provider
- * in Spring application context.
+ * Configure {@code SpringCacheManager} as a cache provider
+ * in the Spring application context.
* </li>
* </ul>
- * {@code GridSpringCacheManager} can start a node itself on its startup
+ * {@code SpringCacheManager} can start a node itself on its startup
* based on provided Ignite configuration. You can provide path to a
* Spring configuration XML file, like below (path can be absolute or
* relative to {@code IGNITE_HOME}):
@@ -61,9 +63,9 @@ import java.util.concurrent.*;
* http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
* http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
* <-- Provide configuration file path. -->
- * <bean id="cacheManager" class="org.apache.ignite.cache.spring.GridSpringCacheManager">
+ * <bean id="cacheManager" class="org.apache.ignite.cache.spring.SpringCacheManager">
* <property name="configurationPath" value="examples/config/spring-cache.xml"/>
- * </bean>
+ * </bean>
*
* <-- Use annotation-driven caching configuration. -->
* <cache:annotation-driven/>
@@ -78,7 +80,7 @@ import java.util.concurrent.*;
* http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
* http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
* <-- Provide configuration bean. -->
- * <bean id="cacheManager" class="org.apache.ignite.cache.spring.GridSpringCacheManager">
+ * <bean id="cacheManager" class="org.apache.ignite.cache.spring.SpringCacheManager">
* <property name="configuration">
* <bean id="gridCfg" class="org.apache.ignite.configuration.IgniteConfiguration">
* ...
@@ -104,7 +106,7 @@ import java.util.concurrent.*;
* http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
* http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
* <-- Provide Grid name. -->
- * <bean id="cacheManager" class="org.apache.ignite.cache.spring.GridSpringCacheManager">
+ * <bean id="cacheManager" class="org.apache.ignite.cache.spring.SpringCacheManager">
* <property name="gridName" value="myGrid"/>
* </bean>
*
@@ -247,7 +249,7 @@ public class SpringCacheManager implements CacheManager, InitializingBean {
if (cfgPath != null && cfg != null) {
throw new IllegalArgumentException("Both 'configurationPath' and 'configuration' are " +
"provided. Set only one of these properties if you need to start a Ignite node inside of " +
- "GridSpringCacheManager. If you already have a node running, omit both of them and set" +
+ "SpringCacheManager. If you already have a node running, omit both of them and set" +
"'gridName' property.");
}
[36/50] [abbrv] incubator-ignite git commit: # ignite-901 client
reconnect support
Posted by av...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java
new file mode 100644
index 0000000..7cfc329
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverTest.java
@@ -0,0 +1,212 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.transactions.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.transactions.TransactionIsolation.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectFailoverTest extends IgniteClientReconnectFailoverAbstractTest {
+ /** */
+ protected static final String ATOMIC_CACHE = "ATOMIC_CACHE";
+
+ /** */
+ protected static final String TX_CACHE = "TX_CACHE";
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ CacheConfiguration ccfg1 = new CacheConfiguration();
+
+ ccfg1.setName(ATOMIC_CACHE);
+ ccfg1.setBackups(1);
+ ccfg1.setAtomicityMode(ATOMIC);
+
+ CacheConfiguration ccfg2 = new CacheConfiguration();
+
+ ccfg2.setName(TX_CACHE);
+ ccfg2.setBackups(1);
+ ccfg2.setAtomicityMode(TRANSACTIONAL);
+
+ cfg.setCacheConfiguration(ccfg1, ccfg2);
+
+ return cfg;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectAtomicCache() throws Exception {
+ final Ignite client = grid(serverCount());
+
+ final IgniteCache<Integer, Integer> cache = client.cache(ATOMIC_CACHE);
+
+ assertNotNull(cache);
+
+ assertEquals(ATOMIC, cache.getConfiguration(CacheConfiguration.class).getAtomicityMode());
+
+ reconnectFailover(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ TreeMap<Integer, Integer> map = new TreeMap<>();
+
+ ThreadLocalRandom rnd = ThreadLocalRandom.current();
+
+ for (int i = 0; i < 10; i++) {
+ Integer key = rnd.nextInt(0, 100_000);
+
+ cache.put(key, key);
+
+ assertEquals(key, cache.get(key));
+
+ map.put(key, key);
+ }
+
+ cache.putAll(map);
+
+ Map<Integer, Integer> res = cache.getAll(map.keySet());
+
+ assertEquals(map, res);
+
+ return null;
+ }
+ });
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectTxCache() throws Exception {
+ final Ignite client = grid(serverCount());
+
+ final IgniteCache<Integer, Integer> cache = client.cache(TX_CACHE);
+
+ assertNotNull(cache);
+
+ assertEquals(TRANSACTIONAL, cache.getConfiguration(CacheConfiguration.class).getAtomicityMode());
+
+ final IgniteTransactions txs = client.transactions();
+
+ reconnectFailover(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ TreeMap<Integer, Integer> map = new TreeMap<>();
+
+ ThreadLocalRandom rnd = ThreadLocalRandom.current();
+
+ for (int i = 0; i < 5; i++) {
+ Integer key = rnd.nextInt(0, 100_000);
+
+ cache.put(key, key);
+
+ assertEquals(key, cache.get(key));
+
+ map.put(key, key);
+ }
+
+ for (TransactionConcurrency txConcurrency : TransactionConcurrency.values()) {
+ try (Transaction tx = txs.txStart(txConcurrency, REPEATABLE_READ)) {
+ for (Map.Entry<Integer, Integer> e : map.entrySet()) {
+ cache.put(e.getKey(), e.getValue());
+
+ assertNotNull(cache.get(e.getKey()));
+ }
+
+ tx.commit();
+ }
+ }
+
+ cache.putAll(map);
+
+ Map<Integer, Integer> res = cache.getAll(map.keySet());
+
+ assertEquals(map, res);
+
+ return null;
+ }
+ });
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectComputeApi() throws Exception {
+ final Ignite client = grid(serverCount());
+
+ final IgniteCompute comp = client.compute();
+
+ reconnectFailover(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ comp.call(new DummyClosure());
+
+ comp.broadcast(new DummyClosure());
+
+ return null;
+ }
+ });
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectStreamerApi() throws Exception {
+ final Ignite client = grid(serverCount());
+
+ reconnectFailover(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ stream(ATOMIC_CACHE);
+
+ stream(TX_CACHE);
+
+ return null;
+ }
+
+ private void stream(String cacheName) {
+ ThreadLocalRandom rnd = ThreadLocalRandom.current();
+
+ try (IgniteDataStreamer<Integer, Integer> streamer = client.dataStreamer(cacheName)) {
+ streamer.allowOverwrite(true);
+
+ streamer.perNodeBufferSize(10);
+
+ for (int i = 0; i < 100; i++)
+ streamer.addData(rnd.nextInt(100_000), 0);
+ }
+ }
+ });
+ }
+
+ /**
+ *
+ */
+ public static class DummyClosure implements IgniteCallable<Object> {
+ /** {@inheritDoc} */
+ @Override public Object call() throws Exception {
+ return 1;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectServicesTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectServicesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectServicesTest.java
new file mode 100644
index 0000000..31b4192
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectServicesTest.java
@@ -0,0 +1,260 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+import org.apache.ignite.internal.processors.service.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.services.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.concurrent.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectServicesTest extends IgniteClientReconnectAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected int serverCount() {
+ return 1;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int clientCount() {
+ return 1;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnect() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ IgniteServices services = client.services();
+
+ services.deployClusterSingleton("testReconnect", new TestServiceImpl());
+
+ TestService srvc = services.serviceProxy("testReconnect", TestService.class, false);
+
+ assertNotNull(srvc);
+
+ long topVer = grid(0).cluster().topologyVersion();
+
+ assertEquals((Object)topVer, srvc.test());
+
+ Ignite srv = clientRouter(client);
+
+ reconnectClientNode(client, srv, null);
+
+ CountDownLatch latch = new CountDownLatch(1);
+
+ DummyService.exeLatch("testReconnect2", latch);
+
+ services.deployClusterSingleton("testReconnect2", new DummyService());
+
+ assertTrue(latch.await(5000, TimeUnit.MILLISECONDS));
+
+ assertEquals((Object)(topVer + 2), srvc.test());
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testServiceRemove() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ IgniteServices clnServices = client.services();
+
+ final IgniteServices srvServices = srv.services();
+
+ srvServices.deployClusterSingleton("testServiceRemove", new TestServiceImpl());
+
+ final TestService srvc = clnServices.serviceProxy("testServiceRemove", TestService.class, false);
+
+ assertNotNull(srvc);
+
+ assertNotNull(srvc.test());
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ srvServices.cancel("testServiceRemove");
+ }
+ });
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return srvc.test();
+ }
+ }, IgniteException.class, null);
+
+ clnServices.deployClusterSingleton("testServiceRemove", new TestServiceImpl());
+
+ TestService newSrvc = clnServices.serviceProxy("testServiceRemove", TestService.class, false);
+
+ assertNotNull(newSrvc);
+ assertNotNull(newSrvc.test());
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectInDeploying() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ final IgniteServices services = client.services();
+
+ Ignite srv = clientRouter(client);
+
+ BlockTpcCommunicationSpi commSpi = commSpi(srv);
+
+ commSpi.blockMessage(GridNearTxPrepareResponse.class);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ services.deployClusterSingleton("testReconnectInDeploying", new TestServiceImpl());
+ }
+ catch (IgniteClientDisconnectedException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ commSpi.unblockMessage();
+
+ reconnectClientNode(client, srv, null);
+
+ assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectInProgress() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ final IgniteServices services = client.services();
+
+ final Ignite srv = clientRouter(client);
+
+ services.deployClusterSingleton("testReconnectInProgress", new TestServiceImpl());
+
+ final TestService srvc = services.serviceProxy("testReconnectInProgress", TestService.class, false);
+
+ assertNotNull(srvc);
+
+ BlockTpcCommunicationSpi commSpi = commSpi(srv);
+
+ commSpi.blockMessage(GridJobExecuteResponse.class);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ srvc.test();
+ }
+ catch (IgniteClientDisconnectedException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ commSpi.unblockMessage();
+
+ reconnectClientNode(client, srv, null);
+
+ assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
+ }
+
+ /**
+ *
+ */
+ public static interface TestService {
+ /**
+ * @return Topology version.
+ */
+ public Long test();
+ }
+
+ /**
+ *
+ */
+ public static class TestServiceImpl implements Service, TestService {
+ /** */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** {@inheritDoc} */
+ @Override public void cancel(ServiceContext ctx) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void init(ServiceContext ctx) throws Exception {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void execute(ServiceContext ctx) throws Exception {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public Long test() {
+ assertFalse(ignite.cluster().localNode().isClient());
+
+ return ignite.cluster().topologyVersion();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectStopTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectStopTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectStopTest.java
new file mode 100644
index 0000000..98c3d0f
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectStopTest.java
@@ -0,0 +1,106 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.lang.*;
+
+import java.util.concurrent.*;
+
+import static org.apache.ignite.events.EventType.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectStopTest extends IgniteClientReconnectAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected int serverCount() {
+ return 1;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testStopWhenDisconnected() throws Exception {
+ clientMode = true;
+
+ Ignite client = startGrid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ TestTcpDiscoverySpi srvSpi = spi(srv);
+ final CountDownLatch disconnectLatch = new CountDownLatch(1);
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+ final TestTcpDiscoverySpi clientSpi = spi(client);
+
+ log.info("Block reconnect.");
+
+ clientSpi.writeLatch = new CountDownLatch(1);
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+ info("Disconnected: " + evt);
+
+ disconnectLatch.countDown();
+ } else if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ info("Reconnected: " + evt);
+
+ reconnectLatch.countDown();
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED);
+
+ srvSpi.failNode(client.cluster().localNode().id(), null);
+
+ waitReconnectEvent(disconnectLatch);
+
+ IgniteFuture<?> reconnectFut = null;
+
+ try {
+ client.getOrCreateCache(new CacheConfiguration<>());
+
+ fail();
+ }
+ catch (IgniteClientDisconnectedException e) {
+ log.info("Expected operation exception: " + e);
+
+ reconnectFut = e.reconnectFuture();
+ }
+
+ assertNotNull(reconnectFut);
+
+ client.close();
+
+ try {
+ reconnectFut.get();
+
+ fail();
+ }
+ catch (IgniteException e) {
+ log.info("Expected reconnect exception: " + e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectStreamerTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectStreamerTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectStreamerTest.java
new file mode 100644
index 0000000..a4cf77f
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectStreamerTest.java
@@ -0,0 +1,233 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.datastreamer.*;
+import org.apache.ignite.internal.util.lang.*;
+import org.apache.ignite.testframework.*;
+
+import javax.cache.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectStreamerTest extends IgniteClientReconnectAbstractTest {
+ /** */
+ public static final String CACHE_NAME = "streamer";
+
+ /** {@inheritDoc} */
+ @Override protected int serverCount() {
+ return 1;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int clientCount() {
+ return 1;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ CacheConfiguration<Integer, Integer> ccfg = new CacheConfiguration<Integer, Integer>(CACHE_NAME)
+ .setAtomicityMode(ATOMIC)
+ .setCacheMode(PARTITIONED);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ return cfg;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testStreamerReconnect() throws Exception {
+ final Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ final IgniteCache<Object, Object> srvCache = srv.cache(CACHE_NAME);
+
+ IgniteDataStreamer<Integer, Integer> streamer = client.dataStreamer(CACHE_NAME);
+
+ for (int i = 0; i < 50; i++)
+ streamer.addData(i, i);
+
+ streamer.flush();
+
+ GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ return srvCache.localSize() == 50;
+ }
+ }, 2000L);
+
+ assertEquals(50, srvCache.localSize());
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ try {
+ client.dataStreamer(CACHE_NAME);
+
+ fail();
+ }
+ catch (IgniteClientDisconnectedException e) {
+ assertNotNull(e.reconnectFuture());
+ }
+ }
+ });
+
+ checkStreamerClosed(streamer);
+
+ streamer = client.dataStreamer(CACHE_NAME);
+
+ for (int i = 50; i < 100; i++)
+ streamer.addData(i, i);
+
+ streamer.flush();
+
+ GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ return srvCache.localSize() == 100;
+ }
+ }, 2000L);
+
+ assertEquals(100, srvCache.localSize());
+
+ streamer.close();
+
+ streamer.future().get(2, TimeUnit.SECONDS);
+
+ srvCache.removeAll();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testStreamerReconnectInProgress() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ final IgniteCache<Object, Object> srvCache = srv.cache(CACHE_NAME);
+
+ final IgniteDataStreamer<Integer, Integer> streamer = client.dataStreamer(CACHE_NAME);
+
+ BlockTpcCommunicationSpi commSpi = commSpi(srv);
+
+ commSpi.blockMessage(DataStreamerResponse.class);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ for (int i = 0; i < 50; i++)
+ streamer.addData(i, i);
+
+ streamer.flush();
+ }
+ catch (CacheException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+ finally {
+ streamer.close();
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ commSpi.unblockMessage();
+
+ reconnectClientNode(client, srv, null);
+
+ assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
+
+ checkStreamerClosed(streamer);
+
+ IgniteDataStreamer<Integer, Integer> streamer2 = client.dataStreamer(CACHE_NAME);
+
+ for (int i = 0; i < 50; i++)
+ streamer2.addData(i, i);
+
+ streamer2.close();
+
+ GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ return srvCache.localSize() == 50;
+ }
+ }, 2000L);
+
+ assertEquals(50, srvCache.localSize());
+ }
+
+ /**
+ * @param streamer Streamer.
+ */
+ private void checkStreamerClosed(IgniteDataStreamer<Integer, Integer> streamer) {
+ try {
+ streamer.addData(100, 100);
+
+ fail();
+ }
+ catch (CacheException e) {
+ checkAndWait(e);
+ }
+
+ try {
+ streamer.flush();
+
+ fail();
+ }
+ catch (CacheException e) {
+ checkAndWait(e);
+ }
+
+ try {
+ streamer.future().get();
+
+ fail();
+ }
+ catch (CacheException e) {
+ checkAndWait(e);
+ }
+
+ streamer.tryFlush();
+
+ streamer.close();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteSlowClientDetectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteSlowClientDetectionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteSlowClientDetectionSelfTest.java
index 27c2a61..a392245 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteSlowClientDetectionSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteSlowClientDetectionSelfTest.java
@@ -62,6 +62,7 @@ public class IgniteSlowClientDetectionSelfTest extends GridCommonAbstractTest {
IgniteConfiguration cfg = super.getConfiguration(gridName);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setClientReconnectDisabled(true);
if (getTestGridName(nodeCount() - 1).equals(gridName) || getTestGridName(nodeCount() - 2).equals(gridName))
cfg.setClientMode(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManagerStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManagerStopSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManagerStopSelfTest.java
index 9780080..62f5d41 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManagerStopSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManagerStopSelfTest.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.managers.deployment;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.resource.*;
+import org.apache.ignite.lang.*;
import org.apache.ignite.marshaller.jdk.*;
import org.apache.ignite.spi.*;
import org.apache.ignite.spi.deployment.*;
@@ -95,5 +96,11 @@ public class GridDeploymentManagerStopSelfTest extends GridCommonAbstractTest {
/** {@inheritDoc} */
@Override public boolean unregister(String rsrcName) { return false; }
+
+ /** {@inheritDoc} */
+ @Override public void onClientDisconnected(IgniteFuture<?> reconnectFut) { /* No-op. */ }
+
+ /** {@inheritDoc} */
+ @Override public void onClientReconnected(boolean clusterRestarted) { /* No-op. */ }
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java
index 074f6ff..9c30f23 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java
@@ -263,7 +263,7 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst
e.printStackTrace(pw);
- assertTrue(sw.toString().contains("grid is stopping"));
+ assertTrue(sw.toString().contains("node is stopping"));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDynamicStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDynamicStopSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDynamicStopSelfTest.java
index 071341e..8703d32 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDynamicStopSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDynamicStopSelfTest.java
@@ -18,7 +18,6 @@
package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.IgniteDataStreamer;
-import org.apache.ignite.IgniteException;
import org.apache.ignite.cache.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.IgniteInternalFuture;
@@ -27,7 +26,7 @@ import org.apache.ignite.lang.IgniteFuture;
import org.apache.ignite.testframework.*;
import org.apache.ignite.testframework.junits.common.*;
-import javax.cache.Cache;
+import javax.cache.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -89,7 +88,8 @@ public class IgniteCacheDynamicStopSelfTest extends GridCommonAbstractTest {
@Override public void apply(IgniteFuture<?> f) {
try {
f.get();
- } catch (IgniteException ignore) {
+ }
+ catch (CacheException ignore) {
// This may be debugged.
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
index af3ea9d..30bf5dc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxExceptionAbstractSelfTest.java
@@ -22,6 +22,7 @@ import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.processors.cache.distributed.near.*;
+import org.apache.ignite.internal.transactions.*;
import org.apache.ignite.spi.*;
import org.apache.ignite.spi.indexing.*;
import org.apache.ignite.testframework.*;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java
index d78add6..53404cc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheSystemTransactionsSelfTest.java
@@ -75,7 +75,7 @@ public class IgniteCacheSystemTransactionsSelfTest extends GridCacheAbstractSelf
jcache.get("1");
jcache.put("1", "11");
- GridCacheAdapter<Object, Object> utilityCache = ignite.context().cache().utilityCache();
+ IgniteInternalCache<Object, Object> utilityCache = ignite.context().cache().utilityCache();
utilityCache.getAndPutIfAbsent("2", "2");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java
index 19e40bf..7a2e8b3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedInvalidateSelfTest.java
@@ -220,7 +220,8 @@ public class GridCacheReplicatedInvalidateSelfTest extends GridCommonAbstractTes
Object msg0 = ((GridIoMessage)msg).message();
if (!(msg0 instanceof GridClockDeltaSnapshotMessage)) {
- info("Sending message [locNodeId=" + getLocalNodeId() + ", destNodeId= " + destNode.id()
+ info("Sending message [locNodeId=" + ignite.cluster().localNode().id() +
+ ", destNodeId= " + destNode.id()
+ ", msg=" + msg + ']');
synchronized (msgCntMap) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
index e9d7a45..9a883b3 100644
--- a/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
+++ b/modules/core/src/test/java/org/apache/ignite/loadtests/hashmap/GridCacheTestContext.java
@@ -55,8 +55,8 @@ public class GridCacheTestContext<K, V> extends GridCacheContext<K, V> {
new GridCacheDeploymentManager<K, V>(),
new GridCachePartitionExchangeManager<K, V>(),
new GridCacheIoManager(),
- null,
- new CacheNoopJtaManager()
+ new CacheNoopJtaManager(),
+ null
),
defaultCacheConfiguration(),
CacheType.USER,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
index ec6a526..63db0c1 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
@@ -111,6 +111,9 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
/** */
private IgniteInClosure2X<TcpDiscoveryAbstractMessage, Socket> afterWrite;
+ /** */
+ private boolean reconnectDisabled;
+
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -159,6 +162,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
disco.setJoinTimeout(joinTimeout);
disco.setNetworkTimeout(netTimeout);
+ disco.setClientReconnectDisabled(reconnectDisabled);
+
disco.afterWrite(afterWrite);
cfg.setDiscoverySpi(disco);
@@ -524,7 +529,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
TestTcpDiscoverySpi spi = ((TestTcpDiscoverySpi)ignite.configuration().getDiscoverySpi());
- spi.pauseAll();
+ spi.pauseAll(false);
try {
spi.brakeConnection();
@@ -568,7 +573,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
TestTcpDiscoverySpi spi = ((TestTcpDiscoverySpi)ignite.configuration().getDiscoverySpi());
- spi.pauseAll();
+ spi.pauseAll(false);
try {
spi.brakeConnection();
@@ -606,7 +611,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
attachListeners(2, 2);
- ((TestTcpDiscoverySpi)G.ignite("client-1").configuration().getDiscoverySpi()).pauseAll();
+ ((TestTcpDiscoverySpi)G.ignite("client-1").configuration().getDiscoverySpi()).pauseAll(true);
stopGrid("server-2");
@@ -633,6 +638,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
public void testClientSegmentation() throws Exception {
clientsPerSrv = 1;
+ reconnectDisabled = true;
+
startServerNodes(3);
startClientNodes(3);
@@ -656,6 +663,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
final TcpDiscoverySpi disco = (TcpDiscoverySpi)G.ignite("client-2").configuration().getDiscoverySpi();
try {
+ log.info("Fail server: " + 2);
+
failServer(2);
await(srvFailedLatch);
@@ -886,8 +895,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
try {
startClientNodes(1);
- assertEquals(G.ignite("server-0").cluster().localNode().id(), ((TcpDiscoveryNode)G.ignite("client-0")
- .cluster().localNode()).clientRouterNodeId());
+ assertEquals(G.ignite("server-0").cluster().localNode().id(),
+ ((TcpDiscoveryNode) G.ignite("client-0").cluster().localNode()).clientRouterNodeId());
checkNodes(2, 1);
@@ -1206,6 +1215,528 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
}
/**
+ * @throws Exception If failed.
+ */
+ public void testReconnectAfterFail() throws Exception {
+ reconnectAfterFail(false);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectAfterFailTopologyChanged() throws Exception {
+ reconnectAfterFail(true);
+ }
+
+ /**
+ * @param changeTop If {@code true} topology is changed after client disconnects.
+ * @throws Exception If failed.
+ */
+ private void reconnectAfterFail(final boolean changeTop) throws Exception {
+ startServerNodes(1);
+
+ startClientNodes(1);
+
+ Ignite srv = G.ignite("server-0");
+
+ TestTcpDiscoverySpi srvSpi = ((TestTcpDiscoverySpi)srv.configuration().getDiscoverySpi());
+
+ Ignite client = G.ignite("client-0");
+
+ final ClusterNode clientNode = client.cluster().localNode();
+
+ final UUID clientId = clientNode.id();
+
+ final TestTcpDiscoverySpi clientSpi = ((TestTcpDiscoverySpi)client.configuration().getDiscoverySpi());
+
+ assertEquals(2L, clientNode.order());
+
+ final CountDownLatch failLatch = new CountDownLatch(1);
+
+ final CountDownLatch joinLatch = new CountDownLatch(1);
+
+ srv.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ info("Server event: " + evt);
+
+ DiscoveryEvent evt0 = (DiscoveryEvent)evt;
+
+ if (evt0.eventNode().id().equals(clientId) && (evt.type() == EVT_NODE_FAILED)) {
+ if (evt.type() == EVT_NODE_FAILED)
+ failLatch.countDown();
+ }
+ else if (evt.type() == EVT_NODE_JOINED) {
+ TcpDiscoveryNode node = (TcpDiscoveryNode)evt0.eventNode();
+
+ if ("client-0".equals(node.attribute(IgniteNodeAttributes.ATTR_GRID_NAME))) {
+ assertEquals(changeTop ? 5L : 4L, node.order());
+
+ joinLatch.countDown();
+ }
+ }
+
+ return true;
+ }
+ }, EVT_NODE_FAILED, EVT_NODE_JOINED);
+
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+ final CountDownLatch disconnectLatch = new CountDownLatch(1);
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ info("Client event: " + evt);
+
+ if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+ assertEquals(1, reconnectLatch.getCount());
+
+ disconnectLatch.countDown();
+
+ if (changeTop)
+ clientSpi.pauseAll(false);
+ }
+ else if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ assertEquals(0, disconnectLatch.getCount());
+
+ reconnectLatch.countDown();
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED);
+
+ srvSpi.failNode(client.cluster().localNode().id(), null);
+
+ if (changeTop) {
+ Ignite g = startGrid("server-" + srvIdx.getAndIncrement());
+
+ srvNodeIds.add(g.cluster().localNode().id());
+
+ clientSpi.resumeAll();
+ }
+
+ assertTrue(disconnectLatch.await(5000, MILLISECONDS));
+ assertTrue(reconnectLatch.await(5000, MILLISECONDS));
+ assertTrue(failLatch.await(5000, MILLISECONDS));
+ assertTrue(joinLatch.await(5000, MILLISECONDS));
+
+ long topVer = changeTop ? 5L : 4L;
+
+ assertEquals(topVer, client.cluster().localNode().order());
+
+ assertEquals(topVer, client.cluster().topologyVersion());
+
+ Collection<ClusterNode> clientTop = client.cluster().topology(topVer);
+
+ assertEquals(changeTop ? 3 : 2, clientTop.size());
+
+ clientNodeIds.remove(clientId);
+
+ clientNodeIds.add(client.cluster().localNode().id());
+
+ checkNodes(changeTop ? 2 : 1, 1);
+
+ Ignite g = startGrid("server-" + srvIdx.getAndIncrement());
+
+ srvNodeIds.add(g.cluster().localNode().id());
+
+ checkNodes(changeTop ? 3 : 2, 1);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectAfterFailConcurrentJoin() throws Exception {
+ startServerNodes(1);
+
+ startClientNodes(1);
+
+ Ignite srv = G.ignite("server-0");
+
+ TestTcpDiscoverySpi srvSpi = ((TestTcpDiscoverySpi)srv.configuration().getDiscoverySpi());
+
+ Ignite client = G.ignite("client-0");
+
+ final ClusterNode clientNode = client.cluster().localNode();
+
+ assertEquals(2L, clientNode.order());
+
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+ final CountDownLatch disconnectLatch = new CountDownLatch(1);
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ info("Client event: " + evt);
+
+ if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+ assertEquals(1, reconnectLatch.getCount());
+
+ disconnectLatch.countDown();
+ }
+ else if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ assertEquals(0, disconnectLatch.getCount());
+
+ reconnectLatch.countDown();
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED);
+
+ final int CLIENTS = 20;
+
+ clientsPerSrv = CLIENTS + 1;
+
+ final CountDownLatch latch = new CountDownLatch(1);
+
+ IgniteInternalFuture<?> fut = GridTestUtils.runMultiThreadedAsync(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ latch.await();
+
+ Ignite g = startGrid("client-" + clientIdx.getAndIncrement());
+
+ clientNodeIds.add(g.cluster().localNode().id());
+
+ return null;
+ }
+ }, CLIENTS, "start-client");
+
+ srvSpi.failNode(client.cluster().localNode().id(), null);
+
+ latch.countDown();
+
+ assertTrue(disconnectLatch.await(10_000, MILLISECONDS));
+ assertTrue(reconnectLatch.await(10_000, MILLISECONDS));
+
+ clientNodeIds.add(client.cluster().localNode().id());
+
+ fut.get();
+
+ checkNodes(1, CLIENTS + 1);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testClientFailReconnectDisabled() throws Exception {
+ reconnectDisabled = true;
+
+ startServerNodes(1);
+
+ startClientNodes(1);
+
+ Ignite srv = G.ignite("server-0");
+
+ TestTcpDiscoverySpi srvSpi = ((TestTcpDiscoverySpi)srv.configuration().getDiscoverySpi());
+
+ Ignite client = G.ignite("client-0");
+
+ final CountDownLatch segmentedLatch = new CountDownLatch(1);
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_NODE_SEGMENTED)
+ segmentedLatch.countDown();
+
+ return false;
+ }
+ }, EVT_NODE_SEGMENTED);
+
+ srvFailedLatch = new CountDownLatch(1);
+
+ attachListeners(1, 0);
+
+ log.info("Fail client node.");
+
+ srvSpi.failNode(client.cluster().localNode().id(), null);
+
+ assertTrue(srvFailedLatch.await(5000, MILLISECONDS));
+ assertTrue(segmentedLatch.await(5000, MILLISECONDS));
+
+ checkNodes(1, 0);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectSegmentedAfterJoinTimeoutServerFailed() throws Exception {
+ reconnectSegmentedAfterJoinTimeout(true);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectSegmentedAfterJoinTimeoutNetworkError() throws Exception {
+ reconnectSegmentedAfterJoinTimeout(false);
+ }
+
+ /**
+ * @param failSrv If {@code true} fails server, otherwise server does not send join message.
+ * @throws Exception If failed.
+ */
+ private void reconnectSegmentedAfterJoinTimeout(boolean failSrv) throws Exception {
+ netTimeout = 4000;
+ joinTimeout = 5000;
+
+ startServerNodes(1);
+
+ startClientNodes(1);
+
+ final Ignite srv = G.ignite("server-0");
+ Ignite client = G.ignite("client-0");
+
+ TestTcpDiscoverySpi srvSpi = ((TestTcpDiscoverySpi)srv.configuration().getDiscoverySpi());
+ TestTcpDiscoverySpi clientSpi = ((TestTcpDiscoverySpi)client.configuration().getDiscoverySpi());
+
+ final CountDownLatch disconnectLatch = new CountDownLatch(1);
+ final CountDownLatch segmentedLatch = new CountDownLatch(1);
+ final AtomicBoolean err = new AtomicBoolean(false);
+
+ if (!failSrv) {
+ srvFailedLatch = new CountDownLatch(1);
+
+ attachListeners(1, 0);
+ }
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+ log.info("Disconnected event.");
+
+ assertEquals(1, segmentedLatch.getCount());
+ assertEquals(1, disconnectLatch.getCount());
+ assertFalse(err.get());
+
+ disconnectLatch.countDown();
+ }
+ else if (evt.type() == EVT_NODE_SEGMENTED) {
+ log.info("Segmented event.");
+
+ assertEquals(1, segmentedLatch.getCount());
+ assertEquals(0, disconnectLatch.getCount());
+ assertFalse(err.get());
+
+ segmentedLatch.countDown();
+ }
+ else {
+ log.error("Unexpected event: " + evt);
+
+ err.set(true);
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED, EVT_NODE_SEGMENTED);
+
+ if (failSrv) {
+ log.info("Fail server.");
+
+ failServer(0);
+ }
+ else {
+ log.info("Fail client connection.");
+
+ srvSpi.failClientReconnect.set(1_000_000);
+ srvSpi.skipNodeAdded = true;
+
+ clientSpi.brakeConnection();
+ }
+
+ assertTrue(disconnectLatch.await(10_000, MILLISECONDS));
+
+ assertTrue(segmentedLatch.await(10_000, MILLISECONDS));
+
+ waitSegmented(client);
+
+ assertFalse(err.get());
+
+ if (!failSrv) {
+ await(srvFailedLatch);
+
+ GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ return srv.cluster().nodes().size() == 1;
+ }
+ }, 10_000);
+
+ checkNodes(1, 0);
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectClusterRestart() throws Exception {
+ netTimeout = 3000;
+ joinTimeout = 60_000;
+
+ final CountDownLatch disconnectLatch = new CountDownLatch(1);
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+ final AtomicBoolean err = new AtomicBoolean(false);
+
+ startServerNodes(1);
+
+ startClientNodes(1);
+
+ Ignite srv = G.ignite("server-0");
+ Ignite client = G.ignite("client-0");
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+ log.info("Disconnected event.");
+
+ assertEquals(1, reconnectLatch.getCount());
+ assertEquals(1, disconnectLatch.getCount());
+
+ disconnectLatch.countDown();
+ }
+ else if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ log.info("Reconnected event.");
+
+ assertEquals(1, reconnectLatch.getCount());
+ assertEquals(0, disconnectLatch.getCount());
+ assertFalse(err.get());
+
+ reconnectLatch.countDown();
+ }
+ else {
+ log.error("Unexpected event: " + evt);
+
+ err.set(true);
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED, EVT_NODE_SEGMENTED);
+
+ log.info("Stop server.");
+
+ srv.close();
+
+ assertTrue(disconnectLatch.await(10_000, MILLISECONDS));
+
+ srvNodeIds.clear();
+ srvIdx.set(0);
+
+ Thread.sleep(3000);
+
+ log.info("Restart server.");
+
+ startServerNodes(1);
+
+ assertTrue(reconnectLatch.await(10_000, MILLISECONDS));
+
+ clientNodeIds.clear();
+ clientNodeIds.add(client.cluster().localNode().id());
+
+ checkNodes(1, 1);
+
+ assertFalse(err.get());
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testDisconnectAfterNetworkTimeout() throws Exception {
+ netTimeout = 5000;
+ joinTimeout = 60_000;
+ maxMissedClientHbs = 2;
+
+ startServerNodes(1);
+
+ startClientNodes(1);
+
+ final Ignite srv = G.ignite("server-0");
+ Ignite client = G.ignite("client-0");
+
+ TestTcpDiscoverySpi srvSpi = ((TestTcpDiscoverySpi)srv.configuration().getDiscoverySpi());
+ TestTcpDiscoverySpi clientSpi = ((TestTcpDiscoverySpi)client.configuration().getDiscoverySpi());
+
+ final CountDownLatch disconnectLatch = new CountDownLatch(1);
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+ final AtomicBoolean err = new AtomicBoolean(false);
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override
+ public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+ log.info("Disconnected event.");
+
+ assertEquals(1, reconnectLatch.getCount());
+ assertEquals(1, disconnectLatch.getCount());
+ assertFalse(err.get());
+
+ disconnectLatch.countDown();
+ }
+ else if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ log.info("Reconnected event.");
+
+ assertEquals(1, reconnectLatch.getCount());
+ assertEquals(0, disconnectLatch.getCount());
+ assertFalse(err.get());
+
+ reconnectLatch.countDown();
+ }
+ else {
+ log.error("Unexpected event: " + evt);
+
+ err.set(true);
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED, EVT_NODE_SEGMENTED);
+
+ log.info("Fail client connection1.");
+
+ srvSpi.failClientReconnect.set(1_000_000);
+ srvSpi.skipNodeAdded = true;
+
+ clientSpi.brakeConnection();
+
+ assertTrue(disconnectLatch.await(10_000, MILLISECONDS));
+
+ log.info("Fail client connection2.");
+
+ srvSpi.failClientReconnect.set(0);
+ srvSpi.skipNodeAdded = false;
+
+ clientSpi.brakeConnection();
+
+ assertTrue(reconnectLatch.await(10_000, MILLISECONDS));
+
+ clientNodeIds.clear();
+
+ clientNodeIds.add(client.cluster().localNode().id());
+
+ GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override
+ public boolean apply() {
+ return srv.cluster().nodes().size() == 2;
+ }
+ }, 10_000);
+
+ checkNodes(1, 1);
+
+ assertFalse(err.get());
+ }
+
+ /**
+ * @param ignite Ignite.
+ * @throws Exception If failed.
+ */
+ private void waitSegmented(final Ignite ignite) throws Exception {
+ GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ return IgniteState.STOPPED_ON_SEGMENTATION == Ignition.state(ignite.name());
+ }
+ }, 5000);
+
+ assertEquals(IgniteState.STOPPED_ON_SEGMENTATION, Ignition.state(ignite.name()));
+ }
+
+ /**
* @param clientIdx Client index.
* @param srvIdx Server index.
* @throws Exception In case of error.
@@ -1401,7 +1932,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
private void checkRemoteNodes(Ignite ignite, int expCnt) {
Collection<ClusterNode> nodes = ignite.cluster().forRemotes().nodes();
- assertEquals(expCnt, nodes.size());
+ assertEquals("Unexpected state for node: " + ignite.name(), expCnt, nodes.size());
for (ClusterNode node : nodes) {
UUID id = node.id();
@@ -1420,7 +1951,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
* @throws InterruptedException If interrupted.
*/
private void await(CountDownLatch latch) throws InterruptedException {
- assertTrue("Latch count: " + latch.getCount(), latch.await(10000, MILLISECONDS));
+ assertTrue("Latch count: " + latch.getCount(), latch.await(10_000, MILLISECONDS));
}
/**
@@ -1471,6 +2002,9 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
/** */
private volatile String delayJoinAckFor;
+ /** */
+ private volatile boolean skipNodeAdded;
+
/**
* @param lock Lock.
*/
@@ -1543,6 +2077,13 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
boolean fail = false;
+ if (skipNodeAdded &&
+ (msg instanceof TcpDiscoveryNodeAddedMessage || msg instanceof TcpDiscoveryNodeAddFinishedMessage)) {
+ log.info("Skip message: " + msg);
+
+ return;
+ }
+
if (msg instanceof TcpDiscoveryNodeAddedMessage)
fail = failNodeAdded.getAndDecrement() > 0;
else if (msg instanceof TcpDiscoveryNodeAddFinishedMessage)
@@ -1577,12 +2118,13 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
}
/**
- *
+ * @param suspend If {@code true} suspends worker threads.
*/
- public void pauseAll() {
+ public void pauseAll(boolean suspend) {
pauseResumeOperation(true, openSockLock, writeLock);
- impl.workerThread().suspend();
+ if (suspend)
+ impl.workerThread().suspend();
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
index 159c451..dacbf55 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/multijvm/IgniteClusterProcessProxy.java
@@ -317,4 +317,9 @@ public class IgniteClusterProcessProxy implements IgniteClusterEx {
@Override public ClusterMetrics metrics() throws IgniteException {
throw new UnsupportedOperationException("Operation is not supported yet.");
}
+
+ /** {@inheritDoc} */
+ @Nullable @Override public IgniteFuture<?> clientReconnectFuture() {
+ throw new UnsupportedOperationException("Operation is not supported yet.");
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteClientReconnectTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteClientReconnectTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteClientReconnectTestSuite.java
new file mode 100644
index 0000000..66c9835
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteClientReconnectTestSuite.java
@@ -0,0 +1,48 @@
+/*
+ * 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.testsuites;
+
+import junit.framework.*;
+import org.apache.ignite.internal.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectTestSuite extends TestSuite {
+ /**
+ * @return Test suite.
+ * @throws Exception In case of error.
+ */
+ public static TestSuite suite() throws Exception {
+ TestSuite suite = new TestSuite("Ignite Client Reconnect Test Suite");
+
+ suite.addTestSuite(IgniteClientReconnectStopTest.class);
+ suite.addTestSuite(IgniteClientReconnectApiExceptionTest.class);
+ suite.addTestSuite(IgniteClientReconnectDiscoveryStateTest.class);
+ suite.addTestSuite(IgniteClientReconnectCacheTest.class);
+ suite.addTestSuite(IgniteClientReconnectContinuousProcessorTest.class);
+ suite.addTestSuite(IgniteClientReconnectComputeTest.class);
+ suite.addTestSuite(IgniteClientReconnectAtomicsTest.class);
+ suite.addTestSuite(IgniteClientReconnectCollectionsTest.class);
+ suite.addTestSuite(IgniteClientReconnectServicesTest.class);
+ suite.addTestSuite(IgniteClientReconnectStreamerTest.class);
+ suite.addTestSuite(IgniteClientReconnectFailoverTest.class);
+
+ return suite;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 06c0961..c76dbe7 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -1439,6 +1439,11 @@ public class IgniteH2Indexing implements GridQueryIndexing {
fut.get();
}
+ /** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) {
+ rdcQryExec.onDisconnected(reconnectFut);
+ }
+
/**
* Wrapper to store connection and flag is schema set or not.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
index af29647..2b2996d 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMergeIndex.java
@@ -26,6 +26,7 @@ import org.h2.table.*;
import org.jetbrains.annotations.*;
import org.jsr166.*;
+import javax.cache.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
@@ -40,7 +41,7 @@ public abstract class GridMergeIndex extends BaseIndex {
private static final int MAX_FETCH_SIZE = getInteger(IGNITE_SQL_MERGE_TABLE_MAX_SIZE, 10_000);
/** All rows number. */
- private final AtomicInteger expectedRowsCnt = new AtomicInteger(0);
+ private final AtomicInteger expRowsCnt = new AtomicInteger(0);
/** Remaining rows per source node ID. */
private final ConcurrentMap<UUID, Counter> remainingRows = new ConcurrentHashMap8<>();
@@ -75,8 +76,8 @@ public abstract class GridMergeIndex extends BaseIndex {
}
/** {@inheritDoc} */
- @Override public long getRowCount(Session session) {
- return expectedRowsCnt.get();
+ @Override public long getRowCount(Session ses) {
+ return expRowsCnt.get();
}
/** {@inheritDoc} */
@@ -93,6 +94,23 @@ public abstract class GridMergeIndex extends BaseIndex {
}
/**
+ * @param e Error.
+ */
+ public void fail(final CacheException e) {
+ for (UUID nodeId0 : remainingRows.keySet()) {
+ addPage0(new GridResultPage(null, nodeId0, null) {
+ @Override public boolean isFail() {
+ return true;
+ }
+
+ @Override public void fetchNextPage() {
+ throw e;
+ }
+ });
+ }
+ }
+
+ /**
* @param nodeId Node ID.
*/
public void fail(UUID nodeId) {
@@ -120,7 +138,7 @@ public abstract class GridMergeIndex extends BaseIndex {
assert !cnt.initialized : "Counter is already initialized.";
cnt.addAndGet(allRows);
- expectedRowsCnt.addAndGet(allRows);
+ expRowsCnt.addAndGet(allRows);
// We need this separate flag to handle case when the first source contains only one page
// and it will signal that all remaining counters are zero and fetch is finished.
@@ -162,7 +180,7 @@ public abstract class GridMergeIndex extends BaseIndex {
}
/** {@inheritDoc} */
- @Override public Cursor find(Session session, SearchRow first, SearchRow last) {
+ @Override public Cursor find(Session ses, SearchRow first, SearchRow last) {
if (fetched == null)
throw new IgniteException("Fetched result set was too large.");
@@ -176,7 +194,7 @@ public abstract class GridMergeIndex extends BaseIndex {
* @return {@code true} If we have fetched all the remote rows.
*/
public boolean fetchedAll() {
- return fetchedCnt == expectedRowsCnt.get();
+ return fetchedCnt == expRowsCnt.get();
}
/**
@@ -200,32 +218,32 @@ public abstract class GridMergeIndex extends BaseIndex {
}
/** {@inheritDoc} */
- @Override public void close(Session session) {
+ @Override public void close(Session ses) {
// No-op.
}
/** {@inheritDoc} */
- @Override public void add(Session session, Row row) {
+ @Override public void add(Session ses, Row row) {
throw DbException.getUnsupportedException("add");
}
/** {@inheritDoc} */
- @Override public void remove(Session session, Row row) {
+ @Override public void remove(Session ses, Row row) {
throw DbException.getUnsupportedException("remove row");
}
/** {@inheritDoc} */
- @Override public double getCost(Session session, int[] masks, TableFilter filter, SortOrder sortOrder) {
+ @Override public double getCost(Session ses, int[] masks, TableFilter filter, SortOrder sortOrder) {
return getRowCountApproximation() + Constants.COST_ROW_OFFSET;
}
/** {@inheritDoc} */
- @Override public void remove(Session session) {
+ @Override public void remove(Session ses) {
throw DbException.getUnsupportedException("remove index");
}
/** {@inheritDoc} */
- @Override public void truncate(Session session) {
+ @Override public void truncate(Session ses) {
throw DbException.getUnsupportedException("truncate");
}
@@ -235,7 +253,7 @@ public abstract class GridMergeIndex extends BaseIndex {
}
/** {@inheritDoc} */
- @Override public Cursor findFirstOrLast(Session session, boolean first) {
+ @Override public Cursor findFirstOrLast(Session ses, boolean first) {
throw DbException.getUnsupportedException("findFirstOrLast");
}
@@ -299,6 +317,7 @@ public abstract class GridMergeIndex extends BaseIndex {
private Iterator<Row> stream;
/**
+ * @param stream Iterator.
*/
public FetchingCursor(Iterator<Row> stream) {
super(new FetchedIterator());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index 32d1c95..cde3288 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -33,6 +33,7 @@ import org.apache.ignite.internal.processors.query.h2.twostep.messages.*;
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.*;
import org.apache.ignite.plugin.extensions.communication.*;
import org.h2.command.*;
@@ -47,6 +48,7 @@ import org.h2.table.*;
import org.h2.tools.*;
import org.h2.util.*;
import org.h2.value.*;
+import org.jetbrains.annotations.*;
import org.jsr166.*;
import javax.cache.*;
@@ -234,10 +236,15 @@ public class GridReduceQueryExecutor {
Object errState = r.state.get();
if (errState != null) {
+ CacheException err0 = errState instanceof CacheException ? (CacheException)errState : null;
+
+ if (err0 != null && err0.getCause() instanceof IgniteClientDisconnectedException)
+ throw err0;
+
CacheException e = new CacheException("Failed to fetch data from node: " + node.id());
- if (errState instanceof CacheException)
- e.addSuppressed((Throwable)errState);
+ if (err0 != null)
+ e.addSuppressed(err0);
throw e;
}
@@ -301,6 +308,7 @@ public class GridReduceQueryExecutor {
}
/**
+ * @param cctx Cache context.
* @return {@code true} If cache context
*/
private boolean hasMovingPartitions(GridCacheContext<?,?> cctx) {
@@ -481,6 +489,12 @@ public class GridReduceQueryExecutor {
runs.put(qryReqId, r);
try {
+ if (ctx.clientDisconnected()) {
+ throw new CacheException("Query was cancelled, client node disconnected.",
+ new IgniteClientDisconnectedException(ctx.cluster().clientReconnectFuture(),
+ "Client node disconnected."));
+ }
+
Collection<GridCacheSqlQuery> mapQrys = qry.mapQueries();
if (qry.explain()) {
@@ -506,8 +520,14 @@ public class GridReduceQueryExecutor {
Object state = r.state.get();
if (state != null) {
- if (state instanceof CacheException)
- throw new CacheException("Failed to run map query remotely.", (CacheException)state);
+ if (state instanceof CacheException) {
+ CacheException err = (CacheException)state;
+
+ if (err.getCause() instanceof IgniteClientDisconnectedException)
+ throw err;
+
+ throw new CacheException("Failed to run map query remotely.", err);
+ }
if (state instanceof AffinityTopologyVersion) {
retry = true;
@@ -550,7 +570,20 @@ public class GridReduceQueryExecutor {
catch (IgniteCheckedException | RuntimeException e) {
U.closeQuiet(r.conn);
- throw new CacheException("Failed to run reduce query locally.", e);
+ if (e instanceof CacheException)
+ throw (CacheException)e;
+
+ Throwable cause = e;
+
+ if (e instanceof IgniteCheckedException) {
+ Throwable disconnectedErr =
+ ((IgniteCheckedException)e).getCause(IgniteClientDisconnectedException.class);
+
+ if (disconnectedErr != null)
+ cause = disconnectedErr;
+ }
+
+ throw new CacheException("Failed to run reduce query locally.", cause);
}
finally {
if (!runs.remove(qryReqId, r))
@@ -1082,6 +1115,17 @@ public class GridReduceQueryExecutor {
}
/**
+ * @param reconnectFut Reconnect future.
+ */
+ public void onDisconnected(IgniteFuture<?> reconnectFut) {
+ CacheException err = new CacheException("Query was cancelled, client node disconnected.",
+ new IgniteClientDisconnectedException(reconnectFut, "Client node disconnected."));
+
+ for (Map.Entry<Long, QueryRun> e : runs.entrySet())
+ e.getValue().disconnected(err);
+ }
+
+ /**
*
*/
private static class QueryRun {
@@ -1104,7 +1148,7 @@ public class GridReduceQueryExecutor {
* @param o Fail state object.
* @param nodeId Node ID.
*/
- void state(Object o, UUID nodeId) {
+ void state(Object o, @Nullable UUID nodeId) {
assert o != null;
assert o instanceof CacheException || o instanceof AffinityTopologyVersion : o.getClass();
@@ -1117,6 +1161,20 @@ public class GridReduceQueryExecutor {
for (GridMergeTable tbl : tbls) // Fail all merge indexes.
tbl.getScanIndex(null).fail(nodeId);
}
+
+ /**
+ * @param e Error.
+ */
+ void disconnected(CacheException e) {
+ if (!state.compareAndSet(null, e))
+ return;
+
+ while (latch.getCount() != 0) // We don't need to wait for all nodes to reply.
+ latch.countDown();
+
+ for (GridMergeTable tbl : tbls) // Fail all merge indexes.
+ tbl.getScanIndex(null).fail(e);
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientReconnectCacheQueriesFailoverTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientReconnectCacheQueriesFailoverTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientReconnectCacheQueriesFailoverTest.java
new file mode 100644
index 0000000..23320ae
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteClientReconnectCacheQueriesFailoverTest.java
@@ -0,0 +1,225 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cache.query.*;
+import org.apache.ignite.cache.query.annotations.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+
+import javax.cache.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectCacheQueriesFailoverTest extends IgniteClientReconnectFailoverAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+
+ ccfg.setCacheMode(PARTITIONED);
+ ccfg.setBackups(1);
+ ccfg.setIndexedTypes(Integer.class, Person.class);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ super.beforeTestsStarted();
+
+ final IgniteCache<Integer, Person> cache = grid(serverCount()).cache(null);
+
+ assertNotNull(cache);
+
+ for (int i = 0; i <= 10_000; i++)
+ cache.put(i, new Person(i, "name-" + i));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectCacheQueries() throws Exception {
+ final Ignite client = grid(serverCount());
+
+ final IgniteCache<Integer, Person> cache = client.cache(null);
+
+ assertNotNull(cache);
+
+ reconnectFailover(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ SqlQuery<Integer, Person> sqlQry = new SqlQuery<>(Person.class, "where id > 1");
+
+ try {
+ assertEquals(9999, cache.query(sqlQry).getAll().size());
+ }
+ catch (CacheException e) {
+ if (e.getCause() instanceof IgniteClientDisconnectedException)
+ throw e;
+ else
+ log.info("Ignore error: " + e);
+ }
+
+ try {
+ SqlFieldsQuery fieldsQry = new SqlFieldsQuery("select avg(p.id) from Person p");
+
+ List<List<?>> res = cache.query(fieldsQry).getAll();
+
+ assertEquals(1, res.size());
+
+ Double avg = (Double)res.get(0).get(0);
+
+ assertEquals(5_000, avg.intValue());
+ }
+ catch (CacheException e) {
+ if (e.getCause() instanceof IgniteClientDisconnectedException)
+ throw e;
+ else
+ log.info("Ignore error: " + e);
+ }
+
+ return null;
+ }
+ });
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectScanQuery() throws Exception {
+ final Ignite client = grid(serverCount());
+
+ final IgniteCache<Integer, Person> cache = client.cache(null);
+
+ assertNotNull(cache);
+
+ final Affinity<Integer> aff = client.affinity(null);
+
+ final Map<Integer, Integer> partMap = new HashMap<>();
+
+ for (int i = 0; i < aff.partitions(); i++)
+ partMap.put(i, 0);
+
+ for (int i = 0; i <= 10_000; i++) {
+ Integer part = aff.partition(i);
+
+ Integer size = partMap.get(part);
+
+ partMap.put(part, size + 1);
+ }
+
+ reconnectFailover(new Callable<Void>() {
+ @Override public Void call() throws Exception {
+ ScanQuery<Integer, Person> qry = new ScanQuery<>(new IgniteBiPredicate<Integer, Person>() {
+ @Override public boolean apply(Integer key, Person val) {
+ return val.getId() % 2 == 1;
+ }
+ });
+
+ assertEquals(5000, cache.query(qry).getAll().size());
+
+ ThreadLocalRandom rnd = ThreadLocalRandom.current();
+
+ Integer part = rnd.nextInt(0, aff.partitions());
+
+ qry = new ScanQuery<>(part);
+
+ assertEquals((int)partMap.get(part), cache.query(qry).getAll().size());
+
+ return null;
+ }
+ });
+ }
+
+ /**
+ *
+ */
+ public static class Person {
+ /** */
+ @QuerySqlField
+ public int id;
+
+ /** */
+ @QuerySqlField
+ public String name;
+
+ /**
+ * @param id Id.
+ * @param name Name.
+ */
+ public Person(int id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ /**
+ * @return Id.
+ */
+ public int getId() {
+ return id;
+ }
+
+ /**
+ * @param id Set id.
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ /**
+ * @return Name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name Name.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean equals(Object o) {
+ return this == o || !(o == null || getClass() != o.getClass()) && id == ((Person)o).id;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int hashCode() {
+ return id;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(Person.class, this);
+ }
+ }
+}
[31/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/ignite-1085'
Posted by av...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1085'
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/77da7288
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/77da7288
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/77da7288
Branch: refs/heads/ignite-630
Commit: 77da7288f61868cf344fde68ced65cfe747d765b
Parents: cd3a9b6 d11fc9b
Author: Denis Magda <dm...@gridgain.com>
Authored: Thu Jul 16 09:05:06 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Thu Jul 16 09:05:06 2015 +0300
----------------------------------------------------------------------
.../discovery/GridDiscoveryManager.java | 35 ++++++++++++--------
1 file changed, 22 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
[26/50] [abbrv] incubator-ignite git commit: disable hanging test
Posted by av...@apache.org.
disable hanging test
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a6d33b14
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a6d33b14
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a6d33b14
Branch: refs/heads/ignite-630
Commit: a6d33b143a46f1d0884ee2d88d5d8edf098b1879
Parents: 7147f3d
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Jul 15 14:13:00 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jul 15 14:13:00 2015 +0300
----------------------------------------------------------------------
.../IgniteCacheAtomicReplicatedNodeRestartSelfTest.java | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a6d33b14/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
index f556023..68c7fbb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
@@ -26,6 +26,11 @@ import static org.apache.ignite.cache.CacheAtomicityMode.*;
*/
public class IgniteCacheAtomicReplicatedNodeRestartSelfTest extends GridCacheReplicatedNodeRestartSelfTest {
/** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-1124");
+ }
+
+ /** {@inheritDoc} */
@Override protected CacheAtomicityMode atomicityMode() {
return ATOMIC;
}
[32/50] [abbrv] incubator-ignite git commit: Merge tag '1.3.1'
Posted by av...@apache.org.
Merge tag '1.3.1'
community version 1.3.1 release (REV c559692d6b3aa96316dc0c9b2874c67179489a87)
Conflicts:
examples/pom.xml
modules/aop/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/resources/ignite.properties
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.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
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/13e55b24
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/13e55b24
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/13e55b24
Branch: refs/heads/ignite-630
Commit: 13e55b2469c3fb00bf7f1726e5ade1594d476c72
Parents: 77da728 c559692
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Thu Jul 16 10:14:58 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Thu Jul 16 10:14:58 2015 +0300
----------------------------------------------------------------------
DEVNOTES.txt | 8 +
RELEASE_NOTES.txt | 2 +
assembly/LICENSE_FABRIC | 317 +++++++++++
assembly/LICENSE_HADOOP | 270 ++++++++++
assembly/NOTICE_FABRIC | 13 +
assembly/NOTICE_HADOOP | 12 +
assembly/dependencies-fabric.xml | 13 +
assembly/dependencies-hadoop.xml | 12 +
assembly/dependencies-visor-console.xml | 20 +-
assembly/release-base.xml | 10 -
assembly/release-fabric.xml | 12 +
assembly/release-hadoop.xml | 12 +
modules/aop/licenses/aspectj-epl-license.txt | 69 ---
modules/apache-license-gen/pom.xml | 48 ++
.../src/main/resources/META-INF/licenses.txt.vm | 44 ++
.../processors/cache/IgniteCacheFutureImpl.java | 6 +
.../processors/cache/IgniteCacheProxy.java | 55 +-
.../util/future/GridFutureChainListener.java | 4 -
.../internal/util/future/IgniteFutureImpl.java | 12 +-
.../plugin/security/SecuritySubjectType.java | 3 +-
.../cache/GridCacheAbstractFullApiSelfTest.java | 32 ++
.../geospatial/licenses/jts-lgpl-license.txt | 165 ------
.../licenses/hibernate-lgpl-2.1-license.txt | 174 ------
modules/indexing/licenses/h2-epl-license.txt | 69 ---
modules/mesos/licenses/jetty-epl-license.txt | 69 ---
modules/mesos/pom.xml | 1 +
.../apache/ignite/mesos/ClusterProperties.java | 14 +
.../apache/ignite/mesos/IgniteScheduler.java | 26 +-
modules/rest-http/pom.xml | 6 +-
.../scalar-2.10/licenses/scala-bsd-license.txt | 18 -
modules/scalar/licenses/scala-bsd-license.txt | 18 -
.../licenses/cron4j-lgpl-2.1-license.txt | 174 ------
modules/slf4j/licenses/sl4j-mit-license.txt | 21 -
.../spark-2.10/licenses/scala-bsd-license.txt | 18 -
modules/spark/licenses/scala-bsd-license.txt | 18 -
modules/ssh/licenses/jcraft-revised-bsd.txt | 28 -
modules/tools/licenses/jodd-revised-bsd.txt | 21 -
.../urideploy/licenses/jtidy-mit-license.txt | 50 --
modules/urideploy/pom.xml | 6 +-
.../licenses/jline-bsd-license.txt | 18 -
.../licenses/scala-bsd-license.txt | 18 -
.../licenses/slf4j-mit-license.txt | 21 -
modules/web/pom.xml | 6 +-
modules/yarn/README.txt | 28 +
modules/yarn/licenses/apache-2.0.txt | 202 +++++++
modules/yarn/pom.xml | 101 ++++
.../apache/ignite/yarn/ApplicationMaster.java | 400 ++++++++++++++
.../apache/ignite/yarn/ClusterProperties.java | 432 +++++++++++++++
.../org/apache/ignite/yarn/IgniteContainer.java | 84 +++
.../org/apache/ignite/yarn/IgniteProvider.java | 339 ++++++++++++
.../apache/ignite/yarn/IgniteYarnClient.java | 178 +++++++
.../org/apache/ignite/yarn/package-info.java | 22 +
.../ignite/yarn/utils/IgniteYarnUtils.java | 81 +++
.../main/resources/ignite-default-config.xml | 35 ++
.../org/apache/ignite/IgniteYarnTestSuite.java | 38 ++
.../yarn/IgniteApplicationMasterSelfTest.java | 532 +++++++++++++++++++
parent/pom.xml | 55 ++
pom.xml | 2 +
58 files changed, 3420 insertions(+), 1042 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/13e55b24/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index f8d1ce3,0a8f87c..fb004bf
--- 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
@@@ -61,8 -61,15 +61,16 @@@ import static org.apache.ignite.transac
/**
* Full API cache test.
*/
+@SuppressWarnings("TransientFieldInNonSerializableClass")
public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstractSelfTest {
+ /** */
+ public static final CacheEntryProcessor<String, Integer, String> ERR_PROCESSOR =
+ new CacheEntryProcessor<String, Integer, String>() {
+ @Override public String process(MutableEntry<String, Integer> e, Object... args) {
+ throw new RuntimeException("Failed!");
+ }
+ };
+
/** Increment processor for invoke operations. */
public static final EntryProcessor<String, Integer, String> INCR_PROCESSOR = new EntryProcessor<String, Integer, String>() {
@Override public String process(MutableEntry<String, Integer> e, Object... args) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/13e55b24/modules/mesos/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/13e55b24/modules/rest-http/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/13e55b24/modules/urideploy/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/13e55b24/modules/web/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/13e55b24/parent/pom.xml
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/13e55b24/pom.xml
----------------------------------------------------------------------
[13/50] [abbrv] incubator-ignite git commit: 1.4.1-SNAPSHOT
Posted by av...@apache.org.
1.4.1-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/d52fe87f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d52fe87f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d52fe87f
Branch: refs/heads/ignite-630
Commit: d52fe87fd3229d828dd59be5f01bd00cd9d9fba4
Parents: f5a09f4
Author: Ignite Teamcity <ig...@apache.org>
Authored: Tue Jul 14 12:53:24 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Tue Jul 14 12:53:24 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
.../core/src/main/resources/ignite.properties | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
.../extdata/uri/modules/uri-dependency/pom.xml | 6 ++---
modules/extdata/uri/pom.xml | 26 ++++++++------------
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 +-
pom.xml | 2 +-
39 files changed, 49 insertions(+), 57 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 2f292e9..a2ac452 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index 704358f..ce5cd10 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index 38d300e..8c660ab 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index ca68ef8..0374bdf 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index d752588..47aedd5 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 9a09a69..261e588 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index 5ac49ae..c8abe15 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/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 830ca22..c1c2d0f 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.2.1-SNAPSHOT
+ignite.version=1.4.1-SNAPSHOT
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index 5de55f5..b48859b 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.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/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 c92eb38..f863bed 100644
--- a/modules/extdata/uri/modules/uri-dependency/pom.xml
+++ b/modules/extdata/uri/modules/uri-dependency/pom.xml
@@ -16,9 +16,7 @@
limitations under the License.
-->
-<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">
+<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">
<parent>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-parent</artifactId>
@@ -29,7 +27,7 @@
<artifactId>ignite-extdata-uri-dep</artifactId>
<packaging>jar</packaging>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index c7b4067..0b4f92f 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -20,8 +20,7 @@
<!--
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">
+<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>
<packaging>pom</packaging>
@@ -33,7 +32,7 @@
</parent>
<artifactId>ignite-extdata-uri</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
@@ -140,33 +139,28 @@
<!-- copying resources to classes -->
<copy todir="${basedir}/target/classes">
<fileset dir="${basedir}/src/main/java">
- <include name="**/*.xml"/>
- <include name="**/*.properties"/>
+ <include name="**/*.xml" />
+ <include name="**/*.properties" />
</fileset>
</copy>
- <copy
- file="${settings.localRepository}/com/sun/mail/javax.mail/1.5.2/javax.mail-1.5.2.jar"
- todir="${basedir}/target/classes/lib"/>
+ <copy file="${settings.localRepository}/com/sun/mail/javax.mail/1.5.2/javax.mail-1.5.2.jar" todir="${basedir}/target/classes/lib" />
<zip destfile="${basedir}/target/classes/lib/depend.jar" encoding="UTF-8">
- <zipfileset dir="modules/uri-dependency/target/classes"/>
+ <zipfileset dir="modules/uri-dependency/target/classes" />
</zip>
- <taskdef name="gar"
- classname="org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask"/>
+ <taskdef name="gar" classname="org.apache.ignite.util.antgar.IgniteDeploymentGarAntTask" />
- <gar destfile="${basedir}/target/deploy/uri.gar" basedir="${basedir}/target/classes"/>
+ <gar destfile="${basedir}/target/deploy/uri.gar" basedir="${basedir}/target/classes" />
<!--
This is created for test GridTaskUriDeploymentDeadlockSelfTest.
We put two files here to have a collision and make deployment SPI to unregister class loaders.
This is intended to test GG-2852 issue.
-->
- <gar destfile="${basedir}/target/resources/helloworld.gar"
- descrdir="${basedir}/META-INF" basedir="${basedir}/target/classes"/>
- <gar destfile="${basedir}/target/resources/helloworld1.gar"
- descrdir="${basedir}/META-INF" basedir="${basedir}/target/classes"/>
+ <gar destfile="${basedir}/target/resources/helloworld.gar" descrdir="${basedir}/META-INF" basedir="${basedir}/target/classes" />
+ <gar destfile="${basedir}/target/resources/helloworld1.gar" descrdir="${basedir}/META-INF" basedir="${basedir}/target/classes" />
</target>
</configuration>
</execution>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index f132d39..0e545bf 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index 10035c6..ba29dcf 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index bb46b2a..d7f5ac8 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index 3130f4b..f8f915b 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 8c02e02..ddbd1e3 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 9f65eb0..0c405ee 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index 2d4df0b..2df9bda 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/kafka/pom.xml
----------------------------------------------------------------------
diff --git a/modules/kafka/pom.xml b/modules/kafka/pom.xml
index c492100..9b9d95c 100644
--- a/modules/kafka/pom.xml
+++ b/modules/kafka/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-kafka</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index 3343438..fbba149 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index 328e5b8..e9ccf8b 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-mesos</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<properties>
<mesos.version>0.22.0</mesos.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index bf4b216..780d8ae 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.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index b7c9178..a2ae7b8 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.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 7a2e243..84a709d 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 49b75bd..b3e1c18 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 7f8fff4..7364e1e 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.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 01ad28f..cf98419 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index 7463d52..848d550 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.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index 265bb16..3783a40 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index ab98384..f5563f5 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index 708be4f..2d77c80 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 17ba197..30b1a3e 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index 7e19578..1de61e1 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/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 193e676..167708b 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.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index 87fa4f9..9cadedb 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.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index 8a80009..ae038cd 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.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<!-- Ignite dependencies -->
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index 0509af2..c0b555f 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index a9ee178..dc4a033 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<properties>
<yardstick.version>0.7.0</yardstick.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d52fe87f/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9d1b7d9..0201f84 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>apache-ignite</artifactId>
- <version>1.2.1-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
[24/50] [abbrv] incubator-ignite git commit: ignite-1085:
reimplemented
Posted by av...@apache.org.
ignite-1085: reimplemented
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/24aae82f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/24aae82f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/24aae82f
Branch: refs/heads/ignite-630
Commit: 24aae82fabfebcbeb13516c3f3361ac5d726d20f
Parents: 7147f3d
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Jul 15 13:53:53 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jul 15 13:53:53 2015 +0300
----------------------------------------------------------------------
.../managers/discovery/GridDiscoveryManager.java | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/24aae82f/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index eae07ed..1bac4d0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -376,6 +376,8 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
});
}
+ final CountDownLatch startLatch = new CountDownLatch(1);
+
spi.setListener(new DiscoverySpiListener() {
@Override public void onDiscovery(
int type,
@@ -464,6 +466,13 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
// If this is a local join event, just save it and do not notify listeners.
if (type == EVT_NODE_JOINED && node.id().equals(locNode.id())) {
+ updateTopologyVersionIfGreater(new AffinityTopologyVersion(locNode.order()),
+ new DiscoCache(localNode(), getSpi().getRemoteNodes()));
+
+ assert startLatch.getCount() == 1;
+
+ startLatch.countDown();
+
DiscoveryEvent discoEvt = new DiscoveryEvent();
discoEvt.node(ctx.discovery().localNode());
@@ -527,6 +536,13 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
startSpi();
+ try {
+ U.await(startLatch);
+ }
+ catch (IgniteInterruptedException e) {
+ throw new IgniteCheckedException("Failed to start discovery manager (thread has been interrupted).", e);
+ }
+
// Start segment check worker only if frequency is greater than 0.
if (hasRslvrs && segChkFreq > 0) {
segChkWrk = new SegmentCheckWorker();
@@ -538,9 +554,6 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
locNode = spi.getLocalNode();
- updateTopologyVersionIfGreater(new AffinityTopologyVersion(locNode.order()), new DiscoCache(localNode(),
- getSpi().getRemoteNodes()));
-
checkAttributes(discoCache().remoteNodes());
// Start discovery worker.
[37/50] [abbrv] incubator-ignite git commit: # ignite-901 client
reconnect support
Posted by av...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
new file mode 100644
index 0000000..be3234d
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
@@ -0,0 +1,1202 @@
+/*
+ * 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;
+
+import junit.framework.*;
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.internal.managers.communication.*;
+import org.apache.ignite.internal.managers.discovery.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.*;
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.plugin.extensions.communication.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.spi.*;
+import org.apache.ignite.spi.communication.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.testframework.*;
+import org.apache.ignite.transactions.*;
+
+import javax.cache.*;
+import java.io.*;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+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.*;
+import static org.apache.ignite.events.EventType.*;
+import static org.apache.ignite.transactions.TransactionConcurrency.*;
+import static org.apache.ignite.transactions.TransactionIsolation.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstractTest {
+ /** */
+ private static final int SRV_CNT = 3;
+
+ /** */
+ private static final String STATIC_CACHE = "static-cache";
+
+ /** */
+ private UUID nodeId;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ TestCommunicationSpi commSpi = new TestCommunicationSpi();
+
+ commSpi.setSharedMemoryPort(-1);
+
+ cfg.setCommunicationSpi(commSpi);
+
+ cfg.setPeerClassLoadingEnabled(false);
+
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setNetworkTimeout(5000);
+
+ if (nodeId != null) {
+ cfg.setNodeId(nodeId);
+
+ nodeId = null;
+ }
+
+ CacheConfiguration ccfg = new CacheConfiguration();
+
+ ccfg.setName(STATIC_CACHE);
+
+ cfg.setCacheConfiguration(ccfg);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int serverCount() {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ startGrids(SRV_CNT);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnect() throws Exception {
+ clientMode = true;
+
+ IgniteEx client = startGrid(SRV_CNT);
+
+ final TestTcpDiscoverySpi clientSpi = spi(client);
+
+ Ignite srv = clientRouter(client);
+
+ TestTcpDiscoverySpi srvSpi = spi(srv);
+
+ final IgniteCache<Object, Object> cache = client.getOrCreateCache(new CacheConfiguration<>());
+
+ final IgniteCache<Object, Object> staticCache = client.cache(STATIC_CACHE);
+
+ staticCache.put(1, 1);
+
+ assertEquals(1, staticCache.get(1));
+
+ CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+
+ ccfg.setWriteSynchronizationMode(FULL_SYNC);
+ ccfg.setName("nearCache");
+
+ final IgniteCache<Object, Object> nearCache = client.getOrCreateCache(ccfg, new NearCacheConfiguration<>());
+
+ nearCache.put(1, 1);
+
+ assertEquals(1, nearCache.localPeek(1));
+
+ cache.put(1, 1);
+
+ final CountDownLatch disconnectLatch = new CountDownLatch(1);
+
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+ log.info("Block reconnect.");
+
+ clientSpi.writeLatch = new CountDownLatch(1);
+
+ final AtomicReference<IgniteInternalFuture> blockPutRef = new AtomicReference<>();
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+ info("Disconnected: " + evt);
+
+ assertEquals(1, reconnectLatch.getCount());
+
+ blockPutRef.set(GridTestUtils.runAsync(new Callable() {
+ @Override public Object call() throws Exception {
+ log.info("Start put.");
+
+ try {
+ cache.put(2, 2);
+
+ fail();
+ }
+ catch (CacheException e) {
+ log.info("Expected exception: " + e);
+
+ IgniteClientDisconnectedException e0 = (IgniteClientDisconnectedException) e.getCause();
+
+ e0.reconnectFuture().get();
+ }
+
+ cache.put(2, 2);
+
+ log.info("Finish put.");
+
+ return null;
+ }
+ }));
+
+ disconnectLatch.countDown();
+ } else if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ info("Reconnected: " + evt);
+
+ assertEquals(0, disconnectLatch.getCount());
+
+ reconnectLatch.countDown();
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED);
+
+ log.info("Fail client.");
+
+ srvSpi.failNode(client.cluster().localNode().id(), null);
+
+ waitReconnectEvent(disconnectLatch);
+
+ IgniteInternalFuture putFut = blockPutRef.get();
+
+ assertNotDone(putFut);
+
+ U.sleep(5000);
+
+ assertNotDone(putFut);
+
+ log.info("Allow reconnect.");
+
+ clientSpi.writeLatch.countDown();
+
+ assertTrue(reconnectLatch.await(5000, MILLISECONDS));
+
+ checkCacheDiscoveryData(srv, client, null, true, true, false);
+
+ checkCacheDiscoveryData(srv, client, "nearCache", true, true, true);
+
+ checkCacheDiscoveryData(srv, client, STATIC_CACHE, true, true, false);
+
+ assertEquals(1, cache.get(1));
+
+ putFut.get();
+
+ assertEquals(2, cache.get(2));
+
+ cache.put(3, 3);
+
+ assertEquals(3, cache.get(3));
+
+ assertNull(nearCache.localPeek(1));
+
+ staticCache.put(10, 10);
+
+ assertEquals(10, staticCache.get(10));
+
+ nearCache.put(20, 20);
+
+ srv.cache(nearCache.getName()).put(20, 21);
+
+ assertEquals(21, nearCache.localPeek(20));
+
+ this.clientMode = false;
+
+ IgniteEx srv2 = startGrid(SRV_CNT + 1);
+
+ Integer key = primaryKey(srv2.cache(null));
+
+ cache.put(key, 4);
+
+ assertEquals(4, cache.get(key));
+
+ checkCacheDiscoveryData(srv2, client, null, true, true, false);
+
+ checkCacheDiscoveryData(srv2, client, "nearCache", true, true, true);
+
+ checkCacheDiscoveryData(srv2, client, STATIC_CACHE, true, true, false);
+
+ staticCache.put(20, 20);
+
+ assertEquals(20, staticCache.get(20));
+
+ srv.cache(nearCache.getName()).put(20, 22);
+
+ assertEquals(22, nearCache.localPeek(20));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectTransactions() throws Exception {
+ clientMode = true;
+
+ IgniteEx client = startGrid(SRV_CNT);
+
+ Ignite srv = clientRouter(client);
+
+ CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+
+ ccfg.setAtomicityMode(TRANSACTIONAL);
+ ccfg.setCacheMode(PARTITIONED);
+ ccfg.setBackups(1);
+
+ IgniteCache<Object, Object> cache = client.getOrCreateCache(ccfg);
+
+ final IgniteTransactions txs = client.transactions();
+
+ final Transaction tx = txs.txStart(OPTIMISTIC, REPEATABLE_READ);
+
+ cache.put(1, 1);
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ try {
+ tx.commit();
+
+ fail();
+ } catch (IgniteClientDisconnectedException e) {
+ log.info("Expected error: " + e);
+
+ assertNotNull(e.reconnectFuture());
+ }
+
+ try {
+ txs.txStart();
+
+ fail();
+ } catch (IgniteClientDisconnectedException e) {
+ log.info("Expected error: " + e);
+
+ assertNotNull(e.reconnectFuture());
+ }
+ }
+ });
+
+ assertNull(txs.tx());
+
+ try (Transaction tx0 = txs.txStart(OPTIMISTIC, REPEATABLE_READ)) {
+ cache.put(1, 1);
+
+ assertEquals(1, cache.get(1));
+
+ tx0.commit();
+ }
+
+ try (Transaction tx0 = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) {
+ cache.put(2, 2);
+
+ assertEquals(2, cache.get(2));
+
+ tx0.commit();
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectTransactionInProgress1() throws Exception {
+ clientMode = true;
+
+ IgniteEx client = startGrid(SRV_CNT);
+
+ CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+
+ ccfg.setAtomicityMode(TRANSACTIONAL);
+ ccfg.setCacheMode(PARTITIONED);
+ ccfg.setBackups(1);
+ ccfg.setWriteSynchronizationMode(FULL_SYNC);
+
+ IgniteCache<Object, Object> cache = client.getOrCreateCache(ccfg);
+
+ reconnectTransactionInProgress1(client, OPTIMISTIC, cache);
+
+ reconnectTransactionInProgress1(client, PESSIMISTIC, cache);
+ }
+
+ /**
+ * @param client Client.
+ * @param txConcurrency Transaction concurrency mode.
+ * @param cache Cache.
+ * @throws Exception If failed.
+ */
+ private void reconnectTransactionInProgress1(IgniteEx client,
+ final TransactionConcurrency txConcurrency,
+ final IgniteCache<Object, Object> cache)
+ throws Exception
+ {
+ Ignite srv = clientRouter(client);
+
+ final TestTcpDiscoverySpi clientSpi = spi(client);
+ final TestTcpDiscoverySpi srvSpi = spi(srv);
+
+ final CountDownLatch disconnectLatch = new CountDownLatch(1);
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+ log.info("Block reconnect.");
+
+ clientSpi.writeLatch = new CountDownLatch(1);
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+ info("Disconnected: " + evt);
+
+ disconnectLatch.countDown();
+ } else if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ info("Reconnected: " + evt);
+
+ reconnectLatch.countDown();
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED);
+
+ final IgniteTransactions txs = client.transactions();
+
+ final CountDownLatch afterPut1 = new CountDownLatch(1);
+
+ final CountDownLatch afterPut2 = new CountDownLatch(1);
+
+ final CountDownLatch putFailed = new CountDownLatch(1);
+
+ IgniteInternalFuture<Boolean> fut = GridTestUtils.runAsync(new Callable<Boolean>() {
+ @Override public Boolean call() throws Exception {
+ try {
+ log.info("Start tx1: " + txConcurrency);
+
+ try (Transaction tx = txs.txStart(txConcurrency, REPEATABLE_READ)) {
+ cache.put(1, 1);
+
+ afterPut1.countDown();
+
+ afterPut2.await();
+
+ cache.put(2, 2);
+
+ fail();
+ }
+ catch (CacheException e) {
+ log.info("Expected exception: " + e);
+
+ putFailed.countDown();
+
+ IgniteClientDisconnectedException e0 = (IgniteClientDisconnectedException)e.getCause();
+
+ e0.reconnectFuture().get();
+ }
+
+ log.info("Start tx2: " + txConcurrency);
+
+ try (Transaction tx = txs.txStart(txConcurrency, REPEATABLE_READ)) {
+ cache.put(1, 1);
+
+ cache.put(2, 2);
+
+ tx.commit();
+ }
+
+ assertEquals(1, cache.get(1));
+ assertEquals(2, cache.get(2));
+
+ try (Transaction tx = txs.txStart(txConcurrency, REPEATABLE_READ)) {
+ cache.put(3, 3);
+
+ cache.put(4, 4);
+
+ tx.commit();
+ }
+
+ assertEquals(1, cache.get(1));
+ assertEquals(2, cache.get(2));
+ assertEquals(3, cache.get(3));
+ assertEquals(4, cache.get(4));
+
+ cache.removeAll();
+
+ return true;
+ }
+ catch (AssertionFailedError e) {
+ throw e;
+ }
+ catch (Throwable e) {
+ log.error("Unexpected error", e);
+
+ fail("Unexpected error: " + e);
+
+ return false;
+ }
+ }
+ });
+
+ assertTrue(afterPut1.await(5000, MILLISECONDS));
+
+ assertNotDone(fut);
+
+ srvSpi.failNode(client.localNode().id(), null);
+
+ waitReconnectEvent(disconnectLatch);
+
+ afterPut2.countDown();
+
+ assertTrue(putFailed.await(5000, MILLISECONDS));
+
+ clientSpi.writeLatch.countDown();
+
+ waitReconnectEvent(reconnectLatch);
+
+ assertTrue(fut.get());
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectTransactionInProgress2() throws Exception {
+ clientMode = true;
+
+ final IgniteEx client = startGrid(SRV_CNT);
+
+ CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+
+ ccfg.setAtomicityMode(TRANSACTIONAL);
+ ccfg.setCacheMode(PARTITIONED);
+ ccfg.setBackups(1);
+ ccfg.setWriteSynchronizationMode(FULL_SYNC);
+
+ txInProgressFails(client, ccfg, GridNearTxPrepareResponse.class, OPTIMISTIC, 1);
+
+ txInProgressFails(client, ccfg, GridNearTxPrepareResponse.class, PESSIMISTIC, 2);
+
+ txInProgressFails(client, ccfg, GridNearTxFinishResponse.class, OPTIMISTIC, 3);
+
+ txInProgressFails(client, ccfg, GridNearTxFinishResponse.class, PESSIMISTIC, 4);
+
+ txInProgressFails(client, ccfg, GridNearLockResponse.class, PESSIMISTIC, 5);
+ }
+
+ /**
+ * @param client Client.
+ * @param ccfg Cache configuration.
+ * @param msgToBlock Message to block.
+ * @param txConcurrency Transaction concurrency mode.
+ * @param key Key.
+ * @throws Exception If failed.
+ */
+ private void txInProgressFails(final IgniteEx client,
+ final CacheConfiguration<Object, Object> ccfg,
+ Class<?> msgToBlock,
+ final TransactionConcurrency txConcurrency,
+ final Integer key) throws Exception {
+ log.info("Test tx failure [msg=" + msgToBlock + ", txMode=" + txConcurrency + ", key=" + key + ']');
+
+ checkOperationInProgressFails(client, ccfg, msgToBlock,
+ new CI1<IgniteCache<Object, Object>>() {
+ @Override public void apply(IgniteCache<Object, Object> cache) {
+ try (Transaction tx = client.transactions().txStart(txConcurrency, REPEATABLE_READ)) {
+ log.info("Put1: " + key);
+
+ cache.put(key, key);
+
+ Integer key2 = key + 1;
+
+ log.info("Put2: " + key2);
+
+ cache.put(key2, key2);
+
+ log.info("Commit [key1=" + key + ", key2=" + key2 + ']');
+
+ tx.commit();
+ }
+ }
+ }
+ );
+
+ IgniteCache<Object, Object> cache = client.cache(ccfg.getName());
+
+ assertEquals(key, cache.get(key));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectExchangeInProgress() throws Exception {
+ clientMode = true;
+
+ IgniteEx client = startGrid(SRV_CNT);
+
+ Ignite srv = clientRouter(client);
+
+ TestTcpDiscoverySpi srvSpi = spi(srv);
+
+ TestCommunicationSpi coordCommSpi = (TestCommunicationSpi)grid(0).configuration().getCommunicationSpi();
+
+ coordCommSpi.blockMessages(GridDhtPartitionsFullMessage.class, client.localNode().id());
+
+ clientMode = false;
+
+ startGrid(SRV_CNT + 1);
+
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ info("Reconnected: " + evt);
+
+ reconnectLatch.countDown();
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_RECONNECTED);
+
+ srvSpi.failNode(client.cluster().localNode().id(), null);
+
+ assertTrue(reconnectLatch.await(5000, MILLISECONDS));
+
+ try {
+ coordCommSpi.stopBlock(true);
+
+ fail();
+ }
+ catch (IgniteException e) {
+ log.info("Expected error: " + e);
+ }
+
+ CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+
+ ccfg.setName("newCache");
+
+ ccfg.setCacheMode(REPLICATED);
+
+ log.info("Start new cache.");
+
+ IgniteCache<Object, Object> cache = client.getOrCreateCache(ccfg);
+
+ cache.put(1, 1);
+
+ assertEquals(1, cache.get(1));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectInitialExchangeInProgress() throws Exception {
+ final UUID clientId = UUID.randomUUID();
+
+ Ignite srv = grid(0);
+
+ final CountDownLatch joinLatch = new CountDownLatch(1);
+
+ srv.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_NODE_JOINED && ((DiscoveryEvent)evt).eventNode().id().equals(clientId)) {
+ info("Client joined: " + evt);
+
+ joinLatch.countDown();
+ }
+
+ return true;
+ }
+ }, EVT_NODE_JOINED);
+
+ TestCommunicationSpi srvCommSpi = (TestCommunicationSpi)srv.configuration().getCommunicationSpi();
+
+ srvCommSpi.blockMessages(GridDhtPartitionsFullMessage.class, clientId);
+
+ clientMode = true;
+
+ nodeId = clientId;
+
+ IgniteInternalFuture<Boolean> fut = GridTestUtils.runAsync(new Callable<Boolean>() {
+ @Override public Boolean call() throws Exception {
+ try {
+ Ignition.start(getConfiguration(getTestGridName(SRV_CNT)));
+
+ fail();
+
+ return false;
+ }
+ catch (IgniteClientDisconnectedException e) {
+ log.info("Expected start error: " + e);
+
+ try {
+ e.reconnectFuture().get();
+
+ fail();
+ }
+ catch (IgniteException e0) {
+ log.info("Expected future error: " + e0);
+ }
+
+ return true;
+ }
+ catch (Throwable e) {
+ log.error("Unexpected error: " + e, e);
+
+ throw e;
+ }
+ }
+ });
+
+ TestTcpDiscoverySpi srvSpi = spi(srv);
+
+ assertTrue(joinLatch.await(5000, MILLISECONDS));
+
+ U.sleep(1000);
+
+ assertNotDone(fut);
+
+ srvSpi.failNode(clientId, null);
+
+ srvCommSpi.stopBlock(false);
+
+ assertTrue(fut.get());
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectOperationInProgress() throws Exception {
+ clientMode = true;
+
+ IgniteEx client = startGrid(SRV_CNT);
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED)
+ info("Client disconnected: " + evt);
+ else if (evt.type() == EVT_CLIENT_NODE_RECONNECTED)
+ info("Client reconnected: " + evt);
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED);
+
+ IgniteInClosure<IgniteCache<Object, Object>> putOp = new CI1<IgniteCache<Object, Object>>() {
+ @Override public void apply(IgniteCache<Object, Object> cache) {
+ cache.put(1, 1);
+ }
+ };
+
+ IgniteInClosure<IgniteCache<Object, Object>> getOp = new CI1<IgniteCache<Object, Object>>() {
+ @Override public void apply(IgniteCache<Object, Object> cache) {
+ cache.get(1);
+ }
+ };
+
+ int cnt = 0;
+
+ for (CacheAtomicityMode atomicityMode : CacheAtomicityMode.values()) {
+ CacheAtomicWriteOrderMode[] writeOrders =
+ atomicityMode == ATOMIC ? CacheAtomicWriteOrderMode.values() :
+ new CacheAtomicWriteOrderMode[]{CacheAtomicWriteOrderMode.CLOCK};
+
+ for (CacheAtomicWriteOrderMode writeOrder : writeOrders) {
+ for (CacheWriteSynchronizationMode syncMode : CacheWriteSynchronizationMode.values()) {
+ CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>();
+
+ ccfg.setAtomicityMode(atomicityMode);
+
+ ccfg.setAtomicWriteOrderMode(writeOrder);
+
+ ccfg.setName("cache-" + cnt++);
+
+ ccfg.setWriteSynchronizationMode(syncMode);
+
+ if (syncMode != FULL_ASYNC) {
+ Class<?> cls = (ccfg.getAtomicityMode() == ATOMIC) ?
+ GridNearAtomicUpdateResponse.class : GridNearTxPrepareResponse.class;
+
+ log.info("Test cache put [atomicity=" + atomicityMode +
+ ", writeOrder=" + writeOrder +
+ ", syncMode=" + syncMode + ']');
+
+ checkOperationInProgressFails(client, ccfg, cls, putOp);
+
+ client.destroyCache(ccfg.getName());
+ }
+
+ log.info("Test cache get [atomicity=" + atomicityMode + ", syncMode=" + syncMode + ']');
+
+ checkOperationInProgressFails(client, ccfg, GridNearGetResponse.class, getOp);
+
+ client.destroyCache(ccfg.getName());
+ }
+ }
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectCacheDestroyed() throws Exception {
+ clientMode = true;
+
+ final IgniteEx client = startGrid(SRV_CNT);
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ final Ignite srv = clientRouter(client);
+
+ final IgniteCache<Object, Object> clientCache = client.getOrCreateCache(new CacheConfiguration<>());
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ srv.destroyCache(null);
+ }
+ });
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return clientCache.get(1);
+ }
+ }, IllegalStateException.class, null);
+
+ checkCacheDiscoveryData(srv, client, null, false, false, false);
+
+ IgniteCache<Object, Object> clientCache0 = client.getOrCreateCache(new CacheConfiguration<>());
+
+ checkCacheDiscoveryData(srv, client, null, true, true, false);
+
+ clientCache0.put(1, 1);
+
+ assertEquals(1, clientCache0.get(1));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectCacheDestroyedAndCreated() throws Exception {
+ clientMode = true;
+
+ final Ignite client = startGrid(SRV_CNT);
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ final Ignite srv = clientRouter(client);
+
+ final IgniteCache<Object, Object> clientCache = client.getOrCreateCache(new CacheConfiguration<>());
+
+ assertEquals(ATOMIC,
+ clientCache.getConfiguration(CacheConfiguration.class).getAtomicityMode());
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ srv.destroyCache(null);
+
+ CacheConfiguration ccfg = new CacheConfiguration();
+
+ ccfg.setAtomicityMode(TRANSACTIONAL);
+
+ srv.getOrCreateCache(ccfg);
+ }
+ });
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return clientCache.get(1);
+ }
+ }, IllegalStateException.class, null);
+
+ checkCacheDiscoveryData(srv, client, null, true, false, false);
+
+ IgniteCache<Object, Object> clientCache0 = client.cache(null);
+
+ checkCacheDiscoveryData(srv, client, null, true, true, false);
+
+ assertEquals(TRANSACTIONAL,
+ clientCache0.getConfiguration(CacheConfiguration.class).getAtomicityMode());
+
+ clientCache0.put(1, 1);
+
+ assertEquals(1, clientCache0.get(1));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectMarshallerCache() throws Exception {
+ clientMode = true;
+
+ final Ignite client = startGrid(SRV_CNT);
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ final Ignite srv = clientRouter(client);
+
+ final IgniteCache<Object, Object> clientCache = client.getOrCreateCache(new CacheConfiguration<>());
+ final IgniteCache<Object, Object> srvCache = srv.cache(null);
+
+ assertNotNull(srvCache);
+
+ clientCache.put(1, new TestClass1());
+ srvCache.put(2, new TestClass2());
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ assertNotNull(srvCache.get(1));
+ assertNotNull(srvCache.get(2));
+
+ srvCache.put(3, new TestClass3());
+ }
+ });
+
+ srvCache.put(4, new TestClass4());
+
+ assertNotNull(clientCache.get(1));
+ assertNotNull(clientCache.get(2));
+ assertNotNull(clientCache.get(3));
+ assertNotNull(clientCache.get(4));
+
+ clientCache.put(5, new TestClass5());
+
+ assertNotNull(srvCache.get(5));
+ assertNotNull(clientCache.get(5));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectClusterRestart() throws Exception {
+ clientMode = true;
+
+ final Ignite client = startGrid(SRV_CNT);
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ final CountDownLatch disconnectLatch = new CountDownLatch(1);
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+ final IgniteCache<Object, Object> clientCache = client.getOrCreateCache(new CacheConfiguration<>());
+
+ clientCache.put(1, new TestClass1());
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+ info("Disconnected: " + evt);
+
+ disconnectLatch.countDown();
+ } else if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ info("Reconnected: " + evt);
+
+ reconnectLatch.countDown();
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED);
+
+ for (int i = 0; i < SRV_CNT; i++)
+ stopGrid(i);
+
+ assertTrue(disconnectLatch.await(30_000, MILLISECONDS));
+
+ clientMode = false;
+
+ Ignite srv = startGrid(0);
+
+ assertTrue(reconnectLatch.await(10_000, MILLISECONDS));
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return clientCache.get(1);
+ }
+ }, IllegalStateException.class, null);
+
+ IgniteCache<Object, Object> srvCache = srv.getOrCreateCache(new CacheConfiguration<>());
+
+ srvCache.put(1, new TestClass1());
+ srvCache.put(2, new TestClass2());
+
+ IgniteCache<Object, Object> clientCache2 = client.cache(null);
+
+ assertNotNull(clientCache2);
+
+ assertNotNull(clientCache2.get(1));
+ assertNotNull(clientCache2.get(2));
+ }
+
+ /**
+ *
+ */
+ static class TestClass1 implements Serializable {}
+
+ /**
+ *
+ */
+ static class TestClass2 implements Serializable {}
+
+ /**
+ *
+ */
+ static class TestClass3 implements Serializable {}
+
+ /**
+ *
+ */
+ static class TestClass4 implements Serializable {}
+
+ /**
+ *
+ */
+ static class TestClass5 implements Serializable {}
+
+ /**
+ * @param client Client.
+ * @param ccfg Cache configuration.
+ * @param msgToBlock Message to block.
+ * @param c Cache operation closure.
+ * @throws Exception If failed.
+ */
+ private void checkOperationInProgressFails(IgniteEx client,
+ final CacheConfiguration<Object, Object> ccfg,
+ Class<?> msgToBlock,
+ final IgniteInClosure<IgniteCache<Object, Object>> c)
+ throws Exception
+ {
+ Ignite srv = clientRouter(client);
+
+ TestTcpDiscoverySpi srvSpi = spi(srv);
+
+ final IgniteCache<Object, Object> cache = client.getOrCreateCache(ccfg);
+
+ for (int i = 0; i < SRV_CNT; i++) {
+ TestCommunicationSpi srvCommSpi = (TestCommunicationSpi)grid(i).configuration().getCommunicationSpi();
+
+ srvCommSpi.blockMessages(msgToBlock, client.localNode().id());
+ }
+
+ IgniteInternalFuture<?> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ IgniteClientDisconnectedException e0 = null;
+
+ try {
+ c.apply(cache);
+
+ fail();
+ }
+ catch (IgniteClientDisconnectedException e) {
+ log.info("Expected exception: " + e);
+
+ e0 = e;
+ }
+ catch (CacheException e) {
+ log.info("Expected exception: " + e);
+
+ assertTrue("Unexpected cause: " + e.getCause(),
+ e.getCause() instanceof IgniteClientDisconnectedException);
+
+ e0 = (IgniteClientDisconnectedException)e.getCause();
+ }
+
+ assertNotNull(e0);
+ assertNotNull(e0.reconnectFuture());
+
+ e0.reconnectFuture().get();
+
+ c.apply(cache);
+
+ return null;
+ }
+ });
+
+ Thread.sleep(1000);
+
+ assertNotDone(fut);
+
+ log.info("Fail client: " + client.localNode().id());
+
+ srvSpi.failNode(client.localNode().id(), null);
+
+ fut.get();
+
+ for (int i = 0; i < SRV_CNT; i++)
+ ((TestCommunicationSpi)grid(i).configuration().getCommunicationSpi()).stopBlock(false);
+
+ cache.put(1, 1);
+
+ assertEquals(1, cache.get(1));
+ }
+
+ /**
+ * @param srv Server node.
+ * @param client Client node.
+ * @param cacheName Cache name.
+ * @param cacheExists Cache exists flag.
+ * @param clientCache {@code True} if client node has client cache.
+ * @param clientNear {@code True} if client node has near-enabled client cache.
+ */
+ private void checkCacheDiscoveryData(Ignite srv,
+ Ignite client,
+ String cacheName,
+ boolean cacheExists,
+ boolean clientCache,
+ boolean clientNear)
+ {
+ GridDiscoveryManager srvDisco = ((IgniteKernal)srv).context().discovery();
+ GridDiscoveryManager clientDisco = ((IgniteKernal)client).context().discovery();
+
+ ClusterNode srvNode = ((IgniteKernal)srv).localNode();
+ ClusterNode clientNode = ((IgniteKernal)client).localNode();
+
+ assertFalse(srvDisco.cacheAffinityNode(clientNode, cacheName));
+ assertFalse(clientDisco.cacheAffinityNode(clientNode, cacheName));
+
+ assertEquals(cacheExists, srvDisco.cacheAffinityNode(srvNode, cacheName));
+
+ if (clientNear)
+ assertTrue(srvDisco.cacheNearNode(clientNode, cacheName));
+ else
+ assertEquals(clientCache, srvDisco.cacheClientNode(clientNode, cacheName));
+
+ assertEquals(cacheExists, clientDisco.cacheAffinityNode(srvNode, cacheName));
+
+ if (clientNear)
+ assertTrue(clientDisco.cacheNearNode(clientNode, cacheName));
+ else
+ assertEquals(clientCache, clientDisco.cacheClientNode(clientNode, cacheName));
+
+ if (cacheExists) {
+ if (clientCache || clientNear) {
+ assertTrue(client.cluster().forClientNodes(cacheName).nodes().contains(clientNode));
+ assertTrue(srv.cluster().forClientNodes(cacheName).nodes().contains(clientNode));
+ }
+ else {
+ assertFalse(client.cluster().forClientNodes(cacheName).nodes().contains(clientNode));
+ assertFalse(srv.cluster().forClientNodes(cacheName).nodes().contains(clientNode));
+ }
+ }
+ else {
+ assertTrue(client.cluster().forClientNodes(cacheName).nodes().isEmpty());
+ assertTrue(srv.cluster().forClientNodes(cacheName).nodes().isEmpty());
+ }
+ }
+
+ /**
+ *
+ */
+ private static class TestCommunicationSpi extends TcpCommunicationSpi {
+ /** */
+ @LoggerResource
+ private IgniteLogger log;
+
+ /** */
+ private List<T2<ClusterNode, GridIoMessage>> blockedMsgs = new ArrayList<>();
+
+ /** */
+ private Map<Class<?>, Set<UUID>> blockCls = new HashMap<>();
+
+ /** {@inheritDoc} */
+ @Override public void sendMessage(ClusterNode node, Message msg) throws IgniteSpiException {
+ if (msg instanceof GridIoMessage) {
+ Object msg0 = ((GridIoMessage)msg).message();
+
+ synchronized (this) {
+ Set<UUID> blockNodes = blockCls.get(msg0.getClass());
+
+ if (F.contains(blockNodes, node.id())) {
+ log.info("Block message [node=" + node.attribute(IgniteNodeAttributes.ATTR_GRID_NAME) +
+ ", msg=" + msg0 + ']');
+
+ blockedMsgs.add(new T2<>(node, (GridIoMessage)msg));
+
+ return;
+ }
+ }
+ }
+
+ super.sendMessage(node, msg);
+ }
+
+ /**
+ * @param cls Message class.
+ * @param nodeId Node ID.
+ */
+ void blockMessages(Class<?> cls, UUID nodeId) {
+ synchronized (this) {
+ Set<UUID> set = blockCls.get(cls);
+
+ if (set == null) {
+ set = new HashSet<>();
+
+ blockCls.put(cls, set);
+ }
+
+ set.add(nodeId);
+ }
+ }
+
+ /**
+ * @param snd Send messages flag.
+ */
+ void stopBlock(boolean snd) {
+ synchronized (this) {
+ blockCls.clear();
+
+ if (snd) {
+ for (T2<ClusterNode, GridIoMessage> msg : blockedMsgs) {
+ ClusterNode node = msg.get1();
+
+ log.info("Send blocked message: [node=" + node.attribute(IgniteNodeAttributes.ATTR_GRID_NAME) +
+ ", msg=" + msg.get2().message() + ']');
+
+ super.sendMessage(msg.get1(), msg.get2());
+ }
+ }
+
+ blockedMsgs.clear();
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCollectionsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCollectionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCollectionsTest.java
new file mode 100644
index 0000000..ed811d9
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCollectionsTest.java
@@ -0,0 +1,443 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.concurrent.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectCollectionsTest extends IgniteClientReconnectAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected int serverCount() {
+ return 1;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int clientCount() {
+ return 1;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testQueueReconnect() throws Exception {
+ CollectionConfiguration colCfg = new CollectionConfiguration();
+
+ colCfg.setCacheMode(PARTITIONED);
+ colCfg.setAtomicityMode(TRANSACTIONAL);
+
+ queueReconnect(colCfg);
+
+ colCfg = new CollectionConfiguration();
+
+ colCfg.setCacheMode(PARTITIONED);
+ colCfg.setAtomicityMode(ATOMIC);
+
+ queueReconnect(colCfg);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testQueueReconnectRemoved() throws Exception {
+ CollectionConfiguration colCfg = new CollectionConfiguration();
+
+ colCfg.setCacheMode(PARTITIONED);
+ colCfg.setAtomicityMode(TRANSACTIONAL);
+
+ queueReconnectRemoved(colCfg);
+
+ colCfg = new CollectionConfiguration();
+
+ colCfg.setCacheMode(PARTITIONED);
+ colCfg.setAtomicityMode(ATOMIC);
+
+ queueReconnectRemoved(colCfg);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testQueueReconnectInProgress() throws Exception {
+ CollectionConfiguration colCfg = new CollectionConfiguration();
+
+ colCfg.setCacheMode(PARTITIONED);
+ colCfg.setAtomicityMode(TRANSACTIONAL);
+
+ queueReconnectInProgress(colCfg);
+
+ colCfg = new CollectionConfiguration();
+
+ colCfg.setCacheMode(PARTITIONED);
+ colCfg.setAtomicityMode(ATOMIC);
+
+ queueReconnectInProgress(colCfg);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testSetReconnect() throws Exception {
+ CollectionConfiguration colCfg = new CollectionConfiguration();
+
+ colCfg.setCacheMode(PARTITIONED);
+ colCfg.setAtomicityMode(TRANSACTIONAL);
+
+ setReconnect(colCfg);
+
+ colCfg = new CollectionConfiguration();
+
+ colCfg.setCacheMode(PARTITIONED);
+ colCfg.setAtomicityMode(ATOMIC);
+
+ setReconnect(colCfg);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testSetReconnectRemoved() throws Exception {
+ CollectionConfiguration colCfg = new CollectionConfiguration();
+
+ colCfg.setCacheMode(PARTITIONED);
+ colCfg.setAtomicityMode(ATOMIC);
+
+ setReconnectRemove(colCfg);
+
+ colCfg = new CollectionConfiguration();
+
+ colCfg.setCacheMode(PARTITIONED);
+ colCfg.setAtomicityMode(TRANSACTIONAL);
+
+ setReconnectRemove(colCfg);
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testSetReconnectInProgress() throws Exception {
+ CollectionConfiguration colCfg = new CollectionConfiguration();
+
+ colCfg.setCacheMode(PARTITIONED);
+ colCfg.setAtomicityMode(ATOMIC);
+
+ setReconnectInProgress(colCfg);
+
+ colCfg = new CollectionConfiguration();
+
+ colCfg.setCacheMode(PARTITIONED);
+ colCfg.setAtomicityMode(TRANSACTIONAL);
+
+ setReconnectInProgress(colCfg);
+ }
+
+ /**
+ * @param colCfg Collection configuration.
+ * @throws Exception If failed.
+ */
+ private void setReconnect(CollectionConfiguration colCfg) throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ final String setName = "set-" + colCfg.getAtomicityMode();
+
+ IgniteSet<String> clientSet = client.set(setName, colCfg);
+
+ final IgniteSet<String> srvSet = srv.set(setName, null);
+
+ assertTrue(clientSet.add("1"));
+
+ assertFalse(srvSet.add("1"));
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ assertTrue(srvSet.add("2"));
+ }
+ });
+
+ assertFalse(clientSet.add("2"));
+
+ assertTrue(clientSet.remove("2"));
+
+ assertFalse(srvSet.contains("2"));
+ }
+
+ /**
+ * @param colCfg Collection configuration.
+ * @throws Exception If failed.
+ */
+ private void setReconnectRemove(CollectionConfiguration colCfg) throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ final Ignite srv = clientRouter(client);
+
+ final String setName = "set-rm-" + colCfg.getAtomicityMode();
+
+ final IgniteSet<String> clientSet = client.set(setName, colCfg);
+
+ final IgniteSet<String> srvSet = srv.set(setName, null);
+
+ assertTrue(clientSet.add("1"));
+
+ assertFalse(srvSet.add("1"));
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ srvSet.close();
+ }
+ });
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ clientSet.add("fail");
+
+ return null;
+ }
+ }, IllegalStateException.class, null);
+
+ IgniteSet<String> newClientSet = client.set(setName, colCfg);
+
+ IgniteSet<String> newSrvSet = srv.set(setName, null);
+
+ assertTrue(newClientSet.add("1"));
+
+ assertFalse(newSrvSet.add("1"));
+
+ newSrvSet.close();
+ }
+
+ /**
+ * @param colCfg Collection configuration.
+ * @throws Exception If failed.
+ */
+ private void setReconnectInProgress(final CollectionConfiguration colCfg) throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ final Ignite srv = clientRouter(client);
+
+ final String setName = "set-in-progress-" + colCfg.getAtomicityMode();
+
+ final IgniteSet<String> clientSet = client.set(setName, colCfg);
+
+ final IgniteSet<String> srvSet = srv.set(setName, null);
+
+ assertTrue(clientSet.add("1"));
+
+ assertFalse(srvSet.add("1"));
+
+ BlockTpcCommunicationSpi commSpi = commSpi(srv);
+
+ if (colCfg.getAtomicityMode() == ATOMIC)
+ commSpi.blockMessage(GridNearAtomicUpdateResponse.class);
+ else
+ commSpi.blockMessage(GridNearTxPrepareResponse.class);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ for (int i = 0; i < 100; i++)
+ clientSet.add("2");
+ }
+ catch (IgniteClientDisconnectedException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ commSpi.unblockMessage();
+
+ reconnectClientNode(client, srv, null);
+
+ assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
+
+ assertTrue(clientSet.add("3"));
+
+ assertFalse(srvSet.add("3"));
+
+ srvSet.close();
+ }
+
+ /**
+ * @param colCfg Collection configuration.
+ * @throws Exception If failed.
+ */
+ private void queueReconnect(CollectionConfiguration colCfg) throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ final String setName = "queue-" + colCfg.getAtomicityMode();
+
+ IgniteQueue<String> clientQueue = client.queue(setName, 10, colCfg);
+
+ final IgniteQueue<String> srvQueue = srv.queue(setName, 10, null);
+
+ assertTrue(clientQueue.offer("1"));
+
+ assertTrue(srvQueue.contains("1"));
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ assertTrue(srvQueue.add("2"));
+ }
+ });
+
+ assertTrue(clientQueue.contains("2"));
+
+ assertEquals("1", clientQueue.poll());
+ }
+
+ /**
+ * @param colCfg Collection configuration.
+ * @throws Exception If failed.
+ */
+ private void queueReconnectRemoved(CollectionConfiguration colCfg) throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ final String setName = "queue-rmv" + colCfg.getAtomicityMode();
+
+ final IgniteQueue<String> clientQueue = client.queue(setName, 10, colCfg);
+
+ final IgniteQueue<String> srvQueue = srv.queue(setName, 10, null);
+
+ assertTrue(clientQueue.add("1"));
+
+ assertTrue(srvQueue.add("2"));
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ srvQueue.close();
+ }
+ });
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ clientQueue.add("fail");
+
+ return null;
+ }
+ }, IllegalStateException.class, null);
+
+ IgniteQueue<String> newClientQueue = client.queue(setName, 10, colCfg);
+
+ IgniteQueue<String> newSrvQueue = srv.queue(setName, 10, null);
+
+ assertTrue(newClientQueue.add("1"));
+
+ assertTrue(newSrvQueue.add("2"));
+ }
+
+ /**
+ * @param colCfg Collection configuration.
+ * @throws Exception If failed.
+ */
+ private void queueReconnectInProgress(final CollectionConfiguration colCfg) throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ final String setName = "queue-rmv" + colCfg.getAtomicityMode();
+
+ final IgniteQueue<String> clientQueue = client.queue(setName, 10, colCfg);
+
+ final IgniteQueue<String> srvQueue = srv.queue(setName, 10, null);
+
+ assertTrue(clientQueue.offer("1"));
+
+ assertTrue(srvQueue.contains("1"));
+
+ BlockTpcCommunicationSpi commSpi = commSpi(srv);
+
+ if (colCfg.getAtomicityMode() == ATOMIC)
+ commSpi.blockMessage(GridNearAtomicUpdateResponse.class);
+ else
+ commSpi.blockMessage(GridNearTxPrepareResponse.class);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ clientQueue.add("2");
+ }
+ catch (IgniteClientDisconnectedException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ commSpi.unblockMessage();
+
+ reconnectClientNode(client, srv, null);
+
+ assertTrue("Future was not failed. Atomic mode: " + colCfg.getAtomicityMode() + ".", (Boolean)fut.get());
+
+ assertTrue(clientQueue.add("3"));
+
+ assertEquals("1", clientQueue.poll());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectComputeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectComputeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectComputeTest.java
new file mode 100644
index 0000000..e9667a1
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectComputeTest.java
@@ -0,0 +1,192 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectComputeTest extends IgniteClientReconnectAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected int serverCount() {
+ return 1;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int clientCount() {
+ return 1;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectAffinityCallInProgress() throws Exception {
+ final Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ IgniteCache<Integer, Integer> cache = client.getOrCreateCache("test-cache");
+
+ for (int i = 0; i < 100; i++)
+ cache.put(i, i);
+
+ BlockTpcCommunicationSpi commSpi = commSpi(srv);
+
+ commSpi.blockMessage(GridJobExecuteResponse.class);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ client.compute().affinityCall("test-cache", 40, new IgniteCallable<Object>() {
+ @Override public Integer call() throws Exception {
+ return 42;
+ }
+ });
+ }
+ catch (IgniteClientDisconnectedException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ commSpi.unblockMessage();
+
+ reconnectClientNode(client, srv, null);
+
+ assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectBroadcastInProgress() throws Exception {
+ final Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ BlockTpcCommunicationSpi commSpi = commSpi(srv);
+
+ commSpi.blockMessage(GridJobExecuteResponse.class);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ client.compute().broadcast(new IgniteCallable<Object>() {
+ @Override public Object call() throws Exception {
+ return 42;
+ }
+ });
+ }
+ catch (IgniteClientDisconnectedException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ commSpi.unblockMessage();
+
+ reconnectClientNode(client, srv, null);
+
+ assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnectApplyInProgress() throws Exception {
+ final Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ BlockTpcCommunicationSpi commSpi = commSpi(srv);
+
+ commSpi.blockMessage(GridJobExecuteResponse.class);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ client.compute().apply(new IgniteClosure<Integer, Integer>() {
+ @Override public Integer apply(Integer o) {
+ return o + 1;
+ }
+ }, Arrays.asList(1, 2, 3));
+ }
+ catch (IgniteClientDisconnectedException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ commSpi.unblockMessage();
+
+ reconnectClientNode(client, srv, null);
+
+ assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectContinuousProcessorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectContinuousProcessorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectContinuousProcessorTest.java
new file mode 100644
index 0000000..2bfdc85b
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectContinuousProcessorTest.java
@@ -0,0 +1,372 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.query.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.events.EventType;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.resources.*;
+
+import javax.cache.event.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import static java.util.concurrent.TimeUnit.*;
+import static org.apache.ignite.events.EventType.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectContinuousProcessorTest extends IgniteClientReconnectAbstractTest {
+ /** */
+ private static volatile CountDownLatch latch;
+
+ /** {@inheritDoc} */
+ @Override protected int serverCount() {
+ return 3;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int clientCount() {
+ return 1;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testEventListenerReconnect() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ TestTcpDiscoverySpi srvSpi = spi(srv);
+
+ EventListener lsnr = new EventListener();
+
+ UUID opId = client.events().remoteListen(lsnr, null, EventType.EVT_JOB_STARTED);
+
+ lsnr.latch = new CountDownLatch(1);
+
+ log.info("Created remote listener: " + opId);
+
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ info("Reconnected: " + evt);
+
+ reconnectLatch.countDown();
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_RECONNECTED);
+
+ srvSpi.failNode(client.cluster().localNode().id(), null);
+
+ waitReconnectEvent(reconnectLatch);
+
+ client.compute().run(new DummyJob());
+
+ assertTrue(lsnr.latch.await(5000, MILLISECONDS));
+
+ lsnr.latch = new CountDownLatch(1);
+
+ srv.compute().run(new DummyJob());
+
+ assertTrue(lsnr.latch.await(5000, MILLISECONDS));
+
+ lsnr.latch = new CountDownLatch(1);
+
+ log.info("Stop listen, should not get events anymore.");
+
+ client.events().stopRemoteListen(opId);
+
+ assertFalse(lsnr.latch.await(3000, MILLISECONDS));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testMessageListenerReconnect() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ TestTcpDiscoverySpi srvSpi = spi(srv);
+
+ final String topic = "testTopic";
+
+ MessageListener locLsnr = new MessageListener();
+
+ UUID opId = client.message().remoteListen(topic, new RemoteMessageListener());
+
+ client.message().localListen(topic, locLsnr);
+
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ info("Reconnected: " + evt);
+
+ reconnectLatch.countDown();
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_RECONNECTED);
+
+ srvSpi.failNode(client.cluster().localNode().id(), null);
+
+ waitReconnectEvent(reconnectLatch);
+
+ locLsnr.latch = new CountDownLatch(1);
+ latch = new CountDownLatch(2);
+
+ client.message().send(topic, "msg1");
+
+ assertTrue(locLsnr.latch.await(5000, MILLISECONDS));
+ assertTrue(latch.await(5000, MILLISECONDS));
+
+ locLsnr.latch = new CountDownLatch(1);
+ latch = new CountDownLatch(2);
+
+ srv.message().send(topic, "msg2");
+
+ assertTrue(locLsnr.latch.await(5000, MILLISECONDS));
+ assertTrue(latch.await(5000, MILLISECONDS));
+
+ log.info("Stop listen, should not get remote messages anymore.");
+
+ client.message().stopRemoteListen(opId);
+
+ srv.message().send(topic, "msg3");
+
+ locLsnr.latch = new CountDownLatch(1);
+ latch = new CountDownLatch(1);
+
+ assertTrue(locLsnr.latch.await(5000, MILLISECONDS));
+ assertFalse(latch.await(3000, MILLISECONDS));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testCacheContinuousQueryReconnect() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ IgniteCache<Object, Object> clientCache = client.getOrCreateCache(new CacheConfiguration<>());
+
+ CacheEventListener lsnr = new CacheEventListener();
+
+ ContinuousQuery<Object, Object> qry = new ContinuousQuery<>();
+
+ qry.setAutoUnsubscribe(true);
+
+ qry.setLocalListener(lsnr);
+
+ QueryCursor<?> cur = clientCache.query(qry);
+
+ for (int i = 0; i < 5; i++) {
+ log.info("Iteration: " + i);
+
+ continuousQueryReconnect(client, clientCache, lsnr);
+ }
+
+ log.info("Close cursor, should not get cache events anymore.");
+
+ cur.close();
+
+ lsnr.latch = new CountDownLatch(1);
+
+ clientCache.put(3, 3);
+
+ assertFalse(lsnr.latch.await(3000, MILLISECONDS));
+ }
+
+ /**
+ * @param client Client.
+ * @param clientCache Client cache.
+ * @param lsnr Continuous query listener.
+ * @throws Exception If failed.
+ */
+ private void continuousQueryReconnect(Ignite client,
+ IgniteCache<Object, Object> clientCache,
+ CacheEventListener lsnr)
+ throws Exception
+ {
+ Ignite srv = clientRouter(client);
+
+ TestTcpDiscoverySpi srvSpi = spi(srv);
+
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+ IgnitePredicate<Event> p = new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ info("Reconnected: " + evt);
+
+ reconnectLatch.countDown();
+ }
+
+ return true;
+ }
+ };
+
+ client.events().localListen(p, EVT_CLIENT_NODE_RECONNECTED);
+
+ srvSpi.failNode(client.cluster().localNode().id(), null);
+
+ waitReconnectEvent(reconnectLatch);
+
+ client.events().stopLocalListen(p);
+
+ lsnr.latch = new CountDownLatch(1);
+
+ clientCache.put(1, 1);
+
+ assertTrue(lsnr.latch.await(5000, MILLISECONDS));
+
+ lsnr.latch = new CountDownLatch(1);
+
+ srv.cache(null).put(2, 2);
+
+ assertTrue(lsnr.latch.await(5000, MILLISECONDS));
+ }
+
+ /**
+ *
+ */
+ private static class EventListener implements P2<UUID, Event> {
+ /** */
+ private volatile CountDownLatch latch;
+
+ /** */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** {@inheritDoc} */
+ @Override public boolean apply(UUID uuid, Event evt) {
+ assertTrue(ignite.cluster().localNode().isClient());
+
+ ignite.log().info("Received event: " + evt);
+
+ if (latch != null)
+ latch.countDown();
+
+ return true;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class MessageListener implements P2<UUID, Object> {
+ /** */
+ private volatile CountDownLatch latch;
+
+ /** */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** {@inheritDoc} */
+ @Override public boolean apply(UUID uuid, Object msg) {
+ assertTrue(ignite.cluster().localNode().isClient());
+
+ ignite.log().info("Local listener received message: " + msg);
+
+ if (latch != null)
+ latch.countDown();
+
+ return true;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class RemoteMessageListener implements P2<UUID, Object> {
+ /** */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** {@inheritDoc} */
+ @Override public boolean apply(UUID uuid, Object msg) {
+ ignite.log().info("Remote listener received message: " + msg);
+
+ if (latch != null)
+ latch.countDown();
+
+ return true;
+ }
+ }
+
+ /**
+ *
+ */
+ private static class CacheEventListener implements CacheEntryUpdatedListener<Object, Object> {
+ /** */
+ private volatile CountDownLatch latch;
+
+ /** */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** {@inheritDoc} */
+ @Override public void onUpdated(Iterable<CacheEntryEvent<?, ?>> evts) {
+ int cnt = 0;
+
+ for (CacheEntryEvent<?, ?> evt : evts) {
+ ignite.log().info("Received cache event: " + evt);
+
+ cnt++;
+ }
+
+ assertEquals(1, cnt);
+
+ if (latch != null)
+ latch.countDown();
+ }
+ }
+
+ /**
+ *
+ */
+ static class DummyJob implements IgniteRunnable {
+ /** */
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ /** {@inheritDoc} */
+ @Override public void run() {
+ ignite.log().info("Job run.");
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectDiscoveryStateTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectDiscoveryStateTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectDiscoveryStateTest.java
new file mode 100644
index 0000000..feeebe5
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectDiscoveryStateTest.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.internal;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.lang.*;
+
+import java.util.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.events.EventType.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectDiscoveryStateTest extends IgniteClientReconnectAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected int serverCount() {
+ return 3;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int clientCount() {
+ return 1;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testReconnect() throws Exception {
+ final Ignite client = ignite(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ long topVer = 4;
+
+ IgniteCluster cluster = client.cluster();
+
+ cluster.nodeLocalMap().put("locMapKey", 10);
+
+ Map<Integer, Integer> nodeCnt = new HashMap<>();
+
+ nodeCnt.put(1, 1);
+ nodeCnt.put(2, 2);
+ nodeCnt.put(3, 3);
+ nodeCnt.put(4, 4);
+
+ for (Map.Entry<Integer, Integer> e : nodeCnt.entrySet()) {
+ Collection<ClusterNode> nodes = cluster.topology(e.getKey());
+
+ assertNotNull("No nodes for topology: " + e.getKey(), nodes);
+ assertEquals((int)e.getValue(), nodes.size());
+ }
+
+ ClusterNode locNode = cluster.localNode();
+
+ assertEquals(topVer, locNode.order());
+
+ TestTcpDiscoverySpi srvSpi = spi(clientRouter(client));
+
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+ info("Disconnected: " + evt);
+
+ IgniteFuture<?> fut = client.cluster().clientReconnectFuture();
+
+ assertNotNull(fut);
+ assertFalse(fut.isDone());
+ }
+ else if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ info("Reconnected: " + evt);
+
+ reconnectLatch.countDown();
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED);
+
+ srvSpi.failNode(client.cluster().localNode().id(), null);
+
+ waitReconnectEvent(reconnectLatch);
+
+ topVer += 2; // Client failed and rejoined.
+
+ locNode = cluster.localNode();
+
+ assertEquals(topVer, locNode.order());
+ assertEquals(topVer, cluster.topologyVersion());
+
+ nodeCnt.put(5, 3);
+ nodeCnt.put(6, 4);
+
+ for (Map.Entry<Integer, Integer> e : nodeCnt.entrySet()) {
+ Collection<ClusterNode> nodes = cluster.topology(e.getKey());
+
+ assertNotNull("No nodes for topology: " + e.getKey(), nodes);
+ assertEquals((int)e.getValue(), nodes.size());
+ }
+
+ assertEquals(10, cluster.nodeLocalMap().get("locMapKey"));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverAbstractTest.java
new file mode 100644
index 0000000..1b6523a
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectFailoverAbstractTest.java
@@ -0,0 +1,231 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.testframework.*;
+
+import javax.cache.*;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+import static java.util.concurrent.TimeUnit.*;
+import static org.apache.ignite.events.EventType.*;
+
+/**
+ *
+ */
+public abstract class IgniteClientReconnectFailoverAbstractTest extends IgniteClientReconnectAbstractTest {
+ /** */
+ private static final Integer THREADS = 1;
+
+ /** */
+ private volatile CyclicBarrier barrier;
+
+ /** */
+ protected static final long TEST_TIME = 90_000;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ cfg.setPeerClassLoadingEnabled(false);
+
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setJoinTimeout(30_000);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int serverCount() {
+ return 3;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int clientCount() {
+ return 1;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected long getTestTimeout() {
+ return TEST_TIME * 60_000;
+ }
+
+ /**
+ * @param c Test closure.
+ * @throws Exception If failed.
+ */
+ protected final void reconnectFailover(final Callable<Void> c) throws Exception {
+ final Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ TestTcpDiscoverySpi srvSpi = spi(srv);
+
+ final AtomicBoolean stop = new AtomicBoolean(false);
+
+ final IgniteInternalFuture<Long> fut = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ int iter = 0;
+
+ while (!stop.get()) {
+ try {
+ c.call();
+ }
+ catch (CacheException e) {
+ checkAndWait(e);
+ }
+ catch (IgniteClientDisconnectedException e) {
+ checkAndWait(e);
+ }
+
+ if (++iter % 100 == 0)
+ log.info("Iteration: " + iter);
+
+ if (barrier != null)
+ barrier.await();
+ }
+
+ return null;
+ } catch (Throwable e) {
+ log.error("Unexpected error in operation thread: " + e, e);
+
+ stop.set(true);
+
+ throw e;
+ }
+ }
+ }, THREADS, "test-operation-thread");
+
+ final AtomicReference<CountDownLatch> disconnected = new AtomicReference<>();
+ final AtomicReference<CountDownLatch> reconnected = new AtomicReference<>();
+
+ IgnitePredicate<Event> p = new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ info("Reconnected: " + evt);
+
+ CountDownLatch latch = reconnected.get();
+
+ assertNotNull(latch);
+ assertEquals(1, latch.getCount());
+
+ latch.countDown();
+ }
+ else if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+ info("Disconnected: " + evt);
+
+ CountDownLatch latch = disconnected.get();
+
+ assertNotNull(latch);
+ assertEquals(1, latch.getCount());
+
+ latch.countDown();
+ }
+
+ return true;
+ }
+ };
+
+ client.events().localListen(p, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED);
+
+ try {
+ long stopTime = System.currentTimeMillis() + TEST_TIME;
+
+ String err = null;
+
+ while (System.currentTimeMillis() < stopTime && !fut.isDone()) {
+ U.sleep(500);
+
+ CountDownLatch disconnectLatch = new CountDownLatch(1);
+ CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+ disconnected.set(disconnectLatch);
+ reconnected.set(reconnectLatch);
+
+ UUID nodeId = client.cluster().localNode().id();
+
+ log.info("Fail client: " + nodeId);
+
+ srvSpi.failNode(nodeId, null);
+
+ if (!disconnectLatch.await(10_000, MILLISECONDS)) {
+ err = "Failed to wait for disconnect";
+
+ break;
+ }
+
+ if (!reconnectLatch.await(10_000, MILLISECONDS)) {
+ err = "Failed to wait for reconnect";
+
+ break;
+ }
+
+ barrier = new CyclicBarrier(THREADS + 1, new Runnable() {
+ @Override public void run() {
+ barrier = null;
+ }
+ });
+
+ try {
+ barrier.await(10, SECONDS);
+ }
+ catch (TimeoutException e) {
+ err = "Operations hang or fail with unexpected error.";
+
+ break;
+ }
+ }
+
+ if (err != null) {
+ log.error(err);
+
+ U.dumpThreads(log);
+
+ CyclicBarrier barrier0 = barrier;
+
+ if (barrier0 != null)
+ barrier0.reset();
+
+ stop.set(true);
+
+ fut.get();
+
+ fail(err);
+ }
+
+ stop.set(true);
+
+ fut.get();
+ }
+ finally {
+ client.events().stopLocalListen(p);
+
+ stop.set(true);
+ }
+ }
+}
[14/50] [abbrv] incubator-ignite git commit: # ignite-1095 guard from
concurrent remap
Posted by av...@apache.org.
# ignite-1095 guard from concurrent remap
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b19ed0c9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b19ed0c9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b19ed0c9
Branch: refs/heads/ignite-630
Commit: b19ed0c93d2ea2b0d24302f2caa10c4237302170
Parents: d52fe87
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jul 14 15:55:49 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jul 14 15:55:49 2015 +0300
----------------------------------------------------------------------
.../dht/atomic/GridDhtAtomicCache.java | 4 ++--
.../dht/atomic/GridNearAtomicUpdateFuture.java | 20 +++++++++++++++-----
...eAtomicInvalidPartitionHandlingSelfTest.java | 2 +-
...acheAtomicReplicatedNodeRestartSelfTest.java | 15 ---------------
4 files changed, 18 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b19ed0c9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 1670994..96e6edc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -142,7 +142,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
// Request should be for primary keys only in PRIMARY ordering mode.
- assert req.hasPrimary();
+ assert req.hasPrimary() : req;
if (req.writeSynchronizationMode() != FULL_ASYNC)
sendNearUpdateReply(res.nodeId(), res);
@@ -2158,7 +2158,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
*/
private void unlockEntries(Collection<GridDhtCacheEntry> locked, AffinityTopologyVersion topVer) {
// Process deleted entries before locks release.
- assert ctx.deferredDelete();
+ assert ctx.deferredDelete() : this;
// Entries to skip eviction manager notification for.
// Enqueue entries while holding locks.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b19ed0c9/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 41cc400..751c9ba 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
@@ -358,8 +358,10 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
* @param failed Keys to remap.
*/
private void remap(Collection<?> failed) {
- if (futVer != null)
- cctx.mvcc().removeAtomicFuture(version());
+ GridCacheVersion futVer0 = futVer;
+
+ if (futVer0 == null || cctx.mvcc().removeAtomicFuture(futVer0) == null)
+ return;
Collection<Object> remapKeys = new ArrayList<>(failed.size());
Collection<Object> remapVals = vals != null ? new ArrayList<>(failed.size()) : null;
@@ -444,6 +446,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (err != null && X.hasCause(err, CachePartialUpdateCheckedException.class) &&
X.hasCause(err, ClusterTopologyCheckedException.class) &&
+ storeFuture() &&
remapCnt.decrementAndGet() > 0) {
CachePartialUpdateCheckedException cause = X.cause(err, CachePartialUpdateCheckedException.class);
@@ -646,6 +649,13 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
/**
+ * @return {@code True} future is stored by {@link GridCacheMvccManager#addAtomicFuture}.
+ */
+ private boolean storeFuture() {
+ return cctx.config().getAtomicWriteOrderMode() == CLOCK || syncMode != FULL_ASYNC;
+ }
+
+ /**
* @param topVer Topology version.
* @param remapKeys Keys to remap or {@code null} to map all keys.
* @param remap Flag indicating if this is partial remap for this future.
@@ -671,7 +681,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
// Assign future version in topology read lock before first exception may be thrown.
futVer = cctx.versions().next(topVer);
- if (!remap && (cctx.config().getAtomicWriteOrderMode() == CLOCK || syncMode != FULL_ASYNC))
+ if (!remap && storeFuture())
cctx.mvcc().addAtomicFuture(version(), this);
CacheConfiguration ccfg = cctx.config();
@@ -998,7 +1008,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
@Override public void apply(GridNearAtomicUpdateRequest req,
GridNearAtomicUpdateResponse res) {
- assert res.futureVersion().equals(futVer);
+ assert res.futureVersion().equals(futVer) : futVer;
onResult(res.nodeId(), res);
}
@@ -1065,7 +1075,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
@Override public void apply(GridNearAtomicUpdateRequest req,
GridNearAtomicUpdateResponse res) {
- assert res.futureVersion().equals(futVer);
+ assert res.futureVersion().equals(futVer) : futVer;
onResult(res.nodeId(), res);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b19ed0c9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
index 8e69853..d3bcf67 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
@@ -269,7 +269,7 @@ public class GridCacheAtomicInvalidPartitionHandlingSelfTest extends GridCommonA
return null;
}
- }, 4);
+ }, 4, "putAll-thread");
Random rnd = new Random();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b19ed0c9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
index b4ed18d..f556023 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
@@ -26,21 +26,6 @@ import static org.apache.ignite.cache.CacheAtomicityMode.*;
*/
public class IgniteCacheAtomicReplicatedNodeRestartSelfTest extends GridCacheReplicatedNodeRestartSelfTest {
/** {@inheritDoc} */
- @Override public void testRestartWithPutSixNodesTwoBackups() throws Throwable {
- fail("https://issues.apache.org/jira/browse/IGNITE-1095");
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithPutEightNodesTwoBackups() throws Throwable {
- fail("https://issues.apache.org/jira/browse/IGNITE-1095");
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithPutTenNodesTwoBackups() throws Throwable {
- fail("https://issues.apache.org/jira/browse/IGNITE-1095");
- }
-
- /** {@inheritDoc} */
@Override protected CacheAtomicityMode atomicityMode() {
return ATOMIC;
}
[42/50] [abbrv] incubator-ignite git commit: # ignite-901 client
reconnect support
Posted by av...@apache.org.
# ignite-901 client reconnect support
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/57ac2b3b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/57ac2b3b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/57ac2b3b
Branch: refs/heads/ignite-630
Commit: 57ac2b3bf437c037904624d411fd89b28b22c944
Parents: aef4063
Author: sboikov <sb...@gridgain.com>
Authored: Thu Jul 16 13:06:04 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Jul 16 13:06:05 2015 +0300
----------------------------------------------------------------------
.../IgniteClientDisconnectedException.java | 61 +
.../java/org/apache/ignite/IgniteCluster.java | 5 +
.../apache/ignite/internal/GridComponent.java | 18 +
.../ignite/internal/GridJobSiblingImpl.java | 2 +-
.../ignite/internal/GridKernalContext.java | 5 +
.../ignite/internal/GridKernalContextImpl.java | 31 +-
.../ignite/internal/GridKernalGateway.java | 46 +-
.../ignite/internal/GridKernalGatewayImpl.java | 85 +-
.../apache/ignite/internal/GridKernalState.java | 3 +
.../ignite/internal/GridPluginComponent.java | 11 +
...gniteClientDisconnectedCheckedException.java | 49 +
.../apache/ignite/internal/IgniteKernal.java | 222 +++-
.../cluster/IgniteClusterAsyncImpl.java | 5 +
.../internal/cluster/IgniteClusterImpl.java | 18 +
.../internal/managers/GridManagerAdapter.java | 19 +-
.../deployment/GridDeploymentCommunication.java | 2 +-
.../deployment/GridDeploymentManager.java | 95 +-
.../discovery/GridDiscoveryManager.java | 163 ++-
.../processors/GridProcessorAdapter.java | 11 +
.../affinity/GridAffinityAssignmentCache.java | 26 +-
.../cache/CacheOsConflictResolutionManager.java | 6 +
.../cache/DynamicCacheChangeBatch.java | 17 +
.../processors/cache/GridCacheAdapter.java | 25 +-
.../cache/GridCacheAffinityManager.java | 21 +-
.../cache/GridCacheConcurrentMap.java | 15 +-
.../processors/cache/GridCacheGateway.java | 116 +-
.../processors/cache/GridCacheIoManager.java | 8 +
.../processors/cache/GridCacheManager.java | 6 +
.../cache/GridCacheManagerAdapter.java | 6 +
.../processors/cache/GridCacheMvccManager.java | 41 +-
.../GridCachePartitionExchangeManager.java | 81 +-
.../processors/cache/GridCachePreloader.java | 5 +
.../cache/GridCachePreloaderAdapter.java | 5 +
.../processors/cache/GridCacheProcessor.java | 311 ++++-
.../cache/GridCacheSharedContext.java | 113 +-
.../cache/GridCacheSharedManager.java | 11 +-
.../cache/GridCacheSharedManagerAdapter.java | 20 +-
.../processors/cache/GridCacheUtils.java | 11 +
.../processors/cache/IgniteCacheFutureImpl.java | 5 +
.../processors/cache/IgniteCacheProxy.java | 2 +-
.../CacheDataStructuresManager.java | 35 +
.../distributed/GridCacheTxFinishSync.java | 46 +
.../distributed/dht/GridDhtCacheAdapter.java | 14 +-
.../dht/GridDhtPartitionTopologyImpl.java | 24 +
.../dht/GridPartitionedGetFuture.java | 13 +-
.../dht/preloader/GridDhtPreloader.java | 16 +-
.../distributed/near/GridNearCacheAdapter.java | 8 +
.../distributed/near/GridNearGetFuture.java | 13 +-
.../cache/dr/GridOsCacheDrManager.java | 7 +-
.../query/GridCacheDistributedQueryManager.java | 22 +
.../cache/query/GridCacheQueryAdapter.java | 11 +-
.../query/GridCacheQueryFutureAdapter.java | 2 +-
.../continuous/CacheContinuousQueryHandler.java | 5 +
.../transactions/IgniteTransactionsImpl.java | 59 +-
.../cache/transactions/IgniteTxManager.java | 19 +-
.../transactions/TransactionProxyImpl.java | 2 +-
.../cache/version/GridCacheVersionManager.java | 9 +-
.../clock/GridClockSyncProcessor.java | 6 +-
.../processors/cluster/ClusterProcessor.java | 11 +
.../continuous/GridContinuousHandler.java | 9 +-
.../continuous/GridContinuousProcessor.java | 127 +-
.../datastreamer/DataStreamProcessor.java | 24 +-
.../datastreamer/DataStreamerImpl.java | 90 +-
.../datastructures/DataStructuresProcessor.java | 33 +-
.../datastructures/GridCacheAtomicLongImpl.java | 33 +-
.../GridCacheAtomicReferenceImpl.java | 34 +-
.../GridCacheAtomicSequenceImpl.java | 33 +-
.../GridCacheAtomicStampedImpl.java | 33 +-
.../GridCacheCountDownLatchImpl.java | 51 +-
.../datastructures/GridCacheRemovable.java | 6 +-
.../datastructures/GridCacheSetImpl.java | 15 +-
.../datastructures/GridCacheSetProxy.java | 47 +-
.../processors/job/GridJobProcessor.java | 2 +-
.../internal/processors/job/GridJobWorker.java | 2 +-
.../processors/query/GridQueryIndexing.java | 7 +
.../processors/query/GridQueryProcessor.java | 6 +
.../service/GridServiceProcessor.java | 45 +-
.../processors/service/GridServiceProxy.java | 13 +-
.../processors/task/GridTaskProcessor.java | 55 +-
.../processors/task/GridTaskWorker.java | 59 +-
.../ignite/internal/util/IgniteUtils.java | 28 +
.../shmem/IpcSharedMemoryClientEndpoint.java | 5 +-
.../ignite/internal/util/lang/GridFunc.java | 2 +
.../java/org/apache/ignite/spi/IgniteSpi.java | 15 +
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 37 +-
.../communication/tcp/TcpCommunicationSpi.java | 354 ++++--
.../spi/discovery/DiscoverySpiDataExchange.java | 3 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 408 ++++--
.../ignite/spi/discovery/tcp/ServerImpl.java | 134 +-
.../spi/discovery/tcp/TcpDiscoveryImpl.java | 9 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 33 +-
.../tcp/internal/TcpDiscoveryNode.java | 19 +
.../messages/TcpDiscoveryAbstractMessage.java | 3 +
.../messages/TcpDiscoveryClientAckResponse.java | 64 +
.../messages/TcpDiscoveryHandshakeResponse.java | 14 +
.../spi/swapspace/file/FileSwapSpaceSpi.java | 2 +-
.../internal/GridUpdateNotifierSelfTest.java | 15 +-
.../IgniteClientReconnectAbstractTest.java | 363 ++++++
.../IgniteClientReconnectApiExceptionTest.java | 846 ++++++++++++
.../IgniteClientReconnectAtomicsTest.java | 672 ++++++++++
.../IgniteClientReconnectCacheTest.java | 1202 ++++++++++++++++++
.../IgniteClientReconnectCollectionsTest.java | 443 +++++++
.../IgniteClientReconnectComputeTest.java | 192 +++
...eClientReconnectContinuousProcessorTest.java | 372 ++++++
...IgniteClientReconnectDiscoveryStateTest.java | 123 ++
...niteClientReconnectFailoverAbstractTest.java | 231 ++++
.../IgniteClientReconnectFailoverTest.java | 212 +++
.../IgniteClientReconnectServicesTest.java | 260 ++++
.../internal/IgniteClientReconnectStopTest.java | 106 ++
.../IgniteClientReconnectStreamerTest.java | 233 ++++
.../IgniteSlowClientDetectionSelfTest.java | 1 +
.../GridDeploymentManagerStopSelfTest.java | 7 +
.../IgniteCacheAbstractStopBusySelfTest.java | 2 +-
.../cache/IgniteCacheDynamicStopSelfTest.java | 6 +-
.../IgniteTxExceptionAbstractSelfTest.java | 1 +
.../IgniteCacheSystemTransactionsSelfTest.java | 2 +-
.../GridCacheReplicatedInvalidateSelfTest.java | 3 +-
.../loadtests/hashmap/GridCacheTestContext.java | 4 +-
.../tcp/TcpClientDiscoverySpiSelfTest.java | 562 +++++++-
.../multijvm/IgniteClusterProcessProxy.java | 5 +
.../IgniteClientReconnectTestSuite.java | 48 +
.../processors/query/h2/IgniteH2Indexing.java | 5 +
.../query/h2/twostep/GridMergeIndex.java | 45 +-
.../h2/twostep/GridReduceQueryExecutor.java | 70 +-
...ClientReconnectCacheQueriesFailoverTest.java | 225 ++++
.../cache/IgniteClientReconnectQueriesTest.java | 427 +++++++
...dCacheAbstractReduceFieldsQuerySelfTest.java | 4 +
.../IgniteCacheWithIndexingTestSuite.java | 1 +
128 files changed, 9751 insertions(+), 815 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/IgniteClientDisconnectedException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteClientDisconnectedException.java b/modules/core/src/main/java/org/apache/ignite/IgniteClientDisconnectedException.java
new file mode 100644
index 0000000..2089db0
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteClientDisconnectedException.java
@@ -0,0 +1,61 @@
+/*
+ * 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;
+
+import org.apache.ignite.lang.*;
+import org.jetbrains.annotations.*;
+
+/**
+ * Exception thrown from Ignite API when client node disconnected from cluster.
+ */
+public class IgniteClientDisconnectedException extends IgniteException {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** */
+ private final IgniteFuture<?> reconnectFut;
+
+ /**
+ * @param reconnectFut Reconnect future.
+ * @param msg Error message.
+ */
+ public IgniteClientDisconnectedException(IgniteFuture<?> reconnectFut, String msg) {
+ this(reconnectFut, msg, null);
+ }
+
+ /**
+ * @param reconnectFut Reconnect future.
+ * @param msg Error message.
+ * @param cause Optional nested exception (can be {@code null}).
+ */
+ public IgniteClientDisconnectedException(
+ IgniteFuture<?> reconnectFut,
+ String msg,
+ @Nullable Throwable cause) {
+ super(msg, cause);
+
+ this.reconnectFut = reconnectFut;
+ }
+
+ /**
+ * @return Future that will be completed when client reconnected.
+ */
+ public IgniteFuture<?> reconnectFuture() {
+ return reconnectFut;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java b/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
index 72be3fb..d3ce0e7 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
@@ -328,6 +328,11 @@ public interface IgniteCluster extends ClusterGroup, IgniteAsyncSupport {
*/
public void resetMetrics();
+ /**
+ * @return Future that will be completed when client reconnected.
+ */
+ @Nullable public IgniteFuture<?> clientReconnectFuture();
+
/** {@inheritDoc} */
@Override public IgniteCluster withAsync();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java b/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java
index fb227cd..65e0644 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
+import org.apache.ignite.lang.*;
import org.apache.ignite.spi.*;
import org.jetbrains.annotations.*;
@@ -87,6 +88,7 @@ public interface GridComponent {
/**
* Receives discovery data object from remote nodes (called
* on new node during discovery process).
+ *
* @param joiningNodeId Joining node ID.
* @param rmtNodeId Remote node ID for which data is provided.
* @param data Discovery data object or {@code null} if nothing was
@@ -116,4 +118,20 @@ public interface GridComponent {
* @return Unique component type for discovery data exchange.
*/
@Nullable public DiscoveryDataExchangeType discoveryDataType();
+
+ /**
+ * Client disconnected callback.
+ *
+ * @param reconnectFut Reconnect future.
+ * @throws IgniteCheckedException If failed.
+ */
+ public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException;
+
+ /**
+ * Client reconnected callback.
+ *
+ * @param clusterRestarted Cluster restarted flag.
+ * @throws IgniteCheckedException If failed.
+ */
+ public void onReconnected(boolean clusterRestarted) throws IgniteCheckedException;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/GridJobSiblingImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridJobSiblingImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridJobSiblingImpl.java
index 62adf52..b4e0f01 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridJobSiblingImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridJobSiblingImpl.java
@@ -167,7 +167,7 @@ public class GridJobSiblingImpl implements ComputeJobSibling, Externalizable {
}
catch (IgniteCheckedException e) {
// Avoid stack trace for left nodes.
- if (ctx.discovery().node(node.id()) != null && ctx.discovery().pingNode(node.id()))
+ if (ctx.discovery().node(node.id()) != null && ctx.discovery().pingNodeNoError(node.id()))
U.error(ctx.log(GridJobSiblingImpl.class), "Failed to send cancel request to node " +
"[nodeId=" + node.id() + ", ses=" + ses + ']', e);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
index d6542f3..f4da333 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java
@@ -557,4 +557,9 @@ public interface GridKernalContext extends Iterable<GridComponent> {
* @return {@code True} if local node is client node (has flag {@link IgniteConfiguration#isClientMode()} set).
*/
public boolean clientNode();
+
+ /**
+ * @return {@code True} if local node in disconnected state.
+ */
+ public boolean clientDisconnected();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
index 8abb135..fd8b50c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal;
import org.apache.ignite.*;
+import org.apache.ignite.cluster.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.managers.checkpoint.*;
import org.apache.ignite.internal.managers.collision.*;
@@ -303,6 +304,12 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
/** Marshaller context. */
private MarshallerContextImpl marshCtx;
+ /** */
+ private ClusterNode locNode;
+
+ /** */
+ private volatile boolean disconnected;
+
/**
* No-arg constructor is required by externalization.
*/
@@ -325,6 +332,7 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
* @param mgmtExecSvc Management executor service.
* @param igfsExecSvc IGFS executor service.
* @param restExecSvc REST executor service.
+ * @param plugins Plugin providers.
* @throws IgniteCheckedException In case of error.
*/
@SuppressWarnings("TypeMayBeWeakened")
@@ -503,7 +511,13 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
/** {@inheritDoc} */
@Override public UUID localNodeId() {
- return cfg.getNodeId();
+ if (locNode != null)
+ return locNode.id();
+
+ if (discoMgr != null)
+ locNode = discoMgr.localNode();
+
+ return locNode != null ? locNode.id() : config().getNodeId();
}
/** {@inheritDoc} */
@@ -903,6 +917,21 @@ public class GridKernalContextImpl implements GridKernalContext, Externalizable
}
/** {@inheritDoc} */
+ @Override public boolean clientDisconnected() {
+ if (locNode == null)
+ locNode = discoMgr != null ? discoMgr.localNode() : null;
+
+ return locNode != null ? (locNode.isClient() && disconnected) : false;
+ }
+
+ /**
+ * @param disconnected Disconnected flag.
+ */
+ void disconnected(boolean disconnected) {
+ this.disconnected = disconnected;
+ }
+
+ /** {@inheritDoc} */
@Override public String toString() {
return S.toString(GridKernalContextImpl.class, this);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGateway.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGateway.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGateway.java
index 0156136..1d50aa2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGateway.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGateway.java
@@ -17,7 +17,9 @@
package org.apache.ignite.internal;
+import org.apache.ignite.internal.util.future.*;
import org.apache.ignite.internal.util.tostring.*;
+import org.jetbrains.annotations.*;
/**
* This interface guards access to implementations of public methods that access kernal
@@ -39,22 +41,6 @@ import org.apache.ignite.internal.util.tostring.*;
@GridToStringExclude
public interface GridKernalGateway {
/**
- * Performs light-weight check on the kernal state at the moment of this call.
- * <p>
- * This method should only be used when the kernal state should be checked just once
- * at the beginning of the method and the fact that <b>kernal state can change in the middle
- * of such method's execution</b> should not matter.
- * <p>
- * For example, when a method returns a constant value its implementation doesn't depend
- * on the kernal being valid throughout its execution. In such case it is enough to check
- * the kernal's state just once at the beginning of this method to provide consistent behavior
- * of the API without incurring overhead of <code>lock-based</code> guard methods.
- *
- * @throws IllegalStateException Thrown in case when no kernal calls are allowed.
- */
- public void lightCheck() throws IllegalStateException;
-
- /**
* Should be called on entering every kernal related call
* <b>originated directly or indirectly via public API</b>.
* <p>
@@ -113,31 +99,29 @@ public interface GridKernalGateway {
public void writeUnlock();
/**
- * Adds stop listener. Note that the identity set will be used to store listeners for
- * performance reasons. Futures can register a listener to be notified when they need to
- * be internally interrupted.
+ * Gets user stack trace through the first call of grid public API.
*
- * @param lsnr Listener to add.
+ * @return User stack trace.
*/
- public void addStopListener(Runnable lsnr);
+ public String userStackTrace();
/**
- * Removes previously added stop listener.
- *
- * @param lsnr Listener to remove.
+ * @param timeout Timeout.
+ * @return {@code True} if write lock has been acquired.
+ * @throws InterruptedException If interrupted.
*/
- public void removeStopListener(Runnable lsnr);
+ public boolean tryWriteLock(long timeout) throws InterruptedException;
/**
- * Gets user stack trace through the first call of grid public API.
+ * Disconnected callback.
+ *
+ * @return Reconnect future.
*/
- public String userStackTrace();
+ @Nullable public GridFutureAdapter<?> onDisconnected();
/**
- * @param timeout Timeout.
- * @return {@code True} if write lock has been acquired.
- * @throws InterruptedException If interrupted.
+ * Reconnected callback.
*/
- public boolean tryWriteLock(long timeout) throws InterruptedException;
+ public void onReconnected();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGatewayImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGatewayImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGatewayImpl.java
index 35bbbed..f6a9e51 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGatewayImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalGatewayImpl.java
@@ -17,13 +17,15 @@
package org.apache.ignite.internal;
+import org.apache.ignite.*;
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.internal.*;
import java.io.*;
-import java.util.*;
import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
/**
*
@@ -39,10 +41,10 @@ public class GridKernalGatewayImpl implements GridKernalGateway, Serializable {
/** */
@GridToStringExclude
- private final Collection<Runnable> lsnrs = new GridSetWrapper<>(new IdentityHashMap<Runnable, Object>());
+ private IgniteFutureImpl<?> reconnectFut;
/** */
- private volatile GridKernalState state = GridKernalState.STOPPED;
+ private final AtomicReference<GridKernalState> state = new AtomicReference<>(GridKernalState.STOPPED);
/** */
@GridToStringExclude
@@ -63,12 +65,6 @@ public class GridKernalGatewayImpl implements GridKernalGateway, Serializable {
}
/** {@inheritDoc} */
- @Override public void lightCheck() throws IllegalStateException {
- if (state != GridKernalState.STARTED)
- throw illegalState();
- }
-
- /** {@inheritDoc} */
@SuppressWarnings({"LockAcquiredButNotSafelyReleased", "BusyWait"})
@Override public void readLock() throws IllegalStateException {
if (stackTrace == null)
@@ -76,10 +72,18 @@ public class GridKernalGatewayImpl implements GridKernalGateway, Serializable {
rwLock.readLock();
+ GridKernalState state = this.state.get();
+
if (state != GridKernalState.STARTED) {
// Unlock just acquired lock.
rwLock.readUnlock();
+ if (state == GridKernalState.DISCONNECTED) {
+ assert reconnectFut != null;
+
+ throw new IgniteClientDisconnectedException(reconnectFut, "Client node disconnected: " + gridName);
+ }
+
throw illegalState();
}
}
@@ -90,6 +94,9 @@ public class GridKernalGatewayImpl implements GridKernalGateway, Serializable {
stackTrace = stackTrace();
rwLock.readLock();
+
+ if (state.get() == GridKernalState.DISCONNECTED)
+ throw new IgniteClientDisconnectedException(reconnectFut, "Client node disconnected: " + gridName);
}
/** {@inheritDoc} */
@@ -137,6 +144,27 @@ public class GridKernalGatewayImpl implements GridKernalGateway, Serializable {
return false;
}
+ /** {@inheritDoc} */
+ @Override public GridFutureAdapter<?> onDisconnected() {
+ GridFutureAdapter<?> fut = new GridFutureAdapter<>();
+
+ reconnectFut = new IgniteFutureImpl<>(fut);
+
+ if (!state.compareAndSet(GridKernalState.STARTED, GridKernalState.DISCONNECTED)) {
+ ((GridFutureAdapter<?>)reconnectFut.internalFuture()).onDone(new IgniteCheckedException("Node stopped."));
+
+ return null;
+ }
+
+ return fut;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void onReconnected() {
+ if (state.compareAndSet(GridKernalState.DISCONNECTED, GridKernalState.STARTED))
+ ((GridFutureAdapter<?>)reconnectFut.internalFuture()).onDone();
+ }
+
/**
* Retrieves user stack trace.
*
@@ -171,46 +199,15 @@ public class GridKernalGatewayImpl implements GridKernalGateway, Serializable {
assert state != null;
// NOTE: this method should always be called within write lock.
- this.state = state;
+ this.state.set(state);
- if (state == GridKernalState.STOPPING) {
- Runnable[] runs;
-
- synchronized (lsnrs) {
- lsnrs.toArray(runs = new Runnable[lsnrs.size()]);
- }
-
- // In the same thread.
- for (Runnable r : runs)
- r.run();
- }
+ if (reconnectFut != null)
+ ((GridFutureAdapter<?>)reconnectFut.internalFuture()).onDone(new IgniteCheckedException("Node stopped."));
}
/** {@inheritDoc} */
@Override public GridKernalState getState() {
- return state;
- }
-
- /** {@inheritDoc} */
- @Override public void addStopListener(Runnable lsnr) {
- assert lsnr != null;
-
- if (state == GridKernalState.STARTING || state == GridKernalState.STARTED)
- synchronized (lsnrs) {
- lsnrs.add(lsnr);
- }
- else
- // Call right away in the same thread.
- lsnr.run();
- }
-
- /** {@inheritDoc} */
- @Override public void removeStopListener(Runnable lsnr) {
- assert lsnr != null;
-
- synchronized (lsnrs) {
- lsnrs.remove(lsnr);
- }
+ return state.get();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalState.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalState.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalState.java
index fbb8f45..7d63578 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalState.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalState.java
@@ -32,6 +32,9 @@ public enum GridKernalState {
/** Kernal is stopping. */
STOPPING,
+ /** Kernal is disconnected. */
+ DISCONNECTED,
+
/** Kernal is stopped.
* <p>
* This is also the initial state of the kernal.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java b/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java
index b438bc1..55a84c6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
+import org.apache.ignite.lang.*;
import org.apache.ignite.plugin.*;
import org.apache.ignite.spi.*;
import org.jetbrains.annotations.*;
@@ -64,6 +65,16 @@ public class GridPluginComponent implements GridComponent {
}
/** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void onReconnected(boolean clusterRestarted) {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
@Override public void onKernalStop(boolean cancel) {
plugin.onIgniteStop(cancel);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/IgniteClientDisconnectedCheckedException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteClientDisconnectedCheckedException.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteClientDisconnectedCheckedException.java
new file mode 100644
index 0000000..e58530d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteClientDisconnectedCheckedException.java
@@ -0,0 +1,49 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.lang.*;
+
+/**
+ *
+ */
+public class IgniteClientDisconnectedCheckedException extends IgniteCheckedException {
+ /** */
+ private static final long serialVersionUID = 0L;
+
+ /** */
+ private IgniteFuture<?> reconnectFut;
+
+ /**
+ * @param reconnectFut Reconnect future.
+ * @param msg Message.
+ */
+ public IgniteClientDisconnectedCheckedException(IgniteFuture<?> reconnectFut, String msg) {
+ super(msg);
+
+ this.reconnectFut = reconnectFut;
+ }
+
+ /**
+ * @return Reconnect future.
+ */
+ public IgniteFuture<?> reconnectFuture() {
+ return reconnectFut;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 024dc7b..0d4ce32 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -60,6 +60,7 @@ import org.apache.ignite.internal.processors.session.*;
import org.apache.ignite.internal.processors.task.*;
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.lang.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*;
@@ -902,82 +903,87 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
@Override public void run() {
if (log.isInfoEnabled()) {
- ClusterMetrics m = cluster().localNode().metrics();
+ try {
+ ClusterMetrics m = cluster().localNode().metrics();
- double cpuLoadPct = m.getCurrentCpuLoad() * 100;
- double avgCpuLoadPct = m.getAverageCpuLoad() * 100;
- double gcPct = m.getCurrentGcCpuLoad() * 100;
+ double cpuLoadPct = m.getCurrentCpuLoad() * 100;
+ double avgCpuLoadPct = m.getAverageCpuLoad() * 100;
+ double gcPct = m.getCurrentGcCpuLoad() * 100;
- long heapUsed = m.getHeapMemoryUsed();
- long heapMax = m.getHeapMemoryMaximum();
+ long heapUsed = m.getHeapMemoryUsed();
+ long heapMax = m.getHeapMemoryMaximum();
- long heapUsedInMBytes = heapUsed / 1024 / 1024;
- long heapCommInMBytes = m.getHeapMemoryCommitted() / 1024 / 1024;
+ long heapUsedInMBytes = heapUsed / 1024 / 1024;
+ long heapCommInMBytes = m.getHeapMemoryCommitted() / 1024 / 1024;
- double freeHeapPct = heapMax > 0 ? ((double)((heapMax - heapUsed) * 100)) / heapMax : -1;
+ double freeHeapPct = heapMax > 0 ? ((double)((heapMax - heapUsed) * 100)) / heapMax : -1;
- int hosts = 0;
- int nodes = 0;
- int cpus = 0;
+ int hosts = 0;
+ int nodes = 0;
+ int cpus = 0;
- try {
- ClusterMetrics metrics = cluster().metrics();
+ try {
+ ClusterMetrics metrics = cluster().metrics();
- Collection<ClusterNode> nodes0 = cluster().nodes();
+ Collection<ClusterNode> nodes0 = cluster().nodes();
- hosts = U.neighborhood(nodes0).size();
- nodes = metrics.getTotalNodes();
- cpus = metrics.getTotalCpus();
- }
- catch (IgniteException ignore) {
- // No-op.
- }
+ hosts = U.neighborhood(nodes0).size();
+ nodes = metrics.getTotalNodes();
+ cpus = metrics.getTotalCpus();
+ }
+ catch (IgniteException ignore) {
+ // No-op.
+ }
- int pubPoolActiveThreads = 0;
- int pubPoolIdleThreads = 0;
- int pubPoolQSize = 0;
+ int pubPoolActiveThreads = 0;
+ int pubPoolIdleThreads = 0;
+ int pubPoolQSize = 0;
- if (execSvc instanceof ThreadPoolExecutor) {
- ThreadPoolExecutor exec = (ThreadPoolExecutor)execSvc;
+ if (execSvc instanceof ThreadPoolExecutor) {
+ ThreadPoolExecutor exec = (ThreadPoolExecutor)execSvc;
- int poolSize = exec.getPoolSize();
+ int poolSize = exec.getPoolSize();
- pubPoolActiveThreads = Math.min(poolSize, exec.getActiveCount());
- pubPoolIdleThreads = poolSize - pubPoolActiveThreads;
- pubPoolQSize = exec.getQueue().size();
- }
+ pubPoolActiveThreads = Math.min(poolSize, exec.getActiveCount());
+ pubPoolIdleThreads = poolSize - pubPoolActiveThreads;
+ pubPoolQSize = exec.getQueue().size();
+ }
- int sysPoolActiveThreads = 0;
- int sysPoolIdleThreads = 0;
- int sysPoolQSize = 0;
+ int sysPoolActiveThreads = 0;
+ int sysPoolIdleThreads = 0;
+ int sysPoolQSize = 0;
- if (sysExecSvc instanceof ThreadPoolExecutor) {
- ThreadPoolExecutor exec = (ThreadPoolExecutor)sysExecSvc;
+ if (sysExecSvc instanceof ThreadPoolExecutor) {
+ ThreadPoolExecutor exec = (ThreadPoolExecutor)sysExecSvc;
- int poolSize = exec.getPoolSize();
+ int poolSize = exec.getPoolSize();
- sysPoolActiveThreads = Math.min(poolSize, exec.getActiveCount());
- sysPoolIdleThreads = poolSize - sysPoolActiveThreads;
- sysPoolQSize = exec.getQueue().size();
- }
+ sysPoolActiveThreads = Math.min(poolSize, exec.getActiveCount());
+ sysPoolIdleThreads = poolSize - sysPoolActiveThreads;
+ sysPoolQSize = exec.getQueue().size();
+ }
- String id = U.id8(localNode().id());
+ String id = U.id8(localNode().id());
- String msg = NL +
- "Metrics for local node (to disable set 'metricsLogFrequency' to 0)" + NL +
- " ^-- Node [id=" + id + ", name=" + name() + "]" + NL +
- " ^-- H/N/C [hosts=" + hosts + ", nodes=" + nodes + ", CPUs=" + cpus + "]" + NL +
- " ^-- CPU [cur=" + dblFmt.format(cpuLoadPct) + "%, avg=" +
+ String msg = NL +
+ "Metrics for local node (to disable set 'metricsLogFrequency' to 0)" + NL +
+ " ^-- Node [id=" + id + ", name=" + name() + "]" + NL +
+ " ^-- H/N/C [hosts=" + hosts + ", nodes=" + nodes + ", CPUs=" + cpus + "]" + NL +
+ " ^-- CPU [cur=" + dblFmt.format(cpuLoadPct) + "%, avg=" +
dblFmt.format(avgCpuLoadPct) + "%, GC=" + dblFmt.format(gcPct) + "%]" + NL +
- " ^-- Heap [used=" + dblFmt.format(heapUsedInMBytes) + "MB, free=" +
+ " ^-- Heap [used=" + dblFmt.format(heapUsedInMBytes) + "MB, free=" +
dblFmt.format(freeHeapPct) + "%, comm=" + dblFmt.format(heapCommInMBytes) + "MB]" + NL +
- " ^-- Public thread pool [active=" + pubPoolActiveThreads + ", idle=" +
+ " ^-- Public thread pool [active=" + pubPoolActiveThreads + ", idle=" +
pubPoolIdleThreads + ", qSize=" + pubPoolQSize + "]" + NL +
- " ^-- System thread pool [active=" + sysPoolActiveThreads + ", idle=" +
+ " ^-- System thread pool [active=" + sysPoolActiveThreads + ", idle=" +
sysPoolIdleThreads + ", qSize=" + sysPoolQSize + "]" + NL +
- " ^-- Outbound messages queue [size=" + m.getOutboundMessagesQueueSize() + "]";
+ " ^-- Outbound messages queue [size=" + m.getOutboundMessagesQueueSize() + "]";
- log.info(msg);
+ log.info(msg);
+ }
+ catch (IgniteClientDisconnectedException ignore) {
+ // No-op.
+ }
}
}
}, metricsLogFreq, metricsLogFreq);
@@ -1676,7 +1682,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
GridKernalState state = gw.getState();
- if (state == STARTED)
+ if (state == STARTED || state == DISCONNECTED)
firstStop = true;
else if (state == STARTING)
U.warn(log, "Attempt to stop starting grid. This operation " +
@@ -1753,7 +1759,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
if (cache != null)
cache.blockGateways();
- assert gw.getState() == STARTED || gw.getState() == STARTING;
+ assert gw.getState() == STARTED || gw.getState() == STARTING || gw.getState() == DISCONNECTED;
// No more kernal calls from this point on.
gw.setState(STOPPING);
@@ -2186,6 +2192,9 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
return false;
}
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
finally {
unguard();
}
@@ -2801,6 +2810,109 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
}
/**
+ *
+ */
+ public void onDisconnected() {
+ Throwable err = null;
+
+ GridFutureAdapter<?> reconnectFut = ctx.gateway().onDisconnected();
+
+ if (reconnectFut == null) {
+ assert ctx.gateway().getState() != STARTED : ctx.gateway().getState();
+
+ return;
+ }
+
+ IgniteFuture<?> userFut = new IgniteFutureImpl<>(reconnectFut);
+
+ ctx.cluster().get().clientReconnectFuture(userFut);
+
+ ctx.disconnected(true);
+
+ List<GridComponent> comps = ctx.components();
+
+ for (ListIterator<GridComponent> it = comps.listIterator(comps.size()); it.hasPrevious();) {
+ GridComponent comp = it.previous();
+
+ try {
+ if (!skipDaemon(comp))
+ comp.onDisconnected(userFut);
+ }
+ catch (IgniteCheckedException e) {
+ err = e;
+ }
+ catch (Throwable e) {
+ err = e;
+
+ if (e instanceof Error)
+ throw e;
+ }
+ }
+
+ for (GridCacheContext cctx : ctx.cache().context().cacheContexts()) {
+ cctx.gate().writeLock();
+
+ cctx.gate().writeUnlock();
+ }
+
+ ctx.gateway().writeLock();
+
+ ctx.gateway().writeUnlock();
+
+ if (err != null) {
+ reconnectFut.onDone(err);
+
+ U.error(log, "Failed to reconnect, will stop node", err);
+
+ close();
+ }
+ }
+
+ /**
+ * @param clusterRestarted {@code True} if all cluster nodes restarted while client was disconnected.
+ */
+ public void onReconnected(final boolean clusterRestarted) {
+ Throwable err = null;
+
+ try {
+ ctx.disconnected(false);
+
+ for (GridComponent comp : ctx.components())
+ comp.onReconnected(clusterRestarted);
+
+ ctx.cache().context().exchange().reconnectExchangeFuture().listen(new CI1<IgniteInternalFuture<?>>() {
+ @Override public void apply(IgniteInternalFuture<?> fut) {
+ try {
+ fut.get();
+
+ ctx.gateway().onReconnected();
+ }
+ catch (IgniteCheckedException e) {
+ U.error(log, "Failed to reconnect, will stop node", e);
+
+ close();
+ }
+ }
+ });
+ }
+ catch (IgniteCheckedException e) {
+ err = e;
+ }
+ catch (Throwable e) {
+ err = e;
+
+ if (e instanceof Error)
+ throw e;
+ }
+
+ if (err != null) {
+ U.error(log, "Failed to reconnect, will stop node", err);
+
+ close();
+ }
+ }
+
+ /**
* Creates optional component.
*
* @param cls Component interface.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java
index 26c704c..51cf523 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterAsyncImpl.java
@@ -287,6 +287,11 @@ public class IgniteClusterAsyncImpl extends AsyncSupportAdapter<IgniteCluster>
}
/** {@inheritDoc} */
+ @Nullable @Override public IgniteFuture<?> clientReconnectFuture() {
+ return cluster.clientReconnectFuture();
+ }
+
+ /** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
cluster = (IgniteClusterImpl)in.readObject();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
index 3c937b0..0287ca7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
@@ -52,6 +52,9 @@ public class IgniteClusterImpl extends ClusterGroupAdapter implements IgniteClus
@GridToStringExclude
private ConcurrentMap nodeLoc;
+ /** Client reconnect future. */
+ private IgniteFuture<?> reconnecFut;
+
/**
* Required by {@link Externalizable}.
*/
@@ -120,6 +123,9 @@ public class IgniteClusterImpl extends ClusterGroupAdapter implements IgniteClus
try {
return ctx.discovery().pingNode(nodeId);
}
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
finally {
unguard();
}
@@ -501,6 +507,18 @@ public class IgniteClusterImpl extends ClusterGroupAdapter implements IgniteClus
nodeLoc.clear();
}
+ /**
+ * @param reconnecFut Reconnect future.
+ */
+ public void clientReconnectFuture(IgniteFuture<?> reconnecFut) {
+ this.reconnecFut = reconnecFut;
+ }
+
+ /** {@inheritDoc} */
+ @Nullable @Override public IgniteFuture<?> clientReconnectFuture() {
+ return reconnecFut;
+ }
+
/** {@inheritDoc} */
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
ctx = (GridKernalContext)in.readObject();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
index 40a5ea5..298ff24 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
@@ -166,6 +166,18 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan
// No-op.
}
+ /** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException {
+ for (T t : spis)
+ t.onClientDisconnected(reconnectFut);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void onReconnected(boolean clusterRestarted) throws IgniteCheckedException {
+ for (T t : spis)
+ t.onClientReconnected(clusterRestarted);
+ }
+
/**
* Starts wrapped SPI.
*
@@ -318,7 +330,12 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements GridMan
@Override public boolean pingNode(UUID nodeId) {
A.notNull(nodeId, "nodeId");
- return ctx.discovery().pingNode(nodeId);
+ try {
+ return ctx.discovery().pingNode(nodeId);
+ }
+ catch (IgniteCheckedException e) {
+ throw U.convertException(e);
+ }
}
@Override public void send(ClusterNode node, Serializable msg, String topic)
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentCommunication.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentCommunication.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentCommunication.java
index 443b221..3b886a5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentCommunication.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentCommunication.java
@@ -293,7 +293,7 @@ class GridDeploymentCommunication {
log.debug("Sent peer class loading response [node=" + node.id() + ", res=" + res + ']');
}
catch (IgniteCheckedException e) {
- if (ctx.discovery().pingNode(nodeId))
+ if (ctx.discovery().pingNodeNoError(nodeId))
U.error(log, "Failed to send peer class loading response to node: " + nodeId, e);
else if (log.isDebugEnabled())
log.debug("Failed to send peer class loading response to node " +
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManager.java
index 75fe98f..75fb41e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentManager.java
@@ -94,13 +94,7 @@ public class GridDeploymentManager extends GridManagerAdapter<DeploymentSpi> {
comm.start();
- locStore = new GridDeploymentLocalStore(getSpi(), ctx, comm);
- ldrStore = new GridDeploymentPerLoaderStore(getSpi(), ctx, comm);
- verStore = new GridDeploymentPerVersionStore(getSpi(), ctx, comm);
-
- locStore.start();
- ldrStore.start();
- verStore.start();
+ startStores();
if (log.isDebugEnabled()) {
log.debug("Local deployment: " + locDep);
@@ -110,17 +104,24 @@ public class GridDeploymentManager extends GridManagerAdapter<DeploymentSpi> {
}
/** {@inheritDoc} */
- @Override public void stop(boolean cancel) throws IgniteCheckedException {
- GridProtocolHandler.deregisterDeploymentManager();
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException {
+ storesOnKernalStop();
- if (verStore != null)
- verStore.stop();
+ storesStop();
- if (ldrStore != null)
- ldrStore.stop();
+ startStores();
+ }
- if (locStore != null)
- locStore.stop();
+ /** {@inheritDoc} */
+ @Override public void onReconnected(boolean clusterRestarted) throws IgniteCheckedException {
+ storesOnKernalStart();
+ }
+
+ /** {@inheritDoc} */
+ @Override public void stop(boolean cancel) throws IgniteCheckedException {
+ GridProtocolHandler.deregisterDeploymentManager();
+
+ storesStop();
if (comm != null)
comm.stop();
@@ -135,21 +136,12 @@ public class GridDeploymentManager extends GridManagerAdapter<DeploymentSpi> {
/** {@inheritDoc} */
@Override public void onKernalStart0() throws IgniteCheckedException {
- locStore.onKernalStart();
- ldrStore.onKernalStart();
- verStore.onKernalStart();
+ storesOnKernalStart();
}
/** {@inheritDoc} */
@Override public void onKernalStop0(boolean cancel) {
- if (verStore != null)
- verStore.onKernalStop();
-
- if (ldrStore != null)
- ldrStore.onKernalStop();
-
- if (locStore != null)
- locStore.onKernalStop();
+ storesOnKernalStop();
}
/** {@inheritDoc} */
@@ -547,6 +539,57 @@ public class GridDeploymentManager extends GridManagerAdapter<DeploymentSpi> {
return ldr instanceof GridDeploymentClassLoader;
}
+
+ /**
+ * @throws IgniteCheckedException If failed.
+ */
+ private void startStores() throws IgniteCheckedException {
+ locStore = new GridDeploymentLocalStore(getSpi(), ctx, comm);
+ ldrStore = new GridDeploymentPerLoaderStore(getSpi(), ctx, comm);
+ verStore = new GridDeploymentPerVersionStore(getSpi(), ctx, comm);
+
+ locStore.start();
+ ldrStore.start();
+ verStore.start();
+ }
+
+ /**
+ * @throws IgniteCheckedException If failed.
+ */
+ private void storesOnKernalStart() throws IgniteCheckedException {
+ locStore.onKernalStart();
+ ldrStore.onKernalStart();
+ verStore.onKernalStart();
+ }
+
+ /**
+ *
+ */
+ private void storesOnKernalStop() {
+ if (verStore != null)
+ verStore.onKernalStop();
+
+ if (ldrStore != null)
+ ldrStore.onKernalStop();
+
+ if (locStore != null)
+ locStore.onKernalStop();
+ }
+
+ /**
+ *
+ */
+ private void storesStop() {
+ if (verStore != null)
+ verStore.stop();
+
+ if (ldrStore != null)
+ ldrStore.stop();
+
+ if (locStore != null)
+ locStore.stop();
+ }
+
/**
*
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index b35628c..068d374 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -188,14 +188,14 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
/** Received custom messages history. */
private final ArrayDeque<IgniteUuid> rcvdCustomMsgs = new ArrayDeque<>();
+ /** */
+ private final CountDownLatch startLatch = new CountDownLatch(1);
+
/** @param ctx Context. */
public GridDiscoveryManager(GridKernalContext ctx) {
super(ctx, ctx.config().getDiscoverySpi());
}
- /** */
- private final CountDownLatch startLatch = new CountDownLatch(1);
-
/**
* @return Memory usage of non-heap memory.
*/
@@ -337,7 +337,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
isLocDaemon = ctx.isDaemon();
- hasRslvrs = !F.isEmpty(ctx.config().getSegmentationResolvers());
+ hasRslvrs = !ctx.config().isClientMode() && !F.isEmpty(ctx.config().getSegmentationResolvers());
segChkFreq = ctx.config().getSegmentCheckFrequency();
@@ -380,14 +380,24 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
}
spi.setListener(new DiscoverySpiListener() {
+ private long gridStartTime;
+
@Override public void onDiscovery(
- int type,
- long topVer,
- ClusterNode node,
- Collection<ClusterNode> topSnapshot,
- Map<Long, Collection<ClusterNode>> snapshots,
+ final int type,
+ final long topVer,
+ final ClusterNode node,
+ final Collection<ClusterNode> topSnapshot,
+ final Map<Long, Collection<ClusterNode>> snapshots,
@Nullable DiscoverySpiCustomMessage spiCustomMsg
) {
+ if (type == EVT_NODE_JOINED && node.isLocal() && ctx.clientDisconnected()) {
+ discoCacheHist.clear();
+
+ topHist.clear();
+
+ topSnap.set(new Snapshot(AffinityTopologyVersion.ZERO, null));
+ }
+
DiscoveryCustomMessage customMsg = spiCustomMsg == null ? null
: ((CustomMessageWrapper)spiCustomMsg).delegate();
@@ -415,7 +425,9 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
verChanged = false;
}
else {
- if (type != EVT_NODE_SEGMENTED) {
+ if (type != EVT_NODE_SEGMENTED &&
+ type != EVT_CLIENT_NODE_DISCONNECTED &&
+ type != EVT_CLIENT_NODE_RECONNECTED) {
minorTopVer = 0;
verChanged = true;
@@ -424,7 +436,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
verChanged = false;
}
- AffinityTopologyVersion nextTopVer = new AffinityTopologyVersion(topVer, minorTopVer);
+ final AffinityTopologyVersion nextTopVer = new AffinityTopologyVersion(topVer, minorTopVer);
if (type == EVT_NODE_FAILED || type == EVT_NODE_LEFT) {
for (DiscoCache c : discoCacheHist.values())
@@ -467,11 +479,12 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
// If this is a local join event, just save it and do not notify listeners.
if (type == EVT_NODE_JOINED && node.id().equals(locNode.id())) {
+ if (gridStartTime == 0)
+ gridStartTime = getSpi().getGridStartTime();
+
updateTopologyVersionIfGreater(new AffinityTopologyVersion(locNode.order()),
new DiscoCache(localNode(), getSpi().getRemoteNodes()));
- assert startLatch.getCount() == 1;
-
startLatch.countDown();
DiscoveryEvent discoEvt = new DiscoveryEvent();
@@ -491,6 +504,46 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
return;
}
+ else if (type == EVT_CLIENT_NODE_DISCONNECTED) {
+ /*
+ * Notify all components from discovery thread to avoid concurrent
+ * reconnect while disconnect handling is in progress.
+ */
+
+ assert locNode.isClient() : locNode;
+ assert node.isClient() : node;
+
+ ((IgniteKernal)ctx.grid()).onDisconnected();
+
+ locJoinEvt = new GridFutureAdapter<>();
+
+ registeredCaches.clear();
+ }
+ else if (type == EVT_CLIENT_NODE_RECONNECTED) {
+ assert locNode.isClient() : locNode;
+ assert node.isClient() : node;
+
+ boolean clusterRestarted = gridStartTime != getSpi().getGridStartTime();
+
+ gridStartTime = getSpi().getGridStartTime();
+
+ ((IgniteKernal)ctx.grid()).onReconnected(clusterRestarted);
+
+ ctx.cluster().clientReconnectFuture().listen(new CI1<IgniteFuture<?>>() {
+ @Override public void apply(IgniteFuture<?> fut) {
+ try {
+ fut.get();
+
+ discoWrk.addEvent(type, nextTopVer, node, topSnapshot, null);
+ }
+ catch (IgniteException ignore) {
+ // No-op.
+ }
+ }
+ });
+
+ return;
+ }
discoWrk.addEvent(type, nextTopVer, node, topSnapshot, customMsg);
}
@@ -967,7 +1020,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
Collection<ClusterNode> rmtNodes = discoCache.remoteNodes();
- Collection<ClusterNode> serverNodes = F.view(discoCache.allNodes(), F.not(clientFilter));
+ Collection<ClusterNode> srvNodes = F.view(discoCache.allNodes(), F.not(clientFilter));
Collection<ClusterNode> clientNodes = F.view(discoCache.allNodes(), clientFilter);
@@ -987,7 +1040,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
double heap = U.heapSize(allNodes, 2);
if (log.isQuiet())
- U.quiet(false, topologySnapshotMessage(serverNodes.size(), clientNodes.size(), totalCpus, heap));
+ U.quiet(false, topologySnapshotMessage(srvNodes.size(), clientNodes.size(), totalCpus, heap));
if (log.isDebugEnabled()) {
String dbg = "";
@@ -997,7 +1050,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
">>> " + PREFIX + "." + U.nl() +
">>> +----------------+" + U.nl() +
">>> Grid name: " + (ctx.gridName() == null ? "default" : ctx.gridName()) + U.nl() +
- ">>> Number of server nodes: " + serverNodes.size() + U.nl() +
+ ">>> Number of server nodes: " + srvNodes.size() + U.nl() +
">>> Number of client nodes: " + clientNodes.size() + U.nl() +
(discoOrdered ? ">>> Topology version: " + topVer + U.nl() : "") +
">>> Topology hash: 0x" + Long.toHexString(hash).toUpperCase() + U.nl();
@@ -1031,20 +1084,20 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
log.debug(dbg);
}
else if (log.isInfoEnabled())
- log.info(topologySnapshotMessage(serverNodes.size(), clientNodes.size(), totalCpus, heap));
+ log.info(topologySnapshotMessage(srvNodes.size(), clientNodes.size(), totalCpus, heap));
}
/**
- * @param serverNodesNum Server nodes number.
+ * @param srvNodesNum Server nodes number.
* @param clientNodesNum Client nodes number.
* @param totalCpus Total cpu number.
* @param heap Heap size.
* @return Topology snapshot message.
*/
- private String topologySnapshotMessage(int serverNodesNum, int clientNodesNum, int totalCpus, double heap) {
+ private String topologySnapshotMessage(int srvNodesNum, int clientNodesNum, int totalCpus, double heap) {
return PREFIX + " [" +
(discoOrdered ? "ver=" + topSnap.get().topVer.topologyVersion() + ", " : "") +
- "server nodes=" + serverNodesNum +
+ "server nodes=" + srvNodesNum +
", client nodes=" + clientNodesNum +
", CPUs=" + totalCpus +
", heap=" + heap + "GB" +
@@ -1134,8 +1187,9 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
/**
* @param nodeId ID of the node.
* @return {@code True} if ping succeeded.
+ * @throws IgniteClientDisconnectedCheckedException If ping failed.
*/
- public boolean pingNode(UUID nodeId) {
+ public boolean pingNode(UUID nodeId) throws IgniteClientDisconnectedCheckedException {
assert nodeId != null;
if (!busyLock.enterBusy())
@@ -1144,6 +1198,36 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
try {
return getSpi().pingNode(nodeId);
}
+ catch (IgniteException e) {
+ if (e.hasCause(IgniteClientDisconnectedCheckedException.class)) {
+ IgniteFuture<?> reconnectFut = ctx.cluster().clientReconnectFuture();
+
+ throw new IgniteClientDisconnectedCheckedException(reconnectFut, e.getMessage());
+ }
+
+ throw e;
+ }
+ finally {
+ busyLock.leaveBusy();
+ }
+ }
+
+ /**
+ * @param nodeId ID of the node.
+ * @return {@code True} if ping succeeded.
+ */
+ public boolean pingNodeNoError(UUID nodeId) {
+ assert nodeId != null;
+
+ if (!busyLock.enterBusy())
+ return false;
+
+ try {
+ return getSpi().pingNode(nodeId);
+ }
+ catch (IgniteException e) {
+ return false;
+ }
finally {
busyLock.leaveBusy();
}
@@ -1519,9 +1603,20 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
/**
* @param msg Custom message.
+ * @throws IgniteCheckedException If failed.
*/
- public void sendCustomEvent(DiscoveryCustomMessage msg) {
- getSpi().sendCustomEvent(new CustomMessageWrapper(msg));
+ public void sendCustomEvent(DiscoveryCustomMessage msg) throws IgniteCheckedException {
+ try {
+ getSpi().sendCustomEvent(new CustomMessageWrapper(msg));
+ }
+ catch (IgniteClientDisconnectedException e) {
+ IgniteFuture<?> reconnectFut = ctx.cluster().clientReconnectFuture();
+
+ throw new IgniteClientDisconnectedCheckedException(reconnectFut, e.getMessage());
+ }
+ catch (IgniteException e) {
+ throw new IgniteCheckedException(e);
+ }
}
/**
@@ -1743,6 +1838,12 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
else if (type == EVT_NODE_SEGMENTED)
evt.message("Node segmented: " + node);
+ else if (type == EVT_CLIENT_NODE_DISCONNECTED)
+ evt.message("Client node disconnected: " + node);
+
+ else if (type == EVT_CLIENT_NODE_RECONNECTED)
+ evt.message("Client node reconnected: " + node);
+
else
assert false;
@@ -1755,6 +1856,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
* @param topVer Topology version.
* @param node Node.
* @param topSnapshot Topology snapshot.
+ * @param data Custom message.
*/
void addEvent(
int type,
@@ -1864,6 +1966,21 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
break;
}
+ case EVT_CLIENT_NODE_DISCONNECTED: {
+ // No-op.
+
+ break;
+ }
+
+ case EVT_CLIENT_NODE_RECONNECTED: {
+ if (log.isInfoEnabled())
+ log.info("Client node reconnected to topology: " + node);
+
+ ackTopology(topVer.topologyVersion(), true);
+
+ break;
+ }
+
case EVT_NODE_FAILED: {
// Check only if resolvers were configured.
if (hasRslvrs)
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java
index a84c48a..8baf95c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java
@@ -22,6 +22,7 @@ import org.apache.ignite.cluster.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
import org.apache.ignite.spi.*;
import org.jetbrains.annotations.*;
@@ -62,6 +63,16 @@ public abstract class GridProcessorAdapter implements GridProcessor {
}
/** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void onReconnected(boolean clusterRestarted) throws IgniteCheckedException {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
@Nullable @Override public DiscoveryDataExchangeType discoveryDataType() {
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
index 6989385..d40128c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/affinity/GridAffinityAssignmentCache.java
@@ -69,7 +69,7 @@ public class GridAffinityAssignmentCache {
private IgniteLogger log;
/** Node stop flag. */
- private volatile boolean stopping;
+ private volatile IgniteCheckedException stopErr;
/**
* Constructs affinity cached calculations.
@@ -130,18 +130,28 @@ public class GridAffinityAssignmentCache {
/**
* Kernal stop callback.
+ *
+ * @param err Error.
*/
- public void onKernalStop() {
- stopping = true;
-
- IgniteCheckedException err =
- new IgniteCheckedException("Failed to wait for topology update, cache (or node) is stopping.");
+ public void onKernalStop(IgniteCheckedException err) {
+ stopErr = err;
for (AffinityReadyFuture fut : readyFuts.values())
fut.onDone(err);
}
/**
+ *
+ */
+ public void onReconnected() {
+ affCache.clear();
+
+ head.set(new GridAffinityAssignment(AffinityTopologyVersion.NONE));
+
+ stopErr = null;
+ }
+
+ /**
* Calculates affinity cache for given topology version.
*
* @param topVer Topology version to calculate affinity cache for.
@@ -312,8 +322,8 @@ public class GridAffinityAssignmentCache {
fut.onDone(topVer);
}
- else if (stopping)
- fut.onDone(new IgniteCheckedException("Failed to wait for topology update, cache (or node) is stopping."));
+ else if (stopErr != null)
+ fut.onDone(stopErr);
return fut;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOsConflictResolutionManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOsConflictResolutionManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOsConflictResolutionManager.java
index 29e50b6..9e765d9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOsConflictResolutionManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOsConflictResolutionManager.java
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.*;
import org.apache.ignite.internal.processors.cache.version.*;
+import org.apache.ignite.lang.*;
/**
* OS conflict resolver manager.
@@ -55,4 +56,9 @@ public class CacheOsConflictResolutionManager<K ,V> implements CacheConflictReso
@Override public void printMemoryStats() {
// No-op.
}
+
+ /** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture<?> reconnectFut) {
+ // No-op.
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
index dfc39c1..1e8184d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
@@ -43,6 +43,9 @@ public class DynamicCacheChangeBatch implements DiscoveryCustomMessage {
/** Custom message ID. */
private IgniteUuid id = IgniteUuid.randomUuid();
+ /** */
+ private boolean clientReconnect;
+
/**
* @param reqs Requests.
*/
@@ -93,6 +96,20 @@ public class DynamicCacheChangeBatch implements DiscoveryCustomMessage {
return false;
}
+ /**
+ * @param clientReconnect {@code True} if this is discovery data sent on client reconnect.
+ */
+ public void clientReconnect(boolean clientReconnect) {
+ this.clientReconnect = clientReconnect;
+ }
+
+ /**
+ * @return {@code True} if this is discovery data sent on client reconnect.
+ */
+ public boolean clientReconnect() {
+ return clientReconnect;
+ }
+
/** {@inheritDoc} */
@Override public String toString() {
return S.toString(DynamicCacheChangeBatch.class, this);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/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 e138520..d2a730a 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
@@ -212,7 +212,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
*/
@SuppressWarnings("OverriddenMethodCallDuringObjectConstruction")
protected GridCacheAdapter(GridCacheContext<K, V> ctx, int startSize) {
- this(ctx, new GridCacheConcurrentMap(ctx, startSize, 0.75F));
+ this(ctx, new GridCacheConcurrentMap(ctx, startSize, 0.75F, null));
}
/**
@@ -2868,7 +2868,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
if (ctx.deploymentEnabled())
ctx.deploy().registerClass(val);
- return (GridCacheReturn)tx.removeAllAsync(ctx,
+ return tx.removeAllAsync(ctx,
Collections.singletonList(key),
null,
true,
@@ -2934,7 +2934,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
if (ctx.deploymentEnabled())
ctx.deploy().registerClass(oldVal);
- return (GridCacheReturn) tx.putAllAsync(ctx,
+ return tx.putAllAsync(ctx,
F.t(key, newVal),
true,
null,
@@ -3036,7 +3036,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
ctx.deploy().registerClass(val);
return tx.removeAllAsync(ctx, Collections.singletonList(key), null, false,
- ctx.equalsValArray(val)).get().success();
+ ctx.equalsValArray(val)).get().success();
}
@Override public String toString() {
@@ -3250,10 +3250,10 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
TransactionConfiguration cfg = ctx.gridConfig().getTransactionConfiguration();
return txStart(
- concurrency,
- isolation,
- cfg.getDefaultTxTimeout(),
- 0
+ concurrency,
+ isolation,
+ cfg.getDefaultTxTimeout(),
+ 0
);
}
@@ -3689,7 +3689,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
return F.iterator(iterator(),
new IgniteClosure<Cache.Entry<K, V>, Cache.Entry<K, V>>() {
private IgniteCacheExpiryPolicy expiryPlc =
- ctx.cache().expiryPolicy(opCtx != null ? opCtx.expiry() : null);
+ ctx.cache().expiryPolicy(opCtx != null ? opCtx.expiry() : null);
@Override public Cache.Entry<K, V> apply(Cache.Entry<K, V> lazyEntry) {
CacheOperationContext prev = ctx.gate().enter(opCtx);
@@ -4443,6 +4443,13 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
public abstract void onDeferredDelete(GridCacheEntryEx entry, GridCacheVersion ver);
/**
+ *
+ */
+ public void onReconnected() {
+ // No-op.
+ }
+
+ /**
* Validates that given cache value implements {@link Externalizable}.
*
* @param val Cache value.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
index ea17df1..88e5e40 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAffinityManager.java
@@ -25,6 +25,7 @@ import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.future.*;
import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.lang.*;
import org.jetbrains.annotations.*;
import java.util.*;
@@ -54,7 +55,25 @@ public class GridCacheAffinityManager extends GridCacheManagerAdapter {
/** {@inheritDoc} */
@Override protected void onKernalStop0(boolean cancel) {
- aff.onKernalStop();
+ IgniteCheckedException err =
+ new IgniteCheckedException("Failed to wait for topology update, cache (or node) is stopping.");
+
+ aff.onKernalStop(err);
+ }
+
+ /** {@inheritDoc} */
+ @Override public void onDisconnected(IgniteFuture reconnectFut) {
+ IgniteCheckedException err = new IgniteClientDisconnectedCheckedException(reconnectFut,
+ "Failed to wait for topology update, client disconnected.");
+
+ aff.onKernalStop(err);
+ }
+
+ /**
+ *
+ */
+ public void onReconnected() {
+ aff.onReconnected();
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
index db5eed1..966dcc1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
@@ -279,11 +279,17 @@ public class GridCacheConcurrentMap {
* @param loadFactor the load factor threshold, used to control resizing.
* Resizing may be performed when the average number of elements per
* bin exceeds this threshold.
+ * @param factory Entries factory.
* @throws IllegalArgumentException if the initial capacity of
* elements is negative or the load factor is non-positive.
*/
- public GridCacheConcurrentMap(GridCacheContext ctx, int initCap, float loadFactor) {
+ public GridCacheConcurrentMap(GridCacheContext ctx,
+ int initCap,
+ float loadFactor,
+ @Nullable GridCacheMapEntryFactory factory) {
this(ctx, initCap, loadFactor, DFLT_CONCUR_LEVEL);
+
+ this.factory = factory;
}
/**
@@ -312,6 +318,13 @@ public class GridCacheConcurrentMap {
}
/**
+ * @return Entries factory.
+ */
+ public GridCacheMapEntryFactory getEntryFactory() {
+ return factory;
+ }
+
+ /**
* @return Non-internal predicate.
*/
private static CacheEntryPredicate[] nonInternal() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/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 f2beb0a..a3c8da6 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
@@ -22,8 +22,12 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
import org.jetbrains.annotations.*;
+import javax.cache.*;
+import java.util.concurrent.atomic.*;
+
/**
* Cache gateway.
*/
@@ -33,7 +37,10 @@ public class GridCacheGateway<K, V> {
private final GridCacheContext<K, V> ctx;
/** Stopped flag for dynamic caches. */
- private volatile boolean stopped;
+ private final AtomicReference<State> state = new AtomicReference<>(State.STARTED);
+
+ /** */
+ private IgniteFuture<?> reconnectFut;
/** */
private GridSpinReadWriteLock rwLock = new GridSpinReadWriteLock();
@@ -56,11 +63,36 @@ public class GridCacheGateway<K, V> {
rwLock.readLock();
- if (stopped) {
- rwLock.readUnlock();
+ checkState(true, true);
+ }
- throw new IllegalStateException("Dynamic cache has been stopped: " + ctx.name());
+ /**
+ * @param lock {@code True} if lock is held.
+ * @param stopErr {@code True} if throw exception if stopped.
+ * @return {@code True} if cache is in started state.
+ */
+ private boolean checkState(boolean lock, boolean stopErr) {
+ State state = this.state.get();
+
+ if (state != State.STARTED) {
+ if (lock)
+ rwLock.readUnlock();
+
+ if (state == State.STOPPED) {
+ if (stopErr)
+ throw new IllegalStateException("Cache has been stopped: " + ctx.name());
+ else
+ return false;
+ }
+ else {
+ assert reconnectFut != null;
+
+ throw new CacheException(
+ new IgniteClientDisconnectedException(reconnectFut, "Client node disconnected: " + ctx.gridName()));
+ }
}
+
+ return true;
}
/**
@@ -71,17 +103,11 @@ public class GridCacheGateway<K, V> {
public boolean enterIfNotStopped() {
onEnter();
- // Must unlock in case of unexpected errors to avoid
- // deadlocks during kernal stop.
+ // Must unlock in case of unexpected errors to avoid deadlocks during kernal stop.
rwLock.readLock();
- if (stopped) {
- rwLock.readUnlock();
-
- return false;
- }
+ return checkState(true, false);
- return true;
}
/**
@@ -92,7 +118,7 @@ public class GridCacheGateway<K, V> {
public boolean enterIfNotStoppedNoLock() {
onEnter();
- return !stopped;
+ return checkState(false, false);
}
/**
@@ -144,11 +170,7 @@ public class GridCacheGateway<K, V> {
rwLock.readLock();
- if (stopped) {
- rwLock.readUnlock();
-
- throw new IllegalStateException("Cache has been stopped: " + ctx.name());
- }
+ checkState(true, true);
// Must unlock in case of unexpected errors to avoid
// deadlocks during kernal stop.
@@ -169,8 +191,7 @@ public class GridCacheGateway<K, V> {
@Nullable public CacheOperationContext enterNoLock(@Nullable CacheOperationContext opCtx) {
onEnter();
- if (stopped)
- throw new IllegalStateException("Cache has been stopped: " + ctx.name());
+ checkState(false, false);
return setOperationContextPerCall(opCtx);
}
@@ -229,8 +250,42 @@ public class GridCacheGateway<K, V> {
/**
*
*/
- public void block() {
- stopped = true;
+ public void stopped() {
+ state.set(State.STOPPED);
+ }
+
+ /**
+ * @param reconnectFut Reconnect future.
+ */
+ public void onDisconnected(IgniteFuture<?> reconnectFut) {
+ assert reconnectFut != null;
+
+ this.reconnectFut = reconnectFut;
+
+ state.compareAndSet(State.STARTED, State.DISCONNECTED);
+ }
+
+ /**
+ *
+ */
+ public void writeLock(){
+ rwLock.writeLock();
+ }
+
+ /**
+ *
+ */
+ public void writeUnlock() {
+ rwLock.writeUnlock();
+ }
+
+ /**
+ * @param stopped Cache stopped flag.
+ */
+ public void reconnected(boolean stopped) {
+ State newState = stopped ? State.STOPPED : State.STARTED;
+
+ state.compareAndSet(State.DISCONNECTED, newState);
}
/**
@@ -256,11 +311,24 @@ public class GridCacheGateway<K, V> {
Thread.currentThread().interrupt();
try {
- // No-op.
- stopped = true;
+ state.set(State.STOPPED);
}
finally {
rwLock.writeUnlock();
}
}
+
+ /**
+ *
+ */
+ private enum State {
+ /** */
+ STARTED,
+
+ /** */
+ DISCONNECTED,
+
+ /** */
+ STOPPED
+ }
}
[16/50] [abbrv] incubator-ignite git commit: release notes + minor
Posted by av...@apache.org.
release notes + minor
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/10c8a71b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/10c8a71b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/10c8a71b
Branch: refs/heads/ignite-630
Commit: 10c8a71b9aba311eb96367a6836e2e1420cf640d
Parents: d5ed494
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jul 14 16:41:27 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jul 14 16:41:27 2015 +0300
----------------------------------------------------------------------
.../org/apache/ignite/plugin/security/SecuritySubjectType.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/10c8a71b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubjectType.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubjectType.java b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubjectType.java
index 2170807..f625a3a 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubjectType.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/security/SecuritySubjectType.java
@@ -17,6 +17,7 @@
package org.apache.ignite.plugin.security;
+import org.apache.ignite.cluster.*;
import org.jetbrains.annotations.*;
/**
@@ -24,7 +25,7 @@ import org.jetbrains.annotations.*;
*/
public enum SecuritySubjectType {
/**
- * Subject type for a remote {@link org.apache.ignite.cluster.ClusterNode}.
+ * Subject type for a remote {@link ClusterNode}.
*/
REMOTE_NODE,
[19/50] [abbrv] incubator-ignite git commit: # master - javadoc fix.
Posted by av...@apache.org.
# master - 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/bc036fe5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/bc036fe5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/bc036fe5
Branch: refs/heads/ignite-630
Commit: bc036fe507e189ede3c0a5cd3d3fdbcaa17b30fe
Parents: b19ed0c
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Tue Jul 14 16:24:58 2015 -0700
Committer: Dmitiry Setrakyan <ds...@gridgain.com>
Committed: Tue Jul 14 16:24:58 2015 -0700
----------------------------------------------------------------------
.../apache/ignite/cache/CacheTypeMetadata.java | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc036fe5/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
index 20129b7..1090b0b 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheTypeMetadata.java
@@ -43,11 +43,11 @@ public class CacheTypeMetadata implements Serializable {
/** Value class used to store value in cache. */
private String valType;
- /** Key fields. */
+ /** Persistent key fields. */
@GridToStringInclude
private Collection<CacheTypeFieldMetadata> keyFields;
- /** Value fields . */
+ /** Persistent value fields . */
@GridToStringInclude
private Collection<CacheTypeFieldMetadata> valFields;
@@ -208,36 +208,36 @@ public class CacheTypeMetadata implements Serializable {
}
/**
- * Gets key fields.
+ * Gets persistent key fields.
*
- * @return Key fields.
+ * @return Persistent key fields.
*/
public Collection<CacheTypeFieldMetadata> getKeyFields() {
return keyFields;
}
/**
- * Sets key fields.
+ * Sets persistent key fields.
*
- * @param keyFields New key fields.
+ * @param keyFields Persistent key fields.
*/
public void setKeyFields(Collection<CacheTypeFieldMetadata> keyFields) {
this.keyFields = keyFields;
}
/**
- * Gets value fields.
+ * Gets persistent value fields.
*
- * @return Value fields.
+ * @return Persistent value fields.
*/
public Collection<CacheTypeFieldMetadata> getValueFields() {
return valFields;
}
/**
- * Sets value fields.
+ * Sets persistent value fields.
*
- * @param valFields New value fields.
+ * @param valFields Persistent value fields.
*/
public void setValueFields(Collection<CacheTypeFieldMetadata> valFields) {
this.valFields = valFields;
[44/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/master'
Posted by av...@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/dd246e54
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dd246e54
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dd246e54
Branch: refs/heads/ignite-630
Commit: dd246e5489834b6e6d012bfdf6dc0577aae0af30
Parents: 700600d 57ac2b3
Author: Anton Vinogradov <av...@gridgain.com>
Authored: Thu Jul 16 13:17:06 2015 +0300
Committer: Anton Vinogradov <av...@gridgain.com>
Committed: Thu Jul 16 13:17:06 2015 +0300
----------------------------------------------------------------------
.../IgniteClientDisconnectedException.java | 61 +
.../java/org/apache/ignite/IgniteCluster.java | 5 +
.../apache/ignite/internal/GridComponent.java | 18 +
.../ignite/internal/GridJobSiblingImpl.java | 2 +-
.../ignite/internal/GridKernalContext.java | 5 +
.../ignite/internal/GridKernalContextImpl.java | 31 +-
.../ignite/internal/GridKernalGateway.java | 46 +-
.../ignite/internal/GridKernalGatewayImpl.java | 85 +-
.../apache/ignite/internal/GridKernalState.java | 3 +
.../ignite/internal/GridPluginComponent.java | 11 +
...gniteClientDisconnectedCheckedException.java | 49 +
.../apache/ignite/internal/IgniteKernal.java | 222 +++-
.../cluster/IgniteClusterAsyncImpl.java | 5 +
.../internal/cluster/IgniteClusterImpl.java | 18 +
.../internal/managers/GridManagerAdapter.java | 19 +-
.../deployment/GridDeploymentCommunication.java | 2 +-
.../deployment/GridDeploymentManager.java | 95 +-
.../discovery/GridDiscoveryManager.java | 163 ++-
.../processors/GridProcessorAdapter.java | 11 +
.../affinity/GridAffinityAssignmentCache.java | 26 +-
.../cache/CacheOsConflictResolutionManager.java | 6 +
.../cache/DynamicCacheChangeBatch.java | 17 +
.../processors/cache/GridCacheAdapter.java | 25 +-
.../cache/GridCacheAffinityManager.java | 21 +-
.../cache/GridCacheConcurrentMap.java | 15 +-
.../processors/cache/GridCacheGateway.java | 116 +-
.../processors/cache/GridCacheIoManager.java | 8 +
.../processors/cache/GridCacheManager.java | 6 +
.../cache/GridCacheManagerAdapter.java | 6 +
.../processors/cache/GridCacheMvccManager.java | 41 +-
.../GridCachePartitionExchangeManager.java | 81 +-
.../processors/cache/GridCachePreloader.java | 5 +
.../cache/GridCachePreloaderAdapter.java | 5 +
.../processors/cache/GridCacheProcessor.java | 311 ++++-
.../cache/GridCacheSharedContext.java | 113 +-
.../cache/GridCacheSharedManager.java | 11 +-
.../cache/GridCacheSharedManagerAdapter.java | 20 +-
.../processors/cache/GridCacheUtils.java | 11 +
.../processors/cache/IgniteCacheFutureImpl.java | 5 +
.../processors/cache/IgniteCacheProxy.java | 2 +-
.../CacheDataStructuresManager.java | 35 +
.../distributed/GridCacheTxFinishSync.java | 46 +
.../distributed/dht/GridDhtCacheAdapter.java | 14 +-
.../dht/GridDhtPartitionTopologyImpl.java | 24 +
.../dht/GridPartitionedGetFuture.java | 13 +-
.../dht/preloader/GridDhtPreloader.java | 16 +-
.../distributed/near/GridNearCacheAdapter.java | 8 +
.../distributed/near/GridNearGetFuture.java | 13 +-
.../cache/dr/GridOsCacheDrManager.java | 7 +-
.../query/GridCacheDistributedQueryManager.java | 22 +
.../cache/query/GridCacheQueryAdapter.java | 11 +-
.../query/GridCacheQueryFutureAdapter.java | 2 +-
.../continuous/CacheContinuousQueryHandler.java | 5 +
.../transactions/IgniteTransactionsImpl.java | 59 +-
.../cache/transactions/IgniteTxManager.java | 19 +-
.../transactions/TransactionProxyImpl.java | 2 +-
.../cache/version/GridCacheVersionManager.java | 9 +-
.../clock/GridClockSyncProcessor.java | 6 +-
.../processors/cluster/ClusterProcessor.java | 11 +
.../continuous/GridContinuousHandler.java | 9 +-
.../continuous/GridContinuousProcessor.java | 127 +-
.../datastreamer/DataStreamProcessor.java | 24 +-
.../datastreamer/DataStreamerImpl.java | 90 +-
.../datastructures/DataStructuresProcessor.java | 33 +-
.../datastructures/GridCacheAtomicLongImpl.java | 33 +-
.../GridCacheAtomicReferenceImpl.java | 34 +-
.../GridCacheAtomicSequenceImpl.java | 33 +-
.../GridCacheAtomicStampedImpl.java | 33 +-
.../GridCacheCountDownLatchImpl.java | 51 +-
.../datastructures/GridCacheRemovable.java | 6 +-
.../datastructures/GridCacheSetImpl.java | 15 +-
.../datastructures/GridCacheSetProxy.java | 47 +-
.../processors/job/GridJobProcessor.java | 2 +-
.../internal/processors/job/GridJobWorker.java | 2 +-
.../processors/query/GridQueryIndexing.java | 7 +
.../processors/query/GridQueryProcessor.java | 6 +
.../service/GridServiceProcessor.java | 45 +-
.../processors/service/GridServiceProxy.java | 13 +-
.../processors/task/GridTaskProcessor.java | 55 +-
.../processors/task/GridTaskWorker.java | 59 +-
.../ignite/internal/util/IgniteUtils.java | 28 +
.../shmem/IpcSharedMemoryClientEndpoint.java | 5 +-
.../ignite/internal/util/lang/GridFunc.java | 2 +
.../java/org/apache/ignite/spi/IgniteSpi.java | 15 +
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 37 +-
.../communication/tcp/TcpCommunicationSpi.java | 354 ++++--
.../spi/discovery/DiscoverySpiDataExchange.java | 3 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 408 ++++--
.../ignite/spi/discovery/tcp/ServerImpl.java | 134 +-
.../spi/discovery/tcp/TcpDiscoveryImpl.java | 9 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 33 +-
.../tcp/internal/TcpDiscoveryNode.java | 19 +
.../messages/TcpDiscoveryAbstractMessage.java | 3 +
.../messages/TcpDiscoveryClientAckResponse.java | 64 +
.../messages/TcpDiscoveryHandshakeResponse.java | 14 +
.../spi/swapspace/file/FileSwapSpaceSpi.java | 2 +-
.../internal/GridUpdateNotifierSelfTest.java | 15 +-
.../IgniteClientReconnectAbstractTest.java | 363 ++++++
.../IgniteClientReconnectApiExceptionTest.java | 846 ++++++++++++
.../IgniteClientReconnectAtomicsTest.java | 672 ++++++++++
.../IgniteClientReconnectCacheTest.java | 1202 ++++++++++++++++++
.../IgniteClientReconnectCollectionsTest.java | 443 +++++++
.../IgniteClientReconnectComputeTest.java | 192 +++
...eClientReconnectContinuousProcessorTest.java | 372 ++++++
...IgniteClientReconnectDiscoveryStateTest.java | 123 ++
...niteClientReconnectFailoverAbstractTest.java | 231 ++++
.../IgniteClientReconnectFailoverTest.java | 212 +++
.../IgniteClientReconnectServicesTest.java | 260 ++++
.../internal/IgniteClientReconnectStopTest.java | 106 ++
.../IgniteClientReconnectStreamerTest.java | 233 ++++
.../IgniteSlowClientDetectionSelfTest.java | 1 +
.../GridDeploymentManagerStopSelfTest.java | 7 +
.../IgniteCacheAbstractStopBusySelfTest.java | 2 +-
.../cache/IgniteCacheDynamicStopSelfTest.java | 6 +-
.../IgniteTxExceptionAbstractSelfTest.java | 1 +
.../IgniteCacheSystemTransactionsSelfTest.java | 2 +-
.../GridCacheReplicatedInvalidateSelfTest.java | 3 +-
.../loadtests/hashmap/GridCacheTestContext.java | 4 +-
.../tcp/TcpClientDiscoverySpiSelfTest.java | 562 +++++++-
.../multijvm/IgniteClusterProcessProxy.java | 5 +
.../IgniteClientReconnectTestSuite.java | 48 +
.../processors/query/h2/IgniteH2Indexing.java | 5 +
.../query/h2/twostep/GridMergeIndex.java | 45 +-
.../h2/twostep/GridReduceQueryExecutor.java | 70 +-
...ClientReconnectCacheQueriesFailoverTest.java | 225 ++++
.../cache/IgniteClientReconnectQueriesTest.java | 427 +++++++
...dCacheAbstractReduceFieldsQuerySelfTest.java | 4 +
.../IgniteCacheWithIndexingTestSuite.java | 1 +
128 files changed, 9751 insertions(+), 815 deletions(-)
----------------------------------------------------------------------
[38/50] [abbrv] incubator-ignite git commit: # ignite-901 client
reconnect support
Posted by av...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectApiExceptionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectApiExceptionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectApiExceptionTest.java
new file mode 100644
index 0000000..37773cd
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectApiExceptionTest.java
@@ -0,0 +1,846 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+import org.apache.ignite.resources.*;
+import org.apache.ignite.testframework.*;
+
+import javax.cache.*;
+import javax.cache.processor.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+import static java.util.concurrent.TimeUnit.*;
+import static org.apache.ignite.events.EventType.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectApiExceptionTest extends IgniteClientReconnectAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ cfg.setCacheConfiguration(new CacheConfiguration());
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int serverCount() {
+ return 1;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testErrorOnDisconnect() throws Exception {
+ // Check cache operations.
+ cacheOperationsTest();
+
+ // Check cache operations.
+ beforeTestsStarted();
+ dataStructureOperationsTest();
+
+ // Check ignite operations.
+ beforeTestsStarted();
+ igniteOperationsTest();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ @SuppressWarnings("unchecked")
+ public void dataStructureOperationsTest() throws Exception {
+ clientMode = true;
+
+ final Ignite client = startGrid(serverCount());
+
+ doTestIgniteOperationOnDisconnect(client, Arrays.asList(
+ // Check atomic long.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ client.atomicLong("testAtomic", 41, true);
+ }
+ catch (IgniteClientDisconnectedException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return client.atomicLong("testAtomic", 41, true);
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ assertNotNull(o);
+
+ IgniteAtomicLong atomicLong = (IgniteAtomicLong)o;
+
+ assertEquals(42, atomicLong.incrementAndGet());
+
+ return true;
+ }
+ }
+ ),
+ // Check set.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ client.set("testSet", new CollectionConfiguration());
+ }
+ catch (IgniteClientDisconnectedException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return client.set("testSet", new CollectionConfiguration());
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ assertNotNull(o);
+
+ IgniteSet set = (IgniteSet)o;
+
+ String val = "testVal";
+
+ set.add(val);
+
+ assertEquals(1, set.size());
+ assertTrue(set.contains(val));
+
+ return true;
+ }
+ }
+ ),
+ // Check ignite queue.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ client.queue("TestQueue", 10, new CollectionConfiguration());
+ }
+ catch (IgniteClientDisconnectedException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return client.queue("TestQueue", 10, new CollectionConfiguration());
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ assertNotNull(o);
+
+ IgniteQueue queue = (IgniteQueue)o;
+
+ String val = "Test";
+
+ queue.add(val);
+
+ assertEquals(val, queue.poll());
+
+ return true;
+ }
+ }
+ )
+ ));
+
+ clientMode = false;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ @SuppressWarnings("unchecked")
+ public void cacheOperationsTest() throws Exception {
+ clientMode = true;
+
+ final Ignite client = startGrid(serverCount());
+
+ final IgniteCache<Object, Object> dfltCache = client.cache(null);
+
+ assertNotNull(dfltCache);
+
+ doTestIgniteOperationOnDisconnect(client, Arrays.asList(
+ // Check put and get operation.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ dfltCache.getAndPut(9999, 9999);
+ }
+ catch (CacheException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return dfltCache.getAndPut(9999, 9999);
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ assertNull(o);
+
+ assertEquals(9999, dfltCache.get(9999));
+
+ return true;
+ }
+ }
+ ),
+ // Check put operation.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ dfltCache.put(10000, 10000);
+ }
+ catch (CacheException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ dfltCache.put(10000, 10000);
+
+ return true;
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ assertTrue((Boolean)o);
+
+ assertEquals(10000, dfltCache.get(10000));
+
+ return true;
+ }
+ }
+ ),
+ // Check get operation.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ dfltCache.get(10001);
+ }
+ catch (CacheException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return dfltCache.get(10001);
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ assertNull(o);
+
+ return true;
+ }
+ }
+ ),
+ // Check invoke operation.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ dfltCache.invoke(10000, new CacheEntryProcessor<Object, Object, Object>() {
+ @Override public Object process(MutableEntry<Object, Object> entry,
+ Object... arguments) throws EntryProcessorException {
+ assertTrue(entry.exists());
+
+ return (int)entry.getValue() * 2;
+ }
+ });
+ }
+ catch (CacheException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return dfltCache.invoke(10000, new CacheEntryProcessor<Object, Object, Object>() {
+ @Override public Object process(MutableEntry<Object, Object> entry,
+ Object... arguments) throws EntryProcessorException {
+ assertTrue(entry.exists());
+
+ return (int)entry.getValue() * 2;
+ }
+ });
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ assertNotNull(o);
+
+ assertEquals(20000, (int)o);
+
+ return true;
+ }
+ }
+ ),
+ // Check put async operation.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ IgniteCache<Object, Object> async = dfltCache.withAsync();
+
+ boolean failed = false;
+
+ try {
+ async.put(10002, 10002);
+
+ async.future().get();
+ }
+ catch (CacheException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ async.put(10002, 10002);
+
+ return async.future().get();
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ assertNull(o);
+
+ assertEquals(10002, dfltCache.get(10002));
+
+ return true;
+ }
+ }
+ ),
+ // Check transaction.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ client.transactions();
+ }
+ catch (IgniteClientDisconnectedException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return client.transactions();
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ IgniteTransactions txs = (IgniteTransactions)o;
+
+ assertNotNull(txs);
+
+ return true;
+ }
+ }
+ ),
+ // Check get cache.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ client.cache(null);
+ }
+ catch (IgniteClientDisconnectedException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return client.cache(null);
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ IgniteCache<Object, Object> cache0 = (IgniteCache<Object, Object>)o;
+
+ assertNotNull(cache0);
+
+ cache0.put(1, 1);
+
+ assertEquals(1, cache0.get(1));
+
+ return true;
+ }
+ }
+ ),
+ // Check streamer.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ client.dataStreamer(null);
+ }
+ catch (IgniteClientDisconnectedException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return client.dataStreamer(null);
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ IgniteDataStreamer<Object, Object> streamer = (IgniteDataStreamer<Object, Object>)o;
+
+ streamer.addData(2, 2);
+
+ streamer.close();
+
+ assertEquals(2, client.cache(null).get(2));
+
+ return true;
+ }
+ }
+ ),
+ // Check create cache.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ client.createCache("test_cache");
+ }
+ catch (IgniteClientDisconnectedException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return client.createCache("test_cache");
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ IgniteCache<Object, Object> cache = (IgniteCache<Object, Object>)o;
+
+ assertNotNull(cache);
+
+ cache.put(1, 1);
+
+ assertEquals(1, cache.get(1));
+
+ return true;
+ }
+ }
+ )
+
+ ));
+
+ clientMode = false;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ @SuppressWarnings("unchecked")
+ public void igniteOperationsTest() throws Exception {
+ clientMode = true;
+
+ final Ignite client = startGrid(serverCount());
+
+ final IgniteCache<Object, Object> dfltCache = client.cache(null);
+
+ final CountDownLatch recvLatch = new CountDownLatch(1);
+
+ assertNotNull(dfltCache);
+
+ doTestIgniteOperationOnDisconnect(client, Arrays.asList(
+ // Check compute.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ client.compute();
+ }
+ catch (IgniteClientDisconnectedException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return client.compute();
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ IgniteCompute comp = (IgniteCompute)o;
+
+ Collection<UUID> uuids = comp.broadcast(new IgniteCallable<UUID>() {
+ @IgniteInstanceResource
+ private Ignite ignite;
+
+ @Override public UUID call() throws Exception {
+ return ignite.cluster().localNode().id();
+ }
+ });
+
+ assertFalse(uuids.isEmpty());
+
+ for (UUID uuid : uuids)
+ assertNotNull(uuid);
+
+ return true;
+ }
+ }
+ ),
+
+ // Check ping node.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ client.cluster().pingNode(new UUID(0, 0));
+ }
+ catch (IgniteClientDisconnectedException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return client.cluster().pingNode(new UUID(0, 0));
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ Boolean pingNode = (Boolean)o;
+
+ assertFalse(pingNode);
+
+ return true;
+ }
+ }
+ ),
+ // Check register remote listener.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ client.events().remoteListen(null, new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event event) {
+ return true;
+ }
+ });
+ }
+ catch (IgniteClientDisconnectedException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return client.events().remoteListen(null, new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event event) {
+ return true;
+ }
+ });
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ UUID remoteId = (UUID)o;
+
+ assertNotNull(remoteId);
+
+ client.events().stopRemoteListen(remoteId);
+
+ return true;
+ }
+ }
+ ),
+ // Check message operation.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ client.message().remoteListen(null, new IgniteBiPredicate<UUID, Object>() {
+ @Override public boolean apply(UUID uuid, Object o) {
+ if (o.equals("Test message."))
+ recvLatch.countDown();
+
+ return true;
+ }
+ });
+ }
+ catch (IgniteClientDisconnectedException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return client.message().remoteListen(null, new IgniteBiPredicate<UUID, Object>() {
+ @Override public boolean apply(UUID uuid, Object o) {
+ if (o.equals("Test message."))
+ recvLatch.countDown();
+
+ return true;
+ }
+ });
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ assertNotNull(o);
+
+ IgniteMessaging msg = client.message();
+
+ msg.send(null, "Test message.");
+
+ try {
+ assertTrue(recvLatch.await(2, SECONDS));
+ }
+ catch (InterruptedException e) {
+ fail("Message wasn't received.");
+ }
+
+ return true;
+ }
+ }
+ ),
+ // Check executor.
+ new T2<Callable, C1<Object, Boolean>>(
+ new Callable() {
+ @Override public Object call() throws Exception {
+ boolean failed = false;
+
+ try {
+ client.executorService().submit(new Callable<Integer>() {
+ @Override public Integer call() throws Exception {
+ return 42;
+ }
+ });
+ }
+ catch (IgniteClientDisconnectedException e) {
+ failed = true;
+
+ checkAndWait(e);
+ }
+
+ assertTrue(failed);
+
+ return client.executorService().submit(new Callable<Integer>() {
+ @Override public Integer call() throws Exception {
+ return 42;
+ }
+ });
+ }
+ },
+ new C1<Object, Boolean>() {
+ @Override public Boolean apply(Object o) {
+ assertNotNull(o);
+
+ Future<Integer> fut = (Future<Integer>)o;
+
+ try {
+ assertEquals(42, (int)fut.get());
+ }
+ catch (Exception e) {
+ fail("Failed submit task.");
+ }
+
+ return true;
+ }
+ }
+ )
+ ));
+
+ clientMode = false;
+ }
+
+ /**
+ * @param client Client.
+ * @param ops Operations closures.
+ * @throws Exception If failed.
+ */
+ @SuppressWarnings("unchecked")
+ private void doTestIgniteOperationOnDisconnect(Ignite client, final List<T2<Callable, C1<Object, Boolean>>> ops)
+ throws Exception {
+ assertNotNull(client.cache(null));
+
+ final TestTcpDiscoverySpi clientSpi = spi(client);
+
+ Ignite srv = clientRouter(client);
+
+ TestTcpDiscoverySpi srvSpi = spi(srv);
+
+ final CountDownLatch disconnectLatch = new CountDownLatch(1);
+
+ final CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+ log.info("Block reconnect.");
+
+ clientSpi.writeLatch = new CountDownLatch(1);
+
+ final List<IgniteInternalFuture> futs = new ArrayList<>();
+
+ client.events().localListen(new IgnitePredicate<Event>() {
+ @Override public boolean apply(Event evt) {
+ if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+ info("Disconnected: " + evt);
+
+ assertEquals(1, reconnectLatch.getCount());
+
+ for (T2<Callable, C1<Object, Boolean>> op : ops)
+ futs.add(GridTestUtils.runAsync(op.get1()));
+
+ disconnectLatch.countDown();
+ }
+ else if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+ info("Reconnected: " + evt);
+
+ reconnectLatch.countDown();
+ }
+
+ return true;
+ }
+ }, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED);
+
+ try {
+ log.info("Fail client.");
+
+ srvSpi.failNode(client.cluster().localNode().id(), null);
+
+ waitReconnectEvent(disconnectLatch);
+
+ assertEquals(ops.size(), futs.size());
+
+ for (IgniteInternalFuture<?> fut : futs)
+ assertNotDone(fut);
+
+ U.sleep(2000);
+
+ for (IgniteInternalFuture<?> fut : futs)
+ assertNotDone(fut);
+
+ log.info("Allow reconnect.");
+
+ clientSpi.writeLatch.countDown();
+
+ waitReconnectEvent(reconnectLatch);
+
+ // Check operation after reconnect working.
+ for (int i = 0; i < futs.size(); i++) {
+ final int i0 = i;
+
+ try {
+ final Object futRes = futs.get(i0).get(2, SECONDS);
+
+ assertTrue(GridTestUtils.runAsync(new Callable<Boolean>() {
+ @Override public Boolean call() throws Exception {
+ return ops.get(i0).get2().apply(futRes);
+ }
+ }).get(2, SECONDS));
+ }
+ catch (IgniteFutureTimeoutCheckedException e) {
+ e.printStackTrace();
+
+ fail("Operation timeout. Iteration: " + i + ".");
+ }
+ }
+ }
+ finally {
+ clientSpi.writeLatch.countDown();
+
+ for (IgniteInternalFuture fut : futs)
+ fut.cancel();
+
+ stopAllGrids();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/57ac2b3b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAtomicsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAtomicsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAtomicsTest.java
new file mode 100644
index 0000000..bb568ab
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectAtomicsTest.java
@@ -0,0 +1,672 @@
+/*
+ * 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;
+
+import org.apache.ignite.*;
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+import org.apache.ignite.testframework.*;
+
+import java.util.concurrent.*;
+
+/**
+ *
+ */
+public class IgniteClientReconnectAtomicsTest extends IgniteClientReconnectAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected int serverCount() {
+ return 1;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected int clientCount() {
+ return 1;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicSeqReconnect() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ IgniteAtomicSequence clientAtomicSeq = client.atomicSequence("atomicSeq", 0, true);
+
+ assertEquals(1L, clientAtomicSeq.incrementAndGet());
+
+ final IgniteAtomicSequence srvAtomicSeq = srv.atomicSequence("atomicSeq", 0, false);
+
+ assertEquals(1001L, srvAtomicSeq.incrementAndGet());
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ assertEquals(1002L, srvAtomicSeq.incrementAndGet());
+ }
+ });
+
+ assertEquals(2L, clientAtomicSeq.incrementAndGet());
+
+ assertEquals(1003L, srvAtomicSeq.incrementAndGet());
+
+ assertEquals(3L, clientAtomicSeq.incrementAndGet());
+
+ clientAtomicSeq.close();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicSeqReconnectRemoved() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ final IgniteAtomicSequence clientAtomicSeq = client.atomicSequence("atomicSeqRmv", 0, true);
+
+ clientAtomicSeq.batchSize(1);
+
+ assertEquals(1L, clientAtomicSeq.incrementAndGet());
+
+ final IgniteAtomicSequence srvAtomicSeq = srv.atomicSequence("atomicSeqRmv", 0, false);
+
+ srvAtomicSeq.batchSize(1);
+
+ assertEquals(1001L, srvAtomicSeq.incrementAndGet());
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ srvAtomicSeq.close();
+
+ assert srvAtomicSeq.removed();
+ }
+ });
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ for (int i = 0; i < 2000; i++)
+ clientAtomicSeq.incrementAndGet();
+
+ return null;
+ }
+ }, IllegalStateException.class, null);
+
+ IgniteAtomicSequence newClientAtomicSeq = client.atomicSequence("atomicSeqRmv", 0, true);
+
+ assertEquals(0, newClientAtomicSeq.get());
+
+ assertEquals(1, newClientAtomicSeq.incrementAndGet());
+
+ newClientAtomicSeq.close();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicSeqReconnectInProgress() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ BlockTpcCommunicationSpi commSpi = commSpi(srv);
+
+ final IgniteAtomicSequence clientAtomicSeq = client.atomicSequence("atomicSeqInProg", 0, true);
+
+ clientAtomicSeq.batchSize(1);
+
+ final IgniteAtomicSequence srvAtomicSeq = srv.atomicSequence("atomicSeqInProg", 0, false);
+
+ srvAtomicSeq.batchSize(1);
+
+ commSpi.blockMessage(GridNearLockResponse.class);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ for (int i = 0; i < 3000; i++) {
+ try {
+ clientAtomicSeq.incrementAndGet();
+ }
+ catch (IgniteClientDisconnectedException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ commSpi.unblockMessage();
+
+ reconnectClientNode(client, srv, null);
+
+ assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
+
+ // Check that after reconnect working.
+ assert clientAtomicSeq.incrementAndGet() >= 0;
+ assert srvAtomicSeq.incrementAndGet() >= 0;
+
+ clientAtomicSeq.close();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicReferenceReconnect() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ IgniteAtomicReference<String> clientAtomicRef = client.atomicReference("atomicRef", "1st value", true);
+
+ assertEquals("1st value", clientAtomicRef.get());
+ assertTrue(clientAtomicRef.compareAndSet("1st value", "2st value"));
+ assertEquals("2st value", clientAtomicRef.get());
+
+ final IgniteAtomicReference<String> srvAtomicRef = srv.atomicReference("atomicRef", "1st value", false);
+
+ assertEquals("2st value", srvAtomicRef.get());
+ assertTrue(srvAtomicRef.compareAndSet("2st value", "3st value"));
+ assertEquals("3st value", srvAtomicRef.get());
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ assertEquals("3st value", srvAtomicRef.get());
+ assertTrue(srvAtomicRef.compareAndSet("3st value", "4st value"));
+ assertEquals("4st value", srvAtomicRef.get());
+ }
+ });
+
+ assertEquals("4st value", clientAtomicRef.get());
+ assertTrue(clientAtomicRef.compareAndSet("4st value", "5st value"));
+ assertEquals("5st value", clientAtomicRef.get());
+
+ assertEquals("5st value", srvAtomicRef.get());
+ assertTrue(srvAtomicRef.compareAndSet("5st value", "6st value"));
+ assertEquals("6st value", srvAtomicRef.get());
+
+ srvAtomicRef.close();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicReferenceReconnectRemoved() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ final IgniteAtomicReference<String> clientAtomicRef =
+ client.atomicReference("atomicRefRemoved", "1st value", true);
+
+ assertEquals("1st value", clientAtomicRef.get());
+ assertTrue(clientAtomicRef.compareAndSet("1st value", "2st value"));
+ assertEquals("2st value", clientAtomicRef.get());
+
+ final IgniteAtomicReference<String> srvAtomicRef = srv.atomicReference("atomicRefRemoved", "1st value", false);
+
+ assertEquals("2st value", srvAtomicRef.get());
+ assertTrue(srvAtomicRef.compareAndSet("2st value", "3st value"));
+ assertEquals("3st value", srvAtomicRef.get());
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ srvAtomicRef.close();
+ }
+ });
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ clientAtomicRef.compareAndSet("3st value", "4st value");
+
+ return null;
+ }
+ }, IllegalStateException.class, null);
+
+ IgniteAtomicReference<String> newClientAtomicRef =
+ client.atomicReference("atomicRefRemoved", "1st value", true);
+
+ IgniteAtomicReference<String> newSrvAtomicRef = srv.atomicReference("atomicRefRemoved", "1st value", false);
+
+ assertEquals("1st value", newClientAtomicRef.get());
+ assertTrue(newClientAtomicRef.compareAndSet("1st value", "2st value"));
+ assertEquals("2st value", newClientAtomicRef.get());
+
+ assertEquals("2st value", newSrvAtomicRef.get());
+ assertTrue(newSrvAtomicRef.compareAndSet("2st value", "3st value"));
+ assertEquals("3st value", newSrvAtomicRef.get());
+
+ newClientAtomicRef.close();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicReferenceReconnectInProgress() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ final IgniteAtomicReference<String> clientAtomicRef =
+ client.atomicReference("atomicRefInProg", "1st value", true);
+
+ assertEquals("1st value", clientAtomicRef.get());
+ assertTrue(clientAtomicRef.compareAndSet("1st value", "2st value"));
+ assertEquals("2st value", clientAtomicRef.get());
+
+ IgniteAtomicReference<String> srvAtomicRef = srv.atomicReference("atomicRefInProg", "1st value", false);
+
+ assertEquals("2st value", srvAtomicRef.get());
+ assertTrue(srvAtomicRef.compareAndSet("2st value", "3st value"));
+ assertEquals("3st value", srvAtomicRef.get());
+
+ BlockTpcCommunicationSpi servCommSpi = commSpi(srv);
+
+ servCommSpi.blockMessage(GridNearLockResponse.class);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ clientAtomicRef.compareAndSet("3st value", "4st value");
+ }
+ catch (IgniteClientDisconnectedException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ servCommSpi.unblockMessage();
+
+ reconnectClientNode(client, srv, null);
+
+ assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
+
+ // Check that after reconnect working.
+ assertEquals("3st value", clientAtomicRef.get());
+ assertTrue(clientAtomicRef.compareAndSet("3st value", "4st value"));
+ assertEquals("4st value", clientAtomicRef.get());
+
+ assertEquals("4st value", srvAtomicRef.get());
+ assertTrue(srvAtomicRef.compareAndSet("4st value", "5st value"));
+ assertEquals("5st value", srvAtomicRef.get());
+
+ srvAtomicRef.close();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicStampedReconnect() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ IgniteAtomicStamped clientAtomicStamped = client.atomicStamped("atomicStamped", 0, 0, true);
+
+ assertEquals(true, clientAtomicStamped.compareAndSet(0, 1, 0, 1));
+ assertEquals(1, clientAtomicStamped.value());
+ assertEquals(1, clientAtomicStamped.stamp());
+
+ final IgniteAtomicStamped srvAtomicStamped = srv.atomicStamped("atomicStamped", 0, 0, false);
+
+ assertEquals(true, srvAtomicStamped.compareAndSet(1, 2, 1, 2));
+ assertEquals(2, srvAtomicStamped.value());
+ assertEquals(2, srvAtomicStamped.stamp());
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ assertEquals(true, srvAtomicStamped.compareAndSet(2, 3, 2, 3));
+ assertEquals(3, srvAtomicStamped.value());
+ assertEquals(3, srvAtomicStamped.stamp());
+ }
+ });
+
+ assertEquals(true, clientAtomicStamped.compareAndSet(3, 4, 3, 4));
+ assertEquals(4, clientAtomicStamped.value());
+ assertEquals(4, clientAtomicStamped.stamp());
+
+ assertEquals(true, srvAtomicStamped.compareAndSet(4, 5, 4, 5));
+ assertEquals(5, srvAtomicStamped.value());
+ assertEquals(5, srvAtomicStamped.stamp());
+
+ srvAtomicStamped.close();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicStampedReconnectRemoved() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ final IgniteAtomicStamped clientAtomicStamped = client.atomicStamped("atomicStampedRemoved", 0, 0, true);
+
+ assertEquals(true, clientAtomicStamped.compareAndSet(0, 1, 0, 1));
+ assertEquals(1, clientAtomicStamped.value());
+ assertEquals(1, clientAtomicStamped.stamp());
+
+ final IgniteAtomicStamped srvAtomicStamped = srv.atomicStamped("atomicStampedRemoved", 0, 0, false);
+
+ assertEquals(true, srvAtomicStamped.compareAndSet(1, 2, 1, 2));
+ assertEquals(2, srvAtomicStamped.value());
+ assertEquals(2, srvAtomicStamped.stamp());
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ srvAtomicStamped.close();
+ }
+ });
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ clientAtomicStamped.compareAndSet(2, 3, 2, 3);
+
+ return null;
+ }
+ }, IllegalStateException.class, null);
+
+ IgniteAtomicStamped newClientAtomicStamped = client.atomicStamped("atomicStampedRemoved", 0, 0, true);
+
+ assertEquals(true, newClientAtomicStamped.compareAndSet(0, 1, 0, 1));
+ assertEquals(1, newClientAtomicStamped.value());
+ assertEquals(1, newClientAtomicStamped.stamp());
+
+ IgniteAtomicStamped newSrvAtomicStamped = srv.atomicStamped("atomicStampedRemoved", 0, 0, false);
+
+ assertEquals(true, newSrvAtomicStamped.compareAndSet(1, 2, 1, 2));
+ assertEquals(2, newSrvAtomicStamped.value());
+ assertEquals(2, newSrvAtomicStamped.stamp());
+
+ newClientAtomicStamped.close();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicStampedReconnectInProgress() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ final IgniteAtomicStamped clientAtomicStamped = client.atomicStamped("atomicStampedInProgress", 0, 0, true);
+
+ assertEquals(true, clientAtomicStamped.compareAndSet(0, 1, 0, 1));
+ assertEquals(1, clientAtomicStamped.value());
+ assertEquals(1, clientAtomicStamped.stamp());
+
+ IgniteAtomicStamped srvAtomicStamped = srv.atomicStamped("atomicStampedInProgress", 0, 0, false);
+
+ assertEquals(true, srvAtomicStamped.compareAndSet(1, 2, 1, 2));
+ assertEquals(2, srvAtomicStamped.value());
+ assertEquals(2, srvAtomicStamped.stamp());
+
+ BlockTpcCommunicationSpi servCommSpi = commSpi(srv);
+
+ servCommSpi.blockMessage(GridNearLockResponse.class);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ clientAtomicStamped.compareAndSet(2, 3, 2, 3);
+ }
+ catch (IgniteClientDisconnectedException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ servCommSpi.unblockMessage();
+
+ reconnectClientNode(client, srv, null);
+
+ assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
+
+ // Check that after reconnect working.
+ assertEquals(true, clientAtomicStamped.compareAndSet(2, 3, 2, 3));
+ assertEquals(3, clientAtomicStamped.value());
+ assertEquals(3, clientAtomicStamped.stamp());
+
+ assertEquals(true, srvAtomicStamped.compareAndSet(3, 4, 3, 4));
+ assertEquals(4, srvAtomicStamped.value());
+ assertEquals(4, srvAtomicStamped.stamp());
+
+ srvAtomicStamped.close();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicLongReconnect() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ IgniteAtomicLong clientAtomicLong = client.atomicLong("atomicLong", 0, true);
+
+ assertEquals(0L, clientAtomicLong.getAndAdd(1));
+
+ final IgniteAtomicLong srvAtomicLong = srv.atomicLong("atomicLong", 0, false);
+
+ assertEquals(1L, srvAtomicLong.getAndAdd(1));
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ assertEquals(2L, srvAtomicLong.getAndAdd(1));
+ }
+ });
+
+ assertEquals(3L, clientAtomicLong.getAndAdd(1));
+
+ assertEquals(4L, srvAtomicLong.getAndAdd(1));
+
+ assertEquals(5L, clientAtomicLong.getAndAdd(1));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicLongReconnectRemoved() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ final IgniteAtomicLong clientAtomicLong = client.atomicLong("atomicLongRmv", 0, true);
+
+ assertEquals(0L, clientAtomicLong.getAndAdd(1));
+
+ final IgniteAtomicLong srvAtomicLong = srv.atomicLong("atomicLongRmv", 0, false);
+
+ assertEquals(1L, srvAtomicLong.getAndAdd(1));
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ srvAtomicLong.close();
+ }
+ });
+
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ clientAtomicLong.getAndAdd(1);
+
+ return null;
+ }
+ }, IllegalStateException.class, null);
+
+ IgniteAtomicLong newClientAtomicLong = client.atomicLong("atomicLongRmv", 0, true);
+
+ assertEquals(0L, newClientAtomicLong.getAndAdd(1));
+
+ IgniteAtomicLong newSrvAtomicLong = srv.atomicLong("atomicLongRmv", 0, false);
+
+ assertEquals(1L, newSrvAtomicLong.getAndAdd(1));
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testAtomicLongReconnectInProgress() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ BlockTpcCommunicationSpi commSpi = commSpi(srv);
+
+ final IgniteAtomicLong clientAtomicLong = client.atomicLong("atomicLongInProggress", 0, true);
+
+ final IgniteAtomicLong srvAtomicLong = srv.atomicLong("atomicLongInProggress", 0, false);
+
+ commSpi.blockMessage(GridNearLockResponse.class);
+
+ final IgniteInternalFuture<Object> fut = GridTestUtils.runAsync(new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try {
+ clientAtomicLong.getAndAdd(1);
+ }
+ catch (IgniteClientDisconnectedException e) {
+ checkAndWait(e);
+
+ return true;
+ }
+
+ return false;
+ }
+ });
+
+ // Check that client waiting operation.
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ return fut.get(200);
+ }
+ }, IgniteFutureTimeoutCheckedException.class, null);
+
+ assertNotDone(fut);
+
+ commSpi.unblockMessage();
+
+ reconnectClientNode(client, srv, null);
+
+ assertTrue((Boolean)fut.get(2, TimeUnit.SECONDS));
+
+ // Check that after reconnect working.
+ assertEquals(1, clientAtomicLong.addAndGet(1));
+ assertEquals(2, srvAtomicLong.addAndGet(1));
+
+ clientAtomicLong.close();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testLatchReconnect() throws Exception {
+ Ignite client = grid(serverCount());
+
+ assertTrue(client.cluster().localNode().isClient());
+
+ Ignite srv = clientRouter(client);
+
+ IgniteCountDownLatch clientLatch = client.countDownLatch("latch1", 3, false, true);
+
+ assertEquals(3, clientLatch.count());
+
+ final IgniteCountDownLatch srvLatch = srv.countDownLatch("latch1", 3, false, false);
+
+ assertEquals(3, srvLatch.count());
+
+ reconnectClientNode(client, srv, new Runnable() {
+ @Override public void run() {
+ srvLatch.countDown();
+ }
+ });
+
+ assertEquals(2, srvLatch.count());
+ assertEquals(2, clientLatch.count());
+
+ srvLatch.countDown();
+
+ assertEquals(1, srvLatch.count());
+ assertEquals(1, clientLatch.count());
+
+ clientLatch.countDown();
+
+ assertEquals(0, srvLatch.count());
+ assertEquals(0, clientLatch.count());
+
+ assertTrue(srvLatch.await(1000));
+ assertTrue(clientLatch.await(1000));
+ }
+}
[27/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'remotes/origin/master' into ignite-1085
Posted by av...@apache.org.
Merge remote-tracking branch 'remotes/origin/master' into ignite-1085
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d11fc9b0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d11fc9b0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d11fc9b0
Branch: refs/heads/ignite-630
Commit: d11fc9b0811f33e8d1e3f1d2eeabac0504952833
Parents: f0ace1f a6d33b1
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Jul 15 14:18:16 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jul 15 14:18:16 2015 +0300
----------------------------------------------------------------------
.../IgniteCacheAtomicReplicatedNodeRestartSelfTest.java | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
[48/50] [abbrv] incubator-ignite git commit: Merge remote-tracking
branch 'origin/master'
Posted by av...@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/fbc38d77
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fbc38d77
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fbc38d77
Branch: refs/heads/ignite-630
Commit: fbc38d779cbbc2125f1837501a87ebec9c587f9d
Parents: 954ae15 17f8c85
Author: Anton Vinogradov <av...@gridgain.com>
Authored: Thu Jul 16 15:26:27 2015 +0300
Committer: Anton Vinogradov <av...@gridgain.com>
Committed: Thu Jul 16 15:26:27 2015 +0300
----------------------------------------------------------------------
modules/core/src/main/java/org/apache/ignite/IgniteCluster.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
[45/50] [abbrv] incubator-ignite git commit: # master minor
Posted by av...@apache.org.
# master minor
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9e529128
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9e529128
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9e529128
Branch: refs/heads/ignite-630
Commit: 9e529128b909cfd8fb74710a3d97fb8eaec5362c
Parents: 57ac2b3
Author: sboikov <sb...@gridgain.com>
Authored: Thu Jul 16 13:26:16 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu Jul 16 13:26:16 2015 +0300
----------------------------------------------------------------------
modules/core/src/main/java/org/apache/ignite/IgniteCluster.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9e529128/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java b/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
index d3ce0e7..969d320 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCluster.java
@@ -329,6 +329,9 @@ public interface IgniteCluster extends ClusterGroup, IgniteAsyncSupport {
public void resetMetrics();
/**
+ * If local client node disconnected from cluster returns future
+ * that will be completed when client reconnected.
+ *
* @return Future that will be completed when client reconnected.
*/
@Nullable public IgniteFuture<?> clientReconnectFuture();
[15/50] [abbrv] incubator-ignite git commit: # ignite-1095 guard from
concurrent remap (cherry picked from commit b19ed0c)
Posted by av...@apache.org.
# ignite-1095 guard from concurrent remap (cherry picked from commit b19ed0c)
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/24f8961c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/24f8961c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/24f8961c
Branch: refs/heads/ignite-630
Commit: 24f8961c098534beb399dbeee7dfd61e053c3f2e
Parents: d5ed494
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jul 14 16:55:49 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jul 14 16:40:58 2015 +0300
----------------------------------------------------------------------
.../dht/atomic/GridDhtAtomicCache.java | 4 ++--
.../dht/atomic/GridNearAtomicUpdateFuture.java | 20 +++++++++++++++-----
...eAtomicInvalidPartitionHandlingSelfTest.java | 2 +-
...acheAtomicReplicatedNodeRestartSelfTest.java | 15 ---------------
4 files changed, 18 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/24f8961c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 1670994..96e6edc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -142,7 +142,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
}
// Request should be for primary keys only in PRIMARY ordering mode.
- assert req.hasPrimary();
+ assert req.hasPrimary() : req;
if (req.writeSynchronizationMode() != FULL_ASYNC)
sendNearUpdateReply(res.nodeId(), res);
@@ -2158,7 +2158,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
*/
private void unlockEntries(Collection<GridDhtCacheEntry> locked, AffinityTopologyVersion topVer) {
// Process deleted entries before locks release.
- assert ctx.deferredDelete();
+ assert ctx.deferredDelete() : this;
// Entries to skip eviction manager notification for.
// Enqueue entries while holding locks.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/24f8961c/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 41cc400..751c9ba 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
@@ -358,8 +358,10 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
* @param failed Keys to remap.
*/
private void remap(Collection<?> failed) {
- if (futVer != null)
- cctx.mvcc().removeAtomicFuture(version());
+ GridCacheVersion futVer0 = futVer;
+
+ if (futVer0 == null || cctx.mvcc().removeAtomicFuture(futVer0) == null)
+ return;
Collection<Object> remapKeys = new ArrayList<>(failed.size());
Collection<Object> remapVals = vals != null ? new ArrayList<>(failed.size()) : null;
@@ -444,6 +446,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
if (err != null && X.hasCause(err, CachePartialUpdateCheckedException.class) &&
X.hasCause(err, ClusterTopologyCheckedException.class) &&
+ storeFuture() &&
remapCnt.decrementAndGet() > 0) {
CachePartialUpdateCheckedException cause = X.cause(err, CachePartialUpdateCheckedException.class);
@@ -646,6 +649,13 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
}
/**
+ * @return {@code True} future is stored by {@link GridCacheMvccManager#addAtomicFuture}.
+ */
+ private boolean storeFuture() {
+ return cctx.config().getAtomicWriteOrderMode() == CLOCK || syncMode != FULL_ASYNC;
+ }
+
+ /**
* @param topVer Topology version.
* @param remapKeys Keys to remap or {@code null} to map all keys.
* @param remap Flag indicating if this is partial remap for this future.
@@ -671,7 +681,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
// Assign future version in topology read lock before first exception may be thrown.
futVer = cctx.versions().next(topVer);
- if (!remap && (cctx.config().getAtomicWriteOrderMode() == CLOCK || syncMode != FULL_ASYNC))
+ if (!remap && storeFuture())
cctx.mvcc().addAtomicFuture(version(), this);
CacheConfiguration ccfg = cctx.config();
@@ -998,7 +1008,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
@Override public void apply(GridNearAtomicUpdateRequest req,
GridNearAtomicUpdateResponse res) {
- assert res.futureVersion().equals(futVer);
+ assert res.futureVersion().equals(futVer) : futVer;
onResult(res.nodeId(), res);
}
@@ -1065,7 +1075,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
new CI2<GridNearAtomicUpdateRequest, GridNearAtomicUpdateResponse>() {
@Override public void apply(GridNearAtomicUpdateRequest req,
GridNearAtomicUpdateResponse res) {
- assert res.futureVersion().equals(futVer);
+ assert res.futureVersion().equals(futVer) : futVer;
onResult(res.nodeId(), res);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/24f8961c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
index 8e69853..d3bcf67 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheAtomicInvalidPartitionHandlingSelfTest.java
@@ -269,7 +269,7 @@ public class GridCacheAtomicInvalidPartitionHandlingSelfTest extends GridCommonA
return null;
}
- }, 4);
+ }, 4, "putAll-thread");
Random rnd = new Random();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/24f8961c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
index b4ed18d..f556023 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/IgniteCacheAtomicReplicatedNodeRestartSelfTest.java
@@ -26,21 +26,6 @@ import static org.apache.ignite.cache.CacheAtomicityMode.*;
*/
public class IgniteCacheAtomicReplicatedNodeRestartSelfTest extends GridCacheReplicatedNodeRestartSelfTest {
/** {@inheritDoc} */
- @Override public void testRestartWithPutSixNodesTwoBackups() throws Throwable {
- fail("https://issues.apache.org/jira/browse/IGNITE-1095");
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithPutEightNodesTwoBackups() throws Throwable {
- fail("https://issues.apache.org/jira/browse/IGNITE-1095");
- }
-
- /** {@inheritDoc} */
- @Override public void testRestartWithPutTenNodesTwoBackups() throws Throwable {
- fail("https://issues.apache.org/jira/browse/IGNITE-1095");
- }
-
- /** {@inheritDoc} */
@Override protected CacheAtomicityMode atomicityMode() {
return ATOMIC;
}
[28/50] [abbrv] incubator-ignite git commit: # master minor
Posted by av...@apache.org.
# master minor
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/bdd17626
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/bdd17626
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/bdd17626
Branch: refs/heads/ignite-630
Commit: bdd176267f4085acce5ac3c51b5ac2787bd9ace7
Parents: a6d33b1
Author: sboikov <sb...@gridgain.com>
Authored: Wed Jul 15 15:34:43 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed Jul 15 15:34:43 2015 +0300
----------------------------------------------------------------------
.../GridCacheAbstractNodeRestartSelfTest.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bdd17626/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java
index 7e65f23..ec1a12c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java
@@ -505,7 +505,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs
try {
barrier.await();
- info("Starting put thread...");
+ info("Starting put thread: " + gridIdx);
IgniteCache<Integer, String> cache = grid(gridIdx).cache(CACHE_NAME);
@@ -546,7 +546,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs
try {
barrier.await();
- info("Starting restart thread...");
+ info("Starting restart thread: " + gridIdx);
int cnt = 0;
@@ -624,7 +624,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs
try {
barrier.await();
- info("Starting put thread...");
+ info("Starting put thread: " + gridIdx);
Ignite ignite = grid(gridIdx);
@@ -705,7 +705,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs
try {
barrier.await();
- info("Starting restart thread...");
+ info("Starting restart thread: " + gridIdx);
int cnt = 0;
@@ -780,7 +780,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs
try {
barrier.await();
- info("Starting put thread...");
+ info("Starting put thread: " + gridIdx);
Ignite ignite = grid(gridIdx);
@@ -849,7 +849,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs
try {
barrier.await();
- info("Starting restart thread...");
+ info("Starting restart thread: " + gridIdx);
int cnt = 0;