ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [19/50] incubator-ignite git commit: # ignite-330 Fixed examples.
Date Mon, 23 Mar 2015 11:23:24 GMT
# ignite-330 Fixed examples.


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

Branch: refs/heads/ignite-497-stick
Commit: 6aa1a016668350dc336abcc53e10319c9e1a64bc
Parents: f839894
Author: anovikov <anovikov@gridgain.com>
Authored: Mon Mar 23 12:27:07 2015 +0700
Committer: anovikov <anovikov@gridgain.com>
Committed: Mon Mar 23 12:27:07 2015 +0700

----------------------------------------------------------------------
 .../datagrid/store/auto/CacheAutoStoreExample.java       |  7 ++++---
 .../store/auto/CacheAutoStoreLoadDataExample.java        | 11 ++++++-----
 .../ignite/examples/datagrid/store/auto/H2Startup.java   |  1 -
 .../examples/datagrid/store/auto/package-info.java       |  2 +-
 .../ignite/cache/store/jdbc/CacheAbstractJdbcStore.java  |  2 +-
 .../cache/store/jdbc/dialect/BasicJdbcDialect.java       |  4 ++--
 .../ignite/cache/store/jdbc/dialect/JdbcDialect.java     |  2 +-
 7 files changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6aa1a016/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreExample.java
b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreExample.java
index 36057e3..12c80dc 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreExample.java
@@ -27,8 +27,9 @@ import org.apache.ignite.transactions.*;
 import java.util.*;
 
 /**
- * Example of {@link CacheJdbcPojoStore} implementation that uses JDBC
- * transaction with cache transactions and maps {@link Long} to {@link Person}.
+ * Demonstrates usage of cache with underlying persistent store configured.
+ * <p>
+ * This example uses {@link CacheJdbcPojoStore} as a persistent store.
  * <p>
  * To run this example your should start {@link H2Startup} first.
  * <p>
@@ -56,7 +57,7 @@ public class CacheAutoStoreExample {
 
             CacheConfiguration<Long, Person> cacheCfg = CacheConfig.jdbcPojoStoreCache();
 
-            try (IgniteCache<Long, Person> cache = ignite.createCache(cacheCfg)) {
+            try (IgniteCache<Long, Person> cache = ignite.getOrCreateCache(cacheCfg))
{
                 try (Transaction tx = ignite.transactions().txStart()) {
                     Person val = cache.get(id);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6aa1a016/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreLoadDataExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreLoadDataExample.java
b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreLoadDataExample.java
index 3158c4b..85e2291 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreLoadDataExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/CacheAutoStoreLoadDataExample.java
@@ -29,8 +29,9 @@ import java.io.*;
 import java.sql.*;
 
 /**
- * Example of load data from database through {@link CacheJdbcPojoStore} implementation.
- * This example shows how to load all data or with custom SQL.
+ * Demonstrates how to load data from database.
+ * <p>
+ * This example uses {@link CacheJdbcPojoStore} as a persistent store.
  * <p>
  * To run this example your should start {@link H2Startup} first.
  * <p>
@@ -71,8 +72,8 @@ public class CacheAutoStoreLoadDataExample {
 
             CacheConfiguration<Long, Person> cacheCfg = CacheConfig.jdbcPojoStoreCache();
 
-            try (IgniteCache<Long, Person> cache = ignite.createCache(cacheCfg)) {
-                System.out.println(">>> Load cache from database using custom script.");
+            try (IgniteCache<Long, Person> cache = ignite.getOrCreateCache(cacheCfg))
{
+                System.out.println(">>> Load cache from database using custom SQL.");
 
                 System.out.println(">>> Cache size: " + cache.size());
 
@@ -85,7 +86,7 @@ public class CacheAutoStoreLoadDataExample {
 
                 System.out.println(">>> Loaded " + cache.size() + " keys with backups
in " + (end - start) + "ms.");
 
-                System.out.println(">>> Load cache from database.");
+                System.out.println(">>> Load cache data from database.");
 
                 cache.clear();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6aa1a016/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/H2Startup.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/H2Startup.java
b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/H2Startup.java
index 16aac7e..1b7c5e9 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/H2Startup.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/H2Startup.java
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.ignite.examples.datagrid.store.auto;
 
 import org.apache.ignite.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6aa1a016/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/package-info.java
b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/package-info.java
index 4b61a1f..484ff47 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/package-info.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/auto/package-info.java
@@ -17,6 +17,6 @@
 
 /**
  * <!-- Package description. -->
- * Contains dummy cache store implementation.
+ * Contains CacheJdbcPojoStore example.
  */
 package org.apache.ignite.examples.datagrid.store.auto;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6aa1a016/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 8861f85..b0031ab 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
@@ -1465,7 +1465,7 @@ public abstract class CacheAbstractJdbcStore<K, V> implements
CacheStore<K, V>,
 
             loadQrySingle = dialect.loadQuery(fullTblName, keyCols, cols, 1);
 
-            maxKeysPerStmt = dialect.getMaxParamsCnt() / keyCols.size();
+            maxKeysPerStmt = dialect.getMaxParameterCount() / keyCols.size();
 
             loadQry = dialect.loadQuery(fullTblName, keyCols, cols, maxKeysPerStmt);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6aa1a016/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/BasicJdbcDialect.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/BasicJdbcDialect.java
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/BasicJdbcDialect.java
index 4910025..ffca656 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/BasicJdbcDialect.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/BasicJdbcDialect.java
@@ -259,7 +259,7 @@ public class BasicJdbcDialect implements JdbcDialect {
     }
 
     /** {@inheritDoc} */
-    @Override public int getMaxParamsCnt() {
+    @Override public int getMaxParameterCount() {
         return maxParamsCnt;
     }
 
@@ -268,7 +268,7 @@ public class BasicJdbcDialect implements JdbcDialect {
      *
      * @param maxParamsCnt Max query parameters count.
      */
-    public void setMaxParamsCnt(int maxParamsCnt) {
+    public void setMaxParameterCount(int maxParamsCnt) {
         this.maxParamsCnt = maxParamsCnt;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6aa1a016/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/JdbcDialect.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/JdbcDialect.java
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/JdbcDialect.java
index ab652ae..be1cc67 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/JdbcDialect.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/dialect/JdbcDialect.java
@@ -113,5 +113,5 @@ public interface JdbcDialect {
      *
      * @return Max query parameters count.
      */
-    public int getMaxParamsCnt();
+    public int getMaxParameterCount();
 }


Mime
View raw message