ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [21/50] incubator-ignite git commit: # i-960
Date Wed, 17 Jun 2015 10:43:34 GMT
# 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-gg-10052
Commit: b037baff59770d94a15d246b42fc0c881633db73
Parents: 55764e8
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Tue Jun 16 12:34:31 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@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);
+    }
 }


Mime
View raw message