ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsetrak...@apache.org
Subject incubator-ignite git commit: # ignite-45 - Example fixes.
Date Mon, 23 Mar 2015 05:01:41 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-45 31273ba0d -> a628cb921


# ignite-45 - Example fixes.


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

Branch: refs/heads/ignite-45
Commit: a628cb921b4458b9b4cbf55fdd34ac28fb009555
Parents: 31273ba
Author: Dmitiry Setrakyan <dsetrakyan@gridgain.com>
Authored: Sun Mar 22 22:01:35 2015 -0700
Committer: Dmitiry Setrakyan <dsetrakyan@gridgain.com>
Committed: Sun Mar 22 22:01:35 2015 -0700

----------------------------------------------------------------------
 .../datagrid/store/dummy/CacheDummyStoreExample.java      | 10 +++-------
 .../store/hibernate/CacheHibernateStoreExample.java       | 10 +++-------
 .../datagrid/store/jdbc/CacheJdbcStoreExample.java        | 10 +++-------
 3 files changed, 9 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a628cb92/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyStoreExample.java
b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyStoreExample.java
index d3d6977..7ee0ff7 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyStoreExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyStoreExample.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.examples.datagrid.store.dummy;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.store.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.examples.*;
 import org.apache.ignite.examples.datagrid.store.*;
@@ -69,16 +68,13 @@ public class CacheDummyStoreExample {
             // Set atomicity as transaction, since we are showing transactions in example.
             cacheCfg.setAtomicityMode(TRANSACTIONAL);
 
-            cacheCfg.setCacheStoreFactory(new Factory<CacheStore<? super Long, ? super
Person>>() {
-                @Override public CacheStore<? super Long, ? super Person> create()
{
-                    return new CacheDummyPersonStore();
-                }
-            });
+            // Configure Dummy store.
+            cacheCfg.setCacheStoreFactory(FactoryBuilder.factoryOf(CacheDummyPersonStore.class));
 
             cacheCfg.setReadThrough(true);
             cacheCfg.setWriteThrough(true);
 
-            try (IgniteCache<Long, Person> cache = ignite.createCache(cacheCfg)) {
+            try (IgniteCache<Long, Person> cache = ignite.getOrCreateCache(cacheCfg))
{
                 long start = System.currentTimeMillis();
 
                 // Start loading cache from persistent store on all caching nodes.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a628cb92/examples/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
index 0eed3a9..af28d68 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/hibernate/CacheHibernateStoreExample.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.examples.datagrid.store.hibernate;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.store.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.examples.*;
 import org.apache.ignite.examples.datagrid.store.*;
@@ -69,16 +68,13 @@ public class CacheHibernateStoreExample {
             // Set atomicity as transaction, since we are showing transactions in example.
             cacheCfg.setAtomicityMode(TRANSACTIONAL);
 
-            cacheCfg.setCacheStoreFactory(new Factory<CacheStore<? super Long, ? super
Person>>() {
-                @Override public CacheStore<? super Long, ? super Person> create()
{
-                    return new CacheHibernatePersonStore();
-                }
-            });
+            // Configure Hibernate store.
+            cacheCfg.setCacheStoreFactory(FactoryBuilder.factoryOf(CacheHibernatePersonStore.class));
 
             cacheCfg.setReadThrough(true);
             cacheCfg.setWriteThrough(true);
 
-            try (IgniteCache<Long, Person> cache = ignite.createCache(cacheCfg)) {
+            try (IgniteCache<Long, Person> cache = ignite.getOrCreateCache(cacheCfg))
{
                 long start = System.currentTimeMillis();
 
                 // Start loading cache from persistent store on all caching nodes.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a628cb92/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
index 7eef116..a65e41b 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcStoreExample.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.examples.datagrid.store.jdbc;
 
 import org.apache.ignite.*;
-import org.apache.ignite.cache.store.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.examples.*;
 import org.apache.ignite.examples.datagrid.store.*;
@@ -69,16 +68,13 @@ public class CacheJdbcStoreExample {
             // Set atomicity as transaction, since we are showing transactions in example.
             cacheCfg.setAtomicityMode(TRANSACTIONAL);
 
-            cacheCfg.setCacheStoreFactory(new Factory<CacheStore<? super Long, ? super
Person>>() {
-                @Override public CacheStore<? super Long, ? super Person> create()
{
-                    return new CacheJdbcPersonStore();
-                }
-            });
+            // Configure JDBC store.
+            cacheCfg.setCacheStoreFactory(FactoryBuilder.factoryOf(CacheJdbcPersonStore.class));
 
             cacheCfg.setReadThrough(true);
             cacheCfg.setWriteThrough(true);
 
-            try (IgniteCache<Long, Person> cache = ignite.createCache(cacheCfg)) {
+            try (IgniteCache<Long, Person> cache = ignite.getOrCreateCache(cacheCfg))
{
                 long start = System.currentTimeMillis();
 
                 // Start loading cache from persistent store on all caching nodes.


Mime
View raw message