You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by se...@apache.org on 2015/06/17 12:44:51 UTC
[01/39] incubator-ignite git commit: #ignite-960: Small fix in
javadoc.
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-484-1 8343058d5 -> c1fc7b5d6
#ignite-960: Small fix in javadoc.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4c1733dc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4c1733dc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4c1733dc
Branch: refs/heads/ignite-484-1
Commit: 4c1733dc84af7b4d08e1cfd89b68e2f17bdc3ac6
Parents: 31fcc3e
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jun 1 12:47:36 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jun 1 12:47:36 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/configuration/CacheConfiguration.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4c1733dc/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index df6b2ee..6966af0 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -793,7 +793,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
}
/**
- * Sets factory fpr persistent storage for cache data.
+ * Sets factory for persistent storage for cache data.
* @param storeFactory Cache store factory.
*/
[05/39] incubator-ignite git commit: #ignite-960: Small fix in javadoc
Posted by se...@apache.org.
#ignite-960: Small fix in javadoc
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/90f42a4b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/90f42a4b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/90f42a4b
Branch: refs/heads/ignite-484-1
Commit: 90f42a4b78c5b0aba8dcc5ff9985470077dc66e0
Parents: 6affd3f
Author: ivasilinets <iv...@gridgain.com>
Authored: Tue Jun 2 11:00:22 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Tue Jun 2 11:00:22 2015 +0300
----------------------------------------------------------------------
.../ignite/resources/SpringApplicationContextResource.java | 4 ++--
modules/spring/src/test/config/store-cache.xml | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90f42a4b/modules/core/src/main/java/org/apache/ignite/resources/SpringApplicationContextResource.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/resources/SpringApplicationContextResource.java b/modules/core/src/main/java/org/apache/ignite/resources/SpringApplicationContextResource.java
index 93c9a30..38c0c88 100644
--- a/modules/core/src/main/java/org/apache/ignite/resources/SpringApplicationContextResource.java
+++ b/modules/core/src/main/java/org/apache/ignite/resources/SpringApplicationContextResource.java
@@ -37,7 +37,7 @@ import java.lang.annotation.*;
* <pre name="code" class="java">
* public class MyGridJob implements ComputeJob {
* ...
- * @IgniteSpringApplicationContextResource
+ * @SpringApplicationContextResource
* private ApplicationContext springCtx;
* ...
* }
@@ -48,7 +48,7 @@ import java.lang.annotation.*;
* ...
* private ApplicationContext springCtx;
* ...
- * @IgniteSpringApplicationContextResource
+ * @SpringApplicationContextResource
* public void setApplicationContext(MBeanServer springCtx) {
* this.springCtx = springCtx;
* }
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/90f42a4b/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 23cf3ea..af5928b 100644
--- a/modules/spring/src/test/config/store-cache.xml
+++ b/modules/spring/src/test/config/store-cache.xml
@@ -24,7 +24,7 @@
<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
- <bean id= "simpleDataSource" class="org.h2.jdbcx.JdbcDataSource"/>
+ <bean id="simpleDataSource" class="org.h2.jdbcx.JdbcDataSource"/>
<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="cacheConfiguration">
[06/39] incubator-ignite git commit: #ignite-960: Add dependency for
test.
Posted by se...@apache.org.
#ignite-960: Add dependency for 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/4d5f603f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4d5f603f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4d5f603f
Branch: refs/heads/ignite-484-1
Commit: 4d5f603ff69f33f84fa1f2f07d888b4fc4d4dde2
Parents: 90f42a4
Author: ivasilinets <iv...@gridgain.com>
Authored: Tue Jun 2 11:45:03 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Tue Jun 2 11:45:03 2015 +0300
----------------------------------------------------------------------
modules/spring/pom.xml | 7 +++++++
.../cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 3 ++-
2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4d5f603f/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index 2aeddaf..f5e957c 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -97,6 +97,13 @@
</dependency>
<dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>1.3.175</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-core</artifactId>
<version>${project.version}</version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4d5f603f/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 cadd899..0c7c933 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
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
import org.apache.ignite.configuration.*;
import org.apache.ignite.testframework.*;
import org.apache.ignite.testframework.junits.common.*;
+import org.h2.jdbcx.*;
/**
* Test for Cache jdbc blob store factory.
@@ -34,7 +35,7 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
assertEquals("GridGain", GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "user"));
- assertEquals(CacheJdbcBlobStoreFactory.class,
+ assertEquals(JdbcDataSource.class,
GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "dataSrc").getClass());
}
}
[02/39] incubator-ignite git commit: #ignite-960: Small fix in
javadoc.
Posted by se...@apache.org.
#ignite-960: Small fix in javadoc.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/83f77230
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/83f77230
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/83f77230
Branch: refs/heads/ignite-484-1
Commit: 83f772309122f31a0d17bb14ec4c7cb199f012cb
Parents: 4c1733d
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jun 1 18:27:57 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jun 1 18:27:57 2015 +0300
----------------------------------------------------------------------
.../java/org/apache/ignite/configuration/CacheConfiguration.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/83f77230/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
index 6966af0..d01678c 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
@@ -774,7 +774,6 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
*
* @param loadPrevVal Load previous value flag.
* @return {@code this} for chaining.
- * @return {@code this} for chaining.
*/
public CacheConfiguration setLoadPreviousValue(boolean loadPrevVal) {
this.loadPrevVal = loadPrevVal;
@@ -796,6 +795,7 @@ public class CacheConfiguration<K, V> extends MutableConfiguration<K, V> {
* Sets factory for persistent storage for cache data.
* @param storeFactory Cache store factory.
+ * @return {@code this} for chaining.
*/
@SuppressWarnings("unchecked")
public CacheConfiguration setCacheStoreFactory(Factory<? extends CacheStore<? super K, ? super V>> storeFactory) {
[30/39] incubator-ignite git commit: # i-960
Posted by se...@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-484-1
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> {
/**
[34/39] incubator-ignite git commit: #IGNITE-960 Added tests.
Posted by se...@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-484-1
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
[04/39] incubator-ignite git commit: #ignite-960: Small fix in javadoc
Posted by se...@apache.org.
#ignite-960: Small fix in javadoc
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6affd3fe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6affd3fe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6affd3fe
Branch: refs/heads/ignite-484-1
Commit: 6affd3fe32dce9b055a94a2174a497746427b120
Parents: f4a122c
Author: ivasilinets <iv...@gridgain.com>
Authored: Tue Jun 2 10:52:49 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Tue Jun 2 10:52:49 2015 +0300
----------------------------------------------------------------------
.../main/java/org/apache/ignite/resources/SpringResource.java | 6 +++---
.../processors/resource/GridResourceSpringBeanInjector.java | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6affd3fe/modules/core/src/main/java/org/apache/ignite/resources/SpringResource.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/resources/SpringResource.java b/modules/core/src/main/java/org/apache/ignite/resources/SpringResource.java
index 0d6a207..4426637 100644
--- a/modules/core/src/main/java/org/apache/ignite/resources/SpringResource.java
+++ b/modules/core/src/main/java/org/apache/ignite/resources/SpringResource.java
@@ -50,7 +50,7 @@ import java.lang.annotation.*;
* <pre name="code" class="java">
* public class MyGridJob implements ComputeJob {
* ...
- * @IgniteSpringResource(resourceName = "bean-name")
+ * @SpringResource(resourceName = "bean-name")
* private transient MyUserBean rsrc;
* ...
* }
@@ -61,7 +61,7 @@ import java.lang.annotation.*;
* ...
* private transient MyUserBean rsrc;
* ...
- * @IgniteSpringResource(resourceName = "bean-name")
+ * @SpringResource(resourceName = "bean-name")
* public void setMyUserBean(MyUserBean rsrc) {
* this.rsrc = rsrc;
* }
@@ -72,7 +72,7 @@ import java.lang.annotation.*;
* <pre name="code" class="java">
* public class MyUserResource {
* ...
- * @IgniteSpringResource(resourceName = "bean-name")
+ * @SpringResource(resourceName = "bean-name")
* private MyUserBean rsrc;
* ...
* // Inject logger (or any other resource).
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6affd3fe/modules/spring/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceSpringBeanInjector.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceSpringBeanInjector.java b/modules/spring/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceSpringBeanInjector.java
index fb57027..3acb070 100644
--- a/modules/spring/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceSpringBeanInjector.java
+++ b/modules/spring/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceSpringBeanInjector.java
@@ -56,7 +56,7 @@ public class GridResourceSpringBeanInjector implements GridResourceInjector {
// Check for 'transient' modifier only in serializable classes.
if (!Modifier.isTransient(field.getField().getModifiers()) &&
Serializable.class.isAssignableFrom(field.getField().getDeclaringClass())) {
- throw new IgniteCheckedException("@GridSpringResource must only be used with 'transient' fields: " +
+ throw new IgniteCheckedException("@SpringResource must only be used with 'transient' fields: " +
field.getField());
}
[19/39] incubator-ignite git commit: # ignite-sprint-6 tests fixes
Posted by se...@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-484-1
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/39] incubator-ignite git commit: ignite-484-1 - minor
Posted by se...@apache.org.
ignite-484-1 - minor
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c1fc7b5d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c1fc7b5d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c1fc7b5d
Branch: refs/heads/ignite-484-1
Commit: c1fc7b5d6d7deb895bdf13d3b7e199161d494277
Parents: ca253a8
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 17 13:44:36 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 17 13:44:36 2015 +0300
----------------------------------------------------------------------
.../distributed/dht/GridDhtLocalPartition.java | 8 +++-----
.../dht/GridDhtPartitionsReservation.java | 20 ++++++++++++++------
.../IgniteCacheQueryNodeRestartSelfTest2.java | 8 ++++++--
3 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1fc7b5d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
index 5938fc8..1392f5e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtLocalPartition.java
@@ -505,14 +505,12 @@ public class GridDhtLocalPartition implements Comparable<GridDhtLocalPartition>,
* @return {@code true} If there is a group reservation.
*/
private boolean groupReserved() {
- boolean reserved = false;
-
for (GridDhtPartitionsReservation reservation : reservations) {
- if (!reservation.canEvict())
- reserved = true; // Calling all the reservations to allow them unregister themselves.
+ if (!reservation.invalidate())
+ return true; // Failed to invalidate reservation -> we are reserved.
}
- return reserved;
+ return false;
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1fc7b5d/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
index a32946a..aced999 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtPartitionsReservation.java
@@ -34,6 +34,13 @@ public class GridDhtPartitionsReservation implements GridReservable {
private static final GridDhtLocalPartition[] EMPTY = {};
/** */
+ private static final CI1<GridDhtPartitionsReservation> NO_OP = new CI1<GridDhtPartitionsReservation>() {
+ @Override public void apply(GridDhtPartitionsReservation gridDhtPartitionsReservation) {
+ throw new IllegalStateException();
+ }
+ };
+
+ /** */
private final Object appKey;
/** */
@@ -154,7 +161,7 @@ public class GridDhtPartitionsReservation implements GridReservable {
for (;;) {
int r = reservations.get();
- if (r == -1) // Invalidated by successful canEvict call.
+ if (r == -1) // Invalidated.
return false;
assert r >= 0 : r;
@@ -224,20 +231,21 @@ public class GridDhtPartitionsReservation implements GridReservable {
// Unpublish.
CI1<GridDhtPartitionsReservation> u = unpublish.get();
- if (u != null && unpublish.compareAndSet(u, null))
+ if (u != null && u != NO_OP && unpublish.compareAndSet(u, NO_OP))
u.apply(this);
}
/**
* Must be checked in {@link GridDhtLocalPartition#tryEvict(boolean)}.
- * If returns {@code true} then probably partition will be evicted (or at least cleared),
- * so this reservation object becomes invalid and must be dropped from the partition.
+ * If returns {@code true} this reservation object becomes invalid and partitions
+ * can be evicted or at least cleared.
* Also this means that after returning {@code true} here method {@link #reserve()} can not
* return {@code true} anymore.
*
- * @return {@code true} If this reservation is NOT reserved and partition CAN be evicted.
+ * @return {@code true} If this reservation was successfully invalidated because it was not
+ * reserved and partitions can be evicted.
*/
- public boolean canEvict() {
+ public boolean invalidate() {
assert parts.get() != null : "all parts must be reserved before registration";
int r = reservations.get();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1fc7b5d/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
index d440b13..527dfea 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheQueryNodeRestartSelfTest2.java
@@ -177,7 +177,7 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
* @throws Exception If failed.
*/
public void testRestarts() throws Exception {
- int duration = 150 * 1000;
+ int duration = 90 * 1000;
int qryThreadNum = 4;
int restartThreadsNum = 2; // 4 + 2 = 6 nodes
final int nodeLifeTime = 2 * 1000;
@@ -197,6 +197,9 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
final List<List<?>> rRes = grid(0).cache("co").query(new SqlFieldsQuery(REPLICATED_QRY)).getAll();
+ assertFalse(pRes.isEmpty());
+ assertFalse(rRes.isEmpty());
+
final AtomicInteger qryCnt = new AtomicInteger();
final AtomicBoolean qrysDone = new AtomicBoolean();
@@ -235,7 +238,8 @@ public class IgniteCacheQueryNodeRestartSelfTest2 extends GridCommonAbstractTest
if (!(th instanceof CacheException))
continue;
- if (th.getMessage().startsWith("Failed to fetch data from node:")) {
+ if (th.getMessage() != null &&
+ th.getMessage().startsWith("Failed to fetch data from node:")) {
failedOnRemoteFetch = true;
break;
[20/39] incubator-ignite git commit: # ignite-sprint-6 tests fixes
Posted by se...@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-484-1
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.
*/
[37/39] incubator-ignite git commit: 1.1.3-SNAPSHOT
Posted by se...@apache.org.
1.1.3-SNAPSHOT
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dc05e88c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dc05e88c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dc05e88c
Branch: refs/heads/ignite-484-1
Commit: dc05e88c8a0dd314ebfba6b5baf246e0d00be6a2
Parents: d1a2150
Author: Ignite Teamcity <ig...@apache.org>
Authored: Wed Jun 17 12:04:20 2015 +0300
Committer: Ignite Teamcity <ig...@apache.org>
Committed: Wed Jun 17 12:04:20 2015 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/src/main/resources/ignite.properties | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/mesos/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spark-2.10/pom.xml | 2 +-
modules/spark/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 2 +-
37 files changed, 37 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 016b3ce..8422402 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
</parent>
<artifactId>ignite-examples</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/aop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aop/pom.xml b/modules/aop/pom.xml
index e04f183..1119301 100644
--- a/modules/aop/pom.xml
+++ b/modules/aop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aop</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/aws/pom.xml
----------------------------------------------------------------------
diff --git a/modules/aws/pom.xml b/modules/aws/pom.xml
index f7fdfbc..3b1f3c6 100644
--- a/modules/aws/pom.xml
+++ b/modules/aws/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-aws</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/clients/pom.xml
----------------------------------------------------------------------
diff --git a/modules/clients/pom.xml b/modules/clients/pom.xml
index 7842c47..dfde946 100644
--- a/modules/clients/pom.xml
+++ b/modules/clients/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-clients</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/cloud/pom.xml
----------------------------------------------------------------------
diff --git a/modules/cloud/pom.xml b/modules/cloud/pom.xml
index 579c6a0..b45b503 100644
--- a/modules/cloud/pom.xml
+++ b/modules/cloud/pom.xml
@@ -29,7 +29,7 @@
</parent>
<artifactId>ignite-cloud</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<properties>
<jcloud.version>1.9.0</jcloud.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/codegen/pom.xml
----------------------------------------------------------------------
diff --git a/modules/codegen/pom.xml b/modules/codegen/pom.xml
index 9d375cc..94154ea 100644
--- a/modules/codegen/pom.xml
+++ b/modules/codegen/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-codegen</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index a0ee32e..b81cc63 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-core</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/core/src/main/resources/ignite.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/ignite.properties b/modules/core/src/main/resources/ignite.properties
index 5171bd6..32d6d1f 100644
--- a/modules/core/src/main/resources/ignite.properties
+++ b/modules/core/src/main/resources/ignite.properties
@@ -15,7 +15,7 @@
# limitations under the License.
#
-ignite.version=1.1.2-SNAPSHOT
+ignite.version=1.1.3-SNAPSHOT
ignite.build=0
ignite.revision=DEV
ignite.rel.date=01011970
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/extdata/p2p/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/pom.xml b/modules/extdata/p2p/pom.xml
index 4546112..0ee5e75 100644
--- a/modules/extdata/p2p/pom.xml
+++ b/modules/extdata/p2p/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-p2p</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/extdata/uri/pom.xml
----------------------------------------------------------------------
diff --git a/modules/extdata/uri/pom.xml b/modules/extdata/uri/pom.xml
index be0c73b..633df8b 100644
--- a/modules/extdata/uri/pom.xml
+++ b/modules/extdata/uri/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-extdata-uri</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/gce/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gce/pom.xml b/modules/gce/pom.xml
index e0a5d1d..2da3a6c 100644
--- a/modules/gce/pom.xml
+++ b/modules/gce/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-gce</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/geospatial/pom.xml
----------------------------------------------------------------------
diff --git a/modules/geospatial/pom.xml b/modules/geospatial/pom.xml
index d9bd236..4f71637 100644
--- a/modules/geospatial/pom.xml
+++ b/modules/geospatial/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-geospatial</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hadoop/pom.xml b/modules/hadoop/pom.xml
index dd7c9b7..ef26445 100644
--- a/modules/hadoop/pom.xml
+++ b/modules/hadoop/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hadoop</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/hibernate/pom.xml b/modules/hibernate/pom.xml
index d7e098c..b4da498 100644
--- a/modules/hibernate/pom.xml
+++ b/modules/hibernate/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-hibernate</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/indexing/pom.xml
----------------------------------------------------------------------
diff --git a/modules/indexing/pom.xml b/modules/indexing/pom.xml
index 18a3579..451e801 100644
--- a/modules/indexing/pom.xml
+++ b/modules/indexing/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-indexing</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/jcl/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jcl/pom.xml b/modules/jcl/pom.xml
index 516df8a..0b0f2a6 100644
--- a/modules/jcl/pom.xml
+++ b/modules/jcl/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jcl</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/jta/pom.xml
----------------------------------------------------------------------
diff --git a/modules/jta/pom.xml b/modules/jta/pom.xml
index ca5ef52..b4d6a5a 100644
--- a/modules/jta/pom.xml
+++ b/modules/jta/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-jta</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/log4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/log4j/pom.xml b/modules/log4j/pom.xml
index 533f592..2c5e15e 100644
--- a/modules/log4j/pom.xml
+++ b/modules/log4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-log4j</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/mesos/pom.xml
----------------------------------------------------------------------
diff --git a/modules/mesos/pom.xml b/modules/mesos/pom.xml
index 173fe7c..d718a65 100644
--- a/modules/mesos/pom.xml
+++ b/modules/mesos/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-mesos</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<properties>
<jetty.version>9.2.10.v20150310</jetty.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/rest-http/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest-http/pom.xml b/modules/rest-http/pom.xml
index 243ac06..18ec434 100644
--- a/modules/rest-http/pom.xml
+++ b/modules/rest-http/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-rest-http</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/scalar-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar-2.10/pom.xml b/modules/scalar-2.10/pom.xml
index 63bfd36..71c1ec9 100644
--- a/modules/scalar-2.10/pom.xml
+++ b/modules/scalar-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar_2.10</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/scalar/pom.xml
----------------------------------------------------------------------
diff --git a/modules/scalar/pom.xml b/modules/scalar/pom.xml
index 3fb2470..635b874 100644
--- a/modules/scalar/pom.xml
+++ b/modules/scalar/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-scalar</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/schedule/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schedule/pom.xml b/modules/schedule/pom.xml
index 049fe65..0c73aa0 100644
--- a/modules/schedule/pom.xml
+++ b/modules/schedule/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schedule</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/schema-import/pom.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/pom.xml b/modules/schema-import/pom.xml
index 8523d34..92b9da8 100644
--- a/modules/schema-import/pom.xml
+++ b/modules/schema-import/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-schema-import</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/slf4j/pom.xml
----------------------------------------------------------------------
diff --git a/modules/slf4j/pom.xml b/modules/slf4j/pom.xml
index 5284182..22f538f 100644
--- a/modules/slf4j/pom.xml
+++ b/modules/slf4j/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-slf4j</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/spark-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark-2.10/pom.xml b/modules/spark-2.10/pom.xml
index 46cc4e7..5e5d78e 100644
--- a/modules/spark-2.10/pom.xml
+++ b/modules/spark-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark_2.10</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/spark/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spark/pom.xml b/modules/spark/pom.xml
index e62ca24..244fa3c 100644
--- a/modules/spark/pom.xml
+++ b/modules/spark/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spark</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/spring/pom.xml
----------------------------------------------------------------------
diff --git a/modules/spring/pom.xml b/modules/spring/pom.xml
index d56cb2b..85f57bb 100644
--- a/modules/spring/pom.xml
+++ b/modules/spring/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-spring</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/ssh/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ssh/pom.xml b/modules/ssh/pom.xml
index d65d173..dcd74d8 100644
--- a/modules/ssh/pom.xml
+++ b/modules/ssh/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-ssh</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/tools/pom.xml
----------------------------------------------------------------------
diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml
index 0bb221f..41e4f8a 100644
--- a/modules/tools/pom.xml
+++ b/modules/tools/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-tools</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/urideploy/pom.xml
----------------------------------------------------------------------
diff --git a/modules/urideploy/pom.xml b/modules/urideploy/pom.xml
index 70a23b0..7970f4b 100644
--- a/modules/urideploy/pom.xml
+++ b/modules/urideploy/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-urideploy</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/visor-console-2.10/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console-2.10/pom.xml b/modules/visor-console-2.10/pom.xml
index bb7aefc..f5116bd 100644
--- a/modules/visor-console-2.10/pom.xml
+++ b/modules/visor-console-2.10/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console_2.10</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/visor-console/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-console/pom.xml b/modules/visor-console/pom.xml
index ef6abc0..885afe1 100644
--- a/modules/visor-console/pom.xml
+++ b/modules/visor-console/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-console</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/visor-plugins/pom.xml
----------------------------------------------------------------------
diff --git a/modules/visor-plugins/pom.xml b/modules/visor-plugins/pom.xml
index ef217ed..51680fa 100644
--- a/modules/visor-plugins/pom.xml
+++ b/modules/visor-plugins/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-visor-plugins</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<!-- Ignite dependencies -->
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/web/pom.xml
----------------------------------------------------------------------
diff --git a/modules/web/pom.xml b/modules/web/pom.xml
index 6b69c63..97901ba 100644
--- a/modules/web/pom.xml
+++ b/modules/web/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-web</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/modules/yardstick/pom.xml
----------------------------------------------------------------------
diff --git a/modules/yardstick/pom.xml b/modules/yardstick/pom.xml
index 39c7f5a..c4cb122 100644
--- a/modules/yardstick/pom.xml
+++ b/modules/yardstick/pom.xml
@@ -31,7 +31,7 @@
</parent>
<artifactId>ignite-yardstick</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<properties>
<yardstick.version>0.7.0</yardstick.version>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/dc05e88c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 68d610e..84e1c79 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
<groupId>org.apache.ignite</groupId>
<artifactId>apache-ignite</artifactId>
- <version>1.1.2-SNAPSHOT</version>
+ <version>1.1.3-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
[11/39] incubator-ignite git commit: #ignite-960: Change
CacheJdbcBlobStoreFactorySelfTest:testCacheConfiguration. Start several nodes
with different configuration + use TcpDiscoveryVmIpFinder.
Posted by se...@apache.org.
#ignite-960: Change CacheJdbcBlobStoreFactorySelfTest:testCacheConfiguration. Start several nodes with different configuration + use TcpDiscoveryVmIpFinder.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5c4bb215
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5c4bb215
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5c4bb215
Branch: refs/heads/ignite-484-1
Commit: 5c4bb215b1713df40ac8ae28f97e7f0b3a1916fe
Parents: fef12fc
Author: ivasilinets <iv...@gridgain.com>
Authored: Tue Jun 2 13:18:30 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Tue Jun 2 13:18:30 2015 +0300
----------------------------------------------------------------------
modules/spring/src/test/config/node.xml | 2 +-
modules/spring/src/test/config/node1.xml | 45 ++++++++++++++++++++
.../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 36 +++++++++++-----
3 files changed, 72 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5c4bb215/modules/spring/src/test/config/node.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/node.xml b/modules/spring/src/test/config/node.xml
index 36d64cb..6f467eb 100644
--- a/modules/spring/src/test/config/node.xml
+++ b/modules/spring/src/test/config/node.xml
@@ -29,7 +29,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/5c4bb215/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
new file mode 100644
index 0000000..67bae12
--- /dev/null
+++ b/modules/spring/src/test/config/node1.xml
@@ -0,0 +1,45 @@
+<?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="simpleDataSource" class="sun.jdbc.odbc.ee.ConnectionPoolDataSource"/>
+
+ <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ <property name="gridName" value="ignite1"/>
+
+ <!-- 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/5c4bb215/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 eebd48d..6289e34 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
@@ -31,6 +31,9 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
/** Cache name. */
private static final String CACHE_NAME = "test";
+ /** User name. */
+ private static final String USER_NAME = "GridGain";
+
/**
* @throws Exception If failed.
*/
@@ -49,20 +52,33 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
*/
public void testCacheConfiguration() throws Exception {
try (Ignite ignite = Ignition.start("modules/spring/src/test/config/node.xml")) {
- CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();
+ 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);
+ }
+ }
+ }
+ }
+ }
- CacheJdbcBlobStoreFactory<Integer, String> factory = new CacheJdbcBlobStoreFactory();
+ /**
+ * @return Cache configuration with store.
+ */
+ private CacheConfiguration<Integer, String> cacheConfiguration() {
+ CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();
- factory.setUser("GridGain");
+ CacheJdbcBlobStoreFactory<Integer, String> factory = new CacheJdbcBlobStoreFactory();
- factory.setDataSourceBean("simpleDataSource");
+ factory.setUser(USER_NAME);
- cfg.setCacheStoreFactory(factory);
+ factory.setDataSourceBean("simpleDataSource");
- try(IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cfg)) {
- checkStore(cache, JdbcDataSource.class);
- }
- }
+ cfg.setCacheStoreFactory(factory);
+
+ return cfg;
}
/**
@@ -74,7 +90,7 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
CacheJdbcBlobStore store = (CacheJdbcBlobStore) cache.getConfiguration(CacheConfiguration.class).
getCacheStoreFactory().create();
- assertEquals("GridGain", GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "user"));
+ assertEquals(USER_NAME, GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "user"));
assertEquals(dataSrcClass,
GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "dataSrc").getClass());
[36/39] incubator-ignite git commit: Merge branch 'ignite-960' into
ignite-sprint-6
Posted by se...@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-484-1
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(-)
----------------------------------------------------------------------
[26/39] incubator-ignite git commit: #IGNITE-960 Fixed review notes.
Added tests. Added check that CacheConfiguration is serializable.
Posted by se...@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-484-1
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;
}
}
[21/39] incubator-ignite git commit: # ignite-883 fixed test
Posted by se...@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-484-1
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);
[07/39] incubator-ignite git commit: #ignite-960: Use
@SpringApplicationContextResource annotation.
Posted by se...@apache.org.
#ignite-960: Use @SpringApplicationContextResource annotation.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/50d14032
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/50d14032
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/50d14032
Branch: refs/heads/ignite-484-1
Commit: 50d14032c3b43433aa39a59ff7170ac547058a37
Parents: 4d5f603
Author: ivasilinets <iv...@gridgain.com>
Authored: Tue Jun 2 12:02:19 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Tue Jun 2 12:02:19 2015 +0300
----------------------------------------------------------------------
.../internal/processors/cache/GridCacheProcessor.java | 3 +++
.../cache/store/jdbc/CacheJdbcBlobStoreFactory.java | 4 ++--
modules/spring/src/test/config/store-cache.xml | 2 --
.../store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 14 +++++++-------
4 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/50d14032/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 0e1a9c2..354172a 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
@@ -1052,6 +1052,9 @@ public class GridCacheProcessor extends GridProcessorAdapter {
{
assert cfg != null;
+ if (cfg.getCacheStoreFactory() != null)
+ ctx.resource().injectGeneric(cfg.getCacheStoreFactory());
+
CacheStore cfgStore = cfg.getCacheStoreFactory() != null ? cfg.getCacheStoreFactory().create() : null;
validate(ctx.config(), cfg, cacheType, cfgStore);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/50d14032/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 fab5ee8..5f51c12 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,7 @@
package org.apache.ignite.cache.store.jdbc;
import org.apache.ignite.internal.util.tostring.*;
-import org.springframework.beans.factory.annotation.*;
+import org.apache.ignite.resources.*;
import org.springframework.context.*;
import javax.cache.configuration.*;
@@ -97,7 +97,7 @@ public class CacheJdbcBlobStoreFactory implements Factory<CacheJdbcBlobStore> {
private String dataSrcBean;
/** Application context. */
- @Autowired
+ @SpringApplicationContextResource
private ApplicationContext appContext;
/** {@inheritDoc} */
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/50d14032/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 af5928b..992a22c 100644
--- a/modules/spring/src/test/config/store-cache.xml
+++ b/modules/spring/src/test/config/store-cache.xml
@@ -22,8 +22,6 @@
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
- <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
-
<bean id="simpleDataSource" class="org.h2.jdbcx.JdbcDataSource"/>
<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/50d14032/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 0c7c933..bdfdcb9 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
@@ -29,15 +29,15 @@ import org.h2.jdbcx.*;
public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
public void testXmlConfiguration() throws Exception {
try (Ignite ignite = Ignition.start("modules/spring/src/test/config/store-cache.xml")) {
- try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache("test")) {
- CacheJdbcBlobStore store = (CacheJdbcBlobStore)cache.getConfiguration(CacheConfiguration.class).
- getCacheStoreFactory().create();
+ IgniteCache<Integer, String> cache = ignite.cache("test");
- assertEquals("GridGain", GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "user"));
+ CacheJdbcBlobStore store = (CacheJdbcBlobStore) cache.getConfiguration(CacheConfiguration.class).
+ getCacheStoreFactory().create();
- assertEquals(JdbcDataSource.class,
- GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "dataSrc").getClass());
- }
+ assertEquals("GridGain", GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "user"));
+
+ assertEquals(JdbcDataSource.class,
+ GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "dataSrc").getClass());
}
}
}
[29/39] incubator-ignite git commit: Merge remote-tracking branch
'origin/ignite-960' into ignite-960
Posted by se...@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-484-1
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(-)
----------------------------------------------------------------------
[28/39] incubator-ignite git commit: #IGNITE-960 Fixed test.
Posted by se...@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-484-1
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);
}
}
}
[23/39] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-883' into ignite-sprint-6
Posted by se...@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-484-1
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(-)
----------------------------------------------------------------------
[38/39] incubator-ignite git commit: Merge branches 'ignite-484-1'
and 'ignite-sprint-6' of
https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-484-1
Posted by se...@apache.org.
Merge branches 'ignite-484-1' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-484-1
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ca253a8a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ca253a8a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ca253a8a
Branch: refs/heads/ignite-484-1
Commit: ca253a8a845129ece37fca3a12c384d8b9ef3e76
Parents: 8343058 dc05e88
Author: S.Vladykin <sv...@gridgain.com>
Authored: Wed Jun 17 12:21:53 2015 +0300
Committer: S.Vladykin <sv...@gridgain.com>
Committed: Wed Jun 17 12:21:53 2015 +0300
----------------------------------------------------------------------
RELEASE_NOTES.txt | 2 +-
examples/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
.../cache/store/jdbc/CacheJdbcBlobStore.java | 22 +-
.../store/jdbc/CacheJdbcBlobStoreFactory.java | 290 +++++++++++++++++++
.../cache/store/jdbc/CacheJdbcPojoStore.java | 6 +-
.../store/jdbc/CacheJdbcPojoStoreFactory.java | 148 ++++++++++
.../configuration/CacheConfiguration.java | 3 +-
.../internal/interop/InteropBootstrap.java | 3 +-
.../internal/interop/InteropIgnition.java | 5 +-
.../processors/cache/GridCacheProcessor.java | 23 +-
.../processors/query/GridQueryProcessor.java | 102 +++++--
.../util/spring/IgniteSpringHelper.java | 10 +
.../SpringApplicationContextResource.java | 4 +-
.../apache/ignite/resources/SpringResource.java | 6 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 87 ++++--
.../core/src/main/resources/ignite.properties | 2 +-
.../apache/ignite/internal/GridSelfTest.java | 12 +-
.../GridDiscoveryManagerAliveCacheSelfTest.java | 17 +-
.../GridCacheAbstractFailoverSelfTest.java | 2 +
...ridCacheMultinodeUpdateAbstractSelfTest.java | 9 +
.../cache/GridCacheVersionMultinodeTest.java | 8 +-
...CacheP2pUnmarshallingRebalanceErrorTest.java | 15 +-
.../IgniteCacheClientNodeConcurrentStart.java | 14 +-
.../distributed/IgniteCacheManyClientsTest.java | 69 ++++-
.../GridCachePartitionedTxSalvageSelfTest.java | 37 +--
.../junits/common/GridCommonAbstractTest.java | 11 +-
.../IgniteCacheFailoverTestSuite.java | 8 -
.../IgniteCacheFailoverTestSuite2.java | 47 +++
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 16 +-
.../hibernate/CacheHibernateBlobStore.java | 87 +-----
.../CacheHibernateBlobStoreFactory.java | 235 +++++++++++++++
.../hibernate/src/test/config/factory-cache.xml | 59 ++++
.../src/test/config/factory-cache1.xml | 61 ++++
.../config/factory-incorrect-store-cache.xml | 56 ++++
.../CacheHibernateStoreFactorySelfTest.java | 273 +++++++++++++++++
.../testsuites/IgniteHibernateTestSuite.java | 2 +
modules/indexing/pom.xml | 2 +-
.../CacheAbstractQueryMetricsSelfTest.java | 205 +++++++++++++
.../CachePartitionedQueryMetricsSelfTest.java | 32 ++
.../CacheReplicatedQueryMetricsSelfTest.java | 32 ++
.../cache/GridCacheQueryMetricsSelfTest.java | 206 -------------
.../query/h2/sql/BaseH2CompareQueryTest.java | 2 +-
.../IgniteCacheQuerySelfTestSuite.java | 4 +-
modules/jcl/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/mesos/pom.xml | 2 +-
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spark-2.10/pom.xml | 2 +-
modules/spark/pom.xml | 2 +-
modules/spring/pom.xml | 9 +-
.../GridResourceSpringBeanInjector.java | 2 +-
.../util/spring/IgniteSpringHelperImpl.java | 17 ++
.../src/test/config/incorrect-store-cache.xml | 57 ++++
modules/spring/src/test/config/node.xml | 43 +++
modules/spring/src/test/config/node1.xml | 45 +++
.../test/config/pojo-incorrect-store-cache.xml | 56 ++++
modules/spring/src/test/config/store-cache.xml | 59 ++++
modules/spring/src/test/config/store-cache1.xml | 62 ++++
.../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 172 +++++++++++
.../jdbc/CacheJdbcPojoStoreFactorySelfTest.java | 193 ++++++++++++
.../testsuites/IgniteSpringTestSuite.java | 5 +
modules/ssh/pom.xml | 2 +-
modules/tools/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
pom.xml | 2 +-
87 files changed, 2520 insertions(+), 500 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ca253a8a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 174b7a0,718e6ba..4f2486b
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@@ -687,9 -716,16 +714,9 @@@ public class GridQueryProcessor extend
}
/**
- * @return Message factory for {@link GridIoManager}.
- */
- public MessageFactory messageFactory() {
- return idx == null ? null : idx.messageFactory();
- }
-
- /**
* Closeable iterator.
*/
- private static interface ClIter<X> extends AutoCloseable, Iterator<X> {
+ private interface ClIter<X> extends AutoCloseable, Iterator<X> {
// No-op.
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ca253a8a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteCacheQuerySelfTestSuite.java
----------------------------------------------------------------------
[32/39] incubator-ignite git commit: #IGNITE-960 Added tests.
Posted by se...@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-484-1
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;
+ }
+ }
}
[13/39] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-sprint-5' into ignite-960
Posted by se...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-5' 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/6a22fd27
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6a22fd27
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6a22fd27
Branch: refs/heads/ignite-484-1
Commit: 6a22fd27dc790e3157b57bb93648cba255c8d24d
Parents: 0f12404 1dbdd42
Author: ivasilinets <iv...@gridgain.com>
Authored: Tue Jun 2 13:35:10 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Tue Jun 2 13:35:10 2015 +0300
----------------------------------------------------------------------
.../hibernate/CacheHibernatePersonStore.java | 202 +-
.../hibernate/CacheHibernateStoreExample.java | 17 +
.../store/jdbc/CacheJdbcPersonStore.java | 180 +-
.../store/jdbc/CacheJdbcStoreExample.java | 13 +
.../store/spring/CacheSpringPersonStore.java | 128 +
.../store/spring/CacheSpringStoreExample.java | 143 +
.../datagrid/store/spring/package-info.java | 22 +
.../main/java/org/apache/ignite/Ignition.java | 18 +-
.../apache/ignite/cache/store/CacheStore.java | 2 +
.../ignite/cache/store/CacheStoreSession.java | 22 +
.../cache/store/CacheStoreSessionListener.java | 133 +
.../jdbc/CacheJdbcStoreSessionListener.java | 141 +
.../org/apache/ignite/cluster/ClusterNode.java | 24 +-
.../configuration/CacheConfiguration.java | 53 +-
.../configuration/IgniteConfiguration.java | 42 +-
.../ignite/internal/ClusterMetricsSnapshot.java | 14 +
.../internal/GridEventConsumeHandler.java | 100 +-
.../ignite/internal/GridKernalContext.java | 5 +
.../ignite/internal/GridKernalContextImpl.java | 5 +
.../apache/ignite/internal/IgniteKernal.java | 23 +-
.../org/apache/ignite/internal/IgnitionEx.java | 22 +-
.../ignite/internal/MarshallerContextImpl.java | 2 +-
.../internal/events/DiscoveryCustomEvent.java | 18 +-
.../managers/communication/GridIoManager.java | 12 +-
.../managers/discovery/CustomEventListener.java | 31 +
.../discovery/CustomMessageWrapper.java | 63 +
.../discovery/DiscoveryCustomMessage.java | 48 +
.../discovery/GridDiscoveryManager.java | 214 +-
.../affinity/GridAffinityAssignmentCache.java | 32 +
.../cache/DynamicCacheChangeBatch.java | 20 +-
.../cache/DynamicCacheDescriptor.java | 2 +
.../processors/cache/GridCacheAdapter.java | 17 +-
.../cache/GridCacheAffinityManager.java | 14 +
.../cache/GridCacheConcurrentMap.java | 21 +-
.../processors/cache/GridCacheContext.java | 6 +-
.../processors/cache/GridCacheEntryEx.java | 6 +
.../processors/cache/GridCacheGateway.java | 2 +-
.../processors/cache/GridCacheIoManager.java | 8 +-
.../processors/cache/GridCacheMapEntry.java | 5 +
.../processors/cache/GridCacheMvccManager.java | 32 +-
.../GridCachePartitionExchangeManager.java | 71 +-
.../processors/cache/GridCachePreloader.java | 6 +-
.../cache/GridCachePreloaderAdapter.java | 11 +-
.../processors/cache/GridCacheProcessor.java | 86 +-
.../processors/cache/GridCacheProxyImpl.java | 12 +
.../cache/GridCacheSharedContext.java | 48 +-
.../processors/cache/GridCacheUtils.java | 288 +-
.../processors/cache/IgniteInternalCache.java | 5 +
.../cache/affinity/GridCacheAffinityImpl.java | 10 +-
.../CacheDataStructuresManager.java | 2 +-
.../distributed/GridDistributedCacheEntry.java | 7 -
.../distributed/GridDistributedTxMapping.java | 17 +
.../dht/GridClientPartitionTopology.java | 8 +-
.../dht/GridDhtAssignmentFetchFuture.java | 4 +-
.../distributed/dht/GridDhtCacheAdapter.java | 27 +-
.../distributed/dht/GridDhtCacheEntry.java | 6 +-
.../distributed/dht/GridDhtLockFuture.java | 10 +-
.../dht/GridDhtPartitionTopologyImpl.java | 22 +-
.../dht/GridDhtTransactionalCacheAdapter.java | 224 +-
.../distributed/dht/GridDhtTxLocalAdapter.java | 8 +-
.../distributed/dht/GridDhtTxPrepareFuture.java | 3 +-
.../dht/atomic/GridDhtAtomicCache.java | 18 +-
.../dht/atomic/GridDhtAtomicUpdateFuture.java | 10 +-
.../dht/atomic/GridNearAtomicUpdateFuture.java | 78 +-
.../dht/atomic/GridNearAtomicUpdateRequest.java | 112 +-
.../dht/colocated/GridDhtColocatedCache.java | 12 +-
.../colocated/GridDhtColocatedLockFuture.java | 213 +-
.../dht/preloader/GridDhtForceKeysFuture.java | 4 +-
.../preloader/GridDhtPartitionDemandPool.java | 26 +-
.../dht/preloader/GridDhtPartitionMap.java | 2 +-
.../preloader/GridDhtPartitionSupplyPool.java | 29 +-
.../GridDhtPartitionsExchangeFuture.java | 313 +-
.../preloader/GridDhtPartitionsFullMessage.java | 4 +-
.../GridDhtPartitionsSingleMessage.java | 33 +-
.../dht/preloader/GridDhtPreloader.java | 28 +-
.../preloader/GridDhtPreloaderAssignments.java | 3 +-
.../distributed/near/GridNearAtomicCache.java | 5 +
.../distributed/near/GridNearCacheAdapter.java | 2 +-
.../distributed/near/GridNearGetFuture.java | 2 +-
.../distributed/near/GridNearLockFuture.java | 271 +-
.../distributed/near/GridNearLockRequest.java | 68 +-
.../distributed/near/GridNearLockResponse.java | 48 +-
.../near/GridNearOptimisticTxPrepareFuture.java | 83 +-
.../GridNearPessimisticTxPrepareFuture.java | 5 +-
.../near/GridNearTransactionalCache.java | 4 +-
.../cache/distributed/near/GridNearTxLocal.java | 43 +-
.../near/GridNearTxPrepareRequest.java | 72 +-
.../near/GridNearTxPrepareResponse.java | 70 +-
.../processors/cache/local/GridLocalCache.java | 6 +-
.../local/atomic/GridLocalAtomicCache.java | 6 +-
.../cache/query/GridCacheQueryAdapter.java | 12 +-
.../cache/query/GridCacheQueryErrorFuture.java | 2 +
.../cache/query/GridCacheQueryManager.java | 2 +-
.../continuous/CacheContinuousQueryManager.java | 28 +-
.../cache/store/CacheOsStoreManager.java | 1 -
.../cache/store/CacheStoreManager.java | 7 +-
.../store/GridCacheStoreManagerAdapter.java | 202 +-
.../cache/transactions/IgniteInternalTx.java | 5 +
.../cache/transactions/IgniteTxAdapter.java | 48 +-
.../cache/transactions/IgniteTxHandler.java | 148 +-
.../transactions/IgniteTxLocalAdapter.java | 142 +-
.../cacheobject/IgniteCacheObjectProcessor.java | 5 +-
.../IgniteCacheObjectProcessorImpl.java | 2 +-
.../continuous/AbstractContinuousMessage.java | 54 +
.../continuous/GridContinuousMessageType.java | 12 -
.../continuous/GridContinuousProcessor.java | 836 +--
.../processors/continuous/StartRequestData.java | 267 +
.../StartRoutineAckDiscoveryMessage.java | 63 +
.../StartRoutineDiscoveryMessage.java | 85 +
.../StopRoutineAckDiscoveryMessage.java | 49 +
.../continuous/StopRoutineDiscoveryMessage.java | 49 +
.../datastreamer/DataStreamerImpl.java | 2 +
.../service/GridServiceProcessor.java | 121 +-
.../internal/util/future/GridFutureAdapter.java | 4 +-
.../org/apache/ignite/spi/IgniteSpiAdapter.java | 2 +-
.../communication/tcp/TcpCommunicationSpi.java | 2 +-
.../ignite/spi/discovery/DiscoverySpi.java | 20 +-
.../discovery/DiscoverySpiCustomMessage.java | 40 +
.../spi/discovery/DiscoverySpiListener.java | 5 +-
.../ignite/spi/discovery/tcp/ClientImpl.java | 1478 +++++
.../ignite/spi/discovery/tcp/ServerImpl.java | 4766 ++++++++++++++
.../discovery/tcp/TcpClientDiscoverySpi.java | 1264 ----
.../tcp/TcpClientDiscoverySpiMBean.java | 164 -
.../spi/discovery/tcp/TcpDiscoveryImpl.java | 170 +
.../spi/discovery/tcp/TcpDiscoverySpi.java | 5799 ++++--------------
.../discovery/tcp/TcpDiscoverySpiAdapter.java | 1160 ----
.../spi/discovery/tcp/TcpDiscoverySpiMBean.java | 9 +
.../tcp/internal/TcpDiscoveryNode.java | 7 +-
.../tcp/internal/TcpDiscoveryNodesRing.java | 2 +-
.../TcpDiscoveryMulticastIpFinder.java | 10 +-
.../messages/TcpDiscoveryAbstractMessage.java | 24 +-
.../TcpDiscoveryClientHeartbeatMessage.java | 67 +
.../messages/TcpDiscoveryClientPingRequest.java | 56 +
.../TcpDiscoveryClientPingResponse.java | 67 +
.../TcpDiscoveryCustomEventMessage.java | 41 +-
.../messages/TcpDiscoveryHeartbeatMessage.java | 28 +-
.../TcpDiscoveryNodeAddFinishedMessage.java | 43 +
.../messages/TcpDiscoveryNodeAddedMessage.java | 2 +-
.../tcp/messages/TcpDiscoveryPingRequest.java | 6 +
.../tcp/messages/TcpDiscoveryPingResponse.java | 15 +-
.../affinity/IgniteClientNodeAffinityTest.java | 182 +
...cheStoreSessionListenerAbstractSelfTest.java | 315 +
...heStoreSessionListenerLifecycleSelfTest.java | 395 ++
.../CacheJdbcStoreSessionListenerSelfTest.java | 175 +
.../ignite/internal/GridAffinitySelfTest.java | 1 +
.../internal/GridDiscoveryEventSelfTest.java | 7 +-
...ridFailFastNodeFailureDetectionSelfTest.java | 7 +-
.../internal/GridProjectionAbstractTest.java | 16 +
.../GridProjectionForCachesSelfTest.java | 11 +-
.../internal/GridReleaseTypeSelfTest.java | 77 +-
.../apache/ignite/internal/GridSelfTest.java | 4 +-
.../GridDiscoveryManagerAliveCacheSelfTest.java | 62 +-
.../GridDiscoveryManagerAttributesSelfTest.java | 122 +-
.../discovery/GridDiscoveryManagerSelfTest.java | 46 +-
.../GridAffinityProcessorAbstractSelfTest.java | 1 +
.../cache/CacheRemoveAllSelfTest.java | 2 +-
.../GridCacheAbstractFailoverSelfTest.java | 2 +-
.../cache/GridCacheAbstractFullApiSelfTest.java | 3 +
.../GridCacheAbstractRemoveFailureTest.java | 23 +
.../cache/GridCacheAbstractSelfTest.java | 2 +-
.../GridCacheAtomicMessageCountSelfTest.java | 1 +
...GridCacheMixedPartitionExchangeSelfTest.java | 2 +-
.../cache/GridCachePutAllFailoverSelfTest.java | 1 +
.../GridCacheReturnValueTransferSelfTest.java | 3 +
...acheTcpClientDiscoveryMultiThreadedTest.java | 190 +
.../processors/cache/GridCacheTestEntryEx.java | 4 +
.../GridCacheVariableTopologySelfTest.java | 12 +-
.../IgniteCacheAbstractStopBusySelfTest.java | 6 +-
.../cache/IgniteCacheAbstractTest.java | 2 +-
.../IgniteCacheConfigurationTemplateTest.java | 2 +-
.../cache/IgniteCacheNearLockValueSelfTest.java | 3 +
.../IgniteCacheP2pUnmarshallingErrorTest.java | 29 +-
...gniteCacheP2pUnmarshallingNearErrorTest.java | 13 +-
.../IgniteCachePartitionMapUpdateTest.java | 226 +
.../IgniteDynamicClientCacheStartSelfTest.java | 283 +
.../cache/IgniteSystemCacheOnClientTest.java | 97 +
.../GridCacheQueueApiSelfAbstractTest.java | 4 +-
.../IgniteClientDataStructuresAbstractTest.java | 283 +
.../IgniteClientDataStructuresTest.java | 28 +
...IgniteClientDiscoveryDataStructuresTest.java | 28 +
.../GridCacheClientModesAbstractSelfTest.java | 94 +-
...ientModesTcpClientDiscoveryAbstractTest.java | 168 +
.../distributed/GridCacheMixedModeSelfTest.java | 3 +
...niteCacheClientNodeChangingTopologyTest.java | 1803 ++++++
.../IgniteCacheClientNodeConcurrentStart.java | 105 +
...teCacheClientNodePartitionsExchangeTest.java | 632 ++
.../IgniteCrossCacheTxStoreSelfTest.java | 147 +-
.../dht/GridCacheClientOnlySelfTest.java | 60 +-
.../GridCacheDhtClientRemoveFailureTest.java | 28 +
.../dht/IgniteCacheMultiTxLockSelfTest.java | 47 +-
...cClientInvalidPartitionHandlingSelfTest.java | 29 +
.../GridCacheAtomicClientRemoveFailureTest.java | 28 +
...eAtomicInvalidPartitionHandlingSelfTest.java | 23 +-
...unctionExcludeNeighborsAbstractSelfTest.java | 3 +-
.../near/GridCacheAtomicNearOnlySelfTest.java | 32 -
...idCacheNearOnlyMultiNodeFullApiSelfTest.java | 2 +
.../near/GridCacheNearOnlySelfTest.java | 63 +-
.../near/GridCacheNearOnlyTopologySelfTest.java | 1 +
...ionedClientOnlyNoPrimaryFullApiSelfTest.java | 5 +-
...idCacheRendezvousAffinityClientSelfTest.java | 4 +
.../GridCacheReplicatedClientOnlySelfTest.java | 43 -
.../GridCacheReplicatedNearOnlySelfTest.java | 43 -
.../GridCacheSyncReplicatedPreloadSelfTest.java | 1 -
...heNearOnlyLruNearEvictionPolicySelfTest.java | 25 +-
...ridCacheContinuousQueryAbstractSelfTest.java | 6 +-
.../continuous/GridEventConsumeSelfTest.java | 93 +-
.../DataStreamProcessorSelfTest.java | 1 +
.../DataStreamerMultiThreadedSelfTest.java | 2 -
.../igfs/IgfsClientCacheSelfTest.java | 3 +-
.../processors/igfs/IgfsCommonAbstractTest.java | 10 -
.../processors/igfs/IgfsOneClientNodeTest.java | 8 +-
.../service/ClosureServiceClientsNodesTest.java | 16 +-
.../service/GridServiceClientNodeTest.java | 81 +
.../loadtests/hashmap/GridCacheTestContext.java | 3 +-
.../OptimizedMarshallerNodeFailoverTest.java | 4 +-
...GridMessagingNoPeerClassLoadingSelfTest.java | 7 +-
.../ignite/messaging/GridMessagingSelfTest.java | 13 +-
.../discovery/AbstractDiscoverySelfTest.java | 8 +-
...pClientDiscoveryMarshallerCheckSelfTest.java | 76 +
.../tcp/TcpClientDiscoverySelfTest.java | 700 ---
.../tcp/TcpClientDiscoverySpiSelfTest.java | 1171 ++++
.../tcp/TcpDiscoveryConcurrentStartTest.java | 61 +-
.../tcp/TcpDiscoveryMultiThreadedTest.java | 18 +-
.../spi/discovery/tcp/TcpDiscoverySelfTest.java | 2 +-
.../ignite/testframework/GridTestUtils.java | 15 +
.../testframework/junits/GridAbstractTest.java | 52 +-
.../junits/cache/TestCacheSession.java | 18 +
.../cache/TestThreadLocalCacheSession.java | 15 +
.../junits/common/GridCommonAbstractTest.java | 83 +-
.../ignite/testsuites/IgniteBasicTestSuite.java | 2 +-
.../IgniteCacheDataStructuresSelfTestSuite.java | 3 +
.../IgniteCacheFailoverTestSuite.java | 4 +-
.../IgniteCacheNearOnlySelfTestSuite.java | 16 +-
...gniteCacheP2pUnmarshallingErrorTestSuit.java | 41 -
...niteCacheP2pUnmarshallingErrorTestSuite.java | 41 +
.../IgniteCacheTcpClientDiscoveryTestSuite.java | 47 +
.../ignite/testsuites/IgniteCacheTestSuite.java | 4 +
.../testsuites/IgniteCacheTestSuite2.java | 11 +-
.../testsuites/IgniteCacheTestSuite4.java | 5 +
.../testsuites/IgniteKernalSelfTestSuite.java | 7 +-
.../IgniteSpiDiscoverySelfTestSuite.java | 3 +-
.../igfs/IgfsNearOnlyMultiNodeSelfTest.java | 5 +-
.../CacheHibernateStoreSessionListener.java | 216 +
...heHibernateStoreSessionListenerSelfTest.java | 228 +
.../testsuites/IgniteHibernateTestSuite.java | 2 +
.../cache/IgniteCacheAbstractQuerySelfTest.java | 6 +-
...niteCacheP2pUnmarshallingQueryErrorTest.java | 3 +-
.../IgniteCacheQuerySelfTestSuite.java | 2 +-
modules/spring/pom.xml | 14 +
.../spring/CacheSpringStoreSessionListener.java | 207 +
...CacheSpringStoreSessionListenerSelfTest.java | 197 +
.../testsuites/IgniteSpringTestSuite.java | 3 +
scripts/git-format-patch.sh | 14 +-
253 files changed, 20578 insertions(+), 10728 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6a22fd27/modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6a22fd27/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6a22fd27/modules/spring/pom.xml
----------------------------------------------------------------------
[03/39] incubator-ignite git commit: #ignite-960: Add
CacheJdbcBlobStoreFactory.
Posted by se...@apache.org.
#ignite-960: Add CacheJdbcBlobStoreFactory.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/f4a122cd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/f4a122cd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/f4a122cd
Branch: refs/heads/ignite-484-1
Commit: f4a122cd420b474350c784e726282c4ffe6cc276
Parents: 83f7723
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jun 1 18:29:40 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jun 1 18:29:40 2015 +0300
----------------------------------------------------------------------
.../store/jdbc/CacheJdbcBlobStoreFactory.java | 218 +++++++++++++++++++
modules/spring/src/test/config/store-cache.xml | 61 ++++++
.../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 42 ++++
3 files changed, 321 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f4a122cd/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
new file mode 100644
index 0000000..fab5ee8
--- /dev/null
+++ b/modules/spring/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java
@@ -0,0 +1,218 @@
+/*
+ * 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.internal.util.tostring.*;
+import org.springframework.beans.factory.annotation.*;
+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 org.apache.ignite.configuration.CacheConfiguration}.
+ *
+ * <h2 class="header">Spring Example</h2>
+ * <pre name="code" class="xml">
+ * <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
+ *
+ * <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 implements Factory<CacheJdbcBlobStore> {
+ /** 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. */
+ @Autowired
+ private ApplicationContext appContext;
+
+ /** {@inheritDoc} */
+ @Override public CacheJdbcBlobStore create() {
+ CacheJdbcBlobStore 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) {
+ DataSource data = (DataSource) appContext.getBean(dataSrcBean);
+
+ store.setDataSource(data);
+ }
+
+ return store;
+ }
+
+ /**
+ * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setInitSchema(boolean)}.
+ *
+ * @param initSchema Initialized schema flag.
+ */
+ public void setInitSchema(boolean initSchema) {
+ this.initSchema = initSchema;
+ }
+
+ /**
+ * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setConnectionUrl(String)}.
+ *
+ * @param connUrl Connection URL.
+ */
+ public void setConnectionUrl(String connUrl) {
+ this.connUrl = connUrl;
+ }
+
+ /**
+ * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setCreateTableQuery(String)}.
+ *
+ * @param createTblQry Create table query.
+ */
+ public void setCreateTableQuery(String createTblQry) {
+ this.createTblQry = createTblQry;
+ }
+
+ /**
+ * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setLoadQuery(String)}.
+ *
+ * @param loadQry Load query
+ */
+ public void setLoadQuery(String loadQry) {
+ this.loadQry = loadQry;
+ }
+
+ /**
+ * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setUpdateQuery(String)}.
+ *
+ * @param updateQry Update entry query.
+ */
+ public void setUpdateQuery(String updateQry) {
+ this.updateQry = updateQry;
+ }
+
+ /**
+ * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setInsertQuery(String)}.
+ *
+ * @param insertQry Insert entry query.
+ */
+ public void setInsertQuery(String insertQry) {
+ this.insertQry = insertQry;
+ }
+
+ /**
+ * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setDeleteQuery(String)}.
+ *
+ * @param delQry Delete entry query.
+ */
+ public void setDeleteQuery(String delQry) {
+ this.delQry = delQry;
+ }
+
+ /**
+ * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setUser(String)}.
+ *
+ * @param user User name.
+ */
+ public void setUser(String user) {
+ this.user = user;
+ }
+
+ /**
+ * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setPassword(String)}.
+ *
+ * @param passwd Password.
+ */
+ public void setPassword(String passwd) {
+ this.passwd = passwd;
+ }
+
+ /**
+ * Sets name of the data source bean.
+ *
+ * See {@link org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore#setDataSource(javax.sql.DataSource)}
+ * for more information.
+ *
+ * @param dataSrcBean Data source bean name.
+ */
+ public void setDataSourceBean(String dataSrcBean) {
+ this.dataSrcBean = dataSrcBean;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f4a122cd/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
new file mode 100644
index 0000000..23cf3ea
--- /dev/null
+++ b/modules/spring/src/test/config/store-cache.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 class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
+
+ <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="name" value="test"/>
+ <property name="atomicityMode" value="ATOMIC"/>
+ <property name="backups" value="1"/>
+ <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>
+
+ <!-- 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.multicast.TcpDiscoveryMulticastIpFinder">
+ <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/f4a122cd/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
new file mode 100644
index 0000000..cadd899
--- /dev/null
+++ b/modules/spring/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcBlobStoreFactorySelfTest.java
@@ -0,0 +1,42 @@
+/*
+ * 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.testframework.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+/**
+ * Test for Cache jdbc blob store factory.
+ */
+public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
+ public void testXmlConfiguration() throws Exception {
+ try (Ignite ignite = Ignition.start("modules/spring/src/test/config/store-cache.xml")) {
+ try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache("test")) {
+ CacheJdbcBlobStore store = (CacheJdbcBlobStore)cache.getConfiguration(CacheConfiguration.class).
+ getCacheStoreFactory().create();
+
+ assertEquals("GridGain", GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "user"));
+
+ assertEquals(CacheJdbcBlobStoreFactory.class,
+ GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "dataSrc").getClass());
+ }
+ }
+ }
+}
[35/39] incubator-ignite git commit: #IGNITE-960 Added
serialVersionUID.
Posted by se...@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-484-1
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;
[12/39] incubator-ignite git commit: #ignite-960: Check that
application context in CacheJdbcBlobStoreFactory contains bean + add test for
it.
Posted by se...@apache.org.
#ignite-960: Check that application context in CacheJdbcBlobStoreFactory contains bean + add test for it.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/0f124048
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/0f124048
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/0f124048
Branch: refs/heads/ignite-484-1
Commit: 0f124048e77ddfeb1323b71c1a52251d4071d361
Parents: 5c4bb21
Author: ivasilinets <iv...@gridgain.com>
Authored: Tue Jun 2 13:27:58 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Tue Jun 2 13:27:58 2015 +0300
----------------------------------------------------------------------
.../store/jdbc/CacheJdbcBlobStoreFactory.java | 3 ++
.../src/test/config/incorrect-store-cache.xml | 57 ++++++++++++++++++++
.../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 17 ++++++
3 files changed, 77 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0f124048/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 9d572b6..df9adf8 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
@@ -117,6 +117,9 @@ public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobSt
if (appContext == null)
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 + "].");
+
DataSource data = (DataSource) appContext.getBean(dataSrcBean);
store.setDataSource(data);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0f124048/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
new file mode 100644
index 0000000..9a0b7c6
--- /dev/null
+++ b/modules/spring/src/test/config/incorrect-store-cache.xml
@@ -0,0 +1,57 @@
+<?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.CacheJdbcBlobStoreFactory">
+ <property name="user" value = "GridGain" />
+ <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.multicast.TcpDiscoveryMulticastIpFinder">
+ <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/0f124048/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 6289e34..4a693a7 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
@@ -24,6 +24,8 @@ import org.apache.ignite.testframework.junits.common.*;
import org.h2.jdbcx.*;
import sun.jdbc.odbc.ee.*;
+import java.util.concurrent.*;
+
/**
* Test for Cache jdbc blob store factory.
*/
@@ -65,6 +67,21 @@ public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
}
/**
+ * @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/incorrect-store-cache.xml")) {
+ ignite.cache(CACHE_NAME).getConfiguration(CacheConfiguration.class).
+ getCacheStoreFactory().create();
+ }
+ return null;
+ }
+ }, IgniteException.class, "Cannot find bean in application context.");
+ }
+
+ /**
* @return Cache configuration with store.
*/
private CacheConfiguration<Integer, String> cacheConfiguration() {
[27/39] 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 se...@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-484-1
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(-)
----------------------------------------------------------------------
[14/39] 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 se...@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-484-1
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
----------------------------------------------------------------------
[09/39] incubator-ignite git commit: #ignite-960: Add exception to
check SpringApplicationContextResource.
Posted by se...@apache.org.
#ignite-960: Add exception to check SpringApplicationContextResource.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c9dd8914
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c9dd8914
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c9dd8914
Branch: refs/heads/ignite-484-1
Commit: c9dd89146c2281fdb944f509874cd3faec9c6cb6
Parents: 8a9cd82
Author: ivasilinets <iv...@gridgain.com>
Authored: Tue Jun 2 12:05:17 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Tue Jun 2 12:05:17 2015 +0300
----------------------------------------------------------------------
.../ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c9dd8914/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 4b51982..743e5e8 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
@@ -31,9 +31,7 @@ import javax.sql.*;
* Use this factory to pass {@link CacheJdbcBlobStore} to {@link org.apache.ignite.configuration.CacheConfiguration}.
*
* <h2 class="header">Spring Example</h2>
- * <pre name="code" class="xml">
- * <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
- *
+ * <pre name="code" class="xml"> *
* <bean id= "simpleDataSource" class="org.h2.jdbcx.JdbcDataSource"/>
*
* <bean id="cache.jdbc.store"
[16/39] incubator-ignite git commit: ignite-745 Fixed query metrics
for partitioned cache
Posted by se...@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-484-1
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);
[31/39] incubator-ignite git commit: sp-6 - release notes
Posted by se...@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-484-1
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.
[15/39] incubator-ignite git commit: # i-960
Posted by se...@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-484-1
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);
+ }
}
[08/39] incubator-ignite git commit: #ignite-960: Add exception to
check SpringApplicationContextResource.
Posted by se...@apache.org.
#ignite-960: Add exception to check SpringApplicationContextResource.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/8a9cd822
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/8a9cd822
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/8a9cd822
Branch: refs/heads/ignite-484-1
Commit: 8a9cd822631ebf7be676b6fc076a4c1ed3874690
Parents: 50d1403
Author: ivasilinets <iv...@gridgain.com>
Authored: Tue Jun 2 12:04:06 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Tue Jun 2 12:04:06 2015 +0300
----------------------------------------------------------------------
.../ignite/cache/store/jdbc/CacheJdbcBlobStoreFactory.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8a9cd822/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 5f51c12..4b51982 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
@@ -17,6 +17,7 @@
package org.apache.ignite.cache.store.jdbc;
+import org.apache.ignite.*;
import org.apache.ignite.internal.util.tostring.*;
import org.apache.ignite.resources.*;
import org.springframework.context.*;
@@ -115,6 +116,9 @@ public class CacheJdbcBlobStoreFactory implements Factory<CacheJdbcBlobStore> {
store.setPassword(passwd);
if (dataSrcBean != null) {
+ if (appContext == null)
+ throw new IgniteException("Spring application context resource is not injected.");
+
DataSource data = (DataSource) appContext.getBean(dataSrcBean);
store.setDataSource(data);
[22/39] incubator-ignite git commit: # ignite-sprint-6 enabled test
Posted by se...@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-484-1
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();
}
}
[33/39] incubator-ignite git commit: Merge remote-tracking branch
'origin/ignite-960' into ignite-960
Posted by se...@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-484-1
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(-)
----------------------------------------------------------------------
[24/39] incubator-ignite git commit: # ignite-sprint-6 tests fixes
Posted by se...@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-484-1
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);
}
}
[10/39] incubator-ignite git commit: #ignite-960: Add tests.
Posted by se...@apache.org.
#ignite-960: Add 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/fef12fc2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fef12fc2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fef12fc2
Branch: refs/heads/ignite-484-1
Commit: fef12fc23a45d1bc4cade87460a76315c7dee6f0
Parents: c9dd891
Author: ivasilinets <iv...@gridgain.com>
Authored: Tue Jun 2 12:57:34 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Tue Jun 2 12:57:34 2015 +0300
----------------------------------------------------------------------
.../processors/cache/GridCacheProcessor.java | 3 +-
.../store/jdbc/CacheJdbcBlobStoreFactory.java | 6 +-
modules/spring/src/test/config/node.xml | 43 ++++++++++++++
modules/spring/src/test/config/store-cache1.xml | 62 ++++++++++++++++++++
.../jdbc/CacheJdbcBlobStoreFactorySelfTest.java | 51 ++++++++++++++--
5 files changed, 154 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fef12fc2/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 354172a..a220ae6 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
@@ -1052,8 +1052,7 @@ public class GridCacheProcessor extends GridProcessorAdapter {
{
assert cfg != null;
- if (cfg.getCacheStoreFactory() != null)
- ctx.resource().injectGeneric(cfg.getCacheStoreFactory());
+ prepare(cfg, cfg.getCacheStoreFactory(), false);
CacheStore cfgStore = cfg.getCacheStoreFactory() != null ? cfg.getCacheStoreFactory().create() : null;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fef12fc2/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 743e5e8..9d572b6 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
@@ -63,7 +63,7 @@ import javax.sql.*;
* <br>
* For information about Spring framework visit <a href="http://www.springframework.org/">www.springframework.org</a>
*/
-public class CacheJdbcBlobStoreFactory implements Factory<CacheJdbcBlobStore> {
+public class CacheJdbcBlobStoreFactory<K, V> implements Factory<CacheJdbcBlobStore<K, V>> {
/** Connection URL. */
private String connUrl = CacheJdbcBlobStore.DFLT_CONN_URL;
@@ -100,8 +100,8 @@ public class CacheJdbcBlobStoreFactory implements Factory<CacheJdbcBlobStore> {
private ApplicationContext appContext;
/** {@inheritDoc} */
- @Override public CacheJdbcBlobStore create() {
- CacheJdbcBlobStore store = new CacheJdbcBlobStore();
+ @Override public CacheJdbcBlobStore<K, V> create() {
+ CacheJdbcBlobStore<K, V> store = new CacheJdbcBlobStore();
store.setInitSchema(initSchema);
store.setConnectionUrl(connUrl);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fef12fc2/modules/spring/src/test/config/node.xml
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/config/node.xml b/modules/spring/src/test/config/node.xml
new file mode 100644
index 0000000..36d64cb
--- /dev/null
+++ b/modules/spring/src/test/config/node.xml
@@ -0,0 +1,43 @@
+<?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="simpleDataSource" class="org.h2.jdbcx.JdbcDataSource"/>
+
+ <bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
+ <!-- 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.multicast.TcpDiscoveryMulticastIpFinder">
+ <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/fef12fc2/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
new file mode 100644
index 0000000..9209e52
--- /dev/null
+++ b/modules/spring/src/test/config/store-cache1.xml
@@ -0,0 +1,62 @@
+<?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="simpleDataSource1" class="sun.jdbc.odbc.ee.ConnectionPoolDataSource"/>
+
+ <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.jdbc.CacheJdbcBlobStoreFactory">
+ <property name="user" value = "GridGain" />
+ <property name="dataSourceBean" value = "simpleDataSource1"/>
+ </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.multicast.TcpDiscoveryMulticastIpFinder">
+ <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/fef12fc2/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 bdfdcb9..eebd48d 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,22 +22,61 @@ 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.*;
/**
* Test for Cache jdbc blob store factory.
*/
public class CacheJdbcBlobStoreFactorySelfTest extends GridCommonAbstractTest {
+ /** Cache name. */
+ private static final String CACHE_NAME = "test";
+
+ /**
+ * @throws Exception If failed.
+ */
public void testXmlConfiguration() throws Exception {
try (Ignite ignite = Ignition.start("modules/spring/src/test/config/store-cache.xml")) {
- IgniteCache<Integer, String> cache = ignite.cache("test");
+ 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);
+ }
+ }
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ public void testCacheConfiguration() throws Exception {
+ try (Ignite ignite = Ignition.start("modules/spring/src/test/config/node.xml")) {
+ CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>();
+
+ CacheJdbcBlobStoreFactory<Integer, String> factory = new CacheJdbcBlobStoreFactory();
- CacheJdbcBlobStore store = (CacheJdbcBlobStore) cache.getConfiguration(CacheConfiguration.class).
- getCacheStoreFactory().create();
+ factory.setUser("GridGain");
- assertEquals("GridGain", GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "user"));
+ factory.setDataSourceBean("simpleDataSource");
- assertEquals(JdbcDataSource.class,
- GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "dataSrc").getClass());
+ cfg.setCacheStoreFactory(factory);
+
+ try(IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cfg)) {
+ checkStore(cache, JdbcDataSource.class);
+ }
}
}
+
+ /**
+ * @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 {
+ CacheJdbcBlobStore store = (CacheJdbcBlobStore) cache.getConfiguration(CacheConfiguration.class).
+ getCacheStoreFactory().create();
+
+ assertEquals("GridGain", GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "user"));
+
+ assertEquals(dataSrcClass,
+ GridTestUtils.getFieldValue(store, CacheJdbcBlobStore.class, "dataSrc").getClass());
+ }
}
[18/39] incubator-ignite git commit: # ignite-sprint-6 moved tests to
separate suite
Posted by se...@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-484-1
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;
+ }
+}
[25/39] incubator-ignite git commit: Minor correction to interop
start procedure: add optional pointer to additional data required for startup
Posted by se...@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-484-1
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);
[17/39] incubator-ignite git commit: # ignite-883 client reconnect
issues
Posted by se...@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-484-1
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);