You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/06/17 09:47:39 UTC
[01/50] incubator-ignite git commit: ignite-classname Changed script
for classnames property.
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-950 9e2943db8 -> 5e9a45f0c
ignite-classname Changed script for classnames property.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/fe1750d3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fe1750d3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fe1750d3
Branch: refs/heads/ignite-950
Commit: fe1750d3f15ef283ecc76c0fcba0c8a59493691f
Parents: a515ec9
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 12 13:37:48 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 12 13:37:48 2015 +0300
----------------------------------------------------------------------
.../ignite/tools/classgen/ClassesGenerator.java | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fe1750d3/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
----------------------------------------------------------------------
diff --git a/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java b/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
index ba0aab9..feb2d9d 100644
--- a/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
+++ b/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
@@ -29,7 +29,10 @@ import java.util.jar.*;
*/
public class ClassesGenerator {
/** */
- private static final String FILE_PATH = "META-INF/classnames.properties";
+ private static final String META_INF = "META-INF/";
+
+ /** */
+ private static final String DEFAULT_FILE_PATH = META_INF + "classnames.properties";
/** */
private static final String[] EXCLUDED_PACKAGES = {
@@ -46,8 +49,9 @@ public class ClassesGenerator {
String basePath = args[0];
String hdr = args[1];
String[] packages = args[2].split(":");
+ String finaName = args.length == 4 ? args[3] : null;
- ClassesGenerator gen = new ClassesGenerator(basePath, hdr, packages);
+ ClassesGenerator gen = new ClassesGenerator(basePath, hdr, packages, finaName);
gen.generate();
}
@@ -74,15 +78,20 @@ public class ClassesGenerator {
/** */
private final String[] packages;
+ /** */
+ private final String fileName;
+
/**
* @param basePath Base file path.
* @param hdr Header.
* @param packages Included packages.
+ * @param fileName Property file name.
*/
- private ClassesGenerator(String basePath, String hdr, String[] packages) {
+ private ClassesGenerator(String basePath, String hdr, String[] packages, String fileName) {
this.basePath = basePath;
this.hdr = hdr;
this.packages = packages;
+ this.fileName = fileName;
}
/**
@@ -103,7 +112,8 @@ public class ClassesGenerator {
throw new Exception(sb.toString().trim());
}
- PrintStream out = new PrintStream(new File(basePath, FILE_PATH));
+ PrintStream out = new PrintStream(new File(basePath,
+ (fileName == null || fileName.isEmpty()) ? DEFAULT_FILE_PATH : META_INF + fileName));
out.println(hdr);
out.println();
[35/50] incubator-ignite git commit: # ignite-sprint-6 enabled test
Posted by sb...@apache.org.
# ignite-sprint-6 enabled 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/f6b1b79f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f6b1b79f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f6b1b79f
Branch: refs/heads/ignite-950
Commit: f6b1b79fa3f354bde733d729c8c99016e09956f8
Parents: a9228c0
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 16 16:20:28 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 16 16:23:59 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheVersionMultinodeTest.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f6b1b79f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java
index cecb4a9..91dcbf1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java
@@ -81,7 +81,7 @@ public class GridCacheVersionMultinodeTest extends GridCacheAbstractSelfTest {
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-114");
+ // No-op.
}
/** {@inheritDoc} */
@@ -240,12 +240,14 @@ public class GridCacheVersionMultinodeTest extends GridCacheAbstractSelfTest {
if (e != null) {
if (ver != null) {
- assertEquals("Non-equal versions for key: " + key, ver, e.version());
+ assertEquals("Non-equal versions for key: " + key,
+ ver,
+ e instanceof GridNearCacheEntry ? ((GridNearCacheEntry)e).dhtVersion() : e.version());
verified = true;
}
else
- ver = e.version();
+ ver = e instanceof GridNearCacheEntry ? ((GridNearCacheEntry)e).dhtVersion() : e.version();
}
}
[43/50] incubator-ignite git commit: # i-960
Posted by sb...@apache.org.
# i-960
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4025ce3c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4025ce3c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4025ce3c
Branch: refs/heads/ignite-950
Commit: 4025ce3c6e36b95086e434e0eaba87069093bd7c
Parents: c909cae
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jun 16 18:00:36 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jun 16 18:00:36 2015 +0300
----------------------------------------------------------------------
.../org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java | 3 ---
1 file changed, 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4025ce3c/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
index da00d95..7b78bda 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
@@ -36,9 +36,6 @@ import java.util.*;
* This implementation stores objects in underlying database using java beans mapping description via reflection.
* <p>
* Use {@link CacheJdbcPojoStoreFactory} factory to pass {@link CacheJdbcPojoStore} to {@link CacheConfiguration}.
- *
- * @param <K> The type of keys handled by this loader.
- * @param <V> The type of values generated by this loader.
*/
public class CacheJdbcPojoStore<K, V> extends CacheAbstractJdbcStore<K, V> {
/**
[20/50] incubator-ignite git commit: Merge branches 'ignite-sprint-5'
and 'ignite-sprint-6' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-6
Posted by sb...@apache.org.
Merge branches 'ignite-sprint-5' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-6
Conflicts:
modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
modules/scalar-2.10/pom.xml
modules/spark-2.10/pom.xml
modules/spark/pom.xml
modules/visor-console-2.10/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/460521c3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/460521c3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/460521c3
Branch: refs/heads/ignite-950
Commit: 460521c353e7672c686e90df38d0356455e3c397
Parents: 40f826b 4375529
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Jun 15 10:21:46 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Jun 15 10:21:46 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/cache/query/ScanQuery.java | 23 ++++++++++++++++++++
.../cache/query/GridCacheQueryManager.java | 5 +++++
.../testsuites/IgniteCacheTestSuite4.java | 2 ++
3 files changed, 30 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/460521c3/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
index e6b69bc,11a8c84..90000e8
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
@@@ -99,23 -99,26 +99,46 @@@ public final class ScanQuery<K, V> exte
/**
* Gets partition number over which this query should iterate. Will return {@code null} if partition was not
* set. In this case query will iterate over all partitions in the cache.
+ *
+ * @return Partition number or {@code null}.
+ */
+ @Nullable public Integer getPartition() {
+ return part;
+ }
+
+ /**
+ * Sets partition number over which this query should iterate. If {@code null}, query will iterate over
+ * all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache.
+ *
+ * @param part Partition number over which this query should iterate.
+ * @return {@code this} for chaining.
+ */
+ public ScanQuery<K, V> setPartition(@Nullable Integer part) {
+ this.part = part;
+
+ return this;
+ }
+
++ /**
++ * Gets partition number over which this query should iterate. Will return {@code null} if partition was not
++ * set. In this case query will iterate over all partitions in the cache.
+ *
+ * @return Partition number or {@code null}.
+ */
+ @Nullable public Integer getPartition() {
+ return part;
+ }
+
+ /**
+ * Sets partition number over which this query should iterate. If {@code null}, query will iterate over
+ * all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache.
+ *
+ * @param part Partition number over which this query should iterate.
+ */
+ public void setPartition(@Nullable Integer part) {
+ this.part = part;
+ }
+
/** {@inheritDoc} */
@Override public ScanQuery<K, V> setPageSize(int pageSize) {
return (ScanQuery<K, V>)super.setPageSize(pageSize);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/460521c3/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 1317d38,6e71ba7..7493d07
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@@ -791,9 -791,8 +791,14 @@@ public abstract class GridCacheQueryMan
locPart = dht.topology().localPartition(part, topVer, false);
++<<<<<<< HEAD
+ // double check for owning state
+ if (locPart == null || locPart.state() != OWNING || !locPart.reserve() ||
+ locPart.state() != OWNING)
++=======
+ if (locPart == null || (locPart.state() != OWNING && locPart.state() != RENTING) ||
+ !locPart.reserve())
++>>>>>>> 4375529fa929e650f7b68d750318d67a8609ee10
throw new GridDhtInvalidPartitionException(part, "Partition can't be reserved");
iter = new Iterator<K>() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/460521c3/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index c598e38,ed9fc9a..7fa038c
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@@ -138,9 -140,6 +138,11 @@@ public class IgniteCacheTestSuite4 exte
suite.addTestSuite(IgniteCacheManyClientsTest.class);
+ suite.addTestSuite(IgniteStartCacheInTransactionSelfTest.class);
+ suite.addTestSuite(IgniteStartCacheInTransactionAtomicSelfTest.class);
+
++ suite.addTestSuite(IgniteCacheManyClientsTest.class);
++
return suite;
}
}
[24/50] incubator-ignite git commit: Merge branches 'ignite-883-1'
and 'ignite-sprint-6' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-883-1
Posted by sb...@apache.org.
Merge branches 'ignite-883-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-883-1
Conflicts:
modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.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/5d8a5e61
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5d8a5e61
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5d8a5e61
Branch: refs/heads/ignite-950
Commit: 5d8a5e61945436e6bcda31d9fb12edda2feac2a0
Parents: 4a13491
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Jun 15 10:45:38 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Jun 15 10:45:38 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5d8a5e61/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index c598e38..fed5efe 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -136,11 +136,11 @@ public class IgniteCacheTestSuite4 extends TestSuite {
suite.addTestSuite(CacheReadOnlyTransactionalClientSelfTest.class);
- suite.addTestSuite(IgniteCacheManyClientsTest.class);
-
suite.addTestSuite(IgniteStartCacheInTransactionSelfTest.class);
suite.addTestSuite(IgniteStartCacheInTransactionAtomicSelfTest.class);
+ suite.addTestSuite(IgniteCacheManyClientsTest.class);
+
return suite;
}
}
[27/50] incubator-ignite git commit: Merge branches 'ignite-960' and
'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite
into ignite-960
Posted by sb...@apache.org.
Merge branches 'ignite-960' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-960
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/55764e82
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/55764e82
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/55764e82
Branch: refs/heads/ignite-950
Commit: 55764e8205259dcf970e6850d763bd7c5b2523a1
Parents: 6a22fd2 f4b1123
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jun 16 12:12:55 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jun 16 12:12:55 2015 +0300
----------------------------------------------------------------------
DEVNOTES.txt | 63 +-
RELEASE_NOTES.txt | 12 +
assembly/dependencies-fabric.xml | 1 +
assembly/dependencies-visor-console.xml | 3 +
examples/config/example-cache.xml | 2 +
examples/pom.xml | 36 +-
.../client/memcache/MemcacheRestExample.java | 32 +-
idea/ignite_codeStyle.xml | 147 +++
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
.../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/pom.xml | 3 +-
.../java/org/apache/ignite/IgniteCache.java | 41 +-
.../apache/ignite/IgniteSystemProperties.java | 3 +
.../ignite/cache/eviction/EvictableEntry.java | 7 +
.../ignite/cache/eviction/EvictionPolicy.java | 2 +
.../cache/eviction/fifo/FifoEvictionPolicy.java | 117 +-
.../eviction/fifo/FifoEvictionPolicyMBean.java | 22 +
.../cache/eviction/lru/LruEvictionPolicy.java | 135 ++-
.../eviction/lru/LruEvictionPolicyMBean.java | 38 +
.../eviction/random/RandomEvictionPolicy.java | 10 +-
.../eviction/sorted/SortedEvictionPolicy.java | 141 ++-
.../sorted/SortedEvictionPolicyMBean.java | 22 +
.../apache/ignite/cache/query/QueryMetrics.java | 6 +-
.../apache/ignite/cache/query/ScanQuery.java | 48 +-
.../configuration/CacheConfiguration.java | 13 +-
.../ignite/internal/GridKernalContextImpl.java | 5 +-
.../ignite/internal/GridPluginContext.java | 6 +
.../apache/ignite/internal/IgniteKernal.java | 57 +-
.../ignite/internal/IgniteNodeAttributes.java | 5 +-
.../org/apache/ignite/internal/IgnitionEx.java | 8 +-
.../internal/MarshallerContextAdapter.java | 82 +-
.../ignite/internal/MarshallerContextImpl.java | 24 +-
.../GridClientOptimizedMarshaller.java | 5 +
.../internal/interop/InteropIgnition.java | 54 +-
.../internal/interop/InteropProcessor.java | 8 +
.../internal/managers/GridManagerAdapter.java | 9 +
.../checkpoint/GridCheckpointManager.java | 52 +-
.../managers/communication/GridIoManager.java | 117 +-
.../discovery/DiscoveryCustomMessage.java | 6 +
.../discovery/GridDiscoveryManager.java | 73 +-
.../managers/indexing/GridIndexingManager.java | 4 -
.../affinity/GridAffinityAssignment.java | 12 +
.../affinity/GridAffinityAssignmentCache.java | 12 +-
.../affinity/GridAffinityProcessor.java | 23 +-
.../cache/CacheEvictableEntryImpl.java | 31 +
.../processors/cache/CacheMetricsImpl.java | 4 +-
.../cache/DynamicCacheChangeBatch.java | 19 +-
.../cache/DynamicCacheDescriptor.java | 17 +
.../processors/cache/GridCacheAdapter.java | 36 +-
.../processors/cache/GridCacheContext.java | 16 +-
.../processors/cache/GridCacheMapEntry.java | 64 +-
.../processors/cache/GridCacheMessage.java | 51 -
.../GridCachePartitionExchangeManager.java | 28 +-
.../processors/cache/GridCacheProcessor.java | 85 +-
.../processors/cache/GridCacheProxyImpl.java | 14 +-
.../processors/cache/GridCacheSwapManager.java | 55 +-
.../processors/cache/GridCacheTtlManager.java | 9 +-
.../processors/cache/IgniteCacheProxy.java | 34 +-
.../processors/cache/IgniteInternalCache.java | 38 +-
.../processors/cache/KeyCacheObjectImpl.java | 11 +-
.../processors/cache/QueryCursorImpl.java | 23 +-
.../distributed/GridCacheTxRecoveryRequest.java | 26 +-
.../GridCacheTxRecoveryResponse.java | 14 +-
.../distributed/GridDistributedBaseMessage.java | 77 +-
.../distributed/GridDistributedLockRequest.java | 54 +-
.../GridDistributedLockResponse.java | 14 +-
.../GridDistributedTxFinishRequest.java | 46 +-
.../GridDistributedTxPrepareRequest.java | 62 +-
.../GridDistributedTxPrepareResponse.java | 64 +-
.../GridDistributedUnlockRequest.java | 6 +-
.../dht/GridClientPartitionTopology.java | 2 +-
.../cache/distributed/dht/GridDhtGetFuture.java | 11 +-
.../distributed/dht/GridDhtLocalPartition.java | 7 +
.../distributed/dht/GridDhtLockRequest.java | 72 +-
.../distributed/dht/GridDhtLockResponse.java | 18 +-
.../dht/GridDhtPartitionTopologyImpl.java | 16 +-
.../distributed/dht/GridDhtTxFinishRequest.java | 38 +-
.../dht/GridDhtTxPrepareRequest.java | 54 +-
.../dht/GridDhtTxPrepareResponse.java | 22 +-
.../distributed/dht/GridDhtUnlockRequest.java | 6 +-
.../dht/atomic/GridDhtAtomicCache.java | 35 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 6 +-
.../dht/preloader/GridDhtForceKeysFuture.java | 40 +-
.../GridDhtPartitionsExchangeFuture.java | 139 ++-
.../dht/preloader/GridDhtPreloader.java | 13 +-
.../distributed/near/GridNearLockRequest.java | 58 +-
.../distributed/near/GridNearLockResponse.java | 26 +-
.../near/GridNearTxFinishRequest.java | 26 +-
.../near/GridNearTxPrepareRequest.java | 50 +-
.../near/GridNearTxPrepareResponse.java | 46 +-
.../distributed/near/GridNearUnlockRequest.java | 2 +-
.../local/atomic/GridLocalAtomicCache.java | 25 +-
.../processors/cache/query/CacheQuery.java | 2 +-
.../query/GridCacheDistributedQueryManager.java | 3 +
.../cache/query/GridCacheQueryAdapter.java | 159 ++-
.../cache/query/GridCacheQueryManager.java | 210 ++--
.../cache/query/GridCacheQueryRequest.java | 47 +-
.../processors/cache/query/QueryCursorEx.java | 8 +
.../cache/transactions/IgniteTxHandler.java | 3 -
.../transactions/IgniteTxLocalAdapter.java | 34 +-
.../cache/transactions/IgniteTxManager.java | 3 -
.../cacheobject/IgniteCacheObjectProcessor.java | 9 +-
.../IgniteCacheObjectProcessorImpl.java | 12 +-
.../continuous/AbstractContinuousMessage.java | 9 +
.../continuous/GridContinuousProcessor.java | 17 +-
.../datastreamer/DataStreamerCacheUpdaters.java | 2 +-
.../datastreamer/DataStreamerImpl.java | 100 +-
.../datastructures/DataStructuresProcessor.java | 174 ++-
.../datastructures/GridCacheSetImpl.java | 4 +-
.../processors/hadoop/HadoopTaskContext.java | 14 +-
.../processors/igfs/IgfsMetaManager.java | 2 +-
.../igfs/IgfsSecondaryFileSystemImpl.java | 2 +-
.../plugin/IgnitePluginProcessor.java | 16 +-
.../portable/GridPortableInputStream.java | 10 +
.../processors/query/GridQueryIndexing.java | 4 +-
.../processors/query/GridQueryProcessor.java | 315 ++++--
.../messages/GridQueryNextPageResponse.java | 1 +
.../rest/client/message/GridRouterRequest.java | 18 +
.../rest/client/message/GridRouterResponse.java | 18 +
.../service/GridServiceProcessor.java | 6 +-
.../timeout/GridSpiTimeoutObject.java | 73 ++
.../timeout/GridTimeoutProcessor.java | 105 +-
.../IgniteTxRollbackCheckedException.java | 9 +
.../ignite/internal/util/GridJavaProcess.java | 2 +-
.../ignite/internal/util/IgniteUtils.java | 7 +-
.../shmem/IpcSharedMemoryClientEndpoint.java | 2 +-
.../ipc/shmem/IpcSharedMemoryNativeLoader.java | 151 ++-
.../shmem/IpcSharedMemoryServerEndpoint.java | 2 +-
.../util/ipc/shmem/IpcSharedMemoryUtils.java | 4 +-
.../util/nio/GridCommunicationClient.java | 30 +-
.../util/nio/GridNioDelimitedBuffer.java | 2 +-
.../util/nio/GridNioRecoveryDescriptor.java | 13 +-
.../util/nio/GridShmemCommunicationClient.java | 146 +++
.../util/nio/GridTcpCommunicationClient.java | 554 ---------
.../util/nio/GridTcpNioCommunicationClient.java | 8 -
.../internal/visor/VisorMultiNodeTask.java | 2 +-
.../ignite/internal/visor/cache/VisorCache.java | 2 +-
.../VisorCacheConfigurationCollectorJob.java | 6 +-
.../internal/visor/cache/VisorCacheMetrics.java | 19 +-
.../cache/VisorCacheMetricsCollectorTask.java | 10 +-
.../cache/VisorCacheStoreConfiguration.java | 5 +-
.../visor/node/VisorNodeDataCollectorTask.java | 9 +-
.../node/VisorNodeDataCollectorTaskResult.java | 17 +-
.../node/VisorNodeSuppressedErrorsTask.java | 12 +-
.../internal/visor/query/VisorQueryJob.java | 13 +-
.../internal/visor/query/VisorQueryTask.java | 3 +-
.../visor/util/VisorExceptionWrapper.java | 81 ++
.../internal/visor/util/VisorTaskUtils.java | 6 +-
.../ignite/marshaller/MarshallerContext.java | 8 +
.../org/apache/ignite/plugin/PluginContext.java | 6 +
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 61 +-
.../org/apache/ignite/spi/IgniteSpiContext.java | 10 +
.../ignite/spi/IgniteSpiTimeoutObject.java | 44 +
.../spi/checkpoint/noop/NoopCheckpointSpi.java | 3 +-
.../communication/tcp/TcpCommunicationSpi.java | 825 ++++++++------
.../tcp/TcpCommunicationSpiMBean.java | 10 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 445 +++++---
.../ignite/spi/discovery/tcp/ServerImpl.java | 262 ++---
.../spi/discovery/tcp/TcpDiscoveryImpl.java | 120 +-
.../spi/discovery/tcp/TcpDiscoverySpi.java | 158 +--
.../tcp/ipfinder/TcpDiscoveryIpFinder.java | 10 +-
.../ipfinder/TcpDiscoveryIpFinderAdapter.java | 34 +-
.../TcpDiscoveryMulticastIpFinder.java | 40 +-
.../messages/TcpDiscoveryAbstractMessage.java | 10 +-
.../RoundRobinGlobalLoadBalancer.java | 2 +-
.../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 +-
.../core/src/main/resources/ignite.properties | 2 +-
modules/core/src/test/config/tests.properties | 2 +-
.../ignite/GridSuppressedExceptionSelfTest.java | 4 +-
.../internal/GridDiscoveryEventSelfTest.java | 6 +-
...ridFailFastNodeFailureDetectionSelfTest.java | 2 +
.../GridFailoverTaskWithPredicateSelfTest.java | 3 -
.../GridJobMasterLeaveAwareSelfTest.java | 2 -
.../internal/GridJobStealingSelfTest.java | 3 -
...ectionLocalJobMultipleArgumentsSelfTest.java | 2 -
.../GridTaskExecutionContextSelfTest.java | 9 -
.../IgniteComputeEmptyClusterGroupTest.java | 3 -
.../IgniteComputeTopologyExceptionTest.java | 9 -
.../GridDiscoveryManagerAliveCacheSelfTest.java | 5 +
.../cache/CacheClientStoreSelfTest.java | 228 ++++
.../cache/GridCacheAbstractFullApiSelfTest.java | 125 +++
.../cache/GridCacheAbstractMetricsSelfTest.java | 48 +-
.../cache/GridCacheAbstractSelfTest.java | 3 -
.../cache/GridCacheAffinityRoutingSelfTest.java | 4 +-
.../GridCacheConcurrentTxMultiNodeTest.java | 8 +-
...idCacheConfigurationConsistencySelfTest.java | 14 +-
.../cache/GridCacheDeploymentSelfTest.java | 3 -
.../cache/GridCacheEntryMemorySizeSelfTest.java | 91 +-
.../GridCacheExAbstractFullApiSelfTest.java | 103 --
.../cache/GridCacheMemoryModeSelfTest.java | 25 +-
...inodeUpdateNearEnabledNoBackupsSelfTest.java | 2 +-
...CacheMultinodeUpdateNearEnabledSelfTest.java | 2 +-
.../processors/cache/GridCacheOffHeapTest.java | 33 +-
.../GridCacheReferenceCleanupSelfTest.java | 3 -
.../cache/GridCacheReloadSelfTest.java | 6 +-
.../processors/cache/GridCacheStopSelfTest.java | 5 +
.../cache/GridCacheVersionMultinodeTest.java | 2 +-
.../cache/IgniteCacheAbstractTest.java | 3 -
.../IgniteCacheEntryListenerAbstractTest.java | 14 +-
.../IgniteCacheInterceptorSelfTestSuite.java | 2 +-
.../cache/IgniteCacheInvokeReadThroughTest.java | 5 +
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 14 +-
.../cache/IgniteCachePeekModesAbstractTest.java | 5 +-
...gniteCacheTransactionalStopBusySelfTest.java | 5 +
.../cache/IgniteDynamicCacheStartSelfTest.java | 81 ++
...niteDynamicCacheWithConfigStartSelfTest.java | 97 ++
...teStartCacheInTransactionAtomicSelfTest.java | 32 +
.../IgniteStartCacheInTransactionSelfTest.java | 254 +++++
.../IgniteTxMultiThreadedAbstractTest.java | 4 +-
...cheAtomicReferenceMultiNodeAbstractTest.java | 11 -
...GridCacheQueueMultiNodeAbstractSelfTest.java | 2 -
...dCacheQueueMultiNodeConsistencySelfTest.java | 5 +
...CacheQueueRotativeMultiNodeAbstractTest.java | 10 -
.../GridCacheSetAbstractSelfTest.java | 9 -
.../IgniteCountDownLatchAbstractSelfTest.java | 102 ++
...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 -
.../GridCachePreloadLifecycleAbstractTest.java | 2 -
.../distributed/IgniteCacheManyClientsTest.java | 275 +++++
.../IgniteCacheMessageRecoveryAbstractTest.java | 1 +
...heAbstractTransformWriteThroughSelfTest.java | 3 -
.../GridCacheColocatedTxExceptionSelfTest.java | 5 +
...GridCacheDhtEvictionNearReadersSelfTest.java | 11 +-
.../dht/GridCacheDhtEvictionSelfTest.java | 11 +-
.../GridCacheExColocatedFullApiSelfTest.java | 33 -
...ePartitionedNearDisabledMetricsSelfTest.java | 4 +-
...dCachePartitionedTopologyChangeSelfTest.java | 5 +
.../dht/IgniteCacheMultiTxLockSelfTest.java | 6 +-
.../near/GridCacheExNearFullApiSelfTest.java | 39 -
.../near/GridCacheNearEvictionSelfTest.java | 3 -
.../near/GridCacheNearTxExceptionSelfTest.java | 5 +
.../GridCachePartitionedEvictionSelfTest.java | 11 +-
...PartitionedFullApiMultithreadedSelfTest.java | 5 +
.../GridCachePartitionedFullApiSelfTest.java | 32 +
...idCachePartitionedHitsAndMissesSelfTest.java | 3 -
...ePartitionedMultiThreadedPutGetSelfTest.java | 6 +-
.../GridCachePartitionedNodeRestartTest.java | 5 +
...edOffHeapTieredMultiNodeFullApiSelfTest.java | 2 +-
...ePartitionedOptimisticTxNodeRestartTest.java | 5 +
...achePartitionedPreloadLifecycleSelfTest.java | 2 +-
...CachePartitionedTxMultiThreadedSelfTest.java | 5 +
.../GridCacheExReplicatedFullApiSelfTest.java | 33 -
...eReplicatedFullApiMultithreadedSelfTest.java | 5 +
.../GridCacheReplicatedInvalidateSelfTest.java | 4 +-
...ridCacheReplicatedMultiNodeLockSelfTest.java | 5 +
.../GridCacheReplicatedMultiNodeSelfTest.java | 5 +
.../GridCacheReplicatedNodeRestartSelfTest.java | 5 +
.../GridCacheReplicatedTxExceptionSelfTest.java | 5 +
.../replicated/GridReplicatedTxPreloadTest.java | 2 +
...acheAtomicReplicatedNodeRestartSelfTest.java | 5 +
...CacheReplicatedPreloadLifecycleSelfTest.java | 6 +-
.../cache/eviction/EvictionAbstractTest.java | 1056 ++++++++++++++++++
.../GridCacheBatchEvictUnswapSelfTest.java | 5 +-
...heConcurrentEvictionConsistencySelfTest.java | 82 +-
.../GridCacheConcurrentEvictionsSelfTest.java | 29 +-
.../GridCacheDistributedEvictionsSelfTest.java | 5 +-
.../GridCacheEmptyEntriesAbstractSelfTest.java | 11 +-
.../eviction/GridCacheEvictionAbstractTest.java | 484 --------
.../GridCacheEvictionFilterSelfTest.java | 4 +-
.../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 | 168 ---
.../eviction/lru/LruEvictionPolicySelfTest.java | 353 ++++++
.../lru/LruNearEvictionPolicySelfTest.java | 140 +++
.../LruNearOnlyNearEvictionPolicySelfTest.java | 172 +++
.../GridCacheRandomEvictionPolicySelfTest.java | 258 -----
.../RandomEvictionPolicyCacheSizeSelfTest.java | 6 +
.../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 +-
.../local/GridCacheExLocalFullApiSelfTest.java | 30 -
...dCacheLocalFullApiMultithreadedSelfTest.java | 5 +
.../GridCacheLocalTxExceptionSelfTest.java | 5 +
.../GridCacheSwapScanQueryAbstractSelfTest.java | 115 +-
...ridCacheContinuousQueryAbstractSelfTest.java | 2 -
...CacheClientWriteBehindStoreAbstractTest.java | 104 ++
...teCacheClientWriteBehindStoreAtomicTest.java | 38 +
.../IgnteCacheClientWriteBehindStoreTxTest.java | 32 +
.../closure/GridClosureProcessorSelfTest.java | 29 +-
.../continuous/GridEventConsumeSelfTest.java | 9 +-
.../DataStreamProcessorSelfTest.java | 47 +-
.../DataStreamerMultiThreadedSelfTest.java | 59 +-
.../DataStreamerMultinodeCreateCacheTest.java | 97 ++
.../igfs/IgfsClientCacheSelfTest.java | 9 +-
.../processors/igfs/IgfsModesSelfTest.java | 4 +-
.../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 ++
.../util/nio/GridNioDelimitedBufferTest.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 | 1 +
.../swap/GridSwapEvictAllBenchmark.java | 6 +-
.../marshaller/MarshallerContextTestImpl.java | 29 +-
.../ignite/messaging/GridMessagingSelfTest.java | 3 -
.../IgniteMessagingWithClientTest.java | 166 +++
.../GridP2PContinuousDeploymentSelfTest.java | 2 +
.../p2p/GridP2PLocalDeploymentSelfTest.java | 6 +-
.../p2p/GridP2PRemoteClassLoadersSelfTest.java | 31 +-
.../spi/GridTcpSpiForwardingSelfTest.java | 4 +-
.../GridTcpCommunicationSpiAbstractTest.java | 17 +-
...mmunicationSpiConcurrentConnectSelfTest.java | 6 +-
.../GridTcpCommunicationSpiConfigSelfTest.java | 2 -
...cpCommunicationSpiMultithreadedSelfTest.java | 23 +-
...pCommunicationSpiMultithreadedShmemTest.java | 28 +
...dTcpCommunicationSpiRecoveryAckSelfTest.java | 1 +
...GridTcpCommunicationSpiRecoverySelfTest.java | 1 +
.../GridTcpCommunicationSpiShmemSelfTest.java | 38 +
.../tcp/GridTcpCommunicationSpiTcpSelfTest.java | 7 +
.../discovery/AbstractDiscoverySelfTest.java | 13 +-
.../tcp/TcpClientDiscoverySpiMulticastTest.java | 129 +++
.../tcp/TcpClientDiscoverySpiSelfTest.java | 208 +++-
.../stream/socket/SocketStreamerSelfTest.java | 29 +-
.../testframework/GridSpiTestContext.java | 10 +
.../ignite/testframework/GridTestUtils.java | 16 +-
.../config/GridTestProperties.java | 14 +-
.../junits/GridTestKernalContext.java | 1 +
.../junits/IgniteTestResources.java | 16 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 31 +-
.../IgniteCacheDataStructuresSelfTestSuite.java | 24 +-
.../IgniteCacheEvictionSelfTestSuite.java | 17 +-
.../IgniteCacheFailoverTestSuite.java | 22 +-
.../IgniteCacheFullApiSelfTestSuite.java | 14 +-
...niteCacheP2pUnmarshallingErrorTestSuite.java | 20 +-
.../testsuites/IgniteCacheRestartTestSuite.java | 10 +-
.../ignite/testsuites/IgniteCacheTestSuite.java | 45 +-
.../testsuites/IgniteCacheTestSuite2.java | 4 +-
.../testsuites/IgniteCacheTestSuite3.java | 14 +-
.../testsuites/IgniteCacheTestSuite4.java | 18 +-
.../IgniteCacheWriteBehindTestSuite.java | 2 +
.../testsuites/IgniteKernalSelfTestSuite.java | 16 +-
.../IgniteMarshallerSelfTestSuite.java | 28 +-
.../IgniteSpiCommunicationSelfTestSuite.java | 2 +
.../IgniteSpiDiscoverySelfTestSuite.java | 1 +
.../testsuites/IgniteStreamSelfTestSuite.java | 39 +
.../testsuites/IgniteStreamTestSuite.java | 39 -
.../testsuites/IgniteUtilSelfTestSuite.java | 20 +-
.../apache/ignite/util/GridRandomSelfTest.java | 4 +-
modules/extdata/p2p/pom.xml | 2 +-
.../tests/p2p/P2PTestTaskExternalPath1.java | 10 +-
.../tests/p2p/P2PTestTaskExternalPath2.java | 8 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
.../gce/TcpDiscoveryGoogleStorageIpFinder.java | 43 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 3 +-
.../fs/IgniteHadoopFileSystemCounterWriter.java | 14 +-
.../hadoop/fs/v1/IgniteHadoopFileSystem.java | 70 +-
.../hadoop/fs/v2/IgniteHadoopFileSystem.java | 2 +-
.../processors/hadoop/HadoopDefaultJobInfo.java | 2 +-
.../internal/processors/hadoop/HadoopUtils.java | 282 ++++-
.../hadoop/SecondaryFileSystemProvider.java | 4 +-
.../hadoop/taskexecutor/HadoopRunnableTask.java | 20 +-
.../processors/hadoop/v2/HadoopV2Job.java | 31 +-
.../hadoop/v2/HadoopV2JobResourceManager.java | 26 +-
.../hadoop/v2/HadoopV2TaskContext.java | 48 +-
.../hadoop/HadoopClientProtocolSelfTest.java | 6 +-
.../HadoopIgfs20FileSystemAbstractSelfTest.java | 17 +-
...oopSecondaryFileSystemConfigurationTest.java | 14 +
.../IgniteHadoopFileSystemAbstractSelfTest.java | 2 +-
...IgniteHadoopFileSystemHandshakeSelfTest.java | 7 +
.../IgniteHadoopFileSystemIpcCacheSelfTest.java | 7 +
.../hadoop/HadoopAbstractSelfTest.java | 19 +-
.../hadoop/HadoopCommandLineTest.java | 14 +-
.../processors/hadoop/HadoopMapReduceTest.java | 183 ++-
.../hadoop/HadoopTaskExecutionSelfTest.java | 2 +-
.../hadoop/HadoopTasksAllVersionsTest.java | 15 +-
.../processors/hadoop/HadoopTasksV1Test.java | 5 +-
.../processors/hadoop/HadoopTasksV2Test.java | 5 +-
.../processors/hadoop/HadoopV2JobSelfTest.java | 6 +-
.../collections/HadoopAbstractMapTest.java | 12 +
.../collections/HadoopHashMapSelfTest.java | 4 +-
.../HadoopExternalTaskExecutionSelfTest.java | 2 +
.../HadoopExternalCommunicationSelfTest.java | 5 +
.../testsuites/IgniteHadoopTestSuite.java | 7 +-
modules/hibernate/pom.xml | 2 +-
.../hibernate/HibernateL2CacheSelfTest.java | 5 +
.../HibernateL2CacheTransactionalSelfTest.java | 5 +
.../testsuites/IgniteHibernateTestSuite.java | 4 +-
modules/indexing/pom.xml | 18 +-
.../processors/query/h2/IgniteH2Indexing.java | 44 +-
.../h2/twostep/GridReduceQueryExecutor.java | 8 +-
...CacheScanPartitionQueryFallbackSelfTest.java | 408 +++++++
.../cache/GridCacheCrossCacheQuerySelfTest.java | 22 +-
.../cache/GridCacheOffHeapSelfTest.java | 1 -
.../GridCacheOffheapIndexEntryEvictTest.java | 200 ++++
.../cache/GridCacheOffheapIndexGetSelfTest.java | 80 +-
.../cache/GridCacheQueryMetricsSelfTest.java | 84 +-
...idCacheReduceQueryMultithreadedSelfTest.java | 10 -
.../processors/cache/GridCacheSwapSelfTest.java | 3 -
.../cache/GridIndexingWithNoopSwapSelfTest.java | 6 +-
.../IgniteCacheAbstractFieldsQuerySelfTest.java | 13 +-
.../cache/IgniteCacheAbstractQuerySelfTest.java | 79 +-
...acheConfigurationPrimitiveTypesSelfTest.java | 104 ++
...hePartitionedQueryMultiThreadedSelfTest.java | 40 +-
...QueryMultiThreadedOffHeapTieredSelfTest.java | 37 +
...eQueryMultiThreadedOffHeapTiredSelfTest.java | 37 -
.../IgniteCacheQueryMultiThreadedSelfTest.java | 12 +-
.../IgniteCacheQueryNodeRestartSelfTest.java | 5 +
...dCacheAbstractReduceFieldsQuerySelfTest.java | 1 -
.../cache/ttl/CacheTtlAbstractSelfTest.java | 6 +-
.../h2/GridIndexingSpiAbstractSelfTest.java | 4 +-
.../query/h2/sql/BaseH2CompareQueryTest.java | 4 +-
.../query/h2/sql/GridQueryParsingTest.java | 5 +-
.../IgniteCacheQuerySelfTestSuite.java | 6 +-
.../IgniteCacheWithIndexingTestSuite.java | 3 +
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/mesos/README.txt | 2 +-
modules/mesos/pom.xml | 2 +-
.../apache/ignite/mesos/ClusterProperties.java | 15 +
.../apache/ignite/mesos/IgniteScheduler.java | 10 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/README.txt | 4 +
modules/scalar-2.10/licenses/apache-2.0.txt | 202 ++++
.../scalar-2.10/licenses/scala-bsd-license.txt | 18 +
modules/scalar-2.10/pom.xml | 197 ++++
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/README.txt | 4 +
modules/spark-2.10/licenses/apache-2.0.txt | 202 ++++
.../spark-2.10/licenses/scala-bsd-license.txt | 18 +
modules/spark-2.10/pom.xml | 120 ++
modules/spark/README.txt | 8 +
modules/spark/licenses/apache-2.0.txt | 202 ++++
modules/spark/licenses/scala-bsd-license.txt | 18 +
modules/spark/pom.xml | 110 ++
.../org/apache/ignite/spark/IgniteContext.scala | 119 ++
.../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 | 231 ++++
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
.../ignite/tools/classgen/ClassesGenerator.java | 30 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console-2.10/README.txt | 4 +
modules/visor-console-2.10/pom.xml | 174 +++
modules/visor-console/pom.xml | 2 +-
.../commands/cache/VisorCacheScanCommand.scala | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
.../IgniteWebSessionSelfTestSuite.java | 2 +-
modules/yardstick/pom.xml | 2 +-
parent/pom.xml | 5 +
pom.xml | 22 +-
scripts/git-apply-patch.sh | 8 +-
scripts/git-format-patch.sh | 6 +-
scripts/git-patch-functions.sh | 36 +-
504 files changed, 15851 insertions(+), 7562 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/55764e82/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/55764e82/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/55764e82/modules/spring/pom.xml
----------------------------------------------------------------------
[41/50] incubator-ignite git commit: #IGNITE-960 Fixed test.
Posted by sb...@apache.org.
#IGNITE-960 Fixed test.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dd8048bd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dd8048bd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dd8048bd
Branch: refs/heads/ignite-950
Commit: dd8048bd7c4c143395dbc0f18010d101698604cd
Parents: a7ca45b
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 17:51:57 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 17:51:57 2015 +0300
----------------------------------------------------------------------
modules/spring/src/test/config/node1.xml | 2 +-
modules/spring/src/test/config/store-cache1.xml | 2 +-
.../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 63 +++++++++++++++++++-
.../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 3 +-
4 files changed, 63 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd8048bd/modules/spring/src/test/config/node1.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/node1.xml b/modules/spring/src/test/config/node1.xml
index 67bae12..76539f7 100644
--- a/modules/spring/src/test/config/node1.xml
+++ b/modules/spring/src/test/config/node1.xml
@@ -22,7 +22,7 @@
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
- <bean id="simpleDataSource" class="sun.jdbc.odbc.ee.ConnectionPoolDataSource"/>
+ <bean id="simpleDataSource" class="org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactorySelfTest$DummyDataSource"/>
<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="gridName" value="ignite1"/>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd8048bd/modules/spring/src/test/config/store-cache1.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/store-cache1.xml b/modules/spring/src/test/config/store-cache1.xml
index bff88e9..a9e58d6 100644
--- a/modules/spring/src/test/config/store-cache1.xml
+++ b/modules/spring/src/test/config/store-cache1.xml
@@ -23,7 +23,7 @@
http://www.springframework.org/schema/beans/spring-beans.xsd">
- <bean id="simpleDataSource1" class="sun.jdbc.odbc.ee.ConnectionPoolDataSource"/>
+ <bean id="simpleDataSource1" class="org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactorySelfTest$DummyDataSource"/>
<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="gridName" value="ignite1"/>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd8048bd/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
index 6d3d3fd..7638a46 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
@@ -22,9 +22,11 @@ import org.apache.ignite.configuration.*;
import org.apache.ignite.testframework.*;
import org.apache.ignite.testframework.junits.common.*;
import org.h2.jdbcx.*;
-import sun.jdbc.odbc.ee.*;
+import java.io.*;
+import java.sql.*;
import java.util.concurrent.*;
+import java.util.logging.*;
/**
* Test for Cache jdbc blob store factory.
@@ -44,7 +46,7 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
try(Ignite ignite1 = Ignition.start("modules/spring/src/test/config/store-cache1.xml")) {
checkStore(ignite.<Integer, String>cache(CACHE_NAME), JdbcDataSource.class);
- checkStore(ignite1.<Integer, String>cache(CACHE_NAME), ConnectionPoolDataSource.class);
+ checkStore(ignite1.<Integer, String>cache(CACHE_NAME), DummyDataSource.class);
}
}
}
@@ -59,7 +61,7 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
try (IgniteCache<Integer, String> cache1 = ignite1.getOrCreateCache(cacheConfiguration())) {
checkStore(cache, JdbcDataSource.class);
- checkStore(cache1, ConnectionPoolDataSource.class);
+ checkStore(cache1, DummyDataSource.class);
}
}
}
@@ -112,4 +114,59 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
assertEquals(dataSrcClass,
GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "dataSrc").getClass());
}
+
+ /**
+ *
+ */
+ public static class DummyDataSource implements javax.sql.DataSource, Serializable {
+ /** */
+ public DummyDataSource() {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public Connection getConnection() throws SQLException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Connection getConnection(String username, String password) throws SQLException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public PrintWriter getLogWriter() throws SQLException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void setLogWriter(PrintWriter out) throws SQLException {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public void setLoginTimeout(int seconds) throws SQLException {
+ // No-op.
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getLoginTimeout() throws SQLException {
+ return 0;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public <T> T unwrap(Class<T> iface) throws SQLException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isWrapperFor(Class<?> iface) throws SQLException {
+ return false;
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd8048bd/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
index 7b709d5..c456339 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
@@ -23,7 +23,6 @@ import org.apache.ignite.configuration.*;
import org.apache.ignite.testframework.*;
import org.apache.ignite.testframework.junits.common.*;
import org.h2.jdbcx.*;
-import sun.jdbc.odbc.ee.*;
import javax.cache.*;
import java.io.*;
@@ -47,7 +46,7 @@ public class CacheJdbcPojoStoreFactorySelfTest extends GridCommonAbstractTest {
try (IgniteCache<Integer, String> cache1 = ignite1.getOrCreateCache(cacheConfiguration())) {
checkStore(cache, JdbcDataSource.class);
- checkStore(cache1, ConnectionPoolDataSource.class);
+ checkStore(cache1, CacheJdbcBlobStoreFactorySelfTest.DummyDataSource.class);
}
}
}
[42/50] incubator-ignite git commit: Merge remote-tracking branch
'origin/ignite-960' into ignite-960
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-960' into ignite-960
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c909caee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c909caee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c909caee
Branch: refs/heads/ignite-950
Commit: c909caee1e43610bcbf3e1350b78525a0e76ca48
Parents: ca89d81 dd8048b
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jun 16 17:52:15 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jun 16 17:52:15 2015 +0300
----------------------------------------------------------------------
modules/spring/src/test/config/node1.xml | 2 +-
modules/spring/src/test/config/store-cache1.xml | 2 +-
.../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 63 +++++++++++++++++++-
.../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 3 +-
4 files changed, 63 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
[22/50] incubator-ignite git commit: Merge branches 'ignite-1009-v4'
and 'ignite-sprint-6' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-1009-v4
Posted by sb...@apache.org.
Merge branches 'ignite-1009-v4' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-1009-v4
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7c51a141
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7c51a141
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7c51a141
Branch: refs/heads/ignite-950
Commit: 7c51a14166113e38a1d749fe0a2510c37dc86fe3
Parents: b06eb0e 0907338
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Jun 15 10:30:06 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Jun 15 10:30:06 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/cache/query/ScanQuery.java | 5 +-
.../datastructures/DataStructuresProcessor.java | 67 +++++++++++++++++++-
.../rest/client/message/GridRouterRequest.java | 18 ++++++
.../rest/client/message/GridRouterResponse.java | 18 ++++++
.../ignite/tools/classgen/ClassesGenerator.java | 12 ++++
5 files changed, 116 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
[46/50] incubator-ignite git commit: Merge remote-tracking branch
'origin/ignite-960' into ignite-960
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-960' into ignite-960
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/83abea4a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/83abea4a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/83abea4a
Branch: refs/heads/ignite-950
Commit: 83abea4afd4fd5d66be111f5af8cf1a0d69a677e
Parents: d530c8c 4025ce3
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 18:48:16 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 18:48:16 2015 +0300
----------------------------------------------------------------------
.../cache/store/jdbc/CacheJdbcPojoStore.java | 3 -
.../internal/interop/InteropBootstrap.java | 3 +-
.../internal/interop/InteropIgnition.java | 5 +-
.../processors/query/GridQueryProcessor.java | 102 ++++++---
.../ignite/spi/discovery/tcp/ClientImpl.java | 87 +++++---
.../apache/ignite/internal/GridSelfTest.java | 12 +-
.../GridDiscoveryManagerAliveCacheSelfTest.java | 17 +-
.../GridCacheAbstractFailoverSelfTest.java | 2 +
...ridCacheMultinodeUpdateAbstractSelfTest.java | 9 +
.../cache/GridCacheVersionMultinodeTest.java | 8 +-
...CacheP2pUnmarshallingRebalanceErrorTest.java | 15 +-
.../IgniteCacheClientNodeConcurrentStart.java | 14 +-
.../distributed/IgniteCacheManyClientsTest.java | 69 +++++--
.../GridCachePartitionedTxSalvageSelfTest.java | 37 +---
.../junits/common/GridCommonAbstractTest.java | 11 +-
.../IgniteCacheFailoverTestSuite.java | 8 -
.../IgniteCacheFailoverTestSuite2.java | 47 +++++
.../CacheAbstractQueryMetricsSelfTest.java | 205 ++++++++++++++++++
.../CachePartitionedQueryMetricsSelfTest.java | 32 +++
.../CacheReplicatedQueryMetricsSelfTest.java | 32 +++
.../cache/GridCacheQueryMetricsSelfTest.java | 206 -------------------
.../query/h2/sql/BaseH2CompareQueryTest.java | 2 +-
.../IgniteCacheQuerySelfTestSuite.java | 4 +-
23 files changed, 581 insertions(+), 349 deletions(-)
----------------------------------------------------------------------
[33/50] incubator-ignite git commit: # ignite-sprint-6 tests fixes
Posted by sb...@apache.org.
# ignite-sprint-6 tests fixes
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a9228c07
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a9228c07
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a9228c07
Branch: refs/heads/ignite-950
Commit: a9228c07aa125613df45af226fe133b93c8c2783
Parents: 5b9013f
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 16 15:02:21 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 16 15:02:21 2015 +0300
----------------------------------------------------------------------
.../cache/GridCacheMultinodeUpdateAbstractSelfTest.java | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a9228c07/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java
index ddf42e3..4152229 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java
@@ -33,6 +33,7 @@ import static org.apache.ignite.cache.CacheMode.*;
/**
* Multinode update test.
*/
+@SuppressWarnings("unchecked")
public abstract class GridCacheMultinodeUpdateAbstractSelfTest extends GridCacheAbstractSelfTest {
/** */
protected static volatile boolean failed;
@@ -52,6 +53,7 @@ public abstract class GridCacheMultinodeUpdateAbstractSelfTest extends GridCache
return 3 * 60_000;
}
+ /** {@inheritDoc} */
@Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
CacheConfiguration ccfg = super.cacheConfiguration(gridName);
@@ -62,6 +64,13 @@ public abstract class GridCacheMultinodeUpdateAbstractSelfTest extends GridCache
return ccfg;
}
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ super.beforeTest();
+
+ failed = false;
+ }
+
/**
* @throws Exception If failed.
*/
[08/50] incubator-ignite git commit: # ignite-883
Posted by sb...@apache.org.
# ignite-883
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8870a177
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8870a177
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8870a177
Branch: refs/heads/ignite-950
Commit: 8870a177acaa16f6757615cab6017b21aa274c01
Parents: 16f3d32
Author: sboikov <sb...@gridgain.com>
Authored: Fri Jun 12 10:05:22 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Jun 12 17:20:14 2015 +0300
----------------------------------------------------------------------
.../communication/tcp/TcpCommunicationSpi.java | 2 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 232 ++++++++++++-------
.../ignite/spi/discovery/tcp/ServerImpl.java | 170 +++++++++++---
.../ipfinder/TcpDiscoveryIpFinderAdapter.java | 34 ++-
.../TcpDiscoveryMulticastIpFinder.java | 19 +-
.../messages/TcpDiscoveryAbstractMessage.java | 10 +-
.../distributed/IgniteCacheManyClientsTest.java | 65 ++++--
.../tcp/TcpClientDiscoverySpiSelfTest.java | 42 +++-
8 files changed, 412 insertions(+), 162 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8870a177/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 f19e25b..9e38788 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
@@ -2028,7 +2028,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter
if (X.hasCause(e, SocketTimeoutException.class))
LT.warn(log, null, "Connect timed out (consider increasing 'connTimeout' " +
- "configuration property) [addr=" + addr + ", connTimeout" + connTimeout + ']');
+ "configuration property) [addr=" + addr + ", connTimeout=" + connTimeout + ']');
if (errs == null)
errs = new IgniteCheckedException("Failed to connect to node (is node still alive?). " +
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8870a177/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 23e6f88..d8108e5 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
@@ -311,7 +311,7 @@ class ClientImpl extends TcpDiscoveryImpl {
for (ClusterNode n : rmts) {
rmtNodes.remove(n.id());
- Collection<ClusterNode> top = updateTopologyHistory(topVer + 1);
+ Collection<ClusterNode> top = updateTopologyHistory(topVer + 1, null);
lsnr.onDiscovery(EVT_NODE_FAILED, topVer, n, top, new TreeMap<>(topHist), null);
}
@@ -348,13 +348,14 @@ class ClientImpl extends TcpDiscoveryImpl {
/**
* @param recon {@code True} if reconnects.
+ * @param timeout Timeout.
* @return Opened socket or {@code null} if timeout.
* @throws InterruptedException If interrupted.
* @throws IgniteSpiException If failed.
* @see TcpDiscoverySpi#joinTimeout
*/
@SuppressWarnings("BusyWait")
- @Nullable private Socket joinTopology(boolean recon) throws IgniteSpiException, InterruptedException {
+ @Nullable private Socket joinTopology(boolean recon, long timeout) throws IgniteSpiException, InterruptedException {
Collection<InetSocketAddress> addrs = null;
long startTime = U.currentTimeMillis();
@@ -371,11 +372,11 @@ class ClientImpl extends TcpDiscoveryImpl {
log.debug("Resolved addresses from IP finder: " + addrs);
}
else {
- U.warn(log, "No addresses registered in the IP finder (will retry in 2000ms): " + spi.ipFinder);
-
- if (spi.joinTimeout > 0 && (U.currentTimeMillis() - startTime) > spi.joinTimeout)
+ if (timeout > 0 && (U.currentTimeMillis() - startTime) > timeout)
return null;
+ U.warn(log, "No addresses registered in the IP finder (will retry in 2000ms): " + spi.ipFinder);
+
Thread.sleep(2000);
}
}
@@ -421,13 +422,13 @@ class ClientImpl extends TcpDiscoveryImpl {
}
if (addrs.isEmpty()) {
- if (spi.joinTimeout > 0 && (U.currentTimeMillis() - startTime) > spi.joinTimeout)
+ if (timeout > 0 && (U.currentTimeMillis() - startTime) > timeout)
return null;
- Thread.sleep(2000);
-
U.warn(log, "Failed to connect to any address from IP finder (will retry to join topology " +
"in 2000ms): " + addrs0);
+
+ Thread.sleep(2000);
}
}
}
@@ -541,16 +542,17 @@ class ClientImpl extends TcpDiscoveryImpl {
/**
* @param topVer New topology version.
+ * @param msg Discovery message.
* @return Latest topology snapshot.
*/
- private NavigableSet<ClusterNode> updateTopologyHistory(long topVer) {
+ private NavigableSet<ClusterNode> updateTopologyHistory(long topVer, @Nullable TcpDiscoveryAbstractMessage msg) {
this.topVer = topVer;
NavigableSet<ClusterNode> allNodes = allVisibleNodes();
if (!topHist.containsKey(topVer)) {
assert topHist.isEmpty() || topHist.lastKey() == topVer - 1 :
- "lastVer=" + topHist.lastKey() + ", newVer=" + topVer;
+ "lastVer=" + topHist.lastKey() + ", newVer=" + topVer + ", locNode=" + locNode + ", msg=" + msg;
topHist.put(topVer, allNodes);
@@ -619,6 +621,17 @@ class ClientImpl extends TcpDiscoveryImpl {
}
/**
+ * @param err Error.
+ */
+ private void joinError(IgniteSpiException err) {
+ assert err != null;
+
+ joinErr = err;
+
+ joinLatch.countDown();
+ }
+
+ /**
* Heartbeat sender.
*/
private class HeartbeatSender extends TimerTask {
@@ -727,7 +740,7 @@ class ClientImpl extends TcpDiscoveryImpl {
spi.stats.onMessageReceived(msg);
- if (spi.ensured(msg))
+ if (spi.ensured(msg) && joinLatch.getCount() == 0L)
lastMsgId = msg.id();
msgWorker.addMessage(msg);
@@ -866,11 +879,16 @@ class ClientImpl extends TcpDiscoveryImpl {
/** */
private volatile Socket sock;
+ /** */
+ private boolean join;
+
/**
- *
+ * @param join {@code True} if reconnects during join.
*/
- protected Reconnector() {
+ protected Reconnector(boolean join) {
super(spi.ignite().name(), "tcp-client-disco-msg-worker", log);
+
+ this.join = join;
}
/**
@@ -888,51 +906,94 @@ class ClientImpl extends TcpDiscoveryImpl {
boolean success = false;
+ Exception err = null;
+
+ long timeout = join ? spi.joinTimeout : spi.netTimeout;
+
+ long startTime = U.currentTimeMillis();
+
try {
- sock = joinTopology(true);
+ while (true) {
+ sock = joinTopology(true, timeout);
- if (sock == null) {
- U.error(log, "Failed to reconnect to cluster: timeout.");
+ if (sock == null) {
+ if (join) {
+ joinError(new IgniteSpiException("Join process timed out, connection failed and " +
+ "failed to reconnect (consider increasing 'joinTimeout' configuration property) " +
+ "[networkTimeout=" + spi.joinTimeout + ", sock=" + sock + ']'));
+ }
+ else
+ U.error(log, "Failed to reconnect to cluster (consider increasing 'networkTimeout' " +
+ "configuration property) [networkTimeout=" + spi.netTimeout + ", sock=" + sock + ']');
- return;
- }
+ return;
+ }
- if (isInterrupted())
- throw new InterruptedException();
+ if (isInterrupted())
+ throw new InterruptedException();
- InputStream in = new BufferedInputStream(sock.getInputStream());
+ int oldTimeout = 0;
- sock.setKeepAlive(true);
- sock.setTcpNoDelay(true);
+ try {
+ oldTimeout = sock.getSoTimeout();
- // Wait for
- while (!isInterrupted()) {
- TcpDiscoveryAbstractMessage msg = spi.marsh.unmarshal(in, U.gridClassLoader());
+ sock.setSoTimeout((int)spi.netTimeout);
- if (msg instanceof TcpDiscoveryClientReconnectMessage) {
- TcpDiscoveryClientReconnectMessage res = (TcpDiscoveryClientReconnectMessage)msg;
+ InputStream in = new BufferedInputStream(sock.getInputStream());
- if (res.creatorNodeId().equals(getLocalNodeId())) {
- if (res.success()) {
- msgWorker.addMessage(res);
+ sock.setKeepAlive(true);
+ sock.setTcpNoDelay(true);
- success = true;
- }
+ // Wait for
+ while (!isInterrupted()) {
+ TcpDiscoveryAbstractMessage msg = spi.marsh.unmarshal(in, U.gridClassLoader());
- break;
+ if (msg instanceof TcpDiscoveryClientReconnectMessage) {
+ TcpDiscoveryClientReconnectMessage res = (TcpDiscoveryClientReconnectMessage)msg;
+
+ if (res.creatorNodeId().equals(getLocalNodeId())) {
+ if (res.success()) {
+ msgWorker.addMessage(res);
+
+ success = true;
+ }
+
+ return;
+ }
+ }
}
}
+ catch (IOException | IgniteCheckedException e) {
+ U.closeQuiet(sock);
+
+ if (log.isDebugEnabled())
+ log.error("Reconnect error [join=" + join + ", timeout=" + timeout + ']', e);
+ if (timeout > 0 && (U.currentTimeMillis() - startTime) > timeout)
+ throw e;
+ else
+ U.warn(log, "Failed to reconnect to cluster (will retry): " + e);
+ }
+ finally {
+ if (success)
+ sock.setSoTimeout(oldTimeout);
+ }
}
}
catch (IOException | IgniteCheckedException e) {
+ err = e;
+
U.error(log, "Failed to reconnect", e);
}
finally {
if (!success) {
U.closeQuiet(sock);
- msgWorker.addMessage(SPI_RECONNECT_FAILED);
+ if (join)
+ joinError(new IgniteSpiException("Failed to connect to cluster, connection failed and failed " +
+ "to reconnect.", err));
+ else
+ msgWorker.addMessage(SPI_RECONNECT_FAILED);
}
}
}
@@ -967,7 +1028,7 @@ class ClientImpl extends TcpDiscoveryImpl {
spi.stats.onJoinStarted();
try {
- final Socket sock = joinTopology(false);
+ final Socket sock = joinTopology(false, spi.joinTimeout);
if (sock == null) {
joinErr = new IgniteSpiException("Join process timed out.");
@@ -981,12 +1042,14 @@ class ClientImpl extends TcpDiscoveryImpl {
sockWriter.setSocket(sock);
- timer.schedule(new TimerTask() {
- @Override public void run() {
- if (joinLatch.getCount() > 0)
- queue.add(JOIN_TIMEOUT);
- }
- }, spi.netTimeout);
+ 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());
@@ -996,8 +1059,8 @@ class ClientImpl extends TcpDiscoveryImpl {
if (msg == JOIN_TIMEOUT) {
if (joinLatch.getCount() > 0) {
joinErr = new IgniteSpiException("Join process timed out, did not receive response for " +
- "join request (consider increasing 'networkTimeout' configuration property) " +
- "[networkTimeout=" + spi.netTimeout + ", sock=" + sock +']');
+ "join request (consider increasing 'joinTimeout' configuration property) " +
+ "[joinTimeout=" + spi.joinTimeout + ", sock=" + sock +']');
joinLatch.countDown();
@@ -1021,30 +1084,23 @@ class ClientImpl extends TcpDiscoveryImpl {
if (((SocketClosedMessage)msg).sock == currSock) {
currSock = null;
- if (joinLatch.getCount() > 0) {
- joinErr = new IgniteSpiException("Failed to connect to cluster: socket closed.");
+ boolean join = joinLatch.getCount() > 0;
- joinLatch.countDown();
+ if (spi.getSpiContext().isStopping() || segmented) {
+ leaveLatch.countDown();
- break;
+ if (join) {
+ joinError(new IgniteSpiException("Failed to connect to cluster: socket closed."));
+
+ break;
+ }
}
else {
- if (spi.getSpiContext().isStopping() || segmented)
- leaveLatch.countDown();
- else {
- assert reconnector == null;
-
- final Reconnector reconnector = new Reconnector();
- this.reconnector = reconnector;
- reconnector.start();
-
- timer.schedule(new TimerTask() {
- @Override public void run() {
- if (reconnector.isAlive())
- reconnector.cancel();
- }
- }, spi.netTimeout);
- }
+ assert reconnector == null;
+
+ final Reconnector reconnector = new Reconnector(join);
+ this.reconnector = reconnector;
+ reconnector.start();
}
}
}
@@ -1208,7 +1264,7 @@ class ClientImpl extends TcpDiscoveryImpl {
locNode.order(topVer);
- notifyDiscovery(EVT_NODE_JOINED, topVer, locNode, updateTopologyHistory(topVer));
+ notifyDiscovery(EVT_NODE_JOINED, topVer, locNode, updateTopologyHistory(topVer, msg));
joinErr = null;
@@ -1230,6 +1286,14 @@ class ClientImpl extends TcpDiscoveryImpl {
return;
}
+ if (!topHist.isEmpty() && msg.topologyVersion() <= topHist.lastKey()) {
+ if (log.isDebugEnabled())
+ log.debug("Discarding node add finished message since topology already updated " +
+ "[msg=" + msg + ", lastHistKey=" + topHist.lastKey() + ", node=" + node + ']');
+
+ return;
+ }
+
long topVer = msg.topologyVersion();
node.order(topVer);
@@ -1238,7 +1302,7 @@ class ClientImpl extends TcpDiscoveryImpl {
if (spi.locNodeVer.equals(node.version()))
node.version(spi.locNodeVer);
- NavigableSet<ClusterNode> top = updateTopologyHistory(topVer);
+ NavigableSet<ClusterNode> top = updateTopologyHistory(topVer, msg);
if (!pending && joinLatch.getCount() > 0) {
if (log.isDebugEnabled())
@@ -1276,7 +1340,7 @@ class ClientImpl extends TcpDiscoveryImpl {
return;
}
- NavigableSet<ClusterNode> top = updateTopologyHistory(msg.topologyVersion());
+ NavigableSet<ClusterNode> top = updateTopologyHistory(msg.topologyVersion(), msg);
if (!pending && joinLatch.getCount() > 0) {
if (log.isDebugEnabled())
@@ -1319,7 +1383,7 @@ class ClientImpl extends TcpDiscoveryImpl {
return;
}
- NavigableSet<ClusterNode> top = updateTopologyHistory(msg.topologyVersion());
+ NavigableSet<ClusterNode> top = updateTopologyHistory(msg.topologyVersion(), msg);
if (!pending && joinLatch.getCount() > 0) {
if (log.isDebugEnabled())
@@ -1376,28 +1440,32 @@ class ClientImpl extends TcpDiscoveryImpl {
return;
if (getLocalNodeId().equals(msg.creatorNodeId())) {
- assert msg.success();
+ assert msg.success() : msg;
- currSock = reconnector.sock;
+ if (reconnector != null) {
+ currSock = reconnector.sock;
- sockWriter.setSocket(currSock);
- sockReader.setSocket(currSock, locNode.clientRouterNodeId());
+ sockWriter.setSocket(currSock);
+ sockReader.setSocket(currSock, locNode.clientRouterNodeId());
- reconnector = null;
+ reconnector = null;
- pending = true;
+ pending = true;
- try {
- for (TcpDiscoveryAbstractMessage pendingMsg : msg.pendingMessages()) {
- if (log.isDebugEnabled())
- log.debug("Process message on reconnect [msg=" + pendingMsg + ']');
+ try {
+ for (TcpDiscoveryAbstractMessage pendingMsg : msg.pendingMessages()) {
+ if (log.isDebugEnabled())
+ log.debug("Process message on reconnect [msg=" + pendingMsg + ']');
- processDiscoveryMessage(pendingMsg);
+ processDiscoveryMessage(pendingMsg);
+ }
+ }
+ finally {
+ pending = false;
}
}
- finally {
- pending = false;
- }
+ else if (log.isDebugEnabled())
+ log.debug("Discarding reconnect message, reconnect is completed: " + msg);
}
else if (log.isDebugEnabled())
log.debug("Discarding reconnect message for another client: " + msg);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8870a177/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 65bea9f..9041557 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
@@ -41,7 +41,6 @@ import org.jsr166.*;
import java.io.*;
import java.net.*;
-import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
@@ -1192,7 +1191,7 @@ class ServerImpl extends TcpDiscoveryImpl {
if (node.id().equals(destNodeId)) {
Collection<TcpDiscoveryNode> allNodes = ring.allNodes();
- Collection<TcpDiscoveryNode> topToSend = new ArrayList<>(allNodes.size());
+ Collection<TcpDiscoveryNode> topToSnd = new ArrayList<>(allNodes.size());
for (TcpDiscoveryNode n0 : allNodes) {
assert n0.internalOrder() != 0 : n0;
@@ -1202,10 +1201,10 @@ class ServerImpl extends TcpDiscoveryImpl {
// There will be separate messages for nodes with greater
// internal order.
if (n0.internalOrder() < nodeAddedMsg.node().internalOrder())
- topToSend.add(n0);
+ topToSnd.add(n0);
}
- nodeAddedMsg.topology(topToSend);
+ nodeAddedMsg.topology(topToSnd);
nodeAddedMsg.messages(msgs, discardMsgId);
Map<Long, Collection<ClusterNode>> hist;
@@ -1646,6 +1645,108 @@ class ServerImpl extends TcpDiscoveryImpl {
}
/**
+ * Discovery messages history used for client reconnect.
+ */
+ private class EnsuredMessageHistory {
+ /** */
+ private static final int MAX = 1024;
+
+ /** Pending messages. */
+ private final ArrayDeque<TcpDiscoveryAbstractMessage> msgs = new ArrayDeque<>(MAX * 2);
+
+ /**
+ * @param msg Adds message.
+ */
+ void add(TcpDiscoveryAbstractMessage msg) {
+ assert spi.ensured(msg) : msg;
+
+ msgs.addLast(msg);
+
+ while (msgs.size() > MAX)
+ msgs.pollFirst();
+ }
+
+ /**
+ * Gets messages starting from provided ID (exclusive). If such
+ * message is not found, {@code null} is returned (this indicates
+ * a failure condition when it was already removed from queue).
+ *
+ * @param lastMsgId Last message ID received on client. {@code Null} if client did not finish connect procedure.
+ * @param node Client node.
+ * @return Collection of messages.
+ */
+ @Nullable Collection<TcpDiscoveryAbstractMessage> messages(@Nullable IgniteUuid lastMsgId,
+ TcpDiscoveryNode node)
+ {
+ assert node != null && node.isClient() : node;
+
+ if (lastMsgId == null) {
+ // Client connection failed before it received TcpDiscoveryNodeAddedMessage.
+ List<TcpDiscoveryAbstractMessage> res = null;
+
+ for (TcpDiscoveryAbstractMessage msg : msgs) {
+ if (msg instanceof TcpDiscoveryNodeAddedMessage) {
+ if (node.id().equals(((TcpDiscoveryNodeAddedMessage) msg).node().id()))
+ res = new ArrayList<>(msgs.size());
+ }
+
+ if (res != null)
+ res.add(prepare(msg, node.id()));
+ }
+
+ if (log.isDebugEnabled()) {
+ if (res == null)
+ log.debug("Failed to find node added message [node=" + node + ']');
+ else
+ log.debug("Found add added message [node=" + node + ", hist=" + res + ']');
+ }
+
+ return res;
+ }
+ else {
+ if (msgs.isEmpty())
+ return Collections.emptyList();
+
+ Collection<TcpDiscoveryAbstractMessage> cp = new ArrayList<>(msgs.size());
+
+ boolean skip = true;
+
+ for (TcpDiscoveryAbstractMessage msg : msgs) {
+ if (skip) {
+ if (msg.id().equals(lastMsgId))
+ skip = false;
+ }
+ else
+ cp.add(prepare(msg, node.id()));
+ }
+
+ cp = !skip ? cp : null;
+
+ if (log.isDebugEnabled()) {
+ if (cp == null)
+ log.debug("Failed to find messages history [node=" + node + ", lastMsgId" + lastMsgId + ']');
+ else
+ log.debug("Found messages history [node=" + node + ", hist=" + cp + ']');
+ }
+
+ return cp;
+ }
+ }
+
+ /**
+ * @param msg Message.
+ * @param destNodeId Client node ID.
+ * @return Prepared message.
+ */
+ private TcpDiscoveryAbstractMessage prepare(TcpDiscoveryAbstractMessage msg, UUID destNodeId) {
+ if (msg instanceof TcpDiscoveryNodeAddedMessage)
+ prepareNodeAddedMessage(msg, destNodeId, null, null);
+
+ return msg;
+ }
+ }
+
+ /**
* Pending messages container.
*/
private static class PendingMessages {
@@ -1678,33 +1779,27 @@ class ServerImpl extends TcpDiscoveryImpl {
}
/**
- * Gets messages starting from provided ID (exclusive). If such
- * message is not found, {@code null} is returned (this indicates
- * a failure condition when it was already removed from queue).
+ * Resets pending messages.
*
- * @param lastMsgId Last message ID.
- * @return Collection of messages.
+ * @param msgs Message.
+ * @param discardId Discarded message ID.
*/
- @Nullable Collection<TcpDiscoveryAbstractMessage> messages(IgniteUuid lastMsgId) {
- assert lastMsgId != null;
-
- if (msgs.isEmpty())
- return Collections.emptyList();
+ void reset(@Nullable Collection<TcpDiscoveryAbstractMessage> msgs, @Nullable IgniteUuid discardId) {
+ this.msgs.clear();
- Collection<TcpDiscoveryAbstractMessage> cp = new ArrayList<>(msgs.size());
+ if (msgs != null)
+ this.msgs.addAll(msgs);
- boolean skip = true;
+ this.discardId = discardId;
+ }
- for (TcpDiscoveryAbstractMessage msg : msgs) {
- if (skip) {
- if (msg.id().equals(lastMsgId))
- skip = false;
- }
- else
- cp.add(msg);
- }
+ /**
+ * Clears pending messages.
+ */
+ void clear() {
+ msgs.clear();
- return !skip ? cp : null;
+ discardId = null;
}
/**
@@ -1728,6 +1823,9 @@ class ServerImpl extends TcpDiscoveryImpl {
/** Pending messages. */
private final PendingMessages pendingMsgs = new PendingMessages();
+ /** Messages history used for client reconnect. */
+ private final EnsuredMessageHistory msgHist = new EnsuredMessageHistory();
+
/** Last message that updated topology. */
private TcpDiscoveryAbstractMessage lastMsg;
@@ -1794,6 +1892,9 @@ class ServerImpl extends TcpDiscoveryImpl {
else
assert false : "Unknown message type: " + msg.getClass().getSimpleName();
+ if (spi.ensured(msg))
+ msgHist.add(msg);
+
spi.stats.onMessageProcessingFinished(msg);
}
@@ -2130,6 +2231,8 @@ class ServerImpl extends TcpDiscoveryImpl {
onException("Failed to send message to next node [next=" + next.id() + ", msg=" + msg + ']',
e);
+ log.error("Will resend [msg=" + msg + ", e=" + e + ']');
+
if (e instanceof SocketTimeoutException || X.hasCause(e, SocketTimeoutException.class)) {
ackTimeout0 *= 2;
@@ -2619,11 +2722,15 @@ class ServerImpl extends TcpDiscoveryImpl {
node.aliveCheck(spi.maxMissedClientHbs);
if (isLocalNodeCoordinator()) {
- Collection<TcpDiscoveryAbstractMessage> pending = pendingMsgs.messages(msg.lastMessageId());
+ Collection<TcpDiscoveryAbstractMessage> pending = msgHist.messages(msg.lastMessageId(), node);
if (pending != null) {
msg.pendingMessages(pending);
msg.success(true);
+
+ if (log.isDebugEnabled())
+ log.debug("Accept client reconnect, restored pending messages " +
+ "[locNodeId=" + locNodeId + ", clientNodeId=" + nodeId + ']');
}
else {
if (log.isDebugEnabled())
@@ -2836,7 +2943,8 @@ class ServerImpl extends TcpDiscoveryImpl {
topHist.clear();
topHist.putAll(msg.topologyHistory());
- pendingMsgs.discard(msg.discardedMessageId());
+ // Restore pending messages.
+ pendingMsgs.reset(msg.messages(), msg.discardedMessageId());
// Clear data to minimize message size.
msg.messages(null, null);
@@ -3094,6 +3202,10 @@ class ServerImpl extends TcpDiscoveryImpl {
if (log.isDebugEnabled())
log.debug("Removed node from topology: " + leftNode);
+ // Clear pending messages map.
+ if (!ring.hasRemoteNodes())
+ pendingMsgs.clear();
+
long topVer;
if (locNodeCoord) {
@@ -3257,6 +3369,10 @@ class ServerImpl extends TcpDiscoveryImpl {
assert node != null;
+ // Clear pending messages map.
+ if (!ring.hasRemoteNodes())
+ pendingMsgs.clear();
+
long topVer;
if (locNodeCoord) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8870a177/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/TcpDiscoveryIpFinderAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/TcpDiscoveryIpFinderAdapter.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/TcpDiscoveryIpFinderAdapter.java
index 99a2cdc..4d62ff2 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/TcpDiscoveryIpFinderAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/TcpDiscoveryIpFinderAdapter.java
@@ -17,9 +17,13 @@
package org.apache.ignite.spi.discovery.tcp.ipfinder;
+import org.apache.ignite.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.resources.*;
import org.apache.ignite.spi.*;
+import org.apache.ignite.spi.discovery.*;
+import org.apache.ignite.spi.discovery.tcp.*;
import java.net.*;
import java.util.*;
@@ -35,6 +39,11 @@ public abstract class TcpDiscoveryIpFinderAdapter implements TcpDiscoveryIpFinde
@GridToStringExclude
private volatile IgniteSpiContext spiCtx;
+ /** Ignite instance . */
+ @IgniteInstanceResource
+ @GridToStringExclude
+ protected Ignite ignite;
+
/** {@inheritDoc} */
@Override public void onSpiContextInitialized(IgniteSpiContext spiCtx) throws IgniteSpiException {
this.spiCtx = spiCtx;
@@ -47,7 +56,8 @@ public abstract class TcpDiscoveryIpFinderAdapter implements TcpDiscoveryIpFinde
/** {@inheritDoc} */
@Override public void initializeLocalAddresses(Collection<InetSocketAddress> addrs) throws IgniteSpiException {
- registerAddresses(addrs);
+ if (!discoveryClientMode())
+ registerAddresses(addrs);
}
/** {@inheritDoc} */
@@ -77,6 +87,28 @@ public abstract class TcpDiscoveryIpFinderAdapter implements TcpDiscoveryIpFinde
}
/**
+ * @return {@code True} if TCP discovery works in client mode.
+ */
+ protected boolean discoveryClientMode() {
+ boolean clientMode;
+
+ Ignite ignite0 = ignite;
+
+ if (ignite0 != null) { // Can be null if used in tests without starting Ignite.
+ DiscoverySpi discoSpi = ignite0.configuration().getDiscoverySpi();
+
+ if (!(discoSpi instanceof TcpDiscoverySpi))
+ throw new IgniteSpiException("TcpDiscoveryIpFinder should be used with TcpDiscoverySpi: " + discoSpi);
+
+ clientMode = ignite0.configuration().isClientMode() && !((TcpDiscoverySpi)discoSpi).isForceServerMode();
+ }
+ else
+ clientMode = false;
+
+ return clientMode;
+ }
+
+ /**
* @return SPI context.
*/
protected IgniteSpiContext spiContext() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8870a177/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
index a992620..8e5a1fd 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
@@ -85,11 +85,6 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
@LoggerResource
private IgniteLogger log;
- /** Ignite instance . */
- @IgniteInstanceResource
- @GridToStringExclude
- private Ignite ignite;
-
/** Multicast IP address as string. */
private String mcastGrp = DFLT_MCAST_GROUP;
@@ -256,19 +251,7 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
"(it is recommended in production to specify at least one address in " +
"TcpDiscoveryMulticastIpFinder.getAddresses() configuration property)");
- boolean clientMode;
-
- if (ignite != null) { // Can be null if used in tests without starting Ignite.
- DiscoverySpi discoSpi = ignite.configuration().getDiscoverySpi();
-
- if (!(discoSpi instanceof TcpDiscoverySpi))
- throw new IgniteSpiException("TcpDiscoveryMulticastIpFinder should be used with " +
- "TcpDiscoverySpi: " + discoSpi);
-
- clientMode = ((TcpDiscoverySpi)discoSpi).isClientMode();
- }
- else
- clientMode = false;
+ boolean clientMode = discoveryClientMode();
InetAddress mcastAddr;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8870a177/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 145b518..21dbf4f 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
@@ -41,7 +41,7 @@ public abstract class TcpDiscoveryAbstractMessage implements Serializable {
protected static final int CLIENT_RECON_SUCCESS_FLAG_POS = 2;
/** Sender of the message (transient). */
- private transient UUID senderNodeId;
+ private transient UUID sndNodeId;
/** Message ID. */
private IgniteUuid id;
@@ -99,16 +99,16 @@ public abstract class TcpDiscoveryAbstractMessage implements Serializable {
* @return Sender node ID.
*/
public UUID senderNodeId() {
- return senderNodeId;
+ return sndNodeId;
}
/**
* Sets sender node ID.
*
- * @param senderNodeId Sender node ID.
+ * @param sndNodeId Sender node ID.
*/
- public void senderNodeId(UUID senderNodeId) {
- this.senderNodeId = senderNodeId;
+ public void senderNodeId(UUID sndNodeId) {
+ this.sndNodeId = sndNodeId;
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8870a177/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
index 77ddd40..4fb4387 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
@@ -63,18 +63,13 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
((TcpCommunicationSpi)cfg.getCommunicationSpi()).setLocalPortRange(200);
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setJoinTimeout(2 * 60_000);
if (!clientDiscovery)
((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true);
cfg.setClientMode(client);
- if (client) {
-// cfg.setPublicThreadPoolSize(1);
-// cfg.setPeerClassLoadingThreadPoolSize(1);
-// cfg.setIgfsThreadPoolSize(1);
- }
-
CacheConfiguration ccfg = new CacheConfiguration();
ccfg.setCacheMode(PARTITIONED);
@@ -197,43 +192,62 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
try {
IgniteInternalFuture<?> fut = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
@Override public Object call() throws Exception {
- try (Ignite ignite = startGrid(idx.getAndIncrement())) {
- log.info("Started node: " + ignite.name());
+ boolean counted = false;
- assertTrue(ignite.configuration().isClientMode());
+ try {
+ int nodeIdx = idx.getAndIncrement();
- IgniteCache<Object, Object> cache = ignite.cache(null);
+ Thread.currentThread().setName("client-thread-node-" + nodeIdx);
- ThreadLocalRandom rnd = ThreadLocalRandom.current();
+ try (Ignite ignite = startGrid(nodeIdx)) {
+ log.info("Started node: " + ignite.name());
- int iter = 0;
+ assertTrue(ignite.configuration().isClientMode());
- Integer key = rnd.nextInt(0, 1000);
+ IgniteCache<Object, Object> cache = ignite.cache(null);
- cache.put(key, iter++);
+ ThreadLocalRandom rnd = ThreadLocalRandom.current();
- assertNotNull(cache.get(key));
+ int iter = 0;
- latch.countDown();
-
- while (!stop.get()) {
- key = rnd.nextInt(0, 1000);
+ Integer key = rnd.nextInt(0, 1000);
cache.put(key, iter++);
assertNotNull(cache.get(key));
- Thread.sleep(1);
+ latch.countDown();
+
+ counted = true;
+
+ while (!stop.get()) {
+ key = rnd.nextInt(0, 1000);
+
+ cache.put(key, iter++);
+
+ assertNotNull(cache.get(key));
+
+ Thread.sleep(1);
+ }
+
+ log.info("Stopping node: " + ignite.name());
}
- log.info("Stopping node: " + ignite.name());
+ return null;
}
+ catch (Throwable e) {
+ log.error("Unexpected error in client thread: " + e, e);
- return null;
+ throw e;
+ }
+ finally {
+ if (!counted)
+ latch.countDown();
+ }
}
}, THREADS, "client-thread");
- latch.await();
+ assertTrue(latch.await(getTestTimeout(), TimeUnit.MILLISECONDS));
log.info("All clients started.");
@@ -245,6 +259,11 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
fut.get();
}
+ catch (Throwable e) {
+ log.error("Unexpected error: " + e, e);
+
+ throw e;
+ }
finally {
stop.set(true);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8870a177/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 44fe299..8147958 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
@@ -193,8 +193,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
}
/**
- *
- * @throws Exception
+ * @throws Exception If failed.
*/
public void testJoinTimeout() throws Exception {
clientIpFinder = new TcpDiscoveryVmIpFinder();
@@ -544,8 +543,6 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testClientReconnectTopologyChange2() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-998");
-
maxMissedClientHbs = 100;
clientsPerSrv = 1;
@@ -1001,6 +998,24 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
}
/**
+ * @throws Exception If failed.
+ */
+ public void testJoinError2() throws Exception {
+ startServerNodes(1);
+
+ Ignite ignite = G.ignite("server-0");
+
+ TestTcpDiscoverySpi srvSpi = ((TestTcpDiscoverySpi)ignite.configuration().getDiscoverySpi());
+
+ srvSpi.failNodeAddedMessage();
+ srvSpi.failClientReconnectMessage();
+
+ startClientNodes(1);
+
+ checkNodes(1, 1);
+ }
+
+ /**
* @param clientIdx Client index.
* @param srvIdx Server index.
* @throws Exception In case of error.
@@ -1251,6 +1266,9 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
/** */
private AtomicInteger failNodeAdded = new AtomicInteger();
+ /** */
+ private AtomicInteger failClientReconnect = new AtomicInteger();
+
/**
* @param lock Lock.
*/
@@ -1276,6 +1294,13 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
}
/**
+ *
+ */
+ void failClientReconnectMessage() {
+ failClientReconnect.set(1);
+ }
+
+ /**
* @param isPause Is lock.
* @param locks Locks.
*/
@@ -1293,7 +1318,14 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest {
GridByteArrayOutputStream bout) throws IOException, IgniteCheckedException {
waitFor(writeLock);
- if (msg instanceof TcpDiscoveryNodeAddedMessage && failNodeAdded.getAndDecrement() > 0) {
+ boolean fail = false;
+
+ if (msg instanceof TcpDiscoveryNodeAddedMessage)
+ fail = failNodeAdded.getAndDecrement() > 0;
+ else if (msg instanceof TcpDiscoveryClientReconnectMessage)
+ fail = failClientReconnect.getAndDecrement() > 0;
+
+ if (fail) {
log.info("Close socket on message write [msg=" + msg + "]");
sock.close();
[37/50] incubator-ignite git commit: # ignite-sprint-6 tests fixes
Posted by sb...@apache.org.
# ignite-sprint-6 tests fixes
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e3750b78
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e3750b78
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e3750b78
Branch: refs/heads/ignite-950
Commit: e3750b78c9fa6b50bee2b35506c706ac4b79126e
Parents: f2c4cc8
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 16 16:45:27 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 16 16:52:04 2015 +0300
----------------------------------------------------------------------
.../GridDiscoveryManagerAliveCacheSelfTest.java | 17 ++++++---
.../distributed/IgniteCacheManyClientsTest.java | 11 +++---
.../GridCachePartitionedTxSalvageSelfTest.java | 37 +++-----------------
3 files changed, 24 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e3750b78/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
index ba61890..6e199b8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAliveCacheSelfTest.java
@@ -195,8 +195,11 @@ public class GridDiscoveryManagerAliveCacheSelfTest extends GridCommonAbstractTe
*/
@SuppressWarnings("SuspiciousMethodCalls")
private void validateAlives() {
- for (Ignite g : alive)
- assertEquals(PERM_NODES_CNT, g.cluster().nodes().size());
+ for (Ignite g : alive) {
+ log.info("Validate node: " + g.name());
+
+ assertEquals("Unexpected nodes number for node: " + g.name(), PERM_NODES_CNT, g.cluster().nodes().size());
+ }
for (final Ignite g : alive) {
IgniteKernal k = (IgniteKernal)g;
@@ -222,8 +225,14 @@ public class GridDiscoveryManagerAliveCacheSelfTest extends GridCommonAbstractTe
}
});
- assertTrue(
- currTop.contains(GridCacheUtils.oldestAliveCacheServerNode(k.context().cache().context(), new AffinityTopologyVersion(currVer))));
+ GridCacheSharedContext<?, ?> ctx = k.context().cache().context();
+
+ ClusterNode oldest =
+ GridCacheUtils.oldestAliveCacheServerNode(ctx, new AffinityTopologyVersion(currVer));
+
+ assertNotNull(oldest);
+
+ assertTrue(currTop.contains(oldest));
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e3750b78/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
index 947ded2..c3223a2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
@@ -160,10 +160,13 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
log.info("All clients started.");
- checkNodes(SRVS + CLIENTS);
-
- for (Ignite client : clients)
- client.close();
+ try {
+ checkNodes(SRVS + CLIENTS);
+ }
+ finally {
+ for (Ignite client : clients)
+ client.close();
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e3750b78/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
index 6192f39..c1a19a4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java
@@ -21,7 +21,6 @@ import org.apache.ignite.*;
import org.apache.ignite.cache.affinity.rendezvous.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.affinity.*;
import org.apache.ignite.internal.processors.cache.*;
import org.apache.ignite.internal.processors.cache.transactions.*;
import org.apache.ignite.internal.util.typedef.internal.*;
@@ -147,8 +146,7 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
* Check whether caches has no transactions after salvage timeout.
*
* @param mode Transaction mode (PESSIMISTIC, OPTIMISTIC).
- * @param prepare Whether to prepare transaction state
- * (i.e. call {@link IgniteInternalTx#prepare()}).
+ * @param prepare Whether to prepare transaction state (i.e. call {@link IgniteInternalTx#prepare()}).
* @throws Exception If failed.
*/
private void checkSalvageAfterTimeout(TransactionConcurrency mode, boolean prepare) throws Exception {
@@ -193,14 +191,13 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
* Start new transaction on the grid(0) and put some keys to it.
*
* @param mode Transaction mode (PESSIMISTIC, OPTIMISTIC).
- * @param prepare Whether to prepare transaction state
- * (i.e. call {@link IgniteInternalTx#prepare()}).
+ * @param prepare Whether to prepare transaction state (i.e. call {@link IgniteInternalTx#prepare()}).
* @throws Exception If failed.
*/
private void startTxAndPutKeys(final TransactionConcurrency mode, final boolean prepare) throws Exception {
Ignite ignite = grid(0);
- final Collection<Integer> keys = nearKeys(ignite);
+ final Collection<Integer> keys = nearKeys(ignite.cache(null), KEY_CNT, 0);
IgniteInternalFuture<?> fut = multithreadedAsync(new Runnable() {
@Override public void run() {
@@ -239,31 +236,6 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
}
/**
- * Gets keys that are not primary nor backup for node.
- *
- * @param ignite Grid.
- * @return Collection of keys.
- */
- private Collection<Integer> nearKeys(Ignite ignite) {
- final Collection<Integer> keys = new ArrayList<>(KEY_CNT);
-
- IgniteKernal kernal = (IgniteKernal) ignite;
-
- GridCacheAffinityManager affMgr = kernal.internalCache().context().affinity();
-
- for (int i = 0; i < KEY_CNT * GRID_CNT * 1.5; i++) {
- if (!affMgr.localNode((Object)i, new AffinityTopologyVersion(kernal.context().discovery().topologyVersion()))) {
- keys.add(i);
-
- if (keys.size() == KEY_CNT)
- break;
- }
- }
-
- return keys;
- }
-
- /**
* Checks that transaction manager for cache context does not have any pending transactions.
*
* @param ctx Cache context.
@@ -283,7 +255,6 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes
private void checkTxsNotEmpty(GridCacheContext ctx, int exp) {
int size = ctx.tm().txs().size();
- assert size == exp : "Some transactions were salvaged unexpectedly: " + exp +
- " expected, but only " + size + " found.";
+ assertEquals("Some transactions were salvaged unexpectedly", exp, size);
}
}
[03/50] incubator-ignite git commit: Tests unmuted
Posted by sb...@apache.org.
Tests unmuted
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/96d12d0e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/96d12d0e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/96d12d0e
Branch: refs/heads/ignite-950
Commit: 96d12d0ec2bcee65a4f4f76869b3eb1c259f316e
Parents: b087aca
Author: agura <ag...@gridgain.com>
Authored: Fri Jun 12 16:38:29 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri Jun 12 16:38:29 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCachePutAllFailoverSelfTest.java | 5 -----
.../distributed/dht/GridCacheColocatedFailoverSelfTest.java | 5 -----
.../distributed/near/GridCachePartitionedFailoverSelfTest.java | 5 -----
.../replicated/GridCacheReplicatedFailoverSelfTest.java | 5 -----
4 files changed, 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96d12d0e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
index 4ef5787..fc9e17b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
@@ -49,11 +49,6 @@ import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
* Tests putAll() method along with failover and different configurations.
*/
public class GridCachePutAllFailoverSelfTest extends GridCommonAbstractTest {
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-157");
- }
-
/** IP finder. */
private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96d12d0e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
index 74a107d..568b08f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheColocatedFailoverSelfTest.java
@@ -28,11 +28,6 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheColocatedFailoverSelfTest extends GridCacheAbstractFailoverTxSelfTest {
/** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-631 or IGNITE-157 or IGNITE-882");
- }
-
- /** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return PARTITIONED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96d12d0e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
index 9825cfd..553d748 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedFailoverSelfTest.java
@@ -27,11 +27,6 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCachePartitionedFailoverSelfTest extends GridCacheAbstractFailoverTxSelfTest {
/** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-631 or IGNITE-157 or IGNITE-882");
- }
-
- /** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return PARTITIONED;
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96d12d0e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
index 1103773..3461dd4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/replicated/GridCacheReplicatedFailoverSelfTest.java
@@ -28,11 +28,6 @@ import static org.apache.ignite.cache.CacheMode.*;
*/
public class GridCacheReplicatedFailoverSelfTest extends GridCacheAbstractFailoverTxSelfTest {
/** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-631 or IGNITE-157 or IGNITE-882");
- }
-
- /** {@inheritDoc} */
@Override protected CacheMode cacheMode() {
return REPLICATED;
}
[07/50] incubator-ignite git commit: Merge branch 'ignite-classname'
into ignite-sprint-6
Posted by sb...@apache.org.
Merge branch 'ignite-classname' into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2b81104a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2b81104a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2b81104a
Branch: refs/heads/ignite-950
Commit: 2b81104aaee4c39260dbd276405ef9f477c90f30
Parents: 2b7a18d e17a2be
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 12 17:16:43 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 12 17:16:43 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/GridKernalContextImpl.java | 5 +++--
.../apache/ignite/internal/IgniteKernal.java | 21 ++++++++++++++++++--
.../internal/MarshallerContextAdapter.java | 18 +++++++++++++++--
.../ignite/internal/MarshallerContextImpl.java | 14 ++++++++++++-
.../GridClientOptimizedMarshaller.java | 5 +++++
.../plugin/IgnitePluginProcessor.java | 16 ++-------------
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 14 +++++++++----
.../marshaller/MarshallerContextTestImpl.java | 18 +++++++++++++++++
.../junits/GridTestKernalContext.java | 1 +
.../ignite/tools/classgen/ClassesGenerator.java | 18 +++++++++++++----
10 files changed, 101 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
[50/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-sprint-6' into ignite-950
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-6' into ignite-950
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5e9a45f0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5e9a45f0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5e9a45f0
Branch: refs/heads/ignite-950
Commit: 5e9a45f0c69932ae99b3f79932dc89197afbce1d
Parents: 9e2943d d1a2150
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Jun 17 10:46:23 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jun 17 10:46:23 2015 +0300
----------------------------------------------------------------------
RELEASE_NOTES.txt | 12 +
.../apache/ignite/cache/query/ScanQuery.java | 23 +-
.../cache/store/jdbc/CacheJdbcBlobStore.java | 22 +-
.../store/jdbc/CacheJdbcBlobStoreFactory.java | 290 +++++++++++
.../cache/store/jdbc/CacheJdbcPojoStore.java | 6 +-
.../store/jdbc/CacheJdbcPojoStoreFactory.java | 148 ++++++
.../configuration/CacheConfiguration.java | 3 +-
.../ignite/internal/GridKernalContextImpl.java | 5 +-
.../apache/ignite/internal/IgniteKernal.java | 22 +-
.../internal/MarshallerContextAdapter.java | 18 +-
.../ignite/internal/MarshallerContextImpl.java | 14 +-
.../GridClientOptimizedMarshaller.java | 5 +
.../internal/interop/InteropBootstrap.java | 3 +-
.../internal/interop/InteropIgnition.java | 5 +-
.../discovery/GridDiscoveryManager.java | 9 +-
.../processors/cache/GridCacheProcessor.java | 34 +-
.../dht/preloader/GridDhtPreloader.java | 2 +-
.../transactions/IgniteTxLocalAdapter.java | 6 +-
.../datastructures/DataStructuresProcessor.java | 67 ++-
.../plugin/IgnitePluginProcessor.java | 16 +-
.../processors/query/GridQueryProcessor.java | 102 ++--
.../rest/client/message/GridRouterRequest.java | 18 +
.../rest/client/message/GridRouterResponse.java | 18 +
.../util/spring/IgniteSpringHelper.java | 10 +
.../SpringApplicationContextResource.java | 4 +-
.../apache/ignite/resources/SpringResource.java | 6 +-
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 28 +-
.../communication/tcp/TcpCommunicationSpi.java | 2 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 498 +++++++++++++------
.../ignite/spi/discovery/tcp/ServerImpl.java | 221 ++++----
.../spi/discovery/tcp/TcpDiscoveryImpl.java | 66 +++
.../ipfinder/TcpDiscoveryIpFinderAdapter.java | 34 +-
.../TcpDiscoveryMulticastIpFinder.java | 19 +-
.../messages/TcpDiscoveryAbstractMessage.java | 10 +-
.../apache/ignite/internal/GridSelfTest.java | 12 +-
.../GridDiscoveryManagerAliveCacheSelfTest.java | 17 +-
.../cache/CacheClientStoreSelfTest.java | 228 +++++++++
...acheReadOnlyTransactionalClientSelfTest.java | 327 ------------
.../GridCacheAbstractFailoverSelfTest.java | 2 +
...ridCacheMultinodeUpdateAbstractSelfTest.java | 9 +
.../cache/GridCachePutAllFailoverSelfTest.java | 5 -
.../cache/GridCacheVersionMultinodeTest.java | 8 +-
...CacheP2pUnmarshallingRebalanceErrorTest.java | 15 +-
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 14 +-
.../IgniteCacheClientNodeConcurrentStart.java | 14 +-
.../distributed/IgniteCacheManyClientsTest.java | 189 ++++++-
.../dht/GridCacheColocatedFailoverSelfTest.java | 5 -
.../GridCachePartitionedFailoverSelfTest.java | 5 -
.../GridCachePartitionedTxSalvageSelfTest.java | 37 +-
.../GridCacheReplicatedFailoverSelfTest.java | 5 -
...CacheClientWriteBehindStoreAbstractTest.java | 104 ++++
...teCacheClientWriteBehindStoreAtomicTest.java | 38 ++
.../IgnteCacheClientWriteBehindStoreTxTest.java | 32 ++
.../marshaller/MarshallerContextTestImpl.java | 18 +
.../tcp/TcpClientDiscoverySpiSelfTest.java | 73 ++-
.../junits/GridTestKernalContext.java | 1 +
.../junits/common/GridCommonAbstractTest.java | 11 +-
.../IgniteCacheFailoverTestSuite.java | 8 -
.../IgniteCacheFailoverTestSuite2.java | 47 ++
.../testsuites/IgniteCacheTestSuite4.java | 6 +-
.../IgniteCacheWriteBehindTestSuite.java | 2 +
modules/hibernate/pom.xml | 14 +
.../hibernate/CacheHibernateBlobStore.java | 87 +---
.../CacheHibernateBlobStoreFactory.java | 235 +++++++++
.../hibernate/src/test/config/factory-cache.xml | 59 +++
.../src/test/config/factory-cache1.xml | 61 +++
.../config/factory-incorrect-store-cache.xml | 56 +++
.../CacheHibernateStoreFactorySelfTest.java | 273 ++++++++++
.../testsuites/IgniteHibernateTestSuite.java | 2 +
.../CacheAbstractQueryMetricsSelfTest.java | 205 ++++++++
.../CachePartitionedQueryMetricsSelfTest.java | 32 ++
.../CacheReplicatedQueryMetricsSelfTest.java | 32 ++
.../cache/GridCacheQueryMetricsSelfTest.java | 206 --------
.../query/h2/sql/BaseH2CompareQueryTest.java | 2 +-
.../IgniteCacheQuerySelfTestSuite.java | 4 +-
modules/spring/pom.xml | 7 +
.../GridResourceSpringBeanInjector.java | 2 +-
.../util/spring/IgniteSpringHelperImpl.java | 17 +
.../src/test/config/incorrect-store-cache.xml | 57 +++
modules/spring/src/test/config/node.xml | 43 ++
modules/spring/src/test/config/node1.xml | 45 ++
.../test/config/pojo-incorrect-store-cache.xml | 56 +++
modules/spring/src/test/config/store-cache.xml | 59 +++
modules/spring/src/test/config/store-cache1.xml | 62 +++
.../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 172 +++++++
.../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 193 +++++++
.../testsuites/IgniteSpringTestSuite.java | 5 +
.../ignite/tools/classgen/ClassesGenerator.java | 30 +-
88 files changed, 3859 insertions(+), 1135 deletions(-)
----------------------------------------------------------------------
[06/50] incubator-ignite git commit: Release latch in marshaller
context in stop method.
Posted by sb...@apache.org.
Release latch in marshaller context in stop method.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e17a2be1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e17a2be1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e17a2be1
Branch: refs/heads/ignite-950
Commit: e17a2be1b931ea6b4e56be653b73a7994fd59898
Parents: e158c90
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 12 17:13:06 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 12 17:13:06 2015 +0300
----------------------------------------------------------------------
.../main/java/org/apache/ignite/internal/IgniteKernal.java | 2 ++
.../org/apache/ignite/internal/MarshallerContextImpl.java | 7 +++++++
2 files changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e17a2be1/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 9b2ae27..9da3346 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
@@ -1705,6 +1705,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
List<GridComponent> comps = ctx.components();
+ ctx.marshallerContext().onKernalStop();
+
// Callback component in reverse order while kernal is still functional
// if called in the same thread, at least.
for (ListIterator<GridComponent> it = comps.listIterator(comps.size()); it.hasPrevious();) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e17a2be1/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
index 7940e95..48f24ac 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/MarshallerContextImpl.java
@@ -83,6 +83,13 @@ public class MarshallerContextImpl extends MarshallerContextAdapter {
latch.countDown();
}
+ /**
+ * Release marshaller context.
+ */
+ public void onKernalStop() {
+ latch.countDown();
+ }
+
/** {@inheritDoc} */
@Override protected boolean registerClassName(int id, String clsName) throws IgniteCheckedException {
GridCacheAdapter<Integer, String> cache0 = cache;
[05/50] incubator-ignite git commit: Fixed test. Cache doesn't start
in transaction.
Posted by sb...@apache.org.
Fixed test. Cache doesn't start in transaction.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e158c90f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e158c90f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e158c90f
Branch: refs/heads/ignite-950
Commit: e158c90fe58082e00d97f26c5bb3ae450906fc6a
Parents: fe1750d
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Jun 12 17:11:27 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Jun 12 17:11:27 2015 +0300
----------------------------------------------------------------------
.../cache/IgniteCacheP2pUnmarshallingTxErrorTest.java | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e158c90f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
index a4e2753..017f7db 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
@@ -50,9 +50,12 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmars
* Sends put with optimistic lock and handles fail.
*/
protected void failOptimistic() {
- try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.OPTIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+ IgniteCache<Object, Object> cache = jcache(0);
- jcache(0).put(new TestKey(String.valueOf(++key)), "");
+ try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.OPTIMISTIC,
+ TransactionIsolation.REPEATABLE_READ)) {
+
+ cache.put(new TestKey(String.valueOf(++key)), "");
tx.commit();
@@ -69,9 +72,12 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends IgniteCacheP2pUnmars
* Sends put with pessimistic lock and handles fail.
*/
protected void failPessimictic() {
- try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ)) {
+ IgniteCache<Object, Object> cache = jcache(0);
+
+ try (Transaction tx = grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC,
+ TransactionIsolation.REPEATABLE_READ)) {
- jcache(0).put(new TestKey(String.valueOf(++key)), "");
+ cache.put(new TestKey(String.valueOf(++key)), "");
assert false : "p2p marshalling failed, but error response was not sent";
}
[11/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-883' into ignite-883-1
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-883' into ignite-883-1
Conflicts:
modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
modules/scalar-2.10/pom.xml
modules/spark-2.10/pom.xml
modules/spark/pom.xml
modules/visor-console-2.10/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/65db72eb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/65db72eb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/65db72eb
Branch: refs/heads/ignite-950
Commit: 65db72eb4a731e4b459ec0686f1741ef4ade13ab
Parents: 5160088 8870a17
Author: sboikov <sb...@gridgain.com>
Authored: Fri Jun 12 17:55:08 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Jun 12 17:55:08 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/cache/query/ScanQuery.java | 23 +
.../apache/ignite/internal/IgniteKernal.java | 1 -
.../discovery/GridDiscoveryManager.java | 9 +-
.../dht/preloader/GridDhtPreloader.java | 2 +-
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 28 +-
.../communication/tcp/TcpCommunicationSpi.java | 2 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 439 ++++++++++++-------
.../ignite/spi/discovery/tcp/ServerImpl.java | 223 ++++++----
.../spi/discovery/tcp/TcpDiscoveryImpl.java | 66 +++
.../ipfinder/TcpDiscoveryIpFinderAdapter.java | 34 +-
.../TcpDiscoveryMulticastIpFinder.java | 19 +-
.../messages/TcpDiscoveryAbstractMessage.java | 10 +-
.../distributed/IgniteCacheManyClientsTest.java | 138 +++++-
.../tcp/TcpClientDiscoverySpiSelfTest.java | 73 ++-
.../testsuites/IgniteCacheTestSuite4.java | 2 +
15 files changed, 774 insertions(+), 295 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65db72eb/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
index e6b69bc,11a8c84..90000e8
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
@@@ -99,23 -99,26 +99,46 @@@ public final class ScanQuery<K, V> exte
/**
* Gets partition number over which this query should iterate. Will return {@code null} if partition was not
* set. In this case query will iterate over all partitions in the cache.
+ *
+ * @return Partition number or {@code null}.
+ */
+ @Nullable public Integer getPartition() {
+ return part;
+ }
+
+ /**
+ * Sets partition number over which this query should iterate. If {@code null}, query will iterate over
+ * all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache.
+ *
+ * @param part Partition number over which this query should iterate.
+ * @return {@code this} for chaining.
+ */
+ public ScanQuery<K, V> setPartition(@Nullable Integer part) {
+ this.part = part;
+
+ return this;
+ }
+
++ /**
++ * Gets partition number over which this query should iterate. Will return {@code null} if partition was not
++ * set. In this case query will iterate over all partitions in the cache.
+ *
+ * @return Partition number or {@code null}.
+ */
+ @Nullable public Integer getPartition() {
+ return part;
+ }
+
+ /**
+ * Sets partition number over which this query should iterate. If {@code null}, query will iterate over
+ * all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache.
+ *
+ * @param part Partition number over which this query should iterate.
+ */
+ public void setPartition(@Nullable Integer part) {
+ this.part = part;
+ }
+
/** {@inheritDoc} */
@Override public ScanQuery<K, V> setPageSize(int pageSize) {
return (ScanQuery<K, V>)super.setPageSize(pageSize);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65db72eb/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65db72eb/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65db72eb/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index c598e38,ed9fc9a..7fa038c
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@@ -138,9 -140,6 +138,11 @@@ public class IgniteCacheTestSuite4 exte
suite.addTestSuite(IgniteCacheManyClientsTest.class);
+ suite.addTestSuite(IgniteStartCacheInTransactionSelfTest.class);
+ suite.addTestSuite(IgniteStartCacheInTransactionAtomicSelfTest.class);
+
++ suite.addTestSuite(IgniteCacheManyClientsTest.class);
++
return suite;
}
}
[31/50] incubator-ignite git commit: # ignite-sprint-6 moved tests to
separate suite
Posted by sb...@apache.org.
# ignite-sprint-6 moved tests to separate suite
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3423ed36
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3423ed36
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3423ed36
Branch: refs/heads/ignite-950
Commit: 3423ed363d4a8fa9539db2e3275cddf03b72812d
Parents: 1eb3bd2
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 16 14:28:20 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 16 14:28:20 2015 +0300
----------------------------------------------------------------------
.../IgniteCacheFailoverTestSuite.java | 8 ----
.../IgniteCacheFailoverTestSuite2.java | 47 ++++++++++++++++++++
2 files changed, 47 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3423ed36/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
index 08178db..dda86c1 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite.java
@@ -65,10 +65,6 @@ public class IgniteCacheFailoverTestSuite extends TestSuite {
suite.addTestSuite(GridCacheAtomicNearRemoveFailureTest.class);
suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderNearRemoveFailureTest.class);
- suite.addTestSuite(GridCacheAtomicFailoverSelfTest.class);
- suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderFailoverSelfTest.class);
- suite.addTestSuite(GridCacheAtomicReplicatedFailoverSelfTest.class);
-
suite.addTestSuite(IgniteCacheAtomicNodeJoinTest.class);
suite.addTestSuite(IgniteCacheTxNodeJoinTest.class);
suite.addTestSuite(IgniteCacheTxFairAffinityNodeJoinTest.class);
@@ -76,10 +72,6 @@ public class IgniteCacheFailoverTestSuite extends TestSuite {
suite.addTestSuite(IgniteCacheTxNearDisabledPutGetRestartTest.class);
suite.addTestSuite(IgniteCacheTxNearDisabledFairAffinityPutGetRestartTest.class);
- suite.addTestSuite(GridCachePartitionedFailoverSelfTest.class);
- suite.addTestSuite(GridCacheColocatedFailoverSelfTest.class);
- suite.addTestSuite(GridCacheReplicatedFailoverSelfTest.class);
-
return suite;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3423ed36/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite2.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite2.java
new file mode 100644
index 0000000..3bb4e97
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheFailoverTestSuite2.java
@@ -0,0 +1,47 @@
+/*
+ * 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.distributed.dht.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.atomic.*;
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+import org.apache.ignite.internal.processors.cache.distributed.replicated.*;
+
+/**
+ *
+ */
+public class IgniteCacheFailoverTestSuite2 {
+ /**
+ * @return Suite.
+ * @throws Exception If failed.
+ */
+ public static TestSuite suite() throws Exception {
+ TestSuite suite = new TestSuite("Cache Failover Test Suite2");
+
+ suite.addTestSuite(GridCacheAtomicFailoverSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicPrimaryWriteOrderFailoverSelfTest.class);
+ suite.addTestSuite(GridCacheAtomicReplicatedFailoverSelfTest.class);
+
+ suite.addTestSuite(GridCachePartitionedFailoverSelfTest.class);
+ suite.addTestSuite(GridCacheColocatedFailoverSelfTest.class);
+ suite.addTestSuite(GridCacheReplicatedFailoverSelfTest.class);
+
+ return suite;
+ }
+}
[29/50] incubator-ignite git commit: ignite-745 Fixed query metrics
for partitioned cache
Posted by sb...@apache.org.
ignite-745 Fixed query metrics for partitioned cache
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1eb3bd24
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1eb3bd24
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1eb3bd24
Branch: refs/heads/ignite-950
Commit: 1eb3bd24c50d9c6fdb6de3dedd0216bb6e5a81d8
Parents: f4b1123
Author: agura <ag...@gridgain.com>
Authored: Wed Jun 10 19:23:28 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Tue Jun 16 13:38:30 2015 +0300
----------------------------------------------------------------------
.../processors/query/GridQueryProcessor.java | 102 ++++++---
.../CacheAbstractQueryMetricsSelfTest.java | 205 ++++++++++++++++++
.../CachePartitionedQueryMetricsSelfTest.java | 32 +++
.../CacheReplicatedQueryMetricsSelfTest.java | 32 +++
.../cache/GridCacheQueryMetricsSelfTest.java | 206 -------------------
.../query/h2/sql/BaseH2CompareQueryTest.java | 2 +-
.../IgniteCacheQuerySelfTestSuite.java | 4 +-
7 files changed, 344 insertions(+), 239 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1eb3bd24/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 fed90d5..718e6ba 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
@@ -513,8 +513,8 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @throws IgniteCheckedException If failed.
*/
@SuppressWarnings("unchecked")
- public <K, V> GridCloseableIterator<IgniteBiTuple<K, V>> query(String space, String clause,
- Collection<Object> params, String resType, IndexingQueryFilter filters)
+ public <K, V> GridCloseableIterator<IgniteBiTuple<K, V>> query(final String space, final String clause,
+ final Collection<Object> params, final String resType, final IndexingQueryFilter filters)
throws IgniteCheckedException {
checkEnabled();
@@ -522,12 +522,18 @@ public class GridQueryProcessor extends GridProcessorAdapter {
throw new IllegalStateException("Failed to execute query (grid is stopping).");
try {
- TypeDescriptor type = typesByName.get(new TypeName(space, resType));
+ final GridCacheContext<?, ?> cctx = ctx.cache().internalCache(space).context();
- if (type == null || !type.registered())
- throw new CacheException("Failed to find SQL table for type: " + resType);
+ return executeQuery(cctx, new IgniteOutClosureX<GridCloseableIterator<IgniteBiTuple<K, V>>>() {
+ @Override public GridCloseableIterator<IgniteBiTuple<K, V>> applyx() throws IgniteCheckedException {
+ TypeDescriptor type = typesByName.get(new TypeName(space, resType));
- return idx.query(space, clause, params, type, filters);
+ if (type == null || !type.registered())
+ throw new CacheException("Failed to find SQL table for type: " + resType);
+
+ return idx.query(space, clause, params, type, filters);
+ }
+ });
}
finally {
busyLock.leaveBusy();
@@ -539,19 +545,26 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @param qry Query.
* @return Cursor.
*/
- public Iterable<List<?>> queryTwoStep(String space, GridCacheTwoStepQuery qry) {
+ public Iterable<List<?>> queryTwoStep(String space, final GridCacheTwoStepQuery qry) {
checkxEnabled();
if (!busyLock.enterBusy())
throw new IllegalStateException("Failed to execute query (grid is stopping).");
try {
- GridCacheContext<Object, Object> cacheCtx = ctx.cache().internalCache(space).context();
-
- return idx.queryTwoStep(
- cacheCtx,
- qry,
- cacheCtx.keepPortable());
+ final GridCacheContext<Object, Object> cctx = ctx.cache().internalCache(space).context();
+
+ return executeQuery(cctx, new IgniteOutClosureX<Iterable<List<?>>>() {
+ @Override public Iterable<List<?>> applyx() throws IgniteCheckedException {
+ return idx.queryTwoStep(
+ cctx,
+ qry,
+ cctx.keepPortable());
+ }
+ });
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
}
finally {
busyLock.leaveBusy();
@@ -563,14 +576,21 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @param qry Query.
* @return Cursor.
*/
- public QueryCursor<List<?>> queryTwoStep(GridCacheContext<?,?> cctx, SqlFieldsQuery qry) {
+ public QueryCursor<List<?>> queryTwoStep(final GridCacheContext<?,?> cctx, final SqlFieldsQuery qry) {
checkxEnabled();
if (!busyLock.enterBusy())
throw new IllegalStateException("Failed to execute query (grid is stopping).");
try {
- return idx.queryTwoStep(cctx, qry);
+ return executeQuery(cctx, new IgniteOutClosureX<QueryCursor<List<?>>>() {
+ @Override public QueryCursor<List<?>> applyx() throws IgniteCheckedException {
+ return idx.queryTwoStep(cctx, qry);
+ }
+ });
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
}
finally {
busyLock.leaveBusy();
@@ -582,14 +602,21 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @param qry Query.
* @return Cursor.
*/
- public <K,V> QueryCursor<Cache.Entry<K,V>> queryTwoStep(GridCacheContext<?,?> cctx, SqlQuery qry) {
+ public <K,V> QueryCursor<Cache.Entry<K,V>> queryTwoStep(final GridCacheContext<?,?> cctx, final SqlQuery qry) {
checkxEnabled();
if (!busyLock.enterBusy())
throw new IllegalStateException("Failed to execute query (grid is stopping).");
try {
- return idx.queryTwoStep(cctx, qry);
+ return executeQuery(cctx, new IgniteOutClosureX<QueryCursor<Cache.Entry<K, V>>>() {
+ @Override public QueryCursor<Cache.Entry<K, V>> applyx() throws IgniteCheckedException {
+ return idx.queryTwoStep(cctx, qry);
+ }
+ });
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException(e);
}
finally {
busyLock.leaveBusy();
@@ -698,7 +725,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
/**
* Closeable iterator.
*/
- private static interface ClIter<X> extends AutoCloseable, Iterator<X> {
+ private interface ClIter<X> extends AutoCloseable, Iterator<X> {
// No-op.
}
@@ -810,24 +837,30 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @throws IgniteCheckedException If failed.
*/
@SuppressWarnings("unchecked")
- public <K, V> GridCloseableIterator<IgniteBiTuple<K, V>> queryText(String space, String clause, String resType,
- IndexingQueryFilter filters) throws IgniteCheckedException {
+ public <K, V> GridCloseableIterator<IgniteBiTuple<K, V>> queryText(final String space, final String clause,
+ final String resType, final IndexingQueryFilter filters) throws IgniteCheckedException {
checkEnabled();
if (!busyLock.enterBusy())
throw new IllegalStateException("Failed to execute query (grid is stopping).");
try {
- TypeDescriptor type = typesByName.get(new TypeName(space, resType));
+ final GridCacheContext<?, ?> cctx = ctx.cache().internalCache(space).context();
- if (type == null || !type.registered())
- throw new CacheException("Failed to find SQL table for type: " + resType);
+ return executeQuery(cctx, new IgniteOutClosureX<GridCloseableIterator<IgniteBiTuple<K, V>>>() {
+ @Override public GridCloseableIterator<IgniteBiTuple<K, V>> applyx() throws IgniteCheckedException {
+ TypeDescriptor type = typesByName.get(new TypeName(space, resType));
- return idx.queryText(
- space,
- clause,
- type,
- filters);
+ if (type == null || !type.registered())
+ throw new CacheException("Failed to find SQL table for type: " + resType);
+
+ return idx.queryText(
+ space,
+ clause,
+ type,
+ filters);
+ }
+ });
}
finally {
busyLock.leaveBusy();
@@ -842,15 +875,21 @@ public class GridQueryProcessor extends GridProcessorAdapter {
* @return Field rows.
* @throws IgniteCheckedException If failed.
*/
- public GridQueryFieldsResult queryFields(@Nullable String space, String clause, Collection<Object> params,
- IndexingQueryFilter filters) throws IgniteCheckedException {
+ public GridQueryFieldsResult queryFields(@Nullable final String space, final String clause,
+ final Collection<Object> params, final IndexingQueryFilter filters) throws IgniteCheckedException {
checkEnabled();
if (!busyLock.enterBusy())
throw new IllegalStateException("Failed to execute query (grid is stopping).");
try {
- return idx.queryFields(space, clause, params, filters);
+ final GridCacheContext<?, ?> cctx = ctx.cache().internalCache(space).context();
+
+ return executeQuery(cctx, new IgniteOutClosureX<GridQueryFieldsResult>() {
+ @Override public GridQueryFieldsResult applyx() throws IgniteCheckedException {
+ return idx.queryFields(space, clause, params, filters);
+ }
+ });
}
finally {
busyLock.leaveBusy();
@@ -1718,6 +1757,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
}
/** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
@Override public <T> T value(String field, Object key, Object val) throws IgniteCheckedException {
assert field != null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1eb3bd24/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheAbstractQueryMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheAbstractQueryMetricsSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheAbstractQueryMetricsSelfTest.java
new file mode 100644
index 0000000..63912bf
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheAbstractQueryMetricsSelfTest.java
@@ -0,0 +1,205 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.query.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
+
+/**
+ * Tests for cache query metrics.
+ */
+public abstract class CacheAbstractQueryMetricsSelfTest extends GridCommonAbstractTest {
+ /** Grid count. */
+ private static final int GRID_CNT = 2;
+
+ /** Cache mode. */
+ protected CacheMode cacheMode;
+
+ /** */
+ private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ startGridsMultiThreaded(GRID_CNT);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopAllGrids();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+ disco.setIpFinder(ipFinder);
+
+ cfg.setDiscoverySpi(disco);
+
+ CacheConfiguration<String, Integer> cacheCfg1 = defaultCacheConfiguration();
+
+ cacheCfg1.setName("A");
+ cacheCfg1.setCacheMode(cacheMode);
+ cacheCfg1.setWriteSynchronizationMode(FULL_SYNC);
+ cacheCfg1.setIndexedTypes(String.class, Integer.class);
+
+ CacheConfiguration<String, Integer> cacheCfg2 = defaultCacheConfiguration();
+
+ cacheCfg2.setName("B");
+ cacheCfg2.setCacheMode(cacheMode);
+ cacheCfg2.setWriteSynchronizationMode(FULL_SYNC);
+ cacheCfg2.setIndexedTypes(String.class, Integer.class);
+
+ cfg.setCacheConfiguration(cacheCfg1, cacheCfg2);
+
+ return cfg;
+ }
+
+ /**
+ * Test metrics for SQL queries.
+ *
+ * @throws Exception In case of error.
+ */
+ public void testSqlFieldsQueryMetrics() throws Exception {
+ IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
+
+ // Execute query.
+ SqlFieldsQuery qry = new SqlFieldsQuery("select * from Integer");
+
+ cache.query(qry).getAll();
+
+ QueryMetrics m = cache.queryMetrics();
+
+ assert m != null;
+
+ info("Metrics: " + m);
+
+ assertEquals(1, m.executions());
+ assertEquals(0, m.fails());
+ assertTrue(m.averageTime() >= 0);
+ assertTrue(m.maximumTime() >= 0);
+ assertTrue(m.minimumTime() >= 0);
+
+ // Execute again with the same parameters.
+ cache.query(qry).getAll();
+
+ m = cache.queryMetrics();
+
+ assert m != null;
+
+ info("Metrics: " + m);
+
+ assertEquals(2, m.executions());
+ assertEquals(0, m.fails());
+ assertTrue(m.averageTime() >= 0);
+ assertTrue(m.maximumTime() >= 0);
+ assertTrue(m.minimumTime() >= 0);
+ }
+
+ /**
+ * Test metrics for Scan queries.
+ *
+ * @throws Exception In case of error.
+ */
+ public void testScanQueryMetrics() throws Exception {
+ IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
+
+ // Execute query.
+ ScanQuery<String, Integer> qry = new ScanQuery<>();
+
+ cache.query(qry).getAll();
+
+ QueryMetrics m = cache.queryMetrics();
+
+ assert m != null;
+
+ info("Metrics: " + m);
+
+ assertEquals(1, m.executions());
+ assertEquals(0, m.fails());
+ assertTrue(m.averageTime() >= 0);
+ assertTrue(m.maximumTime() >= 0);
+ assertTrue(m.minimumTime() >= 0);
+
+ // Execute again with the same parameters.
+ cache.query(qry).getAll();
+
+ m = cache.queryMetrics();
+
+ assert m != null;
+
+ info("Metrics: " + m);
+
+ assertEquals(2, m.executions());
+ assertEquals(0, m.fails());
+ assertTrue(m.averageTime() >= 0);
+ assertTrue(m.maximumTime() >= 0);
+ assertTrue(m.minimumTime() >= 0);
+ }
+
+ /**
+ * Test metrics for SQL cross cache queries.
+ *
+ * @throws Exception In case of error.
+ */
+ public void testSqlCrossCacheQueryMetrics() throws Exception {
+ IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
+
+ // Execute query.
+ SqlFieldsQuery qry = new SqlFieldsQuery("select * from \"B\".Integer");
+
+ cache.query(qry).getAll();
+
+ QueryMetrics m = cache.queryMetrics();
+
+ assert m != null;
+
+ info("Metrics: " + m);
+
+ assertEquals(1, m.executions());
+ assertEquals(0, m.fails());
+ assertTrue(m.averageTime() >= 0);
+ assertTrue(m.maximumTime() >= 0);
+ assertTrue(m.minimumTime() >= 0);
+
+ // Execute again with the same parameters.
+ cache.query(qry).getAll();
+
+ m = cache.queryMetrics();
+
+ assert m != null;
+
+ info("Metrics: " + m);
+
+ assertEquals(2, m.executions());
+ assertEquals(0, m.fails());
+ assertTrue(m.averageTime() >= 0);
+ assertTrue(m.maximumTime() >= 0);
+ assertTrue(m.minimumTime() >= 0);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1eb3bd24/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CachePartitionedQueryMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CachePartitionedQueryMetricsSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CachePartitionedQueryMetricsSelfTest.java
new file mode 100644
index 0000000..666acfb
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CachePartitionedQueryMetricsSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ * Tests for partitioned cache query metrics.
+ */
+public class CachePartitionedQueryMetricsSelfTest extends CacheAbstractQueryMetricsSelfTest {
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ cacheMode = PARTITIONED;
+
+ super.beforeTest();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1eb3bd24/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheReplicatedQueryMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheReplicatedQueryMetricsSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheReplicatedQueryMetricsSelfTest.java
new file mode 100644
index 0000000..2be6dd3
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheReplicatedQueryMetricsSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ * Tests for replicated cache query metrics.
+ */
+public class CacheReplicatedQueryMetricsSelfTest extends CacheAbstractQueryMetricsSelfTest {
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ cacheMode = REPLICATED;
+
+ super.beforeTest();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1eb3bd24/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMetricsSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMetricsSelfTest.java
deleted file mode 100644
index 24011b4..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMetricsSelfTest.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.query.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-
-/**
- * Tests for cache query metrics.
- */
-public class GridCacheQueryMetricsSelfTest extends GridCommonAbstractTest {
- /** */
- private static final int GRID_CNT = 2;
-
- /** */
- private static final CacheMode CACHE_MODE = REPLICATED;
-
- /** */
- private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
- /** {@inheritDoc} */
- @Override protected void beforeTest() throws Exception {
- startGridsMultiThreaded(GRID_CNT);
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- stopAllGrids();
- }
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
-
- TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
- disco.setIpFinder(ipFinder);
-
- cfg.setDiscoverySpi(disco);
-
- CacheConfiguration<String, Integer> cacheCfg1 = defaultCacheConfiguration();
-
- cacheCfg1.setName("A");
- cacheCfg1.setCacheMode(CACHE_MODE);
- cacheCfg1.setWriteSynchronizationMode(FULL_SYNC);
- cacheCfg1.setIndexedTypes(String.class, Integer.class);
-
- CacheConfiguration<String, Integer> cacheCfg2 = defaultCacheConfiguration();
-
- cacheCfg2.setName("B");
- cacheCfg2.setCacheMode(CACHE_MODE);
- cacheCfg2.setWriteSynchronizationMode(FULL_SYNC);
- cacheCfg2.setIndexedTypes(String.class, Integer.class);
-
- cfg.setCacheConfiguration(cacheCfg1, cacheCfg2);
-
- return cfg;
- }
-
- /**
- * Test metrics for SQL queries.
- *
- * @throws Exception In case of error.
- */
- public void testSqlFieldsQueryMetrics() throws Exception {
- IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
-
- // Execute query.
- SqlFieldsQuery qry = new SqlFieldsQuery("select * from Integer");
-
- cache.query(qry).getAll();
-
- QueryMetrics m = cache.queryMetrics();
-
- assert m != null;
-
- info("Metrics: " + m);
-
- assertEquals(1, m.executions());
- assertEquals(0, m.fails());
- assertTrue(m.averageTime() >= 0);
- assertTrue(m.maximumTime() >= 0);
- assertTrue(m.minimumTime() >= 0);
-
- // Execute again with the same parameters.
- cache.query(qry).getAll();
-
- m = cache.queryMetrics();
-
- assert m != null;
-
- info("Metrics: " + m);
-
- assertEquals(2, m.executions());
- assertEquals(0, m.fails());
- assertTrue(m.averageTime() >= 0);
- assertTrue(m.maximumTime() >= 0);
- assertTrue(m.minimumTime() >= 0);
- }
-
- /**
- * Test metrics for Scan queries.
- *
- * @throws Exception In case of error.
- */
- public void testScanQueryMetrics() throws Exception {
- IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
-
- // Execute query.
- ScanQuery<String, Integer> qry = new ScanQuery<>();
-
- cache.query(qry).getAll();
-
- QueryMetrics m = cache.queryMetrics();
-
- assert m != null;
-
- info("Metrics: " + m);
-
- assertEquals(1, m.executions());
- assertEquals(0, m.fails());
- assertTrue(m.averageTime() >= 0);
- assertTrue(m.maximumTime() >= 0);
- assertTrue(m.minimumTime() >= 0);
-
- // Execute again with the same parameters.
- cache.query(qry).getAll();
-
- m = cache.queryMetrics();
-
- assert m != null;
-
- info("Metrics: " + m);
-
- assertEquals(2, m.executions());
- assertEquals(0, m.fails());
- assertTrue(m.averageTime() >= 0);
- assertTrue(m.maximumTime() >= 0);
- assertTrue(m.minimumTime() >= 0);
- }
-
- /**
- * Test metrics for SQL cross cache queries.
- *
- * @throws Exception In case of error.
- */
- public void testSqlCrossCacheQueryMetrics() throws Exception {
- IgniteCache<String, Integer> cache = grid(0).context().cache().jcache("A");
-
- // Execute query.
- SqlFieldsQuery qry = new SqlFieldsQuery("select * from \"B\".Integer");
-
- cache.query(qry).getAll();
-
- QueryMetrics m = cache.queryMetrics();
-
- assert m != null;
-
- info("Metrics: " + m);
-
- assertEquals(1, m.executions());
- assertEquals(0, m.fails());
- assertTrue(m.averageTime() >= 0);
- assertTrue(m.maximumTime() >= 0);
- assertTrue(m.minimumTime() >= 0);
-
- // Execute again with the same parameters.
- cache.query(qry).getAll();
-
- m = cache.queryMetrics();
-
- assert m != null;
-
- info("Metrics: " + m);
-
- assertEquals(2, m.executions());
- assertEquals(0, m.fails());
- assertTrue(m.averageTime() >= 0);
- assertTrue(m.maximumTime() >= 0);
- assertTrue(m.minimumTime() >= 0);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1eb3bd24/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java
index 9da7cf8..a43f573 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java
@@ -198,8 +198,8 @@ public class BaseH2CompareQueryTest extends AbstractH2CompareQueryTest {
/**
* @throws Exception
*/
- // TODO: IGNITE-705
public void testAllExamples() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-705");
// compareQueryRes0("select ? limit ? offset ?");
// compareQueryRes0("select cool1()");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1eb3bd24/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
index 0815dc6..e37e696 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
@@ -112,7 +112,9 @@ public class IgniteCacheQuerySelfTestSuite extends TestSuite {
suite.addTestSuite(BaseH2CompareQueryTest.class);
suite.addTestSuite(H2CompareBigQueryTest.class);
- suite.addTestSuite(GridCacheQueryMetricsSelfTest.class);
+ // Cache query metrics.
+ suite.addTestSuite(CachePartitionedQueryMetricsSelfTest.class);
+ suite.addTestSuite(CacheReplicatedQueryMetricsSelfTest.class);
//Unmarshallig query test.
suite.addTestSuite(IgniteCacheP2pUnmarshallingQueryErrorTest.class);
[45/50] incubator-ignite git commit: #IGNITE-960 Added tests.
Posted by sb...@apache.org.
#IGNITE-960 Added tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d530c8c6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d530c8c6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d530c8c6
Branch: refs/heads/ignite-950
Commit: d530c8c64477634576007ce6cacf21fc1113f93c
Parents: dd8048b
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 18:47:55 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 18:47:55 2015 +0300
----------------------------------------------------------------------
.../store/jdbc/CacheJdbcBlobStoreFactory.java | 2 +-
.../store/jdbc/CacheJdbcPojoStoreFactory.java | 4 +-
modules/hibernate/pom.xml | 14 ++
.../CacheHibernateBlobStoreFactory.java | 62 +++++-
.../hibernate/src/test/config/factory-cache.xml | 59 ++++++
.../src/test/config/factory-cache1.xml | 61 ++++++
.../config/factory-incorrect-store-cache.xml | 56 +++++
.../CacheHibernateStoreFactorySelfTest.java | 207 +++++++++++++++++++
8 files changed, 457 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
index 29a83c9..c145641 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
@@ -92,7 +92,7 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSto
private String dataSrcBean;
/** Data source. */
- private DataSource dataSrc;
+ private transient DataSource dataSrc;
/** Application context. */
@SpringApplicationContextResource
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
index 4cb680a..54f890f 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
@@ -63,10 +63,10 @@ public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheJdbcPojoSto
private String dataSrcBean;
/** Data source. */
- private DataSource dataSrc;
+ private transient DataSource dataSrc;
/** Database dialect. */
- protected JdbcDialect dialect;
+ private transient JdbcDialect dialect;
/** Application context. */
@SpringApplicationContextResource
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index 10d91a2..d7e098c 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -90,6 +90,20 @@
</dependency>
<dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-spring</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ignite</groupId>
+ <artifactId>ignite-log4j</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
index 6b89a9e..5154faa 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
@@ -17,9 +17,13 @@
package org.apache.ignite.cache.store.hibernate;
+import org.apache.ignite.*;
import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.spring.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.resources.*;
import org.hibernate.*;
import javax.cache.configuration.*;
@@ -119,7 +123,10 @@ import java.util.*;
public class CacheHibernateBlobStoreFactory<K, V> implements Factory<CacheHibernateBlobStore<K, V>> {
/** Session factory. */
@GridToStringExclude
- private SessionFactory sesFactory;
+ private transient SessionFactory sesFactory;
+
+ /** Session factory bean name. */
+ private String sesFactoryBean;
/** Path to hibernate configuration file. */
private String hibernateCfgPath;
@@ -128,15 +135,38 @@ public class CacheHibernateBlobStoreFactory<K, V> implements Factory<CacheHibern
@GridToStringExclude
private Properties hibernateProps;
+ /** Application context. */
+ @SpringApplicationContextResource
+ private Object appContext;
/** {@inheritDoc} */
@Override public CacheHibernateBlobStore<K, V> create() {
CacheHibernateBlobStore<K, V> store = new CacheHibernateBlobStore<>();
- store.setSessionFactory(sesFactory);
store.setHibernateConfigurationPath(hibernateCfgPath);
store.setHibernateProperties(hibernateProps);
+ if (sesFactory != null)
+ store.setSessionFactory(sesFactory);
+ else if (sesFactoryBean != null) {
+ if (appContext == null)
+ throw new IgniteException("Spring application context resource is not injected.");
+
+ IgniteSpringHelper spring;
+
+ try {
+ spring = IgniteComponentType.SPRING.create(false);
+
+ SessionFactory sesFac = spring.loadBeanFromAppContext(appContext, sesFactoryBean);
+
+ store.setSessionFactory(sesFac);
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException("Failed to load bean in application context [beanName=" + sesFactoryBean +
+ ", igniteConfig=" + appContext + ']');
+ }
+ }
+
return store;
}
@@ -144,10 +174,26 @@ public class CacheHibernateBlobStoreFactory<K, V> implements Factory<CacheHibern
* Sets session factory.
*
* @param sesFactory Session factory.
+ * @return {@code This} for chaining.
* @see CacheHibernateBlobStore#setSessionFactory(SessionFactory)
*/
- public void setSessionFactory(SessionFactory sesFactory) {
+ public CacheHibernateBlobStoreFactory<K, V> setSessionFactory(SessionFactory sesFactory) {
this.sesFactory = sesFactory;
+
+ return this;
+ }
+
+ /**
+ * Sets name of the data source bean.
+ *
+ * @param sesFactory Session factory bean name.
+ * @return {@code This} for chaining.
+ * @see CacheHibernateBlobStore#setSessionFactory(SessionFactory)
+ */
+ public CacheHibernateBlobStoreFactory<K, V> setSessionFactoryBean(String sesFactory) {
+ this.sesFactoryBean = sesFactory;
+
+ return this;
}
/**
@@ -157,20 +203,26 @@ public class CacheHibernateBlobStoreFactory<K, V> implements Factory<CacheHibern
*
* @param hibernateCfgPath URL or file path or classpath resource
* pointing to hibernate configuration XML file.
+ * @return {@code This} for chaining.
* @see CacheHibernateBlobStore#setHibernateConfigurationPath(String)
*/
- public void setHibernateConfigurationPath(String hibernateCfgPath) {
+ public CacheHibernateBlobStoreFactory<K, V> setHibernateConfigurationPath(String hibernateCfgPath) {
this.hibernateCfgPath = hibernateCfgPath;
+
+ return this;
}
/**
* Sets Hibernate properties.
*
* @param hibernateProps Hibernate properties.
+ * @return {@code This} for chaining.
* @see CacheHibernateBlobStore#setHibernateProperties(Properties)
*/
- public void setHibernateProperties(Properties hibernateProps) {
+ public CacheHibernateBlobStoreFactory<K, V> setHibernateProperties(Properties hibernateProps) {
this.hibernateProps = hibernateProps;
+
+ return this;
}
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/hibernate/src/test/config/factory-cache.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/config/factory-cache.xml b/modules/hibernate/src/test/config/factory-cache.xml
new file mode 100644
index 0000000..a251846
--- /dev/null
+++ b/modules/hibernate/src/test/config/factory-cache.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="simpleSessionFactory"
+ class="org.apache.ignite.cache.store.hibernate.CacheHibernateStoreFactorySelfTest$DummySessionFactoryExt"/>
+
+ <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ <property name="cacheConfiguration">
+ <list>
+ <bean class="org.apache.ignite.configuration.CacheConfiguration">
+ <property name="name" value="test"/>
+ <property name="atomicityMode" value="ATOMIC"/>
+ <property name="backups" value="1"/>
+ <property name="cacheStoreFactory">
+ <bean class="org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory">
+ <property name="sessionFactoryBean" value = "simpleSessionFactory"/>
+ </bean>
+ </property>
+ </bean>
+ </list>
+ </property>
+
+ <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+ <property name="discoverySpi">
+ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+ <property name="ipFinder">
+ <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+ <property name="addresses">
+ <list>
+ <value>127.0.0.1:47500..47509</value>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ </bean>
+</beans>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/hibernate/src/test/config/factory-cache1.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/config/factory-cache1.xml b/modules/hibernate/src/test/config/factory-cache1.xml
new file mode 100644
index 0000000..7f751fb
--- /dev/null
+++ b/modules/hibernate/src/test/config/factory-cache1.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="simpleSessionFactory1"
+ class="org.apache.ignite.cache.store.hibernate.CacheHibernateStoreFactorySelfTest$DummySessionFactory"/>
+
+ <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ <property name="gridName" value="ignite1"/>
+
+ <property name="cacheConfiguration">
+ <list>
+ <bean class="org.apache.ignite.configuration.CacheConfiguration">
+ <property name="name" value="test"/>
+ <property name="atomicityMode" value="ATOMIC"/>
+ <property name="backups" value="1"/>
+ <property name="cacheStoreFactory">
+ <bean class="org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory">
+ <property name="sessionFactoryBean" value = "simpleSessionFactory1"/>
+ </bean>
+ </property>
+ </bean>
+ </list>
+ </property>
+
+ <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+ <property name="discoverySpi">
+ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+ <property name="ipFinder">
+ <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+ <property name="addresses">
+ <list>
+ <value>127.0.0.1:47500..47509</value>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ </bean>
+</beans>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/hibernate/src/test/config/factory-incorrect-store-cache.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/config/factory-incorrect-store-cache.xml b/modules/hibernate/src/test/config/factory-incorrect-store-cache.xml
new file mode 100644
index 0000000..459930c
--- /dev/null
+++ b/modules/hibernate/src/test/config/factory-incorrect-store-cache.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ <property name="cacheConfiguration">
+ <list>
+ <bean class="org.apache.ignite.configuration.CacheConfiguration">
+ <property name="name" value="test"/>
+ <property name="atomicityMode" value="ATOMIC"/>
+ <property name="backups" value="1"/>
+ <property name="cacheStoreFactory">
+ <bean class="org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory">
+ <property name="sessionFactoryBean" value = "simpleSessionFactory1"/>
+ </bean>
+ </property>
+ </bean>
+ </list>
+ </property>
+
+ <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+ <property name="discoverySpi">
+ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+ <property name="ipFinder">
+ <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+ <property name="addresses">
+ <list>
+ <value>127.0.0.1:47500..47509</value>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ </bean>
+</beans>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d530c8c6/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java b/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
index 225fc11..ad0bcfc 100644
--- a/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
+++ b/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
@@ -21,11 +21,24 @@ import org.apache.ignite.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.testframework.*;
import org.apache.ignite.testframework.junits.common.*;
+import org.hibernate.*;
+import org.hibernate.engine.spi.*;
+import org.hibernate.metadata.*;
+import org.hibernate.stat.*;
+
+import javax.naming.*;
+import java.io.*;
+import java.sql.*;
+import java.util.*;
+import java.util.concurrent.*;
/**
* Test for Cache jdbc blob store factory.
*/
public class CacheHibernateStoreFactorySelfTest extends GridCommonAbstractTest {
+ /** Cache name. */
+ private static final String CACHE_NAME = "test";
+
/**
* @throws Exception If failed.
*/
@@ -38,6 +51,36 @@ public class CacheHibernateStoreFactorySelfTest extends GridCommonAbstractTest {
}
/**
+ * @throws Exception If failed.
+ */
+ public void testXmlConfiguration() throws Exception {
+ try (Ignite ignite = Ignition.start("modules/hibernate/src/test/config/factory-cache.xml")) {
+ try(Ignite ignite1 = Ignition.start("modules/hibernate/src/test/config/factory-cache1.xml")) {
+ checkStore(ignite.<Integer, String>cache(CACHE_NAME), DummySessionFactoryExt.class);
+
+ checkStore(ignite1.<Integer, String>cache(CACHE_NAME), DummySessionFactory.class);
+ }
+ }
+ }
+
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testIncorrectBeanConfiguration() throws Exception {
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try(Ignite ignite =
+ Ignition.start("modules/hibernate/src/test/config/factory-incorrect-store-cache.xml")) {
+ ignite.cache(CACHE_NAME).getConfiguration(CacheConfiguration.class).
+ getCacheStoreFactory().create();
+ }
+ return null;
+ }
+ }, IgniteException.class, "Failed to load bean in application context");
+ }
+
+ /**
* @return Cache configuration with store.
*/
private CacheConfiguration<Integer, String> cacheConfiguration() {
@@ -54,6 +97,19 @@ public class CacheHibernateStoreFactorySelfTest extends GridCommonAbstractTest {
/**
* @param cache Ignite cache.
+ * @param dataSrcClass Data source class.
+ * @throws Exception If store parameters is not the same as in configuration xml.
+ */
+ private void checkStore(IgniteCache<Integer, String> cache, Class<?> dataSrcClass) throws Exception {
+ CacheHibernateBlobStore store = (CacheHibernateBlobStore)cache
+ .getConfiguration(CacheConfiguration.class).getCacheStoreFactory().create();
+
+ assertEquals(dataSrcClass,
+ GridTestUtils.getFieldValue(store, CacheHibernateBlobStore.class, "sesFactory").getClass());
+ }
+
+ /**
+ * @param cache Ignite cache.
* @throws Exception If store parameters is not the same as in configuration xml.
*/
private void checkStore(IgniteCache<Integer, String> cache) throws Exception {
@@ -63,4 +119,155 @@ public class CacheHibernateStoreFactorySelfTest extends GridCommonAbstractTest {
assertEquals("/org/apache/ignite/cache/store/hibernate/hibernate.cfg.xml",
GridTestUtils.getFieldValue(store, CacheHibernateBlobStore.class, "hibernateCfgPath"));
}
+
+ /**
+ *
+ */
+ public static class DummySessionFactoryExt extends DummySessionFactory {
+ /** */
+ public DummySessionFactoryExt() {
+ // No-op.
+ }
+ }
+
+ /**
+ *
+ */
+ public static class DummySessionFactory implements SessionFactory {
+ /** {@inheritDoc} */
+ @Override public SessionFactoryOptions getSessionFactoryOptions() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public SessionBuilder withOptions() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Session openSession() throws HibernateException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Session getCurrentSession() throws HibernateException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public StatelessSessionBuilder withStatelessOptions() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public StatelessSession openStatelessSession() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public StatelessSession openStatelessSession(Connection connection) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClassMetadata getClassMetadata(Class entityClass) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public ClassMetadata getClassMetadata(String entityName) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public CollectionMetadata getCollectionMetadata(String roleName) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map<String, ClassMetadata> getAllClassMetadata() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Map getAllCollectionMetadata() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Statistics getStatistics() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void close() throws HibernateException {
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean isClosed() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Cache getCache() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public void evict(Class persistentClass) throws HibernateException {
+ }
+
+ /** {@inheritDoc} */
+ @Override public void evict(Class persistentClass, Serializable id) throws HibernateException {
+ }
+
+ /** {@inheritDoc} */
+ @Override public void evictEntity(String entityName) throws HibernateException {
+ }
+
+ /** {@inheritDoc} */
+ @Override public void evictEntity(String entityName, Serializable id) throws HibernateException {
+ }
+
+ /** {@inheritDoc} */
+ @Override public void evictCollection(String roleName) throws HibernateException {
+ }
+
+ /** {@inheritDoc} */
+ @Override public void evictCollection(String roleName, Serializable id) throws HibernateException {
+ }
+
+ /** {@inheritDoc} */
+ @Override public void evictQueries(String cacheRegion) throws HibernateException {
+ }
+
+ /** {@inheritDoc} */
+ @Override public void evictQueries() throws HibernateException {
+ }
+
+ /** {@inheritDoc} */
+ @Override public Set getDefinedFilterNames() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public FilterDefinition getFilterDefinition(String filterName) throws HibernateException {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean containsFetchProfileDefinition(String name) {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override public TypeHelper getTypeHelper() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Reference getReference() throws NamingException {
+ return null;
+ }
+ }
}
[36/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-883' into ignite-sprint-6
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-883' into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f2c4cc80
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f2c4cc80
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f2c4cc80
Branch: refs/heads/ignite-950
Commit: f2c4cc8017fd29adc398f3b98cde361a1156d6a6
Parents: f6b1b79 22ec5cf
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 16 16:24:52 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 16 16:24:52 2015 +0300
----------------------------------------------------------------------
.../ignite/spi/discovery/tcp/ClientImpl.java | 87 ++++++++++++++------
.../IgniteCacheClientNodeConcurrentStart.java | 14 +++-
.../distributed/IgniteCacheManyClientsTest.java | 66 +++++++++++----
3 files changed, 127 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
[28/50] incubator-ignite git commit: # i-960
Posted by sb...@apache.org.
# i-960
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b037baff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b037baff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b037baff
Branch: refs/heads/ignite-950
Commit: b037baff59770d94a15d246b42fc0c881633db73
Parents: 55764e8
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jun 16 12:34:31 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jun 16 12:34:31 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 3 +-
.../store/jdbc/CacheJdbcBlobStoreFactory.java | 46 +++++++++++++-------
2 files changed, 32 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b037baff/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 f48f401..ab7c48d 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
@@ -1108,7 +1108,8 @@ public class GridCacheProcessor extends GridProcessorAdapter {
GridCacheAffinityManager affMgr = new GridCacheAffinityManager();
GridCacheEventManager evtMgr = new GridCacheEventManager();
- GridCacheSwapManager swapMgr = new GridCacheSwapManager(cfg.getCacheMode() == LOCAL || !GridCacheUtils.isNearEnabled(cfg));
+ GridCacheSwapManager swapMgr = new GridCacheSwapManager(cfg.getCacheMode() == LOCAL ||
+ !GridCacheUtils.isNearEnabled(cfg));
GridCacheEvictionManager evictMgr = new GridCacheEvictionManager();
GridCacheQueryManager qryMgr = queryManager(cfg);
CacheContinuousQueryManager contQryMgr = new CacheContinuousQueryManager();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b037baff/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java b/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
index df9adf8..b33b3b6 100644
--- a/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
+++ b/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
@@ -18,7 +18,9 @@
package org.apache.ignite.cache.store.jdbc;
import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.tostring.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
import org.apache.ignite.resources.*;
import org.springframework.context.*;
@@ -28,7 +30,7 @@ import javax.sql.*;
/**
* {@link Factory} implementation for {@link CacheJdbcBlobStore}.
*
- * Use this factory to pass {@link CacheJdbcBlobStore} to {@link org.apache.ignite.configuration.CacheConfiguration}.
+ * Use this factory to pass {@link CacheJdbcBlobStore} to {@link CacheConfiguration}.
*
* <h2 class="header">Spring Example</h2>
* <pre name="code" class="xml"> *
@@ -63,7 +65,7 @@ import javax.sql.*;
* <br>
* For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
*/
-public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobStore<K, V>> {
+public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobStore<K, V>> {
/** Connection URL. */
private String connUrl = CacheJdbcBlobStore.DFLT_CONN_URL;
@@ -101,7 +103,7 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSt
/** {@inheritDoc} */
@Override public CacheJdbcBlobStore<K, V> create() {
- CacheJdbcBlobStore<K, V> store = new CacheJdbcBlobStore();
+ CacheJdbcBlobStore<K, V> store = new CacheJdbcBlobStore<>();
store.setInitSchema(initSchema);
store.setConnectionUrl(connUrl);
@@ -118,9 +120,10 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSt
throw new IgniteException("Spring application context resource is not injected.");
if (!appContext.containsBean(dataSrcBean))
- throw new IgniteException("Cannot find bean in application context. [beanName=" + dataSrcBean + "].");
+ throw new IgniteException("Failed to find bean in application context [beanName=" + dataSrcBean +
+ ", appContext=" + appContext + ']');
- DataSource data = (DataSource) appContext.getBean(dataSrcBean);
+ DataSource data = (DataSource)appContext.getBean(dataSrcBean);
store.setDataSource(data);
}
@@ -129,25 +132,31 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSt
}
/**
- * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setInitSchema(boolean)}.
+ * Flag indicating whether DB schema should be initialized by Ignite (default behaviour) or
+ * was explicitly created by user.
*
* @param initSchema Initialized schema flag.
+ * @return {@code This} for chaining.
+ * @see CacheJdbcBlobStore#setInitSchema(boolean)
*/
- public void setInitSchema(boolean initSchema) {
+ public CacheJdbcBlobStoreFactory setInitSchema(boolean initSchema) {
this.initSchema = initSchema;
+
+ return this;
}
/**
- * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setConnectionUrl(String)}.
+ * Sets connection URL.
*
* @param connUrl Connection URL.
+ * @see CacheJdbcBlobStore#setConnectionUrl(String)
*/
public void setConnectionUrl(String connUrl) {
this.connUrl = connUrl;
}
/**
- * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setCreateTableQuery(String)}.
+ * See {@link CacheJdbcBlobStore#setCreateTableQuery(String)}.
*
* @param createTblQry Create table query.
*/
@@ -156,7 +165,7 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSt
}
/**
- * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setLoadQuery(String)}.
+ * See {@link CacheJdbcBlobStore#setLoadQuery(String)}.
*
* @param loadQry Load query
*/
@@ -165,7 +174,7 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSt
}
/**
- * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setUpdateQuery(String)}.
+ * See {@link CacheJdbcBlobStore#setUpdateQuery(String)}.
*
* @param updateQry Update entry query.
*/
@@ -174,7 +183,7 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSt
}
/**
- * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setInsertQuery(String)}.
+ * See {@link CacheJdbcBlobStore#setInsertQuery(String)}.
*
* @param insertQry Insert entry query.
*/
@@ -183,7 +192,7 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSt
}
/**
- * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setDeleteQuery(String)}.
+ * See {@link CacheJdbcBlobStore#setDeleteQuery(String)}.
*
* @param delQry Delete entry query.
*/
@@ -192,7 +201,7 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSt
}
/**
- * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setUser(String)}.
+ * See {@link CacheJdbcBlobStore#setUser(String)}.
*
* @param user User name.
*/
@@ -201,7 +210,7 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSt
}
/**
- * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setPassword(String)}.
+ * See {@link CacheJdbcBlobStore#setPassword(String)}.
*
* @param passwd Password.
*/
@@ -212,7 +221,7 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSt
/**
* Sets name of the data source bean.
*
- * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setDataSource(javax.sql.DataSource)}
+ * See {@link CacheJdbcBlobStore#setDataSource(DataSource)}
* for more information.
*
* @param dataSrcBean Data source bean name.
@@ -220,4 +229,9 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSt
public void setDataSourceBean(String dataSrcBean) {
this.dataSrcBean = dataSrcBean;
}
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(CacheJdbcBlobStoreFactory.class, this);
+ }
}
[18/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-sprint-6' into ignite-883-1
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-6' into ignite-883-1
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ca7032ea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ca7032ea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ca7032ea
Branch: refs/heads/ignite-950
Commit: ca7032ea72410d14f6d376abca1a801495207b14
Parents: f115c04 2707194
Author: sboikov <sb...@gridgain.com>
Authored: Fri Jun 12 18:47:29 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Jun 12 18:47:29 2015 +0300
----------------------------------------------------------------------
RELEASE_NOTES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
[47/50] incubator-ignite git commit: #IGNITE-960 Added tests.
Posted by sb...@apache.org.
#IGNITE-960 Added tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ec0ee2e6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ec0ee2e6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ec0ee2e6
Branch: refs/heads/ignite-950
Commit: ec0ee2e6df8e303eb77d8da2243042b5f0bd64f7
Parents: 83abea4
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 18:53:17 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 18:53:17 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ec0ee2e6/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
index 54f890f..cade2aa 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
@@ -66,7 +66,7 @@ public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheJdbcPojoSto
private transient DataSource dataSrc;
/** Database dialect. */
- private transient JdbcDialect dialect;
+ private JdbcDialect dialect;
/** Application context. */
@SpringApplicationContextResource
[17/50] incubator-ignite git commit: Merge branch 'ignite-1007' into
ignite-sprint-6
Posted by sb...@apache.org.
Merge branch 'ignite-1007' into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2f7b253e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2f7b253e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2f7b253e
Branch: refs/heads/ignite-950
Commit: 2f7b253e3832951d9e373c6fb13549f5c7e45ebf
Parents: 2707194 811872c
Author: agura <ag...@gridgain.com>
Authored: Fri Jun 12 18:37:41 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri Jun 12 18:37:41 2015 +0300
----------------------------------------------------------------------
.../datastructures/DataStructuresProcessor.java | 67 +++++++++++++++++++-
1 file changed, 64 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[44/50] incubator-ignite git commit: sp-6 - release notes
Posted by sb...@apache.org.
sp-6 - release notes
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/53f4cb75
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/53f4cb75
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/53f4cb75
Branch: refs/heads/ignite-950
Commit: 53f4cb75ad08a3dca595dacc30d0e1b256c4fbc8
Parents: ae188c7
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jun 16 18:09:31 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jun 16 18:09:31 2015 +0300
----------------------------------------------------------------------
RELEASE_NOTES.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/53f4cb75/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 1783131..3a5043e 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -8,8 +8,8 @@ Apache Ignite In-Memory Data Fabric 1.2
* Added memory based evictions.
* Added integration with Apache Spark.
* Added integration with Apache Mesos.
-* Added support for log4j2.
* Added IgniteCache.getAllOutTx() method.
+* Added serializable cache store factories for built-in stores.
* Bug fixes in In-Memory Accelerator For Apache Hadoop.
* Many stability and fault-tolerance fixes.
[38/50] incubator-ignite git commit: Minor correction to interop
start procedure: add optional pointer to additional data required for startup
Posted by sb...@apache.org.
Minor correction to interop start procedure: add optional pointer to additional data required for startup
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ae188c70
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ae188c70
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ae188c70
Branch: refs/heads/ignite-950
Commit: ae188c708854d62fcd586994b83726e8d1db93b1
Parents: e3750b7
Author: ptupitsyn <pt...@gridgain.com>
Authored: Tue Jun 16 17:04:45 2015 +0300
Committer: ptupitsyn <pt...@gridgain.com>
Committed: Tue Jun 16 17:04:45 2015 +0300
----------------------------------------------------------------------
.../org/apache/ignite/internal/interop/InteropBootstrap.java | 3 ++-
.../org/apache/ignite/internal/interop/InteropIgnition.java | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ae188c70/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java
index 820bef9..df5af6c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropBootstrap.java
@@ -28,7 +28,8 @@ public interface InteropBootstrap {
*
* @param cfg Configuration.
* @param envPtr Environment pointer.
+ * @param dataPtr Optional pointer to additional data required for startup.
* @return Ignite node.
*/
- public InteropProcessor start(IgniteConfiguration cfg, long envPtr);
+ public InteropProcessor start(IgniteConfiguration cfg, long envPtr, long dataPtr);
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ae188c70/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
index 96639cd..fb0d6e1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/interop/InteropIgnition.java
@@ -45,10 +45,11 @@ public class InteropIgnition {
* @param gridName Grid name.
* @param factoryId Factory ID.
* @param envPtr Environment pointer.
+ * @param dataPtr Optional pointer to additional data required for startup.
* @return Ignite instance.
*/
public static synchronized InteropProcessor start(@Nullable String springCfgPath, @Nullable String gridName,
- int factoryId, long envPtr) {
+ int factoryId, long envPtr, long dataPtr) {
IgniteConfiguration cfg = configuration(springCfgPath);
if (gridName != null)
@@ -58,7 +59,7 @@ public class InteropIgnition {
InteropBootstrap bootstrap = bootstrap(factoryId);
- InteropProcessor proc = bootstrap.start(cfg, envPtr);
+ InteropProcessor proc = bootstrap.start(cfg, envPtr, dataPtr);
trackFinalization(proc);
[12/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-883' into ignite-883-1
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-883' into ignite-883-1
Conflicts:
modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
modules/scalar-2.10/pom.xml
modules/spark-2.10/pom.xml
modules/spark/pom.xml
modules/visor-console-2.10/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/f115c048
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f115c048
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f115c048
Branch: refs/heads/ignite-950
Commit: f115c048083cd36edd31b589a9c3389322e0220e
Parents: 65db72e
Author: sboikov <sb...@gridgain.com>
Authored: Fri Jun 12 18:02:31 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Jun 12 18:02:31 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/cache/query/ScanQuery.java | 20 --------------------
.../ignite/spi/discovery/tcp/ClientImpl.java | 2 +-
.../ignite/spi/discovery/tcp/ServerImpl.java | 2 --
.../testsuites/IgniteCacheTestSuite4.java | 2 --
4 files changed, 1 insertion(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f115c048/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java b/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
index 90000e8..6e02ff9 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
@@ -97,16 +97,6 @@ public final class ScanQuery<K, V> extends Query<Cache.Entry<K, V>> {
}
/**
- * Gets partition number over which this query should iterate. Will return {@code null} if partition was not
- * set. In this case query will iterate over all partitions in the cache.
- *
- * @return Partition number or {@code null}.
- */
- @Nullable public Integer getPartition() {
- return part;
- }
-
- /**
* Sets partition number over which this query should iterate. If {@code null}, query will iterate over
* all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache.
*
@@ -129,16 +119,6 @@ public final class ScanQuery<K, V> extends Query<Cache.Entry<K, V>> {
return part;
}
- /**
- * Sets partition number over which this query should iterate. If {@code null}, query will iterate over
- * all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache.
- *
- * @param part Partition number over which this query should iterate.
- */
- public void setPartition(@Nullable Integer part) {
- this.part = part;
- }
-
/** {@inheritDoc} */
@Override public ScanQuery<K, V> setPageSize(int pageSize) {
return (ScanQuery<K, V>)super.setPageSize(pageSize);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f115c048/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 d8108e5..a17296c 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
@@ -1145,7 +1145,7 @@ class ClientImpl extends TcpDiscoveryImpl {
if (joinLatch.getCount() > 0) {
// This should not occurs.
- joinErr = new IgniteSpiException("Some error occur in join process.");
+ joinErr = new IgniteSpiException("Some error in join process.");
joinLatch.countDown();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f115c048/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 c92fcde..63f165d 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
@@ -2231,8 +2231,6 @@ class ServerImpl extends TcpDiscoveryImpl {
onException("Failed to send message to next node [next=" + next.id() + ", msg=" + msg + ']',
e);
- log.error("Will resend [msg=" + msg + ", e=" + e + ']');
-
if (e instanceof SocketTimeoutException || X.hasCause(e, SocketTimeoutException.class)) {
ackTimeout0 *= 2;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f115c048/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index 7fa038c..fed5efe 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -136,8 +136,6 @@ public class IgniteCacheTestSuite4 extends TestSuite {
suite.addTestSuite(CacheReadOnlyTransactionalClientSelfTest.class);
- suite.addTestSuite(IgniteCacheManyClientsTest.class);
-
suite.addTestSuite(IgniteStartCacheInTransactionSelfTest.class);
suite.addTestSuite(IgniteStartCacheInTransactionAtomicSelfTest.class);
[21/50] incubator-ignite git commit: Merge branches 'ignite-sprint-5'
and 'ignite-sprint-6' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-6
Posted by sb...@apache.org.
Merge branches 'ignite-sprint-5' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-6
Conflicts:
modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheSwapScanQueryAbstractSelfTest.java
modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheCrossCacheQuerySelfTest.java
modules/scalar-2.10/pom.xml
modules/spark-2.10/pom.xml
modules/spark/pom.xml
modules/visor-console-2.10/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/09073386
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/09073386
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/09073386
Branch: refs/heads/ignite-950
Commit: 0907338684050e952b01df06fe927707e4a280a1
Parents: 460521c
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Jun 15 10:21:53 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Jun 15 10:21:53 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/cache/query/ScanQuery.java | 20 --------------------
.../cache/query/GridCacheQueryManager.java | 5 -----
.../testsuites/IgniteCacheTestSuite4.java | 2 --
3 files changed, 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/09073386/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java b/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
index 90000e8..11a8c84 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
@@ -119,26 +119,6 @@ public final class ScanQuery<K, V> extends Query<Cache.Entry<K, V>> {
return this;
}
- /**
- * Gets partition number over which this query should iterate. Will return {@code null} if partition was not
- * set. In this case query will iterate over all partitions in the cache.
- *
- * @return Partition number or {@code null}.
- */
- @Nullable public Integer getPartition() {
- return part;
- }
-
- /**
- * Sets partition number over which this query should iterate. If {@code null}, query will iterate over
- * all partitions in the cache. Must be in the range [0, N) where N is partition number in the cache.
- *
- * @param part Partition number over which this query should iterate.
- */
- public void setPartition(@Nullable Integer part) {
- this.part = part;
- }
-
/** {@inheritDoc} */
@Override public ScanQuery<K, V> setPageSize(int pageSize) {
return (ScanQuery<K, V>)super.setPageSize(pageSize);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/09073386/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 7493d07..1317d38 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -791,14 +791,9 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
locPart = dht.topology().localPartition(part, topVer, false);
-<<<<<<< HEAD
// double check for owning state
if (locPart == null || locPart.state() != OWNING || !locPart.reserve() ||
locPart.state() != OWNING)
-=======
- if (locPart == null || (locPart.state() != OWNING && locPart.state() != RENTING) ||
- !locPart.reserve())
->>>>>>> 4375529fa929e650f7b68d750318d67a8609ee10
throw new GridDhtInvalidPartitionException(part, "Partition can't be reserved");
iter = new Iterator<K>() {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/09073386/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index 7fa038c..c598e38 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -141,8 +141,6 @@ public class IgniteCacheTestSuite4 extends TestSuite {
suite.addTestSuite(IgniteStartCacheInTransactionSelfTest.class);
suite.addTestSuite(IgniteStartCacheInTransactionAtomicSelfTest.class);
- suite.addTestSuite(IgniteCacheManyClientsTest.class);
-
return suite;
}
}
[32/50] incubator-ignite git commit: # ignite-sprint-6 tests fixes
Posted by sb...@apache.org.
# ignite-sprint-6 tests fixes
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5b9013f6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5b9013f6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5b9013f6
Branch: refs/heads/ignite-950
Commit: 5b9013f60af4b86a8d4362890a54d6eaaa159441
Parents: 3423ed3
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 16 14:54:23 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 16 14:54:23 2015 +0300
----------------------------------------------------------------------
.../org/apache/ignite/internal/GridSelfTest.java | 12 +++++++++---
.../cache/GridCacheAbstractFailoverSelfTest.java | 2 ++
...gniteCacheP2pUnmarshallingRebalanceErrorTest.java | 15 ++++++---------
.../junits/common/GridCommonAbstractTest.java | 11 +++++++----
4 files changed, 24 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5b9013f6/modules/core/src/test/java/org/apache/ignite/internal/GridSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridSelfTest.java
index 7f5ee54..eccae34 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridSelfTest.java
@@ -19,8 +19,10 @@ package org.apache.ignite.internal;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
+import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.messaging.*;
+import org.apache.ignite.testframework.*;
import org.apache.ignite.testframework.junits.common.*;
import java.util.*;
@@ -112,7 +114,7 @@ public class GridSelfTest extends GridProjectionAbstractTest {
public void testAsyncListen() throws Exception {
final String msg = "HELLO!";
- Ignite g = grid(0);
+ final Ignite g = grid(0);
final UUID locNodeId = g.cluster().localNode().id();
@@ -138,9 +140,13 @@ public class GridSelfTest extends GridProjectionAbstractTest {
g.message().send(null, msg);
- Thread.sleep(1000);
+ GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ return cnt.get() == g.cluster().forRemotes().nodes().size();
+ }
+ }, 5000);
- assert cnt.get() == g.cluster().forRemotes().nodes().size();
+ assertEquals(cnt.get(), g.cluster().forRemotes().nodes().size());
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5b9013f6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
index 6b7d1b8..b6cd88e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFailoverSelfTest.java
@@ -68,6 +68,8 @@ public abstract class GridCacheAbstractFailoverSelfTest extends GridCacheAbstrac
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
+ cfg.setNetworkTimeout(60_000);
+
cfg.getTransactionConfiguration().setTxSerializableEnabled(true);
TcpDiscoverySpi discoSpi = (TcpDiscoverySpi)cfg.getDiscoverySpi();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5b9013f6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
index 49f58f9..a37f585 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingRebalanceErrorTest.java
@@ -34,12 +34,11 @@ public class IgniteCacheP2pUnmarshallingRebalanceErrorTest extends IgniteCacheP2
/** {@inheritDoc} */
@Override public void testResponseMessageOnUnmarshallingFailed() throws Exception {
- //GridDhtPartitionSupplyMessage unmarshalling failed test
+ //GridDhtPartitionSupplyMessage unmarshalling failed test.
readCnt.set(Integer.MAX_VALUE);
- for (int i = 0; i <= 20; i++) {
+ for (int i = 0; i <= 20; i++)
jcache(0).put(new TestKey(String.valueOf(++key)), "");
- }
readCnt.set(1);
@@ -49,32 +48,30 @@ public class IgniteCacheP2pUnmarshallingRebalanceErrorTest extends IgniteCacheP2
Thread.sleep(1000);
- //GridDhtForceKeysRequest unmarshalling failed test
+ //GridDhtForceKeysRequest unmarshalling failed test.
stopGrid(3);
readCnt.set(Integer.MAX_VALUE);
- for (int i = 0; i <= 1000; i++) {
+ for (int i = 0; i <= 1000; i++)
jcache(0).put(new TestKey(String.valueOf(++key)), "");
- }
startGrid(3);
Affinity<Object> aff = affinity(grid(3).cache(null));
- while (!aff.isPrimary(grid(3).localNode(), new TestKey(String.valueOf(key)))) {
+ while (!aff.isPrimary(grid(3).localNode(), new TestKey(String.valueOf(key))))
--key;
- }
readCnt.set(1);
try {
jcache(3).get(new TestKey(String.valueOf(key)));
+
assert false : "p2p marshalling failed, but error response was not sent";
}
catch (CacheException e) {
assert X.hasCause(e, IOException.class);
}
-
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5b9013f6/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 d3535b4..bc33746 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
@@ -336,14 +336,14 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
/**
* @param cnt Count.
- * @param awaitPartitionMapExchange If we need to await partition map exchange.
+ * @param awaitPartMapExchange If we need to await partition map exchange.
* @return Ignite.
* @throws Exception If failed.
*/
- protected final Ignite startGridsMultiThreaded(int cnt, boolean awaitPartitionMapExchange) throws Exception {
+ protected final Ignite startGridsMultiThreaded(int cnt, boolean awaitPartMapExchange) throws Exception {
Ignite g = super.startGridsMultiThreaded(cnt);
- if (awaitPartitionMapExchange)
+ if (awaitPartMapExchange)
awaitPartitionMapExchange();
return g;
@@ -379,7 +379,8 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
int exp = affNodes.size();
- Collection<ClusterNode> owners = top.nodes(p, AffinityTopologyVersion.NONE);
+ Collection<ClusterNode> owners = top.topologyVersion() == AffinityTopologyVersion.NONE ?
+ Collections.<ClusterNode>emptyList() : top.nodes(p, AffinityTopologyVersion.NONE);
int actual = owners.size();
@@ -388,6 +389,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
"grid=" + g.name() +
", cache=" + cfg.getName() +
", cacheId=" + dht.context().cacheId() +
+ ", topVer=" + top.topologyVersion() +
", p=" + p +
", affNodesCnt=" + exp +
", ownersCnt=" + actual +
@@ -403,6 +405,7 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
"grid=" + g.name() +
", cache=" + cfg.getName() +
", cacheId=" + dht.context().cacheId() +
+ ", topVer=" + top.topologyVersion() +
", p=" + p +
", affNodesCnt=" + exp +
", ownersCnt=" + actual +
[39/50] incubator-ignite git commit: #IGNITE-960 Fixed review notes.
Added tests. Added check that CacheConfiguration is serializable.
Posted by sb...@apache.org.
#IGNITE-960 Fixed review notes. Added tests. Added check that CacheConfiguration is serializable.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a7ca45bb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a7ca45bb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a7ca45bb
Branch: refs/heads/ignite-950
Commit: a7ca45bb5fb9afa782d2b2ec134cc6524c7c22f8
Parents: b037baf
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 17:15:49 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 17:15:49 2015 +0300
----------------------------------------------------------------------
.../cache/store/jdbc/CacheJdbcBlobStore.java | 22 +-
.../store/jdbc/CacheJdbcBlobStoreFactory.java | 287 +++++++++++++++++++
.../cache/store/jdbc/CacheJdbcPojoStore.java | 3 +
.../store/jdbc/CacheJdbcPojoStoreFactory.java | 145 ++++++++++
.../processors/cache/GridCacheProcessor.java | 18 ++
.../util/spring/IgniteSpringHelper.java | 10 +
.../hibernate/CacheHibernateBlobStore.java | 87 +-----
.../CacheHibernateBlobStoreFactory.java | 180 ++++++++++++
.../CacheHibernateStoreFactorySelfTest.java | 66 +++++
.../testsuites/IgniteHibernateTestSuite.java | 2 +
.../store/jdbc/CacheJdbcBlobStoreFactory.java | 237 ---------------
.../util/spring/IgniteSpringHelperImpl.java | 17 ++
.../src/test/config/incorrect-store-cache.xml | 2 +-
.../test/config/pojo-incorrect-store-cache.xml | 56 ++++
modules/spring/src/test/config/store-cache.xml | 2 +-
modules/spring/src/test/config/store-cache1.xml | 2 +-
.../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 2 +-
.../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 194 +++++++++++++
.../testsuites/IgniteSpringTestSuite.java | 5 +
19 files changed, 991 insertions(+), 346 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
index 6852260..e01c879 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStore.java
@@ -19,6 +19,7 @@ package org.apache.ignite.cache.store.jdbc;
import org.apache.ignite.*;
import org.apache.ignite.cache.store.*;
+import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*;
@@ -65,27 +66,8 @@ import java.util.concurrent.atomic.*;
* <li>Insert entry query (see {@link #setInsertQuery(String)})</li>
* <li>Delete entry query (see {@link #setDeleteQuery(String)})</li>
* </ul>
- * <h2 class="header">Java Example</h2>
- * <pre name="code" class="java">
- * ...
- * GridCacheJdbcBlobStore<String, String> store = new GridCacheJdbcBlobStore<String, String>();
- * ...
- * </pre>
- * <h2 class="header">Spring Example</h2>
- * <pre name="code" class="xml">
- * ...
- * <bean id="cache.jdbc.store"
- * class="org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore">
- * <property name="connectionUrl" value="jdbc:h2:mem:"/>
- * <property name="createTableQuery"
- * value="create table if not exists ENTRIES (key other, val other)"/>
- * </bean>
- * ...
- * </pre>
* <p>
- * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
- * <br>
- * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
+ * Use {@link CacheJdbcBlobStoreFactory} factory to pass {@link CacheJdbcBlobStore} to {@link CacheConfiguration}.
*/
public class CacheJdbcBlobStore<K, V> extends CacheStoreAdapter<K, V> {
/** Default connection URL (value is <tt>jdbc:h2:mem:jdbcCacheStore;DB_CLOSE_DELAY=-1</tt>). */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
new file mode 100644
index 0000000..29a83c9
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
@@ -0,0 +1,287 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cache.store.jdbc;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.spring.*;
+import org.apache.ignite.internal.util.tostring.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.resources.*;
+
+import javax.cache.configuration.*;
+import javax.sql.*;
+
+/**
+ * {@link Factory} implementation for {@link CacheJdbcBlobStore}.
+ *
+ * Use this factory to pass {@link CacheJdbcBlobStore} to {@link CacheConfiguration}.
+ *
+ * <h2 class="header">Spring Example</h2>
+ * <pre name="code" class="xml">
+ * <bean id= "simpleDataSource" class="org.h2.jdbcx.JdbcDataSource"/>
+ *
+ * <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ * ...
+ * <property name="cacheConfiguration">
+ * <list>
+ * <bean class="org.apache.ignite.configuration.CacheConfiguration">
+ * ...
+ * <property name="cacheStoreFactory">
+ * <bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactory">
+ * <property name="user" value = "GridGain" />
+ * <property name="dataSourceBean" value = "simpleDataSource" />
+ * </bean>
+ * </property>
+ * </bean>
+ * </list>
+ * </property>
+ * </bean>
+ * </pre>
+ * <p>
+ * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
+ * <br>
+ * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
+ */
+public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobStore<K, V>> {
+ /** Connection URL. */
+ private String connUrl = CacheJdbcBlobStore.DFLT_CONN_URL;
+
+ /** Query to create table. */
+ private String createTblQry = CacheJdbcBlobStore.DFLT_CREATE_TBL_QRY;
+
+ /** Query to load entry. */
+ private String loadQry = CacheJdbcBlobStore.DFLT_LOAD_QRY;
+
+ /** Query to update entry. */
+ private String updateQry = CacheJdbcBlobStore.DFLT_UPDATE_QRY;
+
+ /** Query to insert entries. */
+ private String insertQry = CacheJdbcBlobStore.DFLT_INSERT_QRY;
+
+ /** Query to delete entries. */
+ private String delQry = CacheJdbcBlobStore.DFLT_DEL_QRY;
+
+ /** User name for database access. */
+ private String user;
+
+ /** Password for database access. */
+ @GridToStringExclude
+ private String passwd;
+
+ /** Flag for schema initialization. */
+ private boolean initSchema = true;
+
+ /** Name of data source bean. */
+ private String dataSrcBean;
+
+ /** Data source. */
+ private DataSource dataSrc;
+
+ /** Application context. */
+ @SpringApplicationContextResource
+ private Object appContext;
+
+ /** {@inheritDoc} */
+ @Override public CacheJdbcBlobStore<K, V> create() {
+ CacheJdbcBlobStore<K, V> store = new CacheJdbcBlobStore<>();
+
+ store.setInitSchema(initSchema);
+ store.setConnectionUrl(connUrl);
+ store.setCreateTableQuery(createTblQry);
+ store.setLoadQuery(loadQry);
+ store.setUpdateQuery(updateQry);
+ store.setInsertQuery(insertQry);
+ store.setDeleteQuery(delQry);
+ store.setUser(user);
+ store.setPassword(passwd);
+
+ if (dataSrc != null)
+ store.setDataSource(dataSrc);
+ else if (dataSrcBean != null) {
+ if (appContext == null)
+ throw new IgniteException("Spring application context resource is not injected.");
+
+ IgniteSpringHelper spring;
+
+ try {
+ spring = IgniteComponentType.SPRING.create(false);
+
+ DataSource data = spring.loadBeanFromAppContext(appContext, dataSrcBean);
+
+ store.setDataSource(data);
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteException("Failed to load bean in application context [beanName=" + dataSrcBean +
+ ", igniteConfig=" + appContext + ']');
+ }
+ }
+
+ return store;
+ }
+
+ /**
+ * Flag indicating whether DB schema should be initialized by Ignite (default behaviour) or
+ * was explicitly created by user.
+ *
+ * @param initSchema Initialized schema flag.
+ * @return {@code This} for chaining.
+ * @see CacheJdbcBlobStore#setInitSchema(boolean)
+ */
+ public CacheJdbcBlobStoreFactory<K, V> setInitSchema(boolean initSchema) {
+ this.initSchema = initSchema;
+
+ return this;
+ }
+
+ /**
+ * Sets connection URL.
+ *
+ * @param connUrl Connection URL.
+ * @return {@code This} for chaining.
+ * @see CacheJdbcBlobStore#setConnectionUrl(String)
+ */
+ public CacheJdbcBlobStoreFactory<K, V> setConnectionUrl(String connUrl) {
+ this.connUrl = connUrl;
+
+ return this;
+ }
+
+ /**
+ * Sets create table query.
+ *
+ * @param createTblQry Create table query.
+ * @return {@code This} for chaining.
+ * @see CacheJdbcBlobStore#setCreateTableQuery(String)
+ */
+ public CacheJdbcBlobStoreFactory<K, V> setCreateTableQuery(String createTblQry) {
+ this.createTblQry = createTblQry;
+
+ return this;
+ }
+
+ /**
+ * Sets load query.
+ *
+ * @param loadQry Load query
+ * @return {@code This} for chaining.
+ * @see CacheJdbcBlobStore#setLoadQuery(String)
+ */
+ public CacheJdbcBlobStoreFactory<K, V> setLoadQuery(String loadQry) {
+ this.loadQry = loadQry;
+
+ return this;
+ }
+
+ /**
+ * Sets update entry query.
+ *
+ * @param updateQry Update entry query.
+ * @return {@code This} for chaining.
+ * @see CacheJdbcBlobStore#setUpdateQuery(String)
+ */
+ public CacheJdbcBlobStoreFactory<K, V> setUpdateQuery(String updateQry) {
+ this.updateQry = updateQry;
+
+ return this;
+ }
+
+ /**
+ * Sets insert entry query.
+ *
+ * @param insertQry Insert entry query.
+ * @return {@code This} for chaining.
+ * @see CacheJdbcBlobStore#setInsertQuery(String)
+ */
+ public CacheJdbcBlobStoreFactory<K, V> setInsertQuery(String insertQry) {
+ this.insertQry = insertQry;
+
+ return this;
+ }
+
+ /**
+ * Sets delete entry query.
+ *
+ * @param delQry Delete entry query.
+ * @return {@code This} for chaining.
+ * @see CacheJdbcBlobStore#setDeleteQuery(String)
+ */
+ public CacheJdbcBlobStoreFactory<K, V> setDeleteQuery(String delQry) {
+ this.delQry = delQry;
+
+ return this;
+ }
+
+ /**
+ * Sets user name for database access.
+ *
+ * @param user User name.
+ * @return {@code This} for chaining.
+ * @see CacheJdbcBlobStore#setUser(String)
+ */
+ public CacheJdbcBlobStoreFactory<K, V> setUser(String user) {
+ this.user = user;
+
+ return this;
+ }
+
+ /**
+ * Sets password for database access.
+ *
+ * @param passwd Password.
+ * @return {@code This} for chaining.
+ * @see CacheJdbcBlobStore#setPassword(String)
+ */
+ public CacheJdbcBlobStoreFactory<K, V> setPassword(String passwd) {
+ this.passwd = passwd;
+
+ return this;
+ }
+
+ /**
+ * Sets name of the data source bean.
+ *
+ * @param dataSrcBean Data source bean name.
+ * @return {@code This} for chaining.
+ * @see CacheJdbcBlobStore#setDataSource(DataSource)
+ */
+ public CacheJdbcBlobStoreFactory<K, V> setDataSourceBean(String dataSrcBean) {
+ this.dataSrcBean = dataSrcBean;
+
+ return this;
+ }
+
+ /**
+ * Sets data source. Data source should be fully configured and ready-to-use.
+ *
+ * @param dataSrc Data source.
+ * @return {@code This} for chaining.
+ * @see CacheJdbcBlobStore#setDataSource(DataSource)
+ */
+ public CacheJdbcBlobStoreFactory<K, V> setDataSource(DataSource dataSrc) {
+ this.dataSrc = dataSrc;
+
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(CacheJdbcBlobStoreFactory.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
index 682f018..da00d95 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStore.java
@@ -19,6 +19,7 @@ package org.apache.ignite.cache.store.jdbc;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.store.*;
+import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.internal.util.typedef.internal.*;
import org.jetbrains.annotations.*;
@@ -33,6 +34,8 @@ import java.util.*;
* Implementation of {@link CacheStore} backed by JDBC and POJO via reflection.
*
* This implementation stores objects in underlying database using java beans mapping description via reflection.
+ * <p>
+ * Use {@link CacheJdbcPojoStoreFactory} factory to pass {@link CacheJdbcPojoStore} to {@link CacheConfiguration}.
*
* @param <K> The type of keys handled by this loader.
* @param <V> The type of values generated by this loader.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
new file mode 100644
index 0000000..4cb680a
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cache.store.jdbc;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.store.jdbc.dialect.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.spring.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.resources.*;
+
+import javax.cache.configuration.*;
+import javax.sql.*;
+
+/**
+ * {@link Factory} implementation for {@link CacheJdbcPojoStore}.
+ *
+ * Use this factory to pass {@link CacheJdbcPojoStore} to {@link CacheConfiguration}.
+ *
+ * <h2 class="header">Spring Example</h2>
+ * <pre name="code" class="xml">
+ * <bean id= "simpleDataSource" class="org.h2.jdbcx.JdbcDataSource"/>
+ *
+ * <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ * ...
+ * <property name="cacheConfiguration">
+ * <list>
+ * <bean class="org.apache.ignite.configuration.CacheConfiguration">
+ * ...
+ * <property name="cacheStoreFactory">
+ * <bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">
+ * <property name="dataSourceBean" value = "simpleDataSource" />
+ * </bean>
+ * </property>
+ * </bean>
+ * </list>
+ * </property>
+ * </bean>
+ * </pre>
+ * <p>
+ * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
+ * <br>
+ * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
+ */
+public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheJdbcPojoStore<K, V>> {
+ /** Name of data source bean. */
+ private String dataSrcBean;
+
+ /** Data source. */
+ private DataSource dataSrc;
+
+ /** Database dialect. */
+ protected JdbcDialect dialect;
+
+ /** Application context. */
+ @SpringApplicationContextResource
+ private Object appContext;
+
+ /** {@inheritDoc} */
+ @Override public CacheJdbcPojoStore<K, V> create() {
+ CacheJdbcPojoStore<K, V> store = new CacheJdbcPojoStore<>();
+
+ store.setDialect(dialect);
+
+ if (dataSrc != null)
+ store.setDataSource(dataSrc);
+ else if (dataSrcBean != null) {
+ if (appContext == null)
+ throw new IgniteException("Spring application context resource is not injected.");
+
+ IgniteSpringHelper spring;
+
+ try {
+ spring = IgniteComponentType.SPRING.create(false);
+
+ DataSource data = spring.loadBeanFromAppContext(appContext, dataSrcBean);
+
+ store.setDataSource(data);
+ }
+ catch (Exception e) {
+ throw new IgniteException("Failed to load bean in application context [beanName=" + dataSrcBean +
+ ", igniteConfig=" + appContext + ']');
+ }
+ }
+
+ return store;
+ }
+
+ /**
+ * Sets name of the data source bean.
+ *
+ * @param dataSrcBean Data source bean name.
+ * @return {@code This} for chaining.
+ * @see CacheJdbcPojoStore#setDataSource(DataSource)
+ */
+ public CacheJdbcPojoStoreFactory<K, V> setDataSourceBean(String dataSrcBean) {
+ this.dataSrcBean = dataSrcBean;
+
+ return this;
+ }
+
+ /**
+ * Sets data source. Data source should be fully configured and ready-to-use.
+ *
+ * @param dataSrc Data source.
+ * @return {@code This} for chaining.
+ * @see CacheJdbcPojoStore#setDataSource(DataSource)
+ */
+ public CacheJdbcPojoStoreFactory<K, V> setDataSource(DataSource dataSrc) {
+ this.dataSrc = dataSrc;
+
+ return this;
+ }
+
+ /**
+ * Set database dialect.
+ *
+ * @param dialect Database dialect.
+ * @see CacheJdbcPojoStore#setDialect(JdbcDialect)
+ */
+ public void setDialect(JdbcDialect dialect) {
+ this.dialect = dialect;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(CacheJdbcPojoStoreFactory.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
index ab7c48d..2f7f22c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
@@ -1888,6 +1888,13 @@ public class GridCacheProcessor extends GridProcessorAdapter {
req.failIfExists(failIfExists);
if (ccfg != null) {
+ try {
+ checkSerializable(ccfg);
+ }
+ catch (IgniteCheckedException e) {
+ return new GridFinishedFuture<>(e);
+ }
+
if (desc != null && !desc.cancelled()) {
if (failIfExists)
return new GridFinishedFuture<>(new CacheExistsException("Failed to start cache " +
@@ -2962,6 +2969,17 @@ public class GridCacheProcessor extends GridProcessorAdapter {
if (val == null)
return;
+ if (val.getCacheStoreFactory() != null) {
+ try {
+ marshaller.unmarshal(marshaller.marshal(val.getCacheStoreFactory()),
+ val.getCacheStoreFactory().getClass().getClassLoader());
+ }
+ catch (IgniteCheckedException e) {
+ throw new IgniteCheckedException("Failed to validate cache configuration. " +
+ "Cache store factory is not serializable. Cache name: " + U.maskName(val.getName()), e);
+ }
+ }
+
try {
marshaller.unmarshal(marshaller.marshal(val), val.getClass().getClassLoader());
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/core/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelper.java b/modules/core/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelper.java
index a9e9e93..345bb7c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelper.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelper.java
@@ -133,6 +133,16 @@ public interface IgniteSpringHelper {
public <T> T loadBean(InputStream stream, String beanName) throws IgniteCheckedException;
/**
+ * Loads bean instance by name from application context.
+ *
+ * @param appContext Sprint application context.
+ * @param beanName Bean name.
+ * @return Bean instance.
+ * @throws IgniteCheckedException In case of error.
+ */
+ public <T> T loadBeanFromAppContext(Object appContext, String beanName) throws IgniteCheckedException;
+
+ /**
* Gets user version for given class loader by checking
* {@code META-INF/ignite.xml} file for {@code userVersion} attribute. If
* {@code ignite.xml} file is not found, or user version is not specified there,
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java
index 77093b5..e6c542c 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStore.java
@@ -19,6 +19,7 @@ package org.apache.ignite.cache.store.hibernate;
import org.apache.ignite.*;
import org.apache.ignite.cache.store.*;
+import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.internal.util.typedef.*;
@@ -59,92 +60,8 @@ import java.util.concurrent.atomic.*;
* <p>
* If hibernate properties are provided, mapping
* {@code GridCacheHibernateStoreEntry.hbm.xml} is included automatically.
- *
- * <h2 class="header">Java Example</h2>
- * In this example existing session factory is provided.
- * <pre name="code" class="java">
- * ...
- * CacheHibernateBlobStore<String, String> store = new CacheHibernateBlobStore<String, String>();
- *
- * store.setSessionFactory(sesFactory);
- * ...
- * </pre>
- *
- * <h2 class="header">Spring Example (using Spring ORM)</h2>
- * <pre name="code" class="xml">
- * ...
- * <bean id="cache.hibernate.store"
- * class="org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStore">
- * <property name="sessionFactory">
- * <bean class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
- * <property name="hibernateProperties">
- * <value>
- * connection.url=jdbc:h2:mem:
- * show_sql=true
- * hbm2ddl.auto=true
- * hibernate.dialect=org.hibernate.dialect.H2Dialect
- * </value>
- * </property>
- * <property name="mappingResources">
- * <list>
- * <value>
- * org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreEntry.hbm.xml
- * </value>
- * </list>
- * </property>
- * </bean>
- * </property>
- * </bean>
- * ...
- * </pre>
- *
- * <h2 class="header">Spring Example (using Spring ORM and persistent annotations)</h2>
- * <pre name="code" class="xml">
- * ...
- * <bean id="cache.hibernate.store1"
- * class="org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStore">
- * <property name="sessionFactory">
- * <bean class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
- * <property name="hibernateProperties">
- * <value>
- * connection.url=jdbc:h2:mem:
- * show_sql=true
- * hbm2ddl.auto=true
- * hibernate.dialect=org.hibernate.dialect.H2Dialect
- * </value>
- * </property>
- * <property name="annotatedClasses">
- * <list>
- * <value>
- * org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreEntry
- * </value>
- * </list>
- * </property>
- * </bean>
- * </property>
- * </bean>
- * ...
- * </pre>
- *
- * <h2 class="header">Spring Example</h2>
- * <pre name="code" class="xml">
- * ...
- * <bean id="cache.hibernate.store2"
- * class="org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStore">
- * <property name="hibernateProperties">
- * <props>
- * <prop key="connection.url">jdbc:h2:mem:</prop>
- * <prop key="hbm2ddl.auto">update</prop>
- * <prop key="show_sql">true</prop>
- * </props>
- * </property>
- * </bean>
- * ...
- * </pre>
* <p>
- * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
- * <br>
- * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
+ * Use {@link CacheHibernateBlobStoreFactory} factory to pass {@link CacheHibernateBlobStore} to {@link CacheConfiguration}.
*/
public class CacheHibernateBlobStore<K, V> extends CacheStoreAdapter<K, V> {
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
new file mode 100644
index 0000000..6b89a9e
--- /dev/null
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cache.store.hibernate;
+
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.tostring.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.hibernate.*;
+
+import javax.cache.configuration.*;
+import java.util.*;
+
+/**
+ * {@link Factory} implementation for {@link CacheHibernateBlobStore}.
+ *
+ * Use this factory to pass {@link CacheHibernateBlobStore} to {@link CacheConfiguration}.
+ *
+ * <h2 class="header">Java Example</h2>
+ * In this example existing session factory is provided.
+ * <pre name="code" class="java">
+ * ...
+ * CacheHibernateBlobStoreFactory<String, String> factory = new CacheHibernateBlobStoreFactory<String, String>();
+ *
+ * factory.setSessionFactory(sesFactory);
+ * ...
+ * </pre>
+ *
+ * <h2 class="header">Spring Example (using Spring ORM)</h2>
+ * <pre name="code" class="xml">
+ * ...
+ * <bean id="cache.hibernate.store.factory"
+ * class="org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory">
+ * <property name="sessionFactory">
+ * <bean class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
+ * <property name="hibernateProperties">
+ * <value>
+ * connection.url=jdbc:h2:mem:
+ * show_sql=true
+ * hbm2ddl.auto=true
+ * hibernate.dialect=org.hibernate.dialect.H2Dialect
+ * </value>
+ * </property>
+ * <property name="mappingResources">
+ * <list>
+ * <value>
+ * org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreEntry.hbm.xml
+ * </value>
+ * </list>
+ * </property>
+ * </bean>
+ * </property>
+ * </bean>
+ * ...
+ * </pre>
+ *
+ * <h2 class="header">Spring Example (using Spring ORM and persistent annotations)</h2>
+ * <pre name="code" class="xml">
+ * ...
+ * <bean id="cache.hibernate.store.factory1"
+ * class="org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory">
+ * <property name="sessionFactory">
+ * <bean class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
+ * <property name="hibernateProperties">
+ * <value>
+ * connection.url=jdbc:h2:mem:
+ * show_sql=true
+ * hbm2ddl.auto=true
+ * hibernate.dialect=org.hibernate.dialect.H2Dialect
+ * </value>
+ * </property>
+ * <property name="annotatedClasses">
+ * <list>
+ * <value>
+ * org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreEntry
+ * </value>
+ * </list>
+ * </property>
+ * </bean>
+ * </property>
+ * </bean>
+ * ...
+ * </pre>
+ *
+ * <h2 class="header">Spring Example</h2>
+ * <pre name="code" class="xml">
+ * ...
+ * <bean id="cache.hibernate.store.factory2"
+ * class="org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory">
+ * <property name="hibernateProperties">
+ * <props>
+ * <prop key="connection.url">jdbc:h2:mem:</prop>
+ * <prop key="hbm2ddl.auto">update</prop>
+ * <prop key="show_sql">true</prop>
+ * </props>
+ * </property>
+ * </bean>
+ * ...
+ * </pre>
+ * <p>
+ * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
+ * <br>
+ * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
+ */
+public class CacheHibernateBlobStoreFactory<K, V> implements Factory<CacheHibernateBlobStore<K, V>> {
+ /** Session factory. */
+ @GridToStringExclude
+ private SessionFactory sesFactory;
+
+ /** Path to hibernate configuration file. */
+ private String hibernateCfgPath;
+
+ /** Hibernate properties. */
+ @GridToStringExclude
+ private Properties hibernateProps;
+
+
+ /** {@inheritDoc} */
+ @Override public CacheHibernateBlobStore<K, V> create() {
+ CacheHibernateBlobStore<K, V> store = new CacheHibernateBlobStore<>();
+
+ store.setSessionFactory(sesFactory);
+ store.setHibernateConfigurationPath(hibernateCfgPath);
+ store.setHibernateProperties(hibernateProps);
+
+ return store;
+ }
+
+ /**
+ * Sets session factory.
+ *
+ * @param sesFactory Session factory.
+ * @see CacheHibernateBlobStore#setSessionFactory(SessionFactory)
+ */
+ public void setSessionFactory(SessionFactory sesFactory) {
+ this.sesFactory = sesFactory;
+ }
+
+ /**
+ * Sets hibernate configuration path.
+ * <p>
+ * This may be either URL or file path or classpath resource.
+ *
+ * @param hibernateCfgPath URL or file path or classpath resource
+ * pointing to hibernate configuration XML file.
+ * @see CacheHibernateBlobStore#setHibernateConfigurationPath(String)
+ */
+ public void setHibernateConfigurationPath(String hibernateCfgPath) {
+ this.hibernateCfgPath = hibernateCfgPath;
+ }
+
+ /**
+ * Sets Hibernate properties.
+ *
+ * @param hibernateProps Hibernate properties.
+ * @see CacheHibernateBlobStore#setHibernateProperties(Properties)
+ */
+ public void setHibernateProperties(Properties hibernateProps) {
+ this.hibernateProps = hibernateProps;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(CacheHibernateBlobStoreFactory.class, this);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java b/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
new file mode 100644
index 0000000..225fc11
--- /dev/null
+++ b/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreFactorySelfTest.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cache.store.hibernate;
+
+import org.apache.ignite.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.testframework.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+/**
+ * Test for Cache jdbc blob store factory.
+ */
+public class CacheHibernateStoreFactorySelfTest extends GridCommonAbstractTest {
+ /**
+ * @throws Exception If failed.
+ */
+ public void testCacheConfiguration() throws Exception {
+ try (Ignite ignite1 = startGrid(0)) {
+ IgniteCache<Integer, String> cache1 = ignite1.getOrCreateCache(cacheConfiguration());
+
+ checkStore(cache1);
+ }
+ }
+
+ /**
+ * @return Cache configuration with store.
+ */
+ private CacheConfiguration<Integer, String> cacheConfiguration() {
+ CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();
+
+ CacheHibernateBlobStoreFactory<Integer, String> factory = new CacheHibernateBlobStoreFactory();
+
+ factory.setHibernateConfigurationPath("/org/apache/ignite/cache/store/hibernate/hibernate.cfg.xml");
+
+ cfg.setCacheStoreFactory(factory);
+
+ return cfg;
+ }
+
+ /**
+ * @param cache Ignite cache.
+ * @throws Exception If store parameters is not the same as in configuration xml.
+ */
+ private void checkStore(IgniteCache<Integer, String> cache) throws Exception {
+ CacheHibernateBlobStore store = (CacheHibernateBlobStore)cache.getConfiguration(CacheConfiguration.class)
+ .getCacheStoreFactory().create();
+
+ assertEquals("/org/apache/ignite/cache/store/hibernate/hibernate.cfg.xml",
+ GridTestUtils.getFieldValue(store, CacheHibernateBlobStore.class, "hibernateCfgPath"));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java b/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
index 3ac5ec4..2965250 100644
--- a/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
+++ b/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java
@@ -43,6 +43,8 @@ public class IgniteHibernateTestSuite extends TestSuite {
suite.addTestSuite(CacheHibernateStoreSessionListenerSelfTest.class);
+ suite.addTestSuite(CacheHibernateStoreFactorySelfTest.class);
+
return suite;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java b/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
deleted file mode 100644
index b33b3b6..0000000
--- a/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.cache.store.jdbc;
-
-import org.apache.ignite.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.util.tostring.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.resources.*;
-import org.springframework.context.*;
-
-import javax.cache.configuration.*;
-import javax.sql.*;
-
-/**
- * {@link Factory} implementation for {@link CacheJdbcBlobStore}.
- *
- * Use this factory to pass {@link CacheJdbcBlobStore} to {@link CacheConfiguration}.
- *
- * <h2 class="header">Spring Example</h2>
- * <pre name="code" class="xml"> *
- * <bean id= "simpleDataSource" class="org.h2.jdbcx.JdbcDataSource"/>
- *
- * <bean id="cache.jdbc.store"
- * class="org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore">
- * <property name="connectionUrl" value="jdbc:h2:mem:"/>
- * <property name="createTableQuery"
- * value="create table if not exists ENTRIES (key other, val other)"/>
- * </bean>
- *
- * <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
- * ...
- * <property name="cacheConfiguration">
- * <list>
- * <bean class="org.apache.ignite.configuration.CacheConfiguration">
- * ...
- * <property name="cacheStoreFactory">
- * <bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactory">
- * <property name="user" value = "GridGain" />
- * <property name="dataSourceBean" value = "simpleDataSource" />
- * </bean>
- * </property>
- * </bean>
- * </list>
- * </property>
- * </bean>
- * </pre>
- * <p>
- * <img src="http://ignite.incubator.apache.org/images/spring-small.png">
- * <br>
- * For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
- */
-public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobStore<K, V>> {
- /** Connection URL. */
- private String connUrl = CacheJdbcBlobStore.DFLT_CONN_URL;
-
- /** Query to create table. */
- private String createTblQry = CacheJdbcBlobStore.DFLT_CREATE_TBL_QRY;
-
- /** Query to load entry. */
- private String loadQry = CacheJdbcBlobStore.DFLT_LOAD_QRY;
-
- /** Query to update entry. */
- private String updateQry = CacheJdbcBlobStore.DFLT_UPDATE_QRY;
-
- /** Query to insert entries. */
- private String insertQry = CacheJdbcBlobStore.DFLT_INSERT_QRY;
-
- /** Query to delete entries. */
- private String delQry = CacheJdbcBlobStore.DFLT_DEL_QRY;
-
- /** User name for database access. */
- private String user;
-
- /** Password for database access. */
- @GridToStringExclude
- private String passwd;
-
- /** Flag for schema initialization. */
- private boolean initSchema = true;
-
- /** Name of data source bean. */
- private String dataSrcBean;
-
- /** Application context. */
- @SpringApplicationContextResource
- private ApplicationContext appContext;
-
- /** {@inheritDoc} */
- @Override public CacheJdbcBlobStore<K, V> create() {
- CacheJdbcBlobStore<K, V> store = new CacheJdbcBlobStore<>();
-
- store.setInitSchema(initSchema);
- store.setConnectionUrl(connUrl);
- store.setCreateTableQuery(createTblQry);
- store.setLoadQuery(loadQry);
- store.setUpdateQuery(updateQry);
- store.setInsertQuery(insertQry);
- store.setDeleteQuery(delQry);
- store.setUser(user);
- store.setPassword(passwd);
-
- if (dataSrcBean != null) {
- if (appContext == null)
- throw new IgniteException("Spring application context resource is not injected.");
-
- if (!appContext.containsBean(dataSrcBean))
- throw new IgniteException("Failed to find bean in application context [beanName=" + dataSrcBean +
- ", appContext=" + appContext + ']');
-
- DataSource data = (DataSource)appContext.getBean(dataSrcBean);
-
- store.setDataSource(data);
- }
-
- return store;
- }
-
- /**
- * Flag indicating whether DB schema should be initialized by Ignite (default behaviour) or
- * was explicitly created by user.
- *
- * @param initSchema Initialized schema flag.
- * @return {@code This} for chaining.
- * @see CacheJdbcBlobStore#setInitSchema(boolean)
- */
- public CacheJdbcBlobStoreFactory setInitSchema(boolean initSchema) {
- this.initSchema = initSchema;
-
- return this;
- }
-
- /**
- * Sets connection URL.
- *
- * @param connUrl Connection URL.
- * @see CacheJdbcBlobStore#setConnectionUrl(String)
- */
- public void setConnectionUrl(String connUrl) {
- this.connUrl = connUrl;
- }
-
- /**
- * See {@link CacheJdbcBlobStore#setCreateTableQuery(String)}.
- *
- * @param createTblQry Create table query.
- */
- public void setCreateTableQuery(String createTblQry) {
- this.createTblQry = createTblQry;
- }
-
- /**
- * See {@link CacheJdbcBlobStore#setLoadQuery(String)}.
- *
- * @param loadQry Load query
- */
- public void setLoadQuery(String loadQry) {
- this.loadQry = loadQry;
- }
-
- /**
- * See {@link CacheJdbcBlobStore#setUpdateQuery(String)}.
- *
- * @param updateQry Update entry query.
- */
- public void setUpdateQuery(String updateQry) {
- this.updateQry = updateQry;
- }
-
- /**
- * See {@link CacheJdbcBlobStore#setInsertQuery(String)}.
- *
- * @param insertQry Insert entry query.
- */
- public void setInsertQuery(String insertQry) {
- this.insertQry = insertQry;
- }
-
- /**
- * See {@link CacheJdbcBlobStore#setDeleteQuery(String)}.
- *
- * @param delQry Delete entry query.
- */
- public void setDeleteQuery(String delQry) {
- this.delQry = delQry;
- }
-
- /**
- * See {@link CacheJdbcBlobStore#setUser(String)}.
- *
- * @param user User name.
- */
- public void setUser(String user) {
- this.user = user;
- }
-
- /**
- * See {@link CacheJdbcBlobStore#setPassword(String)}.
- *
- * @param passwd Password.
- */
- public void setPassword(String passwd) {
- this.passwd = passwd;
- }
-
- /**
- * Sets name of the data source bean.
- *
- * See {@link CacheJdbcBlobStore#setDataSource(DataSource)}
- * for more information.
- *
- * @param dataSrcBean Data source bean name.
- */
- public void setDataSourceBean(String dataSrcBean) {
- this.dataSrcBean = dataSrcBean;
- }
-
- /** {@inheritDoc} */
- @Override public String toString() {
- return S.toString(CacheJdbcBlobStoreFactory.class, this);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java b/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
index 2c7c7e1..cbb200d 100644
--- a/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
+++ b/modules/spring/src/main/java/org/apache/ignite/internal/util/spring/IgniteSpringHelperImpl.java
@@ -192,6 +192,23 @@ public class IgniteSpringHelperImpl implements IgniteSpringHelper {
}
}
+ /** {@inheritDoc} */
+ @Override public <T> T loadBeanFromAppContext(Object appContext, String beanName) throws IgniteCheckedException {
+ ApplicationContext springCtx = (ApplicationContext)appContext;
+
+ try {
+ return (T)springCtx.getBean(beanName);
+ }
+ catch (NoSuchBeanDefinitionException e) {
+ throw new IgniteCheckedException("Spring bean with provided name doesn't exist " +
+ ", beanName=" + beanName + ']');
+ }
+ catch (BeansException e) {
+ throw new IgniteCheckedException("Failed to load Spring bean with provided name " +
+ ", beanName=" + beanName + ']', e);
+ }
+ }
+
/**
* @param stream Input stream containing Spring XML configuration.
* @return Context.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/config/incorrect-store-cache.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/incorrect-store-cache.xml b/modules/spring/src/test/config/incorrect-store-cache.xml
index 9a0b7c6..2ccda21 100644
--- a/modules/spring/src/test/config/incorrect-store-cache.xml
+++ b/modules/spring/src/test/config/incorrect-store-cache.xml
@@ -43,7 +43,7 @@
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
- <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+ <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
<property name="addresses">
<list>
<value>127.0.0.1:47500..47509</value>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/config/pojo-incorrect-store-cache.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/pojo-incorrect-store-cache.xml b/modules/spring/src/test/config/pojo-incorrect-store-cache.xml
new file mode 100644
index 0000000..5627bd0
--- /dev/null
+++ b/modules/spring/src/test/config/pojo-incorrect-store-cache.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ <property name="cacheConfiguration">
+ <list>
+ <bean class="org.apache.ignite.configuration.CacheConfiguration">
+ <property name="name" value="test"/>
+ <property name="atomicityMode" value="ATOMIC"/>
+ <property name="backups" value="1"/>
+ <property name="cacheStoreFactory">
+ <bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">
+ <property name="dataSourceBean" value = "simpleDataSource"/>
+ </bean>
+ </property>
+ </bean>
+ </list>
+ </property>
+
+ <!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
+ <property name="discoverySpi">
+ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
+ <property name="ipFinder">
+ <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
+ <property name="addresses">
+ <list>
+ <value>127.0.0.1:47500..47509</value>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ </bean>
+</beans>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/config/store-cache.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/store-cache.xml b/modules/spring/src/test/config/store-cache.xml
index 992a22c..07a4ab0 100644
--- a/modules/spring/src/test/config/store-cache.xml
+++ b/modules/spring/src/test/config/store-cache.xml
@@ -45,7 +45,7 @@
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
- <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+ <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
<property name="addresses">
<list>
<value>127.0.0.1:47500..47509</value>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/config/store-cache1.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/store-cache1.xml b/modules/spring/src/test/config/store-cache1.xml
index 9209e52..bff88e9 100644
--- a/modules/spring/src/test/config/store-cache1.xml
+++ b/modules/spring/src/test/config/store-cache1.xml
@@ -48,7 +48,7 @@
<property name="discoverySpi">
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="ipFinder">
- <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
+ <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
<property name="addresses">
<list>
<value>127.0.0.1:47500..47509</value>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
index 4a693a7..6d3d3fd 100644
--- a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
@@ -78,7 +78,7 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
}
return null;
}
- }, IgniteException.class, "Cannot find bean in application context.");
+ }, IgniteException.class, "Failed to load bean in application context");
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
new file mode 100644
index 0000000..7b709d5
--- /dev/null
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactorySelfTest.java
@@ -0,0 +1,194 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cache.store.jdbc;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.store.jdbc.dialect.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.testframework.*;
+import org.apache.ignite.testframework.junits.common.*;
+import org.h2.jdbcx.*;
+import sun.jdbc.odbc.ee.*;
+
+import javax.cache.*;
+import java.io.*;
+import java.util.*;
+import java.util.concurrent.*;
+
+/**
+ * Test for Cache jdbc blob store factory.
+ */
+public class CacheJdbcPojoStoreFactorySelfTest extends GridCommonAbstractTest {
+ /** Cache name. */
+ private static final String CACHE_NAME = "test";
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testCacheConfiguration() throws Exception {
+ try (Ignite ignite = Ignition.start("modules/spring/src/test/config/node.xml")) {
+ try (Ignite ignite1 = Ignition.start("modules/spring/src/test/config/node1.xml")) {
+ try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cacheConfiguration())) {
+ try (IgniteCache<Integer, String> cache1 = ignite1.getOrCreateCache(cacheConfiguration())) {
+ checkStore(cache, JdbcDataSource.class);
+
+ checkStore(cache1, ConnectionPoolDataSource.class);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testSerializable() throws Exception {
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try (Ignite ignite = Ignition.start("modules/spring/src/test/config/node.xml")) {
+ try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cacheConfigurationH2Dialect())) {
+ checkStore(cache, JdbcDataSource.class);
+ }
+ }
+
+ return null;
+ }
+ }, CacheException.class, "Failed to validate cache configuration. Cache store factory is not serializable.");
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testIncorrectBeanConfiguration() throws Exception {
+ GridTestUtils.assertThrows(log, new Callable<Object>() {
+ @Override public Object call() throws Exception {
+ try(Ignite ignite = Ignition.start("modules/spring/src/test/config/pojo-incorrect-store-cache.xml")) {
+ ignite.cache(CACHE_NAME).getConfiguration(CacheConfiguration.class).
+ getCacheStoreFactory().create();
+ }
+ return null;
+ }
+ }, IgniteException.class, "Failed to load bean in application context");
+ }
+
+ /**
+ * @return Cache configuration with store.
+ */
+ private CacheConfiguration<Integer, String> cacheConfiguration() {
+ CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();
+
+ CacheJdbcPojoStoreFactory<Integer, String> factory = new CacheJdbcPojoStoreFactory<>();
+
+ factory.setDataSourceBean("simpleDataSource");
+
+ factory.setDialect(new DummyDialect());
+
+ cfg.setCacheStoreFactory(factory);
+
+ return cfg;
+ }
+
+ /**
+ * @return Cache configuration with store.
+ */
+ private CacheConfiguration<Integer, String> cacheConfigurationH2Dialect() {
+ CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();
+
+ CacheJdbcPojoStoreFactory<Integer, String> factory = new CacheJdbcPojoStoreFactory<>();
+
+ factory.setDataSourceBean("simpleDataSource");
+
+ factory.setDialect(new H2Dialect());
+
+ cfg.setCacheStoreFactory(factory);
+
+ return cfg;
+ }
+
+ /**
+ * @param cache Ignite cache.
+ * @param dataSrcClass Data source class.
+ * @throws Exception If store parameters is not the same as in configuration xml.
+ */
+ private void checkStore(IgniteCache<Integer, String> cache, Class<?> dataSrcClass) throws Exception {
+ CacheJdbcPojoStore store = (CacheJdbcPojoStore)cache.getConfiguration(CacheConfiguration.class).
+ getCacheStoreFactory().create();
+
+ assertEquals(dataSrcClass,
+ GridTestUtils.getFieldValue(store, CacheAbstractJdbcStore.class, "dataSrc").getClass());
+ }
+
+ /**
+ *
+ */
+ public static class DummyDialect implements JdbcDialect, Serializable {
+ /** {@inheritDoc} */
+ @Override public String loadCacheSelectRangeQuery(String fullTblName, Collection<String> keyCols) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String loadCacheRangeQuery(String fullTblName, Collection<String> keyCols,
+ Iterable<String> uniqCols, boolean appendLowerBound, boolean appendUpperBound) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String loadCacheQuery(String fullTblName, Iterable<String> uniqCols) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String loadQuery(String fullTblName, Collection<String> keyCols, Iterable<String> cols,
+ int keyCnt) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String insertQuery(String fullTblName, Collection<String> keyCols,
+ Collection<String> valCols) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String updateQuery(String fullTblName, Collection<String> keyCols, Iterable<String> valCols) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public boolean hasMerge() {
+ return false;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String mergeQuery(String fullTblName, Collection<String> keyCols,
+ Collection<String> uniqCols) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String removeQuery(String fullTblName, Iterable<String> keyCols) {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override public int getMaxParameterCount() {
+ return 0;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a7ca45bb/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
index 12dd494..0c2e99e 100644
--- a/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
+++ b/modules/spring/src/test/java/org/apache/ignite/testsuites/IgniteSpringTestSuite.java
@@ -18,6 +18,7 @@
package org.apache.ignite.testsuites;
import junit.framework.*;
+import org.apache.ignite.cache.store.jdbc.*;
import org.apache.ignite.cache.store.spring.*;
import org.apache.ignite.internal.*;
import org.apache.ignite.p2p.*;
@@ -50,6 +51,10 @@ public class IgniteSpringTestSuite extends TestSuite {
suite.addTestSuite(CacheSpringStoreSessionListenerSelfTest.class);
+ suite.addTestSuite(CacheJdbcBlobStoreFactorySelfTest.class);
+
+ suite.addTestSuite(CacheJdbcPojoStoreFactorySelfTest.class);
+
return suite;
}
}
[15/50] incubator-ignite git commit: # ignite-1009-v4
Posted by sb...@apache.org.
# ignite-1009-v4
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b06eb0e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b06eb0e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b06eb0e1
Branch: refs/heads/ignite-950
Commit: b06eb0e19b28fb660445585d4602a07389751476
Parents: cd43ff7
Author: sboikov <sb...@gridgain.com>
Authored: Fri Jun 12 18:29:19 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Jun 12 18:29:19 2015 +0300
----------------------------------------------------------------------
.../cache/distributed/dht/GridDhtTransactionalCacheAdapter.java | 2 +-
.../internal/processors/cache/transactions/IgniteTxHandler.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b06eb0e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 4f081bf..703daf9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -859,7 +859,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
req.isolation(),
req.timeout(),
req.isInvalidate(),
- true,
+ false,
req.txSize(),
null,
req.subjectId(),
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b06eb0e1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index e481e25..01662ef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -325,7 +325,7 @@ public class IgniteTxHandler {
req.isolation(),
req.timeout(),
req.isInvalidate(),
- true,
+ false,
req.txSize(),
req.transactionNodes(),
req.subjectId(),
[14/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-sprint-6' into ignite-1009-v4
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-6' into ignite-1009-v4
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/cd43ff7c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/cd43ff7c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/cd43ff7c
Branch: refs/heads/ignite-950
Commit: cd43ff7c4f9db4dc29572bd4dace4443b0373392
Parents: 7f97ec7 2707194
Author: sboikov <sb...@gridgain.com>
Authored: Fri Jun 12 18:28:23 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Jun 12 18:28:23 2015 +0300
----------------------------------------------------------------------
RELEASE_NOTES.txt | 12 +++
.../ignite/internal/GridKernalContextImpl.java | 5 +-
.../apache/ignite/internal/IgniteKernal.java | 21 +++++-
.../internal/MarshallerContextAdapter.java | 18 ++++-
.../ignite/internal/MarshallerContextImpl.java | 14 +++-
.../GridClientOptimizedMarshaller.java | 5 ++
.../distributed/GridCacheTxRecoveryRequest.java | 26 +++----
.../GridCacheTxRecoveryResponse.java | 14 ++--
.../distributed/GridDistributedBaseMessage.java | 77 +-------------------
.../distributed/GridDistributedLockRequest.java | 54 +++++++-------
.../GridDistributedLockResponse.java | 14 ++--
.../GridDistributedTxFinishRequest.java | 46 ++++++------
.../GridDistributedTxPrepareRequest.java | 62 ++++++++--------
.../GridDistributedTxPrepareResponse.java | 64 +---------------
.../GridDistributedUnlockRequest.java | 6 +-
.../distributed/dht/GridDhtLockRequest.java | 72 ++++++++++++++----
.../distributed/dht/GridDhtLockResponse.java | 18 ++---
.../distributed/dht/GridDhtTxFinishRequest.java | 38 +++++-----
.../dht/GridDhtTxPrepareRequest.java | 54 +++++++-------
.../dht/GridDhtTxPrepareResponse.java | 22 +++---
.../distributed/dht/GridDhtUnlockRequest.java | 6 +-
.../distributed/near/GridNearLockRequest.java | 58 +++++++--------
.../distributed/near/GridNearLockResponse.java | 26 +++----
.../near/GridNearTxFinishRequest.java | 26 +++----
.../near/GridNearTxPrepareRequest.java | 50 ++++++-------
.../near/GridNearTxPrepareResponse.java | 46 ++++++------
.../distributed/near/GridNearUnlockRequest.java | 2 +-
.../cache/transactions/IgniteTxHandler.java | 3 -
.../plugin/IgnitePluginProcessor.java | 16 +---
.../messages/GridQueryNextPageResponse.java | 1 +
.../cache/GridCachePutAllFailoverSelfTest.java | 5 --
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 14 +++-
.../dht/GridCacheColocatedFailoverSelfTest.java | 5 --
.../GridCachePartitionedFailoverSelfTest.java | 5 --
.../GridCacheReplicatedFailoverSelfTest.java | 5 --
.../DataStreamProcessorSelfTest.java | 3 +-
.../marshaller/MarshallerContextTestImpl.java | 18 +++++
.../junits/GridTestKernalContext.java | 1 +
.../testsuites/IgniteKernalSelfTestSuite.java | 2 +-
.../ignite/tools/classgen/ClassesGenerator.java | 18 ++++-
40 files changed, 464 insertions(+), 488 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/cd43ff7c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
[23/50] incubator-ignite git commit: Merge branches 'ignite-883-1'
and 'ignite-sprint-6' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-883-1
Posted by sb...@apache.org.
Merge branches 'ignite-883-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-883-1
Conflicts:
modules/core/src/main/java/org/apache/ignite/cache/query/ScanQuery.java
modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.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/4a134912
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4a134912
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4a134912
Branch: refs/heads/ignite-950
Commit: 4a1349126eb3b7a78cb849f2e8d4b772ced43fe1
Parents: ca7032e 0907338
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Mon Jun 15 10:45:25 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Mon Jun 15 10:45:25 2015 +0300
----------------------------------------------------------------------
.../datastructures/DataStructuresProcessor.java | 67 +++++++++++++++++++-
.../rest/client/message/GridRouterRequest.java | 18 ++++++
.../rest/client/message/GridRouterResponse.java | 18 ++++++
.../testsuites/IgniteCacheTestSuite4.java | 4 +-
.../ignite/tools/classgen/ClassesGenerator.java | 12 ++++
5 files changed, 114 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
[34/50] incubator-ignite git commit: # ignite-883 fixed test
Posted by sb...@apache.org.
# ignite-883 fixed test
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/22ec5cf2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/22ec5cf2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/22ec5cf2
Branch: refs/heads/ignite-950
Commit: 22ec5cf2a50ac7719ddc25ed5feb7ca06c491931
Parents: 54bfa36
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 16 15:58:53 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 16 15:58:53 2015 +0300
----------------------------------------------------------------------
.../IgniteCacheClientNodeConcurrentStart.java | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/22ec5cf2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeConcurrentStart.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeConcurrentStart.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeConcurrentStart.java
index bd74ece..1eff7fb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeConcurrentStart.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientNodeConcurrentStart.java
@@ -37,7 +37,7 @@ public class IgniteCacheClientNodeConcurrentStart extends GridCommonAbstractTest
protected static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
/** */
- private static final int NODES_CNT = 5;
+ private static final int NODES_CNT = 6;
/** */
private Set<Integer> clientNodes;
@@ -83,13 +83,21 @@ public class IgniteCacheClientNodeConcurrentStart extends GridCommonAbstractTest
clientNodes = new HashSet<>();
while (clientNodes.size() < 2)
- clientNodes.add(rnd.nextInt(0, NODES_CNT));
+ clientNodes.add(rnd.nextInt(1, NODES_CNT));
clientNodes.add(NODES_CNT - 1);
log.info("Test iteration [iter=" + i + ", clients=" + clientNodes + ']');
- startGridsMultiThreaded(NODES_CNT, true);
+ Ignite srv = startGrid(0); // Start server node first.
+
+ assertFalse(srv.configuration().isClientMode());
+
+ startGridsMultiThreaded(1, NODES_CNT - 1);
+
+ checkTopology(NODES_CNT);
+
+ awaitPartitionMapExchange();
for (int node : clientNodes) {
Ignite ignite = grid(node);
[10/50] incubator-ignite git commit: Merge remote-tracking branch
'origin/ignite-sprint-6' into ignite-sprint-6
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-6' into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/51600881
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/51600881
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/51600881
Branch: refs/heads/ignite-950
Commit: 516008811d416b92011d3a70249a579cf41b1e93
Parents: dd58664 2b81104
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri Jun 12 17:21:14 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri Jun 12 17:21:14 2015 +0300
----------------------------------------------------------------------
.../ignite/internal/GridKernalContextImpl.java | 5 +++--
.../apache/ignite/internal/IgniteKernal.java | 21 ++++++++++++++++++--
.../internal/MarshallerContextAdapter.java | 18 +++++++++++++++--
.../ignite/internal/MarshallerContextImpl.java | 14 ++++++++++++-
.../GridClientOptimizedMarshaller.java | 5 +++++
.../plugin/IgnitePluginProcessor.java | 16 ++-------------
.../IgniteCacheP2pUnmarshallingTxErrorTest.java | 14 +++++++++----
.../marshaller/MarshallerContextTestImpl.java | 18 +++++++++++++++++
.../junits/GridTestKernalContext.java | 1 +
.../ignite/tools/classgen/ClassesGenerator.java | 18 +++++++++++++----
10 files changed, 101 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
[13/50] incubator-ignite git commit: # Release notes for Hadoop.
Posted by sb...@apache.org.
# Release notes for Hadoop.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2707194f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2707194f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2707194f
Branch: refs/heads/ignite-950
Commit: 2707194f50070622dd646c85ebbdb2671dfd6586
Parents: 5160088
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Jun 12 18:10:06 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Jun 12 18:10:06 2015 +0300
----------------------------------------------------------------------
RELEASE_NOTES.txt | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/2707194f/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index fcd281a..1783131 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,5 +1,6 @@
Apache Ignite Release Notes
===========================
+
Apache Ignite In-Memory Data Fabric 1.2
---------------------------------------
@@ -9,6 +10,7 @@ Apache Ignite In-Memory Data Fabric 1.2
* Added integration with Apache Mesos.
* Added support for log4j2.
* Added IgniteCache.getAllOutTx() method.
+* Bug fixes in In-Memory Accelerator For Apache Hadoop.
* Many stability and fault-tolerance fixes.
Apache Ignite In-Memory Data Fabric 1.1
[19/50] incubator-ignite git commit: sprint-6 - Fixed broken
Externalizable classes + added check
Posted by sb...@apache.org.
sprint-6 - Fixed broken Externalizable classes + added check
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/40f826bf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/40f826bf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/40f826bf
Branch: refs/heads/ignite-950
Commit: 40f826bf9037e4341904e87b90f20e3eb0388f85
Parents: 2f7b253
Author: Valentin Kulichenko <vk...@gridgain.com>
Authored: Fri Jun 12 17:05:07 2015 -0700
Committer: Valentin Kulichenko <vk...@gridgain.com>
Committed: Fri Jun 12 17:05:07 2015 -0700
----------------------------------------------------------------------
.../rest/client/message/GridRouterRequest.java | 18 ++++++++++++++++++
.../rest/client/message/GridRouterResponse.java | 18 ++++++++++++++++++
.../ignite/tools/classgen/ClassesGenerator.java | 12 ++++++++++++
3 files changed, 48 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/40f826bf/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterRequest.java
index 6dcbf92..7839e22 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterRequest.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.processors.rest.client.message;
+import java.io.*;
import java.util.*;
/**
@@ -30,6 +31,13 @@ public class GridRouterRequest extends GridClientAbstractMessage {
private final byte[] body;
/**
+ * For {@link Externalizable} (not supported).
+ */
+ public GridRouterRequest() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
* @param body Message in raw form.
* @param clientId Client id.
* @param reqId Request id.
@@ -51,6 +59,16 @@ public class GridRouterRequest extends GridClientAbstractMessage {
}
/** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** {@inheritDoc} */
@Override public String toString() {
return "GridRouterRequest [clientId=" + clientId() + ", reqId=" + requestId() + ", " +
"destId=" + destinationId() + ", length=" + body.length + "]";
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/40f826bf/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterResponse.java
index 2ff3e21..9054d8e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterResponse.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridRouterResponse.java
@@ -17,6 +17,7 @@
package org.apache.ignite.internal.processors.rest.client.message;
+import java.io.*;
import java.util.*;
/**
@@ -36,6 +37,13 @@ public class GridRouterResponse extends GridClientAbstractMessage {
private final int status;
/**
+ * For {@link Externalizable} (not supported).
+ */
+ public GridRouterResponse() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
* @param body Message in raw form.
* @param clientId Client id.
* @param reqId Request id.
@@ -73,6 +81,16 @@ public class GridRouterResponse extends GridClientAbstractMessage {
}
/** {@inheritDoc} */
+ @Override public void writeExternal(ObjectOutput out) throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** {@inheritDoc} */
+ @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ throw new UnsupportedOperationException();
+ }
+
+ /** {@inheritDoc} */
@Override public String toString() {
return "GridRouterResponse [" +
"clientId=" + clientId() +
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/40f826bf/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
----------------------------------------------------------------------
diff --git a/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java b/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
index feb2d9d..20dcc7f 100644
--- a/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
+++ b/modules/tools/src/main/java/org/apache/ignite/tools/classgen/ClassesGenerator.java
@@ -215,6 +215,18 @@ public class ClassesGenerator {
catch (NoSuchFieldException ignored) {
errs.add("No serialVersionUID field in class: " + cls.getName());
}
+
+ if (Externalizable.class.isAssignableFrom(cls)) {
+ try {
+ Constructor<?> cons = cls.getConstructor();
+
+ if (!Modifier.isPublic(cons.getModifiers()))
+ errs.add("Default constructor in Externalizable class is not public: " + cls.getName());
+ }
+ catch (NoSuchMethodException e) {
+ errs.add("No default constructor in Externalizable class: " + cls.getName());
+ }
+ }
}
classes.add((Class)cls);
[25/50] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-1009-v4' into ignite-sprint-6
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1009-v4' into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d28fea0b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d28fea0b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d28fea0b
Branch: refs/heads/ignite-950
Commit: d28fea0b9f30bf09c37b09218fa41fe819b85c13
Parents: 5d8a5e6 7c51a14
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 16 09:56:47 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 16 09:56:47 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 11 +-
.../transactions/IgniteTxLocalAdapter.java | 6 +-
.../cache/CacheClientStoreSelfTest.java | 228 +++++++++++++
...acheReadOnlyTransactionalClientSelfTest.java | 327 -------------------
...CacheClientWriteBehindStoreAbstractTest.java | 104 ++++++
...teCacheClientWriteBehindStoreAtomicTest.java | 38 +++
.../IgnteCacheClientWriteBehindStoreTxTest.java | 32 ++
.../testsuites/IgniteCacheTestSuite4.java | 2 +-
.../IgniteCacheWriteBehindTestSuite.java | 2 +
9 files changed, 411 insertions(+), 339 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d28fea0b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index fed5efe,83a30bd..d155330
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@@ -134,8 -134,10 +134,8 @@@ public class IgniteCacheTestSuite4 exte
suite.addTestSuite(CacheJdbcStoreSessionListenerSelfTest.class);
- suite.addTestSuite(CacheReadOnlyTransactionalClientSelfTest.class);
+ suite.addTestSuite(CacheClientStoreSelfTest.class);
- suite.addTestSuite(IgniteCacheManyClientsTest.class);
-
suite.addTestSuite(IgniteStartCacheInTransactionSelfTest.class);
suite.addTestSuite(IgniteStartCacheInTransactionAtomicSelfTest.class);
[40/50] incubator-ignite git commit: Merge branches 'ignite-960' and
'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite
into ignite-960
Posted by sb...@apache.org.
Merge branches 'ignite-960' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-960
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ca89d81c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ca89d81c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ca89d81c
Branch: refs/heads/ignite-950
Commit: ca89d81c3e271ea2f905698540b67df8a2cab079
Parents: a7ca45b ae188c7
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Tue Jun 16 17:37:34 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Tue Jun 16 17:37:34 2015 +0300
----------------------------------------------------------------------
.../internal/interop/InteropBootstrap.java | 3 +-
.../internal/interop/InteropIgnition.java | 5 +-
.../processors/query/GridQueryProcessor.java | 102 ++++++---
.../ignite/spi/discovery/tcp/ClientImpl.java | 87 +++++---
.../apache/ignite/internal/GridSelfTest.java | 12 +-
.../GridDiscoveryManagerAliveCacheSelfTest.java | 17 +-
.../GridCacheAbstractFailoverSelfTest.java | 2 +
...ridCacheMultinodeUpdateAbstractSelfTest.java | 9 +
.../cache/GridCacheVersionMultinodeTest.java | 8 +-
...CacheP2pUnmarshallingRebalanceErrorTest.java | 15 +-
.../IgniteCacheClientNodeConcurrentStart.java | 14 +-
.../distributed/IgniteCacheManyClientsTest.java | 69 +++++--
.../GridCachePartitionedTxSalvageSelfTest.java | 37 +---
.../junits/common/GridCommonAbstractTest.java | 11 +-
.../IgniteCacheFailoverTestSuite.java | 8 -
.../IgniteCacheFailoverTestSuite2.java | 47 +++++
.../CacheAbstractQueryMetricsSelfTest.java | 205 ++++++++++++++++++
.../CachePartitionedQueryMetricsSelfTest.java | 32 +++
.../CacheReplicatedQueryMetricsSelfTest.java | 32 +++
.../cache/GridCacheQueryMetricsSelfTest.java | 206 -------------------
.../query/h2/sql/BaseH2CompareQueryTest.java | 2 +-
.../IgniteCacheQuerySelfTestSuite.java | 4 +-
22 files changed, 581 insertions(+), 346 deletions(-)
----------------------------------------------------------------------
[48/50] incubator-ignite git commit: #IGNITE-960 Added
serialVersionUID.
Posted by sb...@apache.org.
#IGNITE-960 Added serialVersionUID.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/37d4710c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/37d4710c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/37d4710c
Branch: refs/heads/ignite-950
Commit: 37d4710c1bbe19396ba6537d8ef41d4b095c2ae7
Parents: ec0ee2e
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 19:07:02 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 19:07:02 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java | 3 +++
.../apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java | 3 +++
.../cache/store/hibernate/CacheHibernateBlobStoreFactory.java | 3 +++
3 files changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37d4710c/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
index c145641..297f32e 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
@@ -60,6 +60,9 @@ import javax.sql.*;
* For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
*/
public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobStore<K, V>> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
/** Connection URL. */
private String connUrl = CacheJdbcBlobStore.DFLT_CONN_URL;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37d4710c/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
index cade2aa..ac1f4f1 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreFactory.java
@@ -59,6 +59,9 @@ import javax.sql.*;
* For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
*/
public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheJdbcPojoStore<K, V>> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
/** Name of data source bean. */
private String dataSrcBean;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/37d4710c/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
----------------------------------------------------------------------
diff --git a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
index 5154faa..60eacb9 100644
--- a/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
+++ b/modules/hibernate/src/main/java/org/apache/ignite/cache/store/hibernate/CacheHibernateBlobStoreFactory.java
@@ -121,6 +121,9 @@ import java.util.*;
* For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
*/
public class CacheHibernateBlobStoreFactory<K, V> implements Factory<CacheHibernateBlobStore<K, V>> {
+ /** */
+ private static final long serialVersionUID = 0L;
+
/** Session factory. */
@GridToStringExclude
private transient SessionFactory sesFactory;
[02/50] incubator-ignite git commit: ignite-1009-v4 decided to
completely remove check for store on clients
Posted by sb...@apache.org.
ignite-1009-v4 decided to completely remove check for store on clients
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/7f97ec75
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/7f97ec75
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/7f97ec75
Branch: refs/heads/ignite-950
Commit: 7f97ec757c9948628678f311ece52978fd53eb5a
Parents: b087aca
Author: sboikov <sb...@gridgain.com>
Authored: Fri Jun 12 14:12:28 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Jun 12 16:15:51 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 11 +-
.../dht/GridDhtTransactionalCacheAdapter.java | 2 +-
.../cache/transactions/IgniteTxHandler.java | 2 +-
.../transactions/IgniteTxLocalAdapter.java | 6 +-
.../cache/CacheClientStoreSelfTest.java | 228 +++++++++++++
...acheReadOnlyTransactionalClientSelfTest.java | 327 -------------------
...CacheClientWriteBehindStoreAbstractTest.java | 104 ++++++
...teCacheClientWriteBehindStoreAtomicTest.java | 38 +++
.../IgnteCacheClientWriteBehindStoreTxTest.java | 32 ++
.../testsuites/IgniteCacheTestSuite4.java | 2 +-
.../IgniteCacheWriteBehindTestSuite.java | 2 +
11 files changed, 413 insertions(+), 341 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f97ec75/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 4fdec33..4428b0f 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
@@ -2278,16 +2278,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "cachePreloadMode",
"Cache preload mode", locAttr.cacheRebalanceMode(), rmtAttr.cacheRebalanceMode(), true);
- boolean checkStore;
-
- if (!isLocAff && isRmtAff && locCfg.getAtomicityMode() == TRANSACTIONAL) {
- checkStore = locAttr.storeFactoryClassName() != null;
-
- if (locAttr.storeFactoryClassName() == null && rmtAttr.storeFactoryClassName() != null)
- desc.updatesAllowed(false);
- }
- else
- checkStore = isLocAff && isRmtAff;
+ boolean checkStore = isLocAff && isRmtAff;
if (checkStore)
CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "storeFactory", "Store factory",
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f97ec75/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 703daf9..4f081bf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -859,7 +859,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends GridDhtCach
req.isolation(),
req.timeout(),
req.isInvalidate(),
- false,
+ true,
req.txSize(),
null,
req.subjectId(),
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f97ec75/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index e6d71aa..e16f7bf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -325,7 +325,7 @@ public class IgniteTxHandler {
req.isolation(),
req.timeout(),
req.isInvalidate(),
- false,
+ true,
req.txSize(),
req.transactionNodes(),
req.subjectId(),
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f97ec75/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 8b5eaec..bc6308b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -503,7 +503,11 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
boolean skipNear = near() && isWriteToStoreFromDht;
for (IgniteTxEntry e : writeEntries) {
- if ((skipNear && e.cached().isNear()) || e.skipStore())
+ boolean skip = (skipNear && e.cached().isNear()) ||
+ e.skipStore() ||
+ (e.context().store().isLocal() && !e.context().affinityNode());
+
+ if (skip)
continue;
boolean intercept = e.context().config().getInterceptor() != null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f97ec75/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheClientStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheClientStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheClientStoreSelfTest.java
new file mode 100644
index 0000000..44b27be
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheClientStoreSelfTest.java
@@ -0,0 +1,228 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.store.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import javax.cache.configuration.*;
+import javax.cache.processor.*;
+
+import static org.apache.ignite.IgniteSystemProperties.*;
+
+/**
+ * Tests for cache client without store.
+ */
+public class CacheClientStoreSelfTest extends GridCommonAbstractTest {
+ /** */
+ private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+ /** */
+ private static final String CACHE_NAME = "test-cache";
+
+ /** */
+ private boolean client;
+
+ /** */
+ private boolean nearEnabled;
+
+ /** */
+ private Factory<CacheStore> factory;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ cfg.setClientMode(client);
+
+ CacheConfiguration cc = new CacheConfiguration();
+
+ cc.setName(CACHE_NAME);
+ cc.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
+ cc.setCacheStoreFactory(factory);
+
+ if (client && nearEnabled)
+ cc.setNearConfiguration(new NearCacheConfiguration());
+
+ cfg.setCacheConfiguration(cc);
+
+ TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+ disco.setIpFinder(IP_FINDER);
+
+ cfg.setDiscoverySpi(disco);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ client = false;
+ factory = new Factory1();
+
+ startGrids(2);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ stopAllGrids();
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ stopGrid();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testCorrectStore() throws Exception {
+ client = true;
+ nearEnabled = false;
+ factory = new Factory1();
+
+ Ignite ignite = startGrid();
+
+ IgniteCache cache = ignite.cache(CACHE_NAME);
+
+ cache.get(0);
+ cache.getAll(F.asSet(0, 1));
+ cache.getAndPut(0, 0);
+ cache.getAndPutIfAbsent(0, 0);
+ cache.getAndRemove(0);
+ cache.getAndReplace(0, 0);
+ cache.put(0, 0);
+ cache.putAll(F.asMap(0, 0, 1, 1));
+ cache.putIfAbsent(0, 0);
+ cache.remove(0);
+ cache.remove(0, 0);
+ cache.removeAll(F.asSet(0, 1));
+ cache.removeAll();
+ cache.invoke(0, new EP());
+ cache.invokeAll(F.asSet(0, 1), new EP());
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testInvalidStore() throws Exception {
+ client = true;
+ nearEnabled = false;
+ factory = new Factory2();
+
+ startGrid();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testDisabledConsistencyCheck() throws Exception {
+ client = false;
+ nearEnabled = false;
+ factory = new Factory2();
+
+ System.setProperty(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK, "true");
+
+ startGrid("client-1");
+
+ factory = new Factory1();
+
+ System.clearProperty(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK);
+
+ startGrid("client-2");
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testNoStoreNearDisabled() throws Exception {
+ nearEnabled = false;
+
+ doTestNoStore();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testNoStoreNearEnabled() throws Exception {
+ nearEnabled = true;
+
+ doTestNoStore();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ private void doTestNoStore() throws Exception {
+ client = true;
+ factory = null;
+
+ Ignite ignite = startGrid();
+
+ IgniteCache cache = ignite.cache(CACHE_NAME);
+
+ cache.get(0);
+ cache.getAll(F.asSet(0, 1));
+ cache.getAndPut(0, 0);
+ cache.getAndPutIfAbsent(0, 0);
+ cache.getAndRemove(0);
+ cache.getAndReplace(0, 0);
+ cache.put(0, 0);
+ cache.putAll(F.asMap(0, 0, 1, 1));
+ cache.putIfAbsent(0, 0);
+ cache.remove(0);
+ cache.remove(0, 0);
+ cache.removeAll(F.asSet(0, 1));
+ cache.removeAll();
+ cache.invoke(0, new EP());
+ cache.invokeAll(F.asSet(0, 1), new EP());
+ }
+
+ /**
+ */
+ private static class Factory1 implements Factory<CacheStore> {
+ /** {@inheritDoc} */
+ @Override public CacheStore create() {
+ return null;
+ }
+ }
+
+ /**
+ */
+ private static class Factory2 implements Factory<CacheStore> {
+ /** {@inheritDoc} */
+ @Override public CacheStore create() {
+ return null;
+ }
+ }
+
+ /**
+ */
+ private static class EP implements CacheEntryProcessor {
+ @Override public Object process(MutableEntry entry, Object... arguments) {
+ return null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f97ec75/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheReadOnlyTransactionalClientSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheReadOnlyTransactionalClientSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheReadOnlyTransactionalClientSelfTest.java
deleted file mode 100644
index f2c38e1..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheReadOnlyTransactionalClientSelfTest.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.store.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import javax.cache.*;
-import javax.cache.configuration.*;
-import javax.cache.processor.*;
-
-import static org.apache.ignite.IgniteSystemProperties.*;
-
-/**
- * Tests for read-only transactional cache client.
- */
-public class CacheReadOnlyTransactionalClientSelfTest extends GridCommonAbstractTest {
- /** */
- private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
- /** */
- private static final String CACHE_NAME = "test-cache";
-
- /** */
- private boolean client;
-
- /** */
- private boolean nearEnabled;
-
- /** */
- private Factory<CacheStore> factory;
-
- /** {@inheritDoc} */
- @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
- IgniteConfiguration cfg = super.getConfiguration(gridName);
-
- cfg.setClientMode(client);
-
- CacheConfiguration cc = new CacheConfiguration();
-
- cc.setName(CACHE_NAME);
- cc.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
- cc.setCacheStoreFactory(factory);
-
- if (client && nearEnabled)
- cc.setNearConfiguration(new NearCacheConfiguration());
-
- cfg.setCacheConfiguration(cc);
-
- TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
- disco.setIpFinder(IP_FINDER);
-
- cfg.setDiscoverySpi(disco);
-
- return cfg;
- }
-
- /** {@inheritDoc} */
- @Override protected void beforeTestsStarted() throws Exception {
- client = false;
- factory = new Factory1();
-
- startGrids(2);
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTestsStopped() throws Exception {
- stopAllGrids();
- }
-
- /** {@inheritDoc} */
- @Override protected void afterTest() throws Exception {
- stopGrid();
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testCorrectStore() throws Exception {
- client = true;
- nearEnabled = false;
- factory = new Factory1();
-
- Ignite ignite = startGrid();
-
- IgniteCache cache = ignite.cache(CACHE_NAME);
-
- cache.get(0);
- cache.getAll(F.asSet(0, 1));
- cache.getAndPut(0, 0);
- cache.getAndPutIfAbsent(0, 0);
- cache.getAndRemove(0);
- cache.getAndReplace(0, 0);
- cache.put(0, 0);
- cache.putAll(F.asMap(0, 0, 1, 1));
- cache.putIfAbsent(0, 0);
- cache.remove(0);
- cache.remove(0, 0);
- cache.removeAll(F.asSet(0, 1));
- cache.removeAll();
- cache.invoke(0, new EP());
- cache.invokeAll(F.asSet(0, 1), new EP());
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testInvalidStore() throws Exception {
- client = true;
- nearEnabled = false;
- factory = new Factory2();
-
- try {
- startGrid();
-
- assert false : "Exception was not thrown.";
- }
- catch (Exception e) {
- assert e.getMessage().startsWith("Store factory mismatch") : e.getMessage();
- }
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testDisabledConsistencyCheck() throws Exception {
- client = false;
- nearEnabled = false;
- factory = new Factory2();
-
- System.setProperty(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK, "true");
-
- startGrid("client-1");
-
- factory = new Factory1();
-
- System.clearProperty(IGNITE_SKIP_CONFIGURATION_CONSISTENCY_CHECK);
-
- startGrid("client-2");
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testNoStoreNearDisabled() throws Exception {
- nearEnabled = false;
-
- doTestNoStore();
- }
-
- /**
- * @throws Exception If failed.
- */
- public void testNoStoreNearEnabled() throws Exception {
- nearEnabled = true;
-
- doTestNoStore();
- }
-
- /**
- * @throws Exception If failed.
- */
- private void doTestNoStore() throws Exception {
- client = true;
- factory = null;
-
- Ignite ignite = startGrid();
-
- IgniteCache cache = ignite.cache(CACHE_NAME);
-
- cache.get(0);
- cache.getAll(F.asSet(0, 1));
-
- try {
- cache.getAndPut(0, 0);
- }
- catch (CacheException e) {
- assert e.getMessage().startsWith("Updates are not allowed for transactional cache: " + CACHE_NAME + ".") :
- e.getMessage();
- }
-
- try {
- cache.getAndPutIfAbsent(0, 0);
- }
- catch (CacheException e) {
- assert e.getMessage().startsWith("Updates are not allowed for transactional cache: " + CACHE_NAME + ".") :
- e.getMessage();
- }
-
- try {
- cache.getAndRemove(0);
- }
- catch (CacheException e) {
- assert e.getMessage().startsWith("Updates are not allowed for transactional cache: " + CACHE_NAME + ".") :
- e.getMessage();
- }
-
- try {
- cache.getAndReplace(0, 0);
- }
- catch (CacheException e) {
- assert e.getMessage().startsWith("Updates are not allowed for transactional cache: " + CACHE_NAME + ".") :
- e.getMessage();
- }
-
- try {
- cache.put(0, 0);
- }
- catch (CacheException e) {
- assert e.getMessage().startsWith("Updates are not allowed for transactional cache: " + CACHE_NAME + ".") :
- e.getMessage();
- }
-
- try {
- cache.putAll(F.asMap(0, 0, 1, 1));
- }
- catch (CacheException e) {
- assert e.getMessage().startsWith("Updates are not allowed for transactional cache: " + CACHE_NAME + ".") :
- e.getMessage();
- }
-
- try {
- cache.putIfAbsent(0, 0);
- }
- catch (CacheException e) {
- assert e.getMessage().startsWith("Updates are not allowed for transactional cache: " + CACHE_NAME + ".") :
- e.getMessage();
- }
-
- try {
- cache.remove(0);
- }
- catch (CacheException e) {
- assert e.getMessage().startsWith("Updates are not allowed for transactional cache: " + CACHE_NAME + ".") :
- e.getMessage();
- }
-
- try {
- cache.remove(0, 0);
- }
- catch (CacheException e) {
- assert e.getMessage().startsWith("Updates are not allowed for transactional cache: " + CACHE_NAME + ".") :
- e.getMessage();
- }
-
- try {
- cache.removeAll(F.asSet(0, 1));
- }
- catch (CacheException e) {
- assert e.getMessage().startsWith("Updates are not allowed for transactional cache: " + CACHE_NAME + ".") :
- e.getMessage();
- }
-
- try {
- cache.removeAll();
- }
- catch (CacheException e) {
- assert e.getMessage().startsWith("Updates are not allowed for transactional cache: " + CACHE_NAME + ".") :
- e.getMessage();
- }
-
- try {
- cache.invoke(0, new EP());
- }
- catch (CacheException e) {
- assert e.getMessage().startsWith("Updates are not allowed for transactional cache: " + CACHE_NAME + ".") :
- e.getMessage();
- }
-
- try {
- cache.invokeAll(F.asSet(0, 1), new EP());
- }
- catch (CacheException e) {
- assert e.getMessage().startsWith("Updates are not allowed for transactional cache: " + CACHE_NAME + ".") :
- e.getMessage();
- }
- }
-
- /**
- */
- private static class Factory1 implements Factory<CacheStore> {
- /** {@inheritDoc} */
- @Override public CacheStore create() {
- return null;
- }
- }
-
- /**
- */
- private static class Factory2 implements Factory<CacheStore> {
- /** {@inheritDoc} */
- @Override public CacheStore create() {
- return null;
- }
- }
-
- /**
- */
- private static class EP implements CacheEntryProcessor {
- @Override public Object process(MutableEntry entry, Object... arguments) {
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f97ec75/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/IgnteCacheClientWriteBehindStoreAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/IgnteCacheClientWriteBehindStoreAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/IgnteCacheClientWriteBehindStoreAbstractTest.java
new file mode 100644
index 0000000..f7c150d
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/IgnteCacheClientWriteBehindStoreAbstractTest.java
@@ -0,0 +1,104 @@
+/*
+ * 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.store;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.store.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.util.lang.*;
+import org.apache.ignite.testframework.*;
+
+import javax.cache.configuration.*;
+
+/**
+ * Tests that write behind store is updated if client does not have store.
+ */
+public abstract class IgnteCacheClientWriteBehindStoreAbstractTest extends IgniteCacheAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected int gridCount() {
+ return 3;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheMode cacheMode() {
+ return CacheMode.PARTITIONED;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected NearCacheConfiguration nearConfiguration() {
+ return null;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
+ CacheConfiguration ccfg = super.cacheConfiguration(gridName);
+
+ ccfg.setWriteBehindEnabled(true);
+ ccfg.setWriteBehindBatchSize(10);
+
+ if (getTestGridName(2).equals(gridName)) {
+ ccfg.setCacheStoreFactory(null);
+ ccfg.setWriteThrough(false);
+ ccfg.setReadThrough(false);
+ ccfg.setWriteBehindEnabled(false);
+ }
+
+ return ccfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+ if (getTestGridName(2).equals(gridName))
+ cfg.setClientMode(true);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected Factory<CacheStore> cacheStoreFactory() {
+ return new TestStoreFactory();
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testClientWithoutStore() throws Exception {
+ Ignite client = grid(2);
+
+ assertTrue(client.configuration().isClientMode());
+
+ IgniteCache<Integer, Integer> cache = client.cache(null);
+
+ assertNull(cache.getConfiguration(CacheConfiguration.class).getCacheStoreFactory());
+
+ for (int i = 0; i < 1000; i++)
+ cache.put(i, i);
+
+ GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ return storeMap.size() == 1000;
+ }
+ }, 5000);
+
+ assertEquals(1000, storeMap.size());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f97ec75/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/IgnteCacheClientWriteBehindStoreAtomicTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/IgnteCacheClientWriteBehindStoreAtomicTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/IgnteCacheClientWriteBehindStoreAtomicTest.java
new file mode 100644
index 0000000..72ed3d6
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/IgnteCacheClientWriteBehindStoreAtomicTest.java
@@ -0,0 +1,38 @@
+/*
+ * 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.store;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*;
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ *
+ */
+public class IgnteCacheClientWriteBehindStoreAtomicTest extends IgnteCacheClientWriteBehindStoreAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return ATOMIC;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicWriteOrderMode atomicWriteOrderMode() {
+ return CLOCK;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f97ec75/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/IgnteCacheClientWriteBehindStoreTxTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/IgnteCacheClientWriteBehindStoreTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/IgnteCacheClientWriteBehindStoreTxTest.java
new file mode 100644
index 0000000..a5ced98
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/store/IgnteCacheClientWriteBehindStoreTxTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.store;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.*;
+
+/**
+ *
+ */
+public class IgnteCacheClientWriteBehindStoreTxTest extends IgnteCacheClientWriteBehindStoreAbstractTest {
+ /** {@inheritDoc} */
+ @Override protected CacheAtomicityMode atomicityMode() {
+ return TRANSACTIONAL;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f97ec75/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
index c598e38..83a30bd 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite4.java
@@ -134,7 +134,7 @@ public class IgniteCacheTestSuite4 extends TestSuite {
suite.addTestSuite(CacheJdbcStoreSessionListenerSelfTest.class);
- suite.addTestSuite(CacheReadOnlyTransactionalClientSelfTest.class);
+ suite.addTestSuite(CacheClientStoreSelfTest.class);
suite.addTestSuite(IgniteCacheManyClientsTest.class);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7f97ec75/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheWriteBehindTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheWriteBehindTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheWriteBehindTestSuite.java
index 529b227..5abc8b2 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheWriteBehindTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheWriteBehindTestSuite.java
@@ -40,6 +40,8 @@ public class IgniteCacheWriteBehindTestSuite extends TestSuite {
suite.addTest(new TestSuite(GridCacheWriteBehindStorePartitionedTest.class));
suite.addTest(new TestSuite(GridCacheWriteBehindStorePartitionedMultiNodeSelfTest.class));
suite.addTest(new TestSuite(GridCachePartitionedWritesTest.class));
+ suite.addTest(new TestSuite(IgnteCacheClientWriteBehindStoreAtomicTest.class));
+ suite.addTest(new TestSuite(IgnteCacheClientWriteBehindStoreTxTest.class));
return suite;
}
[49/50] incubator-ignite git commit: Merge branch 'ignite-960' into
ignite-sprint-6
Posted by sb...@apache.org.
Merge branch 'ignite-960' into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d1a21501
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d1a21501
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d1a21501
Branch: refs/heads/ignite-950
Commit: d1a21501bea846bd5778b72c30ec84ec83644844
Parents: 53f4cb7 37d4710
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Tue Jun 16 19:16:58 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Tue Jun 16 19:16:58 2015 +0300
----------------------------------------------------------------------
.../cache/store/jdbc/CacheJdbcBlobStore.java | 22 +-
.../store/jdbc/CacheJdbcBlobStoreFactory.java | 290 +++++++++++++++++++
.../cache/store/jdbc/CacheJdbcPojoStore.java | 6 +-
.../store/jdbc/CacheJdbcPojoStoreFactory.java | 148 ++++++++++
.../configuration/CacheConfiguration.java | 3 +-
.../processors/cache/GridCacheProcessor.java | 23 +-
.../util/spring/IgniteSpringHelper.java | 10 +
.../SpringApplicationContextResource.java | 4 +-
.../apache/ignite/resources/SpringResource.java | 6 +-
modules/hibernate/pom.xml | 14 +
.../hibernate/CacheHibernateBlobStore.java | 87 +-----
.../CacheHibernateBlobStoreFactory.java | 235 +++++++++++++++
.../hibernate/src/test/config/factory-cache.xml | 59 ++++
.../src/test/config/factory-cache1.xml | 61 ++++
.../config/factory-incorrect-store-cache.xml | 56 ++++
.../CacheHibernateStoreFactorySelfTest.java | 273 +++++++++++++++++
.../testsuites/IgniteHibernateTestSuite.java | 2 +
modules/spring/pom.xml | 7 +
.../GridResourceSpringBeanInjector.java | 2 +-
.../util/spring/IgniteSpringHelperImpl.java | 17 ++
.../src/test/config/incorrect-store-cache.xml | 57 ++++
modules/spring/src/test/config/node.xml | 43 +++
modules/spring/src/test/config/node1.xml | 45 +++
.../test/config/pojo-incorrect-store-cache.xml | 56 ++++
modules/spring/src/test/config/store-cache.xml | 59 ++++
modules/spring/src/test/config/store-cache1.xml | 62 ++++
.../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 172 +++++++++++
.../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 193 ++++++++++++
.../testsuites/IgniteSpringTestSuite.java | 5 +
29 files changed, 1901 insertions(+), 116 deletions(-)
----------------------------------------------------------------------
[04/50] incubator-ignite git commit: Merge branch 'ignite-sprint-6'
of https://git-wip-us.apache.org/repos/asf/incubator-ignite into
ignite-sprint-6
Posted by sb...@apache.org.
Merge branch 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/2b7a18d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/2b7a18d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/2b7a18d9
Branch: refs/heads/ignite-950
Commit: 2b7a18d9a0bd1c98f9a780e0f8f29c34af95e5e3
Parents: 96d12d0 c233aa2
Author: agura <ag...@gridgain.com>
Authored: Fri Jun 12 16:39:07 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri Jun 12 16:39:07 2015 +0300
----------------------------------------------------------------------
.../distributed/GridCacheTxRecoveryRequest.java | 26 +++----
.../GridCacheTxRecoveryResponse.java | 14 ++--
.../distributed/GridDistributedBaseMessage.java | 77 +-------------------
.../distributed/GridDistributedLockRequest.java | 54 +++++++-------
.../GridDistributedLockResponse.java | 14 ++--
.../GridDistributedTxFinishRequest.java | 46 ++++++------
.../GridDistributedTxPrepareRequest.java | 62 ++++++++--------
.../GridDistributedTxPrepareResponse.java | 64 +---------------
.../GridDistributedUnlockRequest.java | 6 +-
.../distributed/dht/GridDhtLockRequest.java | 72 ++++++++++++++----
.../distributed/dht/GridDhtLockResponse.java | 18 ++---
.../distributed/dht/GridDhtTxFinishRequest.java | 38 +++++-----
.../dht/GridDhtTxPrepareRequest.java | 54 +++++++-------
.../dht/GridDhtTxPrepareResponse.java | 22 +++---
.../distributed/dht/GridDhtUnlockRequest.java | 6 +-
.../distributed/near/GridNearLockRequest.java | 58 +++++++--------
.../distributed/near/GridNearLockResponse.java | 26 +++----
.../near/GridNearTxFinishRequest.java | 26 +++----
.../near/GridNearTxPrepareRequest.java | 50 ++++++-------
.../near/GridNearTxPrepareResponse.java | 46 ++++++------
.../distributed/near/GridNearUnlockRequest.java | 2 +-
.../cache/transactions/IgniteTxHandler.java | 3 -
.../messages/GridQueryNextPageResponse.java | 1 +
.../DataStreamProcessorSelfTest.java | 3 +-
.../testsuites/IgniteKernalSelfTestSuite.java | 2 +-
25 files changed, 351 insertions(+), 439 deletions(-)
----------------------------------------------------------------------
[30/50] incubator-ignite git commit: # ignite-883 client reconnect
issues
Posted by sb...@apache.org.
# ignite-883 client reconnect issues
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/54bfa36c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/54bfa36c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/54bfa36c
Branch: refs/heads/ignite-950
Commit: 54bfa36c7417109832effe9c59c0120d9249b1b9
Parents: f4b1123
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 16 12:14:20 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 16 14:03:03 2015 +0300
----------------------------------------------------------------------
.../ignite/spi/discovery/tcp/ClientImpl.java | 87 ++++++++++++++------
.../distributed/IgniteCacheManyClientsTest.java | 66 +++++++++++----
2 files changed, 116 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/54bfa36c/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 a17296c..fef6f4f 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
@@ -545,14 +545,31 @@ class ClientImpl extends TcpDiscoveryImpl {
* @param msg Discovery message.
* @return Latest topology snapshot.
*/
- private NavigableSet<ClusterNode> updateTopologyHistory(long topVer, @Nullable TcpDiscoveryAbstractMessage msg) {
+ private Collection<ClusterNode> updateTopologyHistory(long topVer, @Nullable TcpDiscoveryAbstractMessage msg) {
this.topVer = topVer;
+ if (!topHist.isEmpty() && topVer <= topHist.lastKey()) {
+ if (log.isDebugEnabled())
+ log.debug("Skip topology update since topology already updated [msg=" + msg +
+ ", lastHistKey=" + topHist.lastKey() +
+ ", topVer=" + topVer +
+ ", locNode=" + locNode + ']');
+
+ Collection<ClusterNode> top = topHist.get(topVer);
+
+ assert top != null : msg;
+
+ return top;
+ }
+
NavigableSet<ClusterNode> allNodes = allVisibleNodes();
if (!topHist.containsKey(topVer)) {
assert topHist.isEmpty() || topHist.lastKey() == topVer - 1 :
- "lastVer=" + topHist.lastKey() + ", newVer=" + topVer + ", locNode=" + locNode + ", msg=" + msg;
+ "lastVer=" + (topHist.isEmpty() ? null : topHist.lastKey()) +
+ ", newVer=" + topVer +
+ ", locNode=" + locNode +
+ ", msg=" + msg;
topHist.put(topVer, allNodes);
@@ -886,7 +903,7 @@ class ClientImpl extends TcpDiscoveryImpl {
* @param join {@code True} if reconnects during join.
*/
protected Reconnector(boolean join) {
- super(spi.ignite().name(), "tcp-client-disco-msg-worker", log);
+ super(spi.ignite().name(), "tcp-client-disco-reconnector", log);
this.join = join;
}
@@ -944,7 +961,8 @@ class ClientImpl extends TcpDiscoveryImpl {
sock.setKeepAlive(true);
sock.setTcpNoDelay(true);
- // Wait for
+ List<TcpDiscoveryAbstractMessage> msgs = null;
+
while (!isInterrupted()) {
TcpDiscoveryAbstractMessage msg = spi.marsh.unmarshal(in, U.gridClassLoader());
@@ -955,12 +973,23 @@ class ClientImpl extends TcpDiscoveryImpl {
if (res.success()) {
msgWorker.addMessage(res);
+ if (msgs != null) {
+ for (TcpDiscoveryAbstractMessage msg0 : msgs)
+ msgWorker.addMessage(msg0);
+ }
+
success = true;
}
return;
}
}
+ else if (spi.ensured(msg)) {
+ if (msgs == null)
+ msgs = new ArrayList<>();
+
+ msgs.add(msg);
+ }
}
}
catch (IOException | IgniteCheckedException e) {
@@ -1286,23 +1315,32 @@ class ClientImpl extends TcpDiscoveryImpl {
return;
}
- if (!topHist.isEmpty() && msg.topologyVersion() <= topHist.lastKey()) {
- if (log.isDebugEnabled())
- log.debug("Discarding node add finished message since topology already updated " +
- "[msg=" + msg + ", lastHistKey=" + topHist.lastKey() + ", node=" + node + ']');
-
- return;
- }
+ boolean evt = false;
long topVer = msg.topologyVersion();
- node.order(topVer);
- node.visible(true);
+ assert topVer > 0 : msg;
+
+ if (!node.visible()) {
+ node.order(topVer);
+ node.visible(true);
+
+ if (spi.locNodeVer.equals(node.version()))
+ node.version(spi.locNodeVer);
+
+ evt = true;
+ }
+ else {
+ if (log.isDebugEnabled())
+ log.debug("Skip node join event, node already joined [msg=" + msg + ", node=" + node + ']');
+
+ assert node.order() == topVer : node;
+ }
- if (spi.locNodeVer.equals(node.version()))
- node.version(spi.locNodeVer);
+ Collection<ClusterNode> top = updateTopologyHistory(topVer, msg);
- NavigableSet<ClusterNode> top = updateTopologyHistory(topVer, msg);
+ assert top != null && top.contains(node) : "Topology does not contain node [msg=" + msg +
+ ", node=" + node + ", top=" + top + ']';
if (!pending && joinLatch.getCount() > 0) {
if (log.isDebugEnabled())
@@ -1311,9 +1349,11 @@ class ClientImpl extends TcpDiscoveryImpl {
return;
}
- notifyDiscovery(EVT_NODE_JOINED, topVer, node, top);
+ if (evt) {
+ notifyDiscovery(EVT_NODE_JOINED, topVer, node, top);
- spi.stats.onNodeJoined();
+ spi.stats.onNodeJoined();
+ }
}
}
@@ -1340,7 +1380,7 @@ class ClientImpl extends TcpDiscoveryImpl {
return;
}
- NavigableSet<ClusterNode> top = updateTopologyHistory(msg.topologyVersion(), msg);
+ Collection<ClusterNode> top = updateTopologyHistory(msg.topologyVersion(), msg);
if (!pending && joinLatch.getCount() > 0) {
if (log.isDebugEnabled())
@@ -1383,7 +1423,7 @@ class ClientImpl extends TcpDiscoveryImpl {
return;
}
- NavigableSet<ClusterNode> top = updateTopologyHistory(msg.topologyVersion(), msg);
+ Collection<ClusterNode> top = updateTopologyHistory(msg.topologyVersion(), msg);
if (!pending && joinLatch.getCount() > 0) {
if (log.isDebugEnabled())
@@ -1555,7 +1595,7 @@ class ClientImpl extends TcpDiscoveryImpl {
* @param node Node.
* @param top Topology snapshot.
*/
- private void notifyDiscovery(int type, long topVer, ClusterNode node, NavigableSet<ClusterNode> top) {
+ private void notifyDiscovery(int type, long topVer, ClusterNode node, Collection<ClusterNode> top) {
notifyDiscovery(type, topVer, node, top, null);
}
@@ -1564,8 +1604,9 @@ class ClientImpl extends TcpDiscoveryImpl {
* @param topVer Topology version.
* @param node Node.
* @param top Topology snapshot.
+ * @param data Optional custom message data.
*/
- private void notifyDiscovery(int type, long topVer, ClusterNode node, NavigableSet<ClusterNode> top,
+ private void notifyDiscovery(int type, long topVer, ClusterNode node, Collection<ClusterNode> top,
@Nullable DiscoverySpiCustomMessage data) {
DiscoverySpiListener lsnr = spi.lsnr;
@@ -1589,7 +1630,7 @@ class ClientImpl extends TcpDiscoveryImpl {
}
/**
- *
+ * @return Queue size.
*/
public int queueSize() {
return queue.size();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/54bfa36c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
index 62c7c1a..947ded2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
@@ -17,9 +17,11 @@
package org.apache.ignite.internal.processors.cache.distributed;
+import junit.framework.*;
import org.apache.ignite.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.lang.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.spi.communication.tcp.*;
import org.apache.ignite.spi.discovery.tcp.*;
@@ -102,16 +104,14 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
/**
* @throws Exception If failed.
*/
- public void testManyClients() throws Exception {
+ public void testManyClients() throws Throwable {
manyClientsPutGet();
}
/**
* @throws Exception If failed.
*/
- public void testManyClientsClientDiscovery() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-883");
-
+ public void testManyClientsClientDiscovery() throws Throwable {
clientDiscovery = true;
manyClientsPutGet();
@@ -121,8 +121,6 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testManyClientsSequentiallyClientDiscovery() throws Exception {
- fail("https://issues.apache.org/jira/browse/IGNITE-883");
-
clientDiscovery = true;
manyClientsSequentially();
@@ -162,33 +160,48 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
log.info("All clients started.");
- assertEquals(SRVS + CLIENTS, G.allGrids().size());
+ checkNodes(SRVS + CLIENTS);
+
+ for (Ignite client : clients)
+ client.close();
+ }
+
+ /**
+ * @param expCnt Expected number of nodes.
+ */
+ private void checkNodes(int expCnt) {
+ assertEquals(expCnt, G.allGrids().size());
long topVer = -1L;
for (Ignite ignite : G.allGrids()) {
- assertEquals(SRVS + CLIENTS, ignite.cluster().nodes().size());
+ log.info("Check node: " + ignite.name());
if (topVer == -1L)
topVer = ignite.cluster().topologyVersion();
else
- assertEquals(topVer, ignite.cluster().topologyVersion());
- }
+ assertEquals("Unexpected topology version for node: " + ignite.name(),
+ topVer,
+ ignite.cluster().topologyVersion());
- for (Ignite client : clients)
- client.close();
+ assertEquals("Unexpected number of nodes for node: " + ignite.name(),
+ expCnt,
+ ignite.cluster().nodes().size());
+ }
}
/**
* @throws Exception If failed.
*/
- private void manyClientsPutGet() throws Exception {
+ private void manyClientsPutGet() throws Throwable {
client = true;
final AtomicInteger idx = new AtomicInteger(SRVS);
final AtomicBoolean stop = new AtomicBoolean();
+ final AtomicReference<Throwable> err = new AtomicReference<>();
+
final int THREADS = 50;
final CountDownLatch latch = new CountDownLatch(THREADS);
@@ -224,7 +237,7 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
counted = true;
- while (!stop.get()) {
+ while (!stop.get() && err.get() == null) {
key = rnd.nextInt(0, 1000);
cache.put(key, iter++);
@@ -240,6 +253,8 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
return null;
}
catch (Throwable e) {
+ err.compareAndSet(null, e);
+
log.error("Unexpected error in client thread: " + e, e);
throw e;
@@ -257,6 +272,29 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
Thread.sleep(10_000);
+ Throwable err0 = err.get();
+
+ if (err0 != null)
+ throw err0;
+
+ boolean wait = GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ try {
+ checkNodes(SRVS + THREADS);
+
+ return true;
+ }
+ catch (AssertionFailedError e) {
+ log.info("Check failed, will retry: " + e);
+ }
+
+ return false;
+ }
+ }, 10_000);
+
+ if (!wait)
+ checkNodes(SRVS + THREADS);
+
log.info("Stop clients.");
stop.set(true);
[26/50] incubator-ignite git commit: # ignite-sprint-6 disabled
failing tests
Posted by sb...@apache.org.
# ignite-sprint-6 disabled failing tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f4b11234
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f4b11234
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f4b11234
Branch: refs/heads/ignite-950
Commit: f4b112347c37ed2cb899e00e6d76acbbc664e54a
Parents: d28fea0
Author: sboikov <sb...@gridgain.com>
Authored: Tue Jun 16 10:36:49 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Jun 16 10:36:49 2015 +0300
----------------------------------------------------------------------
.../processors/cache/distributed/IgniteCacheManyClientsTest.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f4b11234/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
index 4fb4387..62c7c1a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheManyClientsTest.java
@@ -110,6 +110,8 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testManyClientsClientDiscovery() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-883");
+
clientDiscovery = true;
manyClientsPutGet();
@@ -119,6 +121,8 @@ public class IgniteCacheManyClientsTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testManyClientsSequentiallyClientDiscovery() throws Exception {
+ fail("https://issues.apache.org/jira/browse/IGNITE-883");
+
clientDiscovery = true;
manyClientsSequentially();
[16/50] incubator-ignite git commit: ignite-1007 Race in data
structures processor
Posted by sb...@apache.org.
ignite-1007 Race in data structures processor
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/811872ce
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/811872ce
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/811872ce
Branch: refs/heads/ignite-950
Commit: 811872ce692666fe8c77235f175b7ec15f717d30
Parents: 5160088
Author: agura <ag...@gridgain.com>
Authored: Fri Jun 12 18:36:58 2015 +0300
Committer: agura <ag...@gridgain.com>
Committed: Fri Jun 12 18:36:58 2015 +0300
----------------------------------------------------------------------
.../datastructures/DataStructuresProcessor.java | 67 +++++++++++++++++++-
1 file changed, 64 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/811872ce/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 aa3bfe2..473a2ac 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
@@ -67,6 +67,12 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
/** */
private static final long RETRY_DELAY = 1;
+ /** Initialization latch. */
+ private final CountDownLatch initLatch = new CountDownLatch(1);
+
+ /** Initialization failed flag. */
+ private boolean initFailed;
+
/** Cache contains only {@code GridCacheInternal,GridCacheInternal}. */
private IgniteInternalCache<GridCacheInternal, GridCacheInternal> dsView;
@@ -145,6 +151,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
dsCacheCtx = atomicsCache.context();
}
+
+ initLatch.countDown();
}
/**
@@ -167,6 +175,12 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
@Override public void onKernalStop(boolean cancel) {
super.onKernalStop(cancel);
+ if (initLatch.getCount() > 0) {
+ initFailed = true;
+
+ initLatch.countDown();
+ }
+
if (qryId != null)
dsCacheCtx.continuousQueries().cancelInternalQuery(qryId);
}
@@ -187,6 +201,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
{
A.notNull(name, "name");
+ awaitInitialization();
+
checkAtomicsConfiguration();
startQuery();
@@ -277,6 +293,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
public final void removeSequence(final String name) throws IgniteCheckedException {
assert name != null;
+ awaitInitialization();
+
checkAtomicsConfiguration();
removeDataStructure(new IgniteCallable<Void>() {
@@ -315,6 +333,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
final boolean create) throws IgniteCheckedException {
A.notNull(name, "name");
+ awaitInitialization();
+
checkAtomicsConfiguration();
startQuery();
@@ -431,6 +451,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
assert name != null;
assert dsCacheCtx != null;
+ awaitInitialization();
+
removeDataStructure(new IgniteCallable<Void>() {
@Override public Void call() throws Exception {
dsCacheCtx.gate().enter();
@@ -520,6 +542,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
{
A.notNull(name, "name");
+ awaitInitialization();
+
checkAtomicsConfiguration();
startQuery();
@@ -585,6 +609,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
assert name != null;
assert dsCacheCtx != null;
+ awaitInitialization();
+
removeDataStructure(new IgniteCallable<Void>() {
@Override public Void call() throws Exception {
dsCacheCtx.gate().enter();
@@ -623,6 +649,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
final S initStamp, final boolean create) throws IgniteCheckedException {
A.notNull(name, "name");
+ awaitInitialization();
+
checkAtomicsConfiguration();
startQuery();
@@ -688,6 +716,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
assert name != null;
assert dsCacheCtx != null;
+ awaitInitialization();
+
removeDataStructure(new IgniteCallable<Void>() {
@Override public Void call() throws Exception {
dsCacheCtx.gate().enter();
@@ -725,6 +755,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
throws IgniteCheckedException {
A.notNull(name, "name");
+ awaitInitialization();
+
String cacheName = null;
if (cfg != null) {
@@ -801,6 +833,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
assert name != null;
assert cctx != null;
+ awaitInitialization();
+
IgniteCallable<GridCacheQueueHeader> rmv = new IgniteCallable<GridCacheQueueHeader>() {
@Override public GridCacheQueueHeader call() throws Exception {
return (GridCacheQueueHeader)retryRemove(cctx.cache(), new GridCacheQueueHeaderKey(name));
@@ -837,6 +871,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
boolean create)
throws IgniteCheckedException
{
+ awaitInitialization();
+
Map<String, DataStructureInfo> dsMap = utilityCache.get(DATA_STRUCTURES_KEY);
if (!create && (dsMap == null || !dsMap.containsKey(dsInfo.name)))
@@ -887,6 +923,24 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
}
/**
+ * Awaits for processor initialization.
+ */
+ private void awaitInitialization() {
+ if (initLatch.getCount() > 0) {
+ try {
+ U.await(initLatch);
+
+ if (initFailed)
+ throw new IllegalStateException("Failed to initialize data structures processor.");
+ }
+ catch (IgniteInterruptedCheckedException e) {
+ throw new IllegalStateException("Failed to initialize data structures processor " +
+ "(thread has been interrupted).", e);
+ }
+ }
+ }
+
+ /**
* @param dsMap Map with data structure information.
* @param info New data structure information.
* @param create Create flag.
@@ -930,6 +984,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
{
A.notNull(name, "name");
+ awaitInitialization();
+
if (create)
A.ensure(cnt >= 0, "count can not be negative");
@@ -997,9 +1053,10 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
assert name != null;
assert dsCacheCtx != null;
+ awaitInitialization();
+
removeDataStructure(new IgniteCallable<Void>() {
- @Override
- public Void call() throws Exception {
+ @Override public Void call() throws Exception {
GridCacheInternal key = new GridCacheInternalKeyImpl(name);
dsCacheCtx.gate().enter();
@@ -1169,6 +1226,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
throws IgniteCheckedException {
A.notNull(name, "name");
+ awaitInitialization();
+
String cacheName = null;
if (cfg != null)
@@ -1196,6 +1255,8 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
assert name != null;
assert cctx != null;
+ awaitInitialization();
+
IgniteCallable<GridCacheSetHeader> rmv = new IgniteCallable<GridCacheSetHeader>() {
@Override public GridCacheSetHeader call() throws Exception {
return (GridCacheSetHeader)retryRemove(cctx.cache(), new GridCacheSetHeaderKey(name));
@@ -1326,7 +1387,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
/**
*
*/
- static enum DataStructureType {
+ enum DataStructureType {
/** */
ATOMIC_LONG(IgniteAtomicLong.class.getSimpleName()),
[09/50] incubator-ignite git commit: # sp-6 release notes
Posted by sb...@apache.org.
# sp-6 release notes
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dd58664f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dd58664f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dd58664f
Branch: refs/heads/ignite-950
Commit: dd58664fc81462c81ac28e5bfefb4d07099ff1e8
Parents: 2b7a18d
Author: Yakov Zhdanov <yz...@gridgain.com>
Authored: Fri Jun 12 17:20:50 2015 +0300
Committer: Yakov Zhdanov <yz...@gridgain.com>
Committed: Fri Jun 12 17:20:50 2015 +0300
----------------------------------------------------------------------
RELEASE_NOTES.txt | 10 ++++++++++
1 file changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dd58664f/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 0369ecd..fcd281a 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -1,5 +1,15 @@
Apache Ignite Release Notes
===========================
+Apache Ignite In-Memory Data Fabric 1.2
+---------------------------------------
+
+* Added client mode to TCP discovery SPI.
+* Added memory based evictions.
+* Added integration with Apache Spark.
+* Added integration with Apache Mesos.
+* Added support for log4j2.
+* Added IgniteCache.getAllOutTx() method.
+* Many stability and fault-tolerance fixes.
Apache Ignite In-Memory Data Fabric 1.1
---------------------------------------