You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/06/16 18:18:25 UTC
[01/25] incubator-ignite git commit: #ignite-960: Small fix in
javadoc.
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-sprint-6 53f4cb75a -> d1a21501b
#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-sprint-6
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.
*/
[24/25] incubator-ignite git commit: #IGNITE-960 Added
serialVersionUID.
Posted by sb...@apache.org.
#IGNITE-960 Added serialVersionUID.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/37d4710c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/37d4710c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/37d4710c
Branch: refs/heads/ignite-sprint-6
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;
[20/25] incubator-ignite git commit: # i-960
Posted by sb...@apache.org.
# i-960
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4025ce3c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4025ce3c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4025ce3c
Branch: refs/heads/ignite-sprint-6
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> {
/**
[21/25] incubator-ignite git commit: #IGNITE-960 Added tests.
Posted by sb...@apache.org.
#IGNITE-960 Added tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d530c8c6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d530c8c6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d530c8c6
Branch: refs/heads/ignite-sprint-6
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;
+ }
+ }
}
[15/25] incubator-ignite git commit: # i-960
Posted by sb...@apache.org.
# i-960
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/b037baff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/b037baff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/b037baff
Branch: refs/heads/ignite-sprint-6
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);
+ }
}
[09/25] incubator-ignite git commit: #ignite-960: Add exception to
check SpringApplicationContextResource.
Posted by sb...@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-sprint-6
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"
[07/25] incubator-ignite git commit: #ignite-960: Use
@SpringApplicationContextResource annotation.
Posted by sb...@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-sprint-6
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());
}
}
}
[12/25] incubator-ignite git commit: #ignite-960: Check that
application context in CacheJdbcBlobStoreFactory contains bean + add test for
it.
Posted by sb...@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-sprint-6
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() {
[22/25] incubator-ignite git commit: Merge remote-tracking branch
'origin/ignite-960' into ignite-960
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-960' into ignite-960
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/83abea4a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/83abea4a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/83abea4a
Branch: refs/heads/ignite-sprint-6
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(-)
----------------------------------------------------------------------
[25/25] incubator-ignite git commit: Merge branch 'ignite-960' into
ignite-sprint-6
Posted by sb...@apache.org.
Merge branch 'ignite-960' into ignite-sprint-6
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/d1a21501
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/d1a21501
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/d1a21501
Branch: refs/heads/ignite-sprint-6
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(-)
----------------------------------------------------------------------
[06/25] incubator-ignite git commit: #ignite-960: Add dependency for
test.
Posted by sb...@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-sprint-6
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());
}
}
[17/25] incubator-ignite git commit: Merge branches 'ignite-960' and
'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite
into ignite-960
Posted by sb...@apache.org.
Merge branches 'ignite-960' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-960
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ca89d81c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ca89d81c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ca89d81c
Branch: refs/heads/ignite-sprint-6
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(-)
----------------------------------------------------------------------
[04/25] incubator-ignite git commit: #ignite-960: Small fix in javadoc
Posted by sb...@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-sprint-6
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());
}
[23/25] incubator-ignite git commit: #IGNITE-960 Added tests.
Posted by sb...@apache.org.
#IGNITE-960 Added tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/ec0ee2e6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/ec0ee2e6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/ec0ee2e6
Branch: refs/heads/ignite-sprint-6
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
[14/25] incubator-ignite git commit: Merge branches 'ignite-960' and
'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite
into ignite-960
Posted by sb...@apache.org.
Merge branches 'ignite-960' and 'ignite-sprint-6' of https://git-wip-us.apache.org/repos/asf/incubator-ignite into ignite-960
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/55764e82
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/55764e82
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/55764e82
Branch: refs/heads/ignite-sprint-6
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
----------------------------------------------------------------------
[13/25] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-sprint-5' into ignite-960
Posted by sb...@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-sprint-6
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
----------------------------------------------------------------------
[11/25] incubator-ignite git commit: #ignite-960: Change
CacheJdbcBlobStoreFactorySelfTest:testCacheConfiguration. Start several nodes
with different configuration + use TcpDiscoveryVmIpFinder.
Posted by sb...@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-sprint-6
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());
[16/25] incubator-ignite git commit: #IGNITE-960 Fixed review notes.
Added tests. Added check that CacheConfiguration is serializable.
Posted by sb...@apache.org.
#IGNITE-960 Fixed review notes. Added tests. Added check that CacheConfiguration is serializable.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a7ca45bb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a7ca45bb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a7ca45bb
Branch: refs/heads/ignite-sprint-6
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;
}
}
[10/25] incubator-ignite git commit: #ignite-960: Add tests.
Posted by sb...@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-sprint-6
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());
+ }
}
[05/25] incubator-ignite git commit: #ignite-960: Small fix in javadoc
Posted by sb...@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-sprint-6
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">
[03/25] incubator-ignite git commit: #ignite-960: Add
CacheJdbcBlobStoreFactory.
Posted by sb...@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-sprint-6
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());
+ }
+ }
+ }
+}
[18/25] incubator-ignite git commit: #IGNITE-960 Fixed test.
Posted by sb...@apache.org.
#IGNITE-960 Fixed test.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/dd8048bd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/dd8048bd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/dd8048bd
Branch: refs/heads/ignite-sprint-6
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);
}
}
}
[02/25] incubator-ignite git commit: #ignite-960: Small fix in
javadoc.
Posted by sb...@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-sprint-6
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) {
[19/25] incubator-ignite git commit: Merge remote-tracking branch
'origin/ignite-960' into ignite-960
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-960' into ignite-960
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c909caee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c909caee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c909caee
Branch: refs/heads/ignite-sprint-6
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(-)
----------------------------------------------------------------------
[08/25] incubator-ignite git commit: #ignite-960: Add exception to
check SpringApplicationContextResource.
Posted by sb...@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-sprint-6
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);