ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [20/21] ignite git commit: IGNITE-1753 Configuration merged into factory.
Date Tue, 10 Nov 2015 04:27:46 GMT
IGNITE-1753 Configuration merged into factory.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/31657d34
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/31657d34
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/31657d34

Branch: refs/heads/ignite-1753-1282
Commit: 31657d348fc2a0e61ae51cb84968363a0bff287b
Parents: c176f07
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Tue Nov 10 11:23:02 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Tue Nov 10 11:23:02 2015 +0700

----------------------------------------------------------------------
 .../store/jdbc/CacheAbstractJdbcStore.java      |   6 +-
 .../jdbc/CacheJdbcPojoStoreConfiguration.java   | 255 ----------------
 .../store/jdbc/CacheJdbcPojoStoreFactory.java   | 291 ++++++++++++++-----
 .../CacheJdbcPojoStoreAbstractSelfTest.java     |  16 +-
 .../store/jdbc/CacheJdbcPojoStoreTest.java      |   7 +-
 5 files changed, 221 insertions(+), 354 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/31657d34/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
index e9c2b9e..c28a5cd 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
@@ -77,9 +77,9 @@ import org.jetbrains.annotations.Nullable;
 import static java.sql.Statement.EXECUTE_FAILED;
 import static java.sql.Statement.SUCCESS_NO_INFO;
 
-import static org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreConfiguration.DFLT_BATCH_SIZE;
-import static org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreConfiguration.DFLT_WRITE_ATTEMPTS;
-import static org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreConfiguration.DFLT_PARALLEL_LOAD_CACHE_MINIMUM_THRESHOLD;
+import static org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory.DFLT_BATCH_SIZE;
+import static org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory.DFLT_WRITE_ATTEMPTS;
+import static org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory.DFLT_PARALLEL_LOAD_CACHE_MINIMUM_THRESHOLD;
 
 /**
  * Implementation of {@link CacheStore} backed by JDBC.

http://git-wip-us.apache.org/repos/asf/ignite/blob/31657d34/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreConfiguration.java
deleted file mode 100644
index 2224904..0000000
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreConfiguration.java
+++ /dev/null
@@ -1,255 +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 java.io.Serializable;
-
-import org.apache.ignite.cache.store.jdbc.dialect.JdbcDialect;
-
-/**
- * JDBC POJO store configuration.
- */
-public class CacheJdbcPojoStoreConfiguration implements Serializable {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** Default value for write attempts. */
-    public static final int DFLT_WRITE_ATTEMPTS = 2;
-
-    /** Default batch size for put and remove operations. */
-    public static final int DFLT_BATCH_SIZE = 512;
-
-    /** Default batch size for put and remove operations. */
-    public static final int DFLT_PARALLEL_LOAD_CACHE_MINIMUM_THRESHOLD = 512;
-
-    /** Maximum batch size for writeAll and deleteAll operations. */
-    private int batchSz = DFLT_BATCH_SIZE;
-
-    /** Name of data source bean. */
-    private String dataSrcBean;
-
-    /** Database dialect. */
-    private JdbcDialect dialect;
-
-    /** Max workers thread count. These threads are responsible for load cache. */
-    private int maxPoolSz = Runtime.getRuntime().availableProcessors();
-
-    /** Maximum write attempts in case of database error. */
-    private int maxWrtAttempts = DFLT_WRITE_ATTEMPTS;
-
-    /** Parallel load cache minimum threshold. If {@code 0} then load sequentially. */
-    private int parallelLoadCacheMinThreshold = DFLT_PARALLEL_LOAD_CACHE_MINIMUM_THRESHOLD;
-
-    /** Hash calculator.  */
-    private JdbcTypeHasher hasher = JdbcTypeDefaultHasher.INSTANCE;
-
-    /** Types that store could process. */
-    private JdbcType[] types;
-
-    /**
-     * Empty constructor (all values are initialized to their defaults).
-     */
-    public CacheJdbcPojoStoreConfiguration() {
-        /* No-op. */
-    }
-
-    /**
-     * Copy constructor.
-     *
-     * @param cfg Configuration to copy.
-     */
-    public CacheJdbcPojoStoreConfiguration(CacheJdbcPojoStoreConfiguration cfg) {
-        // Order alphabetically for maintenance purposes.
-        batchSz = cfg.getBatchSize();
-        dataSrcBean = cfg.getDataSourceBean();
-        dialect = cfg.getDialect();
-        maxPoolSz = cfg.getMaximumPoolSize();
-        maxWrtAttempts = cfg.getMaximumWriteAttempts();
-        parallelLoadCacheMinThreshold = cfg.getParallelLoadCacheMinimumThreshold();
-        types = cfg.getTypes();
-        hasher = cfg.getHasher();
-    }
-
-    /**
-     * Get maximum batch size for delete and delete operations.
-     *
-     * @return Maximum batch size.
-     */
-    public int getBatchSize() {
-        return batchSz;
-    }
-
-    /**
-     * Set maximum batch size for write and delete operations.
-     *
-     * @param batchSz Maximum batch size.
-     * @return {@code This} for chaining.
-     */
-    public CacheJdbcPojoStoreConfiguration setBatchSize(int batchSz) {
-        this.batchSz = batchSz;
-
-        return this;
-    }
-
-    /**
-     * Gets name of the data source bean.
-     *
-     * @return Data source bean name.
-     */
-    public String getDataSourceBean() {
-        return dataSrcBean;
-    }
-
-    /**
-     * Sets name of the data source bean.
-     *
-     * @param dataSrcBean Data source bean name.
-     * @return {@code This} for chaining.
-     */
-    public CacheJdbcPojoStoreConfiguration setDataSourceBean(String dataSrcBean) {
-        this.dataSrcBean = dataSrcBean;
-
-        return this;
-    }
-
-    /**
-     * Get database dialect.
-     *
-     * @return Database dialect.
-     */
-    public JdbcDialect getDialect() {
-        return dialect;
-    }
-
-    /**
-     * Set database dialect.
-     *
-     * @param dialect Database dialect.
-     * @return {@code This} for chaining.
-     */
-    public CacheJdbcPojoStoreConfiguration setDialect(JdbcDialect dialect) {
-        this.dialect = dialect;
-
-        return this;
-    }
-
-    /**
-     * Get maximum workers thread count. These threads are responsible for queries execution.
-     *
-     * @return Maximum workers thread count.
-     */
-    public int getMaximumPoolSize() {
-        return maxPoolSz;
-    }
-
-    /**
-     * Set Maximum workers thread count. These threads are responsible for queries execution.
-     *
-     * @param maxPoolSz Max workers thread count.
-     * @return {@code This} for chaining.
-     */
-    public CacheJdbcPojoStoreConfiguration setMaximumPoolSize(int maxPoolSz) {
-        this.maxPoolSz = maxPoolSz;
-
-        return this;
-    }
-
-    /**
-     * Gets maximum number of write attempts in case of database error.
-     *
-     * @return Maximum number of write attempts.
-     */
-    public int getMaximumWriteAttempts() {
-        return maxWrtAttempts;
-    }
-
-    /**
-     * Sets maximum number of write attempts in case of database error.
-     *
-     * @param maxWrtAttempts Number of write attempts.
-     * @return {@code This} for chaining.
-     */
-    public CacheJdbcPojoStoreConfiguration setMaximumWriteAttempts(int maxWrtAttempts) {
-        this.maxWrtAttempts = maxWrtAttempts;
-
-        return this;
-    }
-
-    /**
-     * Parallel load cache minimum row count threshold.
-     *
-     * @return If {@code 0} then load sequentially.
-     */
-    public int getParallelLoadCacheMinimumThreshold() {
-        return parallelLoadCacheMinThreshold;
-    }
-
-    /**
-     * Parallel load cache minimum row count threshold.
-     *
-     * @param parallelLoadCacheMinThreshold Minimum row count threshold. If {@code 0} then
load sequentially.
-     * @return {@code This} for chaining.
-     */
-    public CacheJdbcPojoStoreConfiguration setParallelLoadCacheMinimumThreshold(int parallelLoadCacheMinThreshold)
{
-        this.parallelLoadCacheMinThreshold = parallelLoadCacheMinThreshold;
-
-        return this;
-    }
-
-    /**
-     * Gets types known by store.
-     *
-     * @return Types known by store.
-     */
-    public JdbcType[] getTypes() {
-        return types;
-    }
-
-    /**
-     * Sets store configurations.
-     *
-     * @param types Store should process.
-     * @return {@code This} for chaining.
-     */
-    public CacheJdbcPojoStoreConfiguration setTypes(JdbcType... types) {
-        this.types = types;
-
-        return this;
-    }
-
-    /**
-     * Gets hash code calculator.
-     *
-     * @return Hash code calculator.
-     */
-    public JdbcTypeHasher getHasher() {
-        return hasher;
-    }
-
-    /**
-     * Sets hash code calculator.
-     *
-     * @param hasher Hash code calculator.
-     * @return {@code This} for chaining.
-     */
-    public CacheJdbcPojoStoreConfiguration setHasher(JdbcTypeHasher hasher) {
-        this.hasher = hasher;
-
-        return this;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/31657d34/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 2fa3b8d..151d4c1 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
@@ -45,45 +45,42 @@ import org.apache.ignite.resources.SpringApplicationContextResource;
  *                      ...
  *                      &lt;property name="cacheStoreFactory"&gt;
  *                          &lt;bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory"&gt;
- *                              &lt;property name="configuration" &gt;
- *                                  &lt;bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcStoreFactory"&gt;
- *                                      &lt;property name="dataSourceBean" value="myDataSource"
- *                                      &lt;property name="types"&gt;
- *                                          &lt;list&gt;
- *                                              &lt;bean class="org.apache.ignite.cache.store.jdbc.JdbcType"&gt;
- *                                                  &lt;property name="cacheName" value="myCache"
/&gt;
- *                                                  &lt;property name="databaseSchema"
value="MY_DB_SCHEMA" /&gt;
- *                                                  &lt;property name="databaseTable"
value="PERSON" /&gt;
- *                                                  &lt;property name="keyType" value="java.lang.Integer"
/&gt;
- *                                                  &lt;property name="keyFields"&gt;
- *                                                      &lt;list&gt;
- *                                                          &lt;bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField"&gt;
- *                                                              &lt;property name="databaseFieldType"
&gt;
- *                                                                  &lt;util:constant
static-field="java.sql.Types.INTEGER"/&gt;
- *                                                              &lt;/property&gt;
- *                                                              &lt;property name="databaseFieldName"
value="ID" /&gt;
- *                                                              &lt;property name="javaFieldType"
value="java.lang.Integer" /&gt;
- *                                                              &lt;property name="javaFieldName"
value="id" /&gt;
- *                                                          &lt;/bean&gt;
- *                                                      &lt;/list&gt;
- *                                                  &lt;/property&gt;
- *                                                  &lt;property name="valueType" value="my.company.Person"
/&gt;
- *                                                  &lt;property name="valueFields"&gt;
- *                                                      &lt;list&gt;
- *                                                          &lt;bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField"&gt;
- *                                                              &lt;property name="databaseFieldType"
&gt;
- *                                                                  &lt;util:constant
static-field="java.sql.Types.VARCHAR"/&gt;
- *                                                              &lt;/property&gt;
- *                                                              &lt;property name="databaseFieldName"
value="NAME" /&gt;
- *                                                              &lt;property name="javaFieldType"
value="java.lang.String" /&gt;
- *                                                              &lt;property name="javaFieldName"
value="name" /&gt;
- *                                                          &lt;/bean&gt;
- *                                                      &lt;/list&gt;
- *                                                  &lt;/property&gt;
- *                                              &lt;/bean&gt;
- *                                          &lt;/list&gt;
- *                                      &lt;/property&gt;
- *                                  &lt;/bean&gt;
+ *                              &lt;property name="dataSourceBean" value="myDataSource"
/&gt;
+ *                              &lt;property name="types"&gt;
+ *                                  &lt;list&gt;
+ *                                      &lt;bean class="org.apache.ignite.cache.store.jdbc.JdbcType"&gt;
+ *                                          &lt;property name="cacheName" value="myCache"
/&gt;
+ *                                          &lt;property name="databaseSchema" value="MY_DB_SCHEMA"
/&gt;
+ *                                          &lt;property name="databaseTable" value="PERSON"
/&gt;
+ *                                          &lt;property name="keyType" value="java.lang.Integer"
/&gt;
+ *                                          &lt;property name="keyFields"&gt;
+ *                                              &lt;list&gt;
+ *                                                  &lt;bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField"&gt;
+ *                                                      &lt;property name="databaseFieldType"
&gt;
+ *                                                          &lt;util:constant static-field="java.sql.Types.INTEGER"/&gt;
+ *                                                      &lt;/property&gt;
+ *                                                      &lt;property name="databaseFieldName"
value="ID" /&gt;
+ *                                                      &lt;property name="javaFieldType"
value="java.lang.Integer" /&gt;
+ *                                                      &lt;property name="javaFieldName"
value="id" /&gt;
+ *                                                  &lt;/bean&gt;
+ *                                              &lt;/list&gt;
+ *                                          &lt;/property&gt;
+ *                                          &lt;property name="valueType" value="my.company.Person"
/&gt;
+ *                                          &lt;property name="valueFields"&gt;
+ *                                              &lt;list&gt;
+ *                                                  &lt;bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField"&gt;
+ *                                                      &lt;property name="databaseFieldType"
&gt;
+ *                                                          &lt;util:constant static-field="java.sql.Types.VARCHAR"/&gt;
+ *                                                      &lt;/property&gt;
+ *                                                      &lt;property name="databaseFieldName"
value="NAME" /&gt;
+ *                                                      &lt;property name="javaFieldType"
value="java.lang.String" /&gt;
+ *                                                      &lt;property name="javaFieldName"
value="name" /&gt;
+ *                                                  &lt;/bean&gt;
+ *                                              &lt;/list&gt;
+ *                                          &lt;/property&gt;
+ *                                      &lt;/bean&gt;
+ *                                  &lt;/list&gt;
+ *                              &lt;/property&gt;
  *                          &lt;/bean&gt;
  *                      &lt;/property&gt;
  *                  &lt;/bean&gt;
@@ -100,17 +97,39 @@ public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheAbstractJdb
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** POJO store configuration. */
-    private CacheJdbcPojoStoreConfiguration cfg;
+    /** Default value for write attempts. */
+    public static final int DFLT_WRITE_ATTEMPTS = 2;
+
+    /** Default batch size for put and remove operations. */
+    public static final int DFLT_BATCH_SIZE = 512;
+
+    /** Default batch size for put and remove operations. */
+    public static final int DFLT_PARALLEL_LOAD_CACHE_MINIMUM_THRESHOLD = 512;
+
+    /** Maximum batch size for writeAll and deleteAll operations. */
+    private int batchSz = DFLT_BATCH_SIZE;
 
     /** Name of data source bean. */
-    @Deprecated
     private String dataSrcBean;
 
     /** Database dialect. */
-    @Deprecated
     private JdbcDialect dialect;
 
+    /** Max workers thread count. These threads are responsible for load cache. */
+    private int maxPoolSz = Runtime.getRuntime().availableProcessors();
+
+    /** Maximum write attempts in case of database error. */
+    private int maxWrtAttempts = DFLT_WRITE_ATTEMPTS;
+
+    /** Parallel load cache minimum threshold. If {@code 0} then load sequentially. */
+    private int parallelLoadCacheMinThreshold = DFLT_PARALLEL_LOAD_CACHE_MINIMUM_THRESHOLD;
+
+    /** Hash calculator.  */
+    private JdbcTypeHasher hasher = JdbcTypeDefaultHasher.INSTANCE;
+
+    /** Types that store could process. */
+    private JdbcType[] types;
+
     /** Data source. */
     private transient DataSource dataSrc;
 
@@ -122,27 +141,17 @@ public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheAbstractJdb
     @Override public CacheJdbcPojoStore<K, V> create() {
         CacheJdbcPojoStore<K, V> store = new CacheJdbcPojoStore<>();
 
-        // For backward compatibility create and initialize store configuration.
-        if (cfg == null) {
-            cfg = new CacheJdbcPojoStoreConfiguration();
-
-            cfg.setDataSourceBean(dataSrcBean);
-            cfg.setDialect(dialect);
-        }
-
-        store.setBatchSize(cfg.getBatchSize());
-        store.setDialect(cfg.getDialect());
-        store.setMaximumPoolSize(cfg.getMaximumPoolSize());
-        store.setMaximumWriteAttempts(cfg.getMaximumWriteAttempts());
-        store.setParallelLoadCacheMinimumThreshold(cfg.getParallelLoadCacheMinimumThreshold());
-        store.setTypes(cfg.getTypes());
+        store.setBatchSize(batchSz);
+        store.setDialect(dialect);
+        store.setMaximumPoolSize(maxPoolSz);
+        store.setMaximumWriteAttempts(maxWrtAttempts);
+        store.setParallelLoadCacheMinimumThreshold(parallelLoadCacheMinThreshold);
+        store.setTypes(types);
 
         if (dataSrc != null)
             store.setDataSource(dataSrc);
         else {
-            String dtSrcBean = cfg.getDataSourceBean();
-
-            if (dtSrcBean != null) {
+            if (dataSrcBean != null) {
                 if (appCtx == null)
                     throw new IgniteException("Spring application context resource is not
injected.");
 
@@ -151,12 +160,12 @@ public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheAbstractJdb
                 try {
                     spring = IgniteComponentType.SPRING.create(false);
 
-                    DataSource data = spring.loadBeanFromAppContext(appCtx, dtSrcBean);
+                    DataSource data = spring.loadBeanFromAppContext(appCtx, dataSrcBean);
 
                     store.setDataSource(data);
                 }
                 catch (Exception e) {
-                    throw new IgniteException("Failed to load bean in application context
[beanName=" + dtSrcBean +
+                    throw new IgniteException("Failed to load bean in application context
[beanName=" + dataSrcBean +
                         ", igniteConfig=" + appCtx + ']', e);
                 }
             }
@@ -166,54 +175,182 @@ public class CacheJdbcPojoStoreFactory<K, V> implements Factory<CacheAbstractJdb
     }
 
     /**
-     * Sets store configuration.
+     * 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;
+    }
+
+    /**
+     * Get maximum batch size for delete and delete operations.
+     *
+     * @return Maximum batch size.
+     */
+    public int getBatchSize() {
+        return batchSz;
+    }
+
+    /**
+     * Set maximum batch size for write and delete operations.
      *
-     * @param cfg Configuration to use.
+     * @param batchSz Maximum batch size.
      * @return {@code This} for chaining.
      */
-    public CacheJdbcPojoStoreFactory<K, V> setConfiguration(CacheJdbcPojoStoreConfiguration
cfg) {
-        this.cfg = cfg;
+    public CacheJdbcPojoStoreFactory setBatchSize(int batchSz) {
+        this.batchSz = batchSz;
 
         return this;
     }
 
     /**
+     * Gets name of the data source bean.
+     *
+     * @return Data source bean name.
+     */
+    public String getDataSourceBean() {
+        return dataSrcBean;
+    }
+
+    /**
      * Sets name of the data source bean.
      *
      * @param dataSrcBean Data source bean name.
      * @return {@code This} for chaining.
-     * @see CacheJdbcPojoStore#setDataSource(DataSource)
      */
-    @Deprecated
-    public CacheJdbcPojoStoreFactory<K, V> setDataSourceBean(String dataSrcBean) {
+    public CacheJdbcPojoStoreFactory setDataSourceBean(String dataSrcBean) {
         this.dataSrcBean = dataSrcBean;
 
         return this;
     }
 
     /**
+     * Get database dialect.
+     *
+     * @return Database dialect.
+     */
+    public JdbcDialect getDialect() {
+        return dialect;
+    }
+
+    /**
      * Set database dialect.
      *
      * @param dialect Database dialect.
      * @return {@code This} for chaining.
-     * @see CacheJdbcPojoStore#setDialect(JdbcDialect)
      */
-    @Deprecated
-    public CacheJdbcPojoStoreFactory<K, V> setDialect(JdbcDialect dialect) {
+    public CacheJdbcPojoStoreFactory setDialect(JdbcDialect dialect) {
         this.dialect = dialect;
 
         return this;
     }
 
     /**
-     * Sets data source. Data source should be fully configured and ready-to-use.
+     * Get maximum workers thread count. These threads are responsible for queries execution.
      *
-     * @param dataSrc Data source.
+     * @return Maximum workers thread count.
+     */
+    public int getMaximumPoolSize() {
+        return maxPoolSz;
+    }
+
+    /**
+     * Set Maximum workers thread count. These threads are responsible for queries execution.
+     *
+     * @param maxPoolSz Max workers thread count.
      * @return {@code This} for chaining.
-     * @see CacheJdbcPojoStore#setDataSource(DataSource)
      */
-    public CacheJdbcPojoStoreFactory<K, V> setDataSource(DataSource dataSrc) {
-        this.dataSrc = dataSrc;
+    public CacheJdbcPojoStoreFactory setMaximumPoolSize(int maxPoolSz) {
+        this.maxPoolSz = maxPoolSz;
+
+        return this;
+    }
+
+    /**
+     * Gets maximum number of write attempts in case of database error.
+     *
+     * @return Maximum number of write attempts.
+     */
+    public int getMaximumWriteAttempts() {
+        return maxWrtAttempts;
+    }
+
+    /**
+     * Sets maximum number of write attempts in case of database error.
+     *
+     * @param maxWrtAttempts Number of write attempts.
+     * @return {@code This} for chaining.
+     */
+    public CacheJdbcPojoStoreFactory setMaximumWriteAttempts(int maxWrtAttempts) {
+        this.maxWrtAttempts = maxWrtAttempts;
+
+        return this;
+    }
+
+    /**
+     * Parallel load cache minimum row count threshold.
+     *
+     * @return If {@code 0} then load sequentially.
+     */
+    public int getParallelLoadCacheMinimumThreshold() {
+        return parallelLoadCacheMinThreshold;
+    }
+
+    /**
+     * Parallel load cache minimum row count threshold.
+     *
+     * @param parallelLoadCacheMinThreshold Minimum row count threshold. If {@code 0} then
load sequentially.
+     * @return {@code This} for chaining.
+     */
+    public CacheJdbcPojoStoreFactory setParallelLoadCacheMinimumThreshold(int parallelLoadCacheMinThreshold)
{
+        this.parallelLoadCacheMinThreshold = parallelLoadCacheMinThreshold;
+
+        return this;
+    }
+
+    /**
+     * Gets types known by store.
+     *
+     * @return Types known by store.
+     */
+    public JdbcType[] getTypes() {
+        return types;
+    }
+
+    /**
+     * Sets store configurations.
+     *
+     * @param types Store should process.
+     * @return {@code This} for chaining.
+     */
+    public CacheJdbcPojoStoreFactory setTypes(JdbcType... types) {
+        this.types = types;
+
+        return this;
+    }
+
+    /**
+     * Gets hash code calculator.
+     *
+     * @return Hash code calculator.
+     */
+    public JdbcTypeHasher getHasher() {
+        return hasher;
+    }
+
+    /**
+     * Sets hash code calculator.
+     *
+     * @param hasher Hash code calculator.
+     * @return {@code This} for chaining.
+     */
+    public CacheJdbcPojoStoreFactory setHasher(JdbcTypeHasher hasher) {
+        this.hasher = hasher;
 
         return this;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/31657d34/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreAbstractSelfTest.java
index 7e6a823..f6b8294 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreAbstractSelfTest.java
@@ -124,19 +124,6 @@ public abstract class CacheJdbcPojoStoreAbstractSelfTest extends GridCommonAbstr
     protected abstract Marshaller marshaller();
 
     /**
-     * @return Store configuration.
-     */
-    protected CacheJdbcPojoStoreConfiguration storeConfiguration() {
-        CacheJdbcPojoStoreConfiguration storeCfg = new CacheJdbcPojoStoreConfiguration();
-
-        storeCfg.setDialect(new H2Dialect());
-
-        storeCfg.setTypes(storeTypes());
-
-        return storeCfg;
-    }
-
-    /**
      * @return Types to be used in test.
      */
     protected JdbcType[] storeTypes() {
@@ -196,7 +183,8 @@ public abstract class CacheJdbcPojoStoreAbstractSelfTest extends GridCommonAbstr
         cc.setWriteBehindEnabled(false);
 
         CacheJdbcPojoStoreFactory<Object, Object> storeFactory = new CacheJdbcPojoStoreFactory<>();
-        storeFactory.setConfiguration(storeConfiguration());
+        storeFactory.setDialect(new H2Dialect());
+        storeFactory.setTypes(storeTypes());
         storeFactory.setDataSource(JdbcConnectionPool.create(DFLT_CONN_URL, "sa", "")); //
H2 DataSource
 
         cc.setCacheStoreFactory(storeFactory);

http://git-wip-us.apache.org/repos/asf/ignite/blob/31657d34/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
index cda13e6..d8f75d3 100644
--- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoStoreTest.java
@@ -67,9 +67,6 @@ public class CacheJdbcPojoStoreTest extends GridAbstractCacheStoreSelfTest<Cache
     @Override protected CacheJdbcPojoStore<Object, Object> store() {
         CacheJdbcPojoStoreFactory<Object, Object> storeFactory = new CacheJdbcPojoStoreFactory<>();
 
-        CacheJdbcPojoStoreConfiguration storeCfg = new CacheJdbcPojoStoreConfiguration();
-        storeCfg.setDialect(new H2Dialect());
-
         JdbcType[] storeTypes = new JdbcType[6];
 
         storeTypes[0] = new JdbcType();
@@ -139,9 +136,9 @@ public class CacheJdbcPojoStoreTest extends GridAbstractCacheStoreSelfTest<Cache
         storeTypes[5].setValueType("java.util.UUID");
         storeTypes[5].setValueFields(new JdbcTypeField(Types.BINARY, "VAL", UUID.class, null));
 
-        storeCfg.setTypes(storeTypes);
+        storeFactory.setTypes(storeTypes);
 
-        storeFactory.setConfiguration(storeCfg);
+        storeFactory.setDialect(new H2Dialect());
 
         CacheJdbcPojoStore<Object, Object> store = storeFactory.create();
 


Mime
View raw message