ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [61/82] [abbrv] ignite git commit: Minor fixes to examples
Date Tue, 01 Sep 2015 12:08:10 GMT
Minor fixes to examples


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

Branch: refs/heads/ignite-1093-2
Commit: 2814d0e91bfe6686aa6c24807997a7a2c4e13c32
Parents: 9e42600
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Mon Aug 31 23:45:23 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Mon Aug 31 23:45:23 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/examples/datagrid/CacheQueryExample.java | 6 +++---
 .../examples/datagrid/hibernate/HibernateL2CacheExample.java   | 4 ++--
 .../ignite/examples/java8/datagrid/CacheAffinityExample.java   | 4 ++--
 .../apache/ignite/examples/java8/datagrid/CacheApiExample.java | 4 ++--
 .../ignite/examples/java8/datagrid/CacheAsyncApiExample.java   | 4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2814d0e9/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
index 1b2e02a..8fba3f6 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
@@ -91,8 +91,8 @@ public class CacheQueryExample {
             personCacheCfg.setIndexedTypes(AffinityKey.class, Person.class);
 
             try (
-                IgniteCache<UUID, Organization> orgCache = ignite.createCache(orgCacheCfg);
-                IgniteCache<AffinityKey<UUID>, Person> personCache = ignite.createCache(personCacheCfg)
+                IgniteCache<UUID, Organization> orgCache = ignite.getOrCreateCache(orgCacheCfg);
+                IgniteCache<AffinityKey<UUID>, Person> personCache = ignite.getOrCreateCache(personCacheCfg)
             ) {
                 // Populate cache.
                 initialize();
@@ -425,4 +425,4 @@ public class CacheQueryExample {
             return "Organization [id=" + id + ", name=" + name + ']';
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/2814d0e9/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
b/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
index 43088a4..2f271c8 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
@@ -199,7 +199,7 @@ public class HibernateL2CacheExample {
         ccfg.setAtomicityMode(atomicityMode);
         ccfg.setWriteSynchronizationMode(FULL_SYNC);
 
-        return Ignition.ignite().createCache(ccfg);
+        return Ignition.ignite().getOrCreateCache(ccfg);
     }
 
     /**
@@ -242,4 +242,4 @@ public class HibernateL2CacheExample {
 
         System.out.println("=====================================");
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/2814d0e9/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java
b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java
index aa1fc25..6635e7f 100644
--- a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java
+++ b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAffinityExample.java
@@ -51,7 +51,7 @@ public final class CacheAffinityExample {
             cfg.setCacheMode(CacheMode.PARTITIONED);
             cfg.setName(CACHE_NAME);
 
-            try (IgniteCache<Integer, String> cache = ignite.createCache(cfg)) {
+            try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cfg))
{
                 for (int i = 0; i < KEY_CNT; i++)
                     cache.put(i, Integer.toString(i));
 
@@ -119,4 +119,4 @@ public final class CacheAffinityExample {
             }
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/2814d0e9/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheApiExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheApiExample.java
b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheApiExample.java
index 98f37c7..cca1812 100644
--- a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheApiExample.java
+++ b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheApiExample.java
@@ -55,7 +55,7 @@ public class CacheApiExample {
             cfg.setCacheMode(CacheMode.PARTITIONED);
             cfg.setName(CACHE_NAME);
 
-            try (IgniteCache<Integer, String> cache = ignite.createCache(cfg)) {
+            try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cfg))
{
                 // Demonstrate atomic map operations.
                 atomicMapOperations(cache);
             }
@@ -102,4 +102,4 @@ public class CacheApiExample {
         b2 = cache.replace(7, "7", "777");
         assert b1 & !b2;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/2814d0e9/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAsyncApiExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAsyncApiExample.java
b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAsyncApiExample.java
index 1313181..2ad5640 100644
--- a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAsyncApiExample.java
+++ b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheAsyncApiExample.java
@@ -57,7 +57,7 @@ public class CacheAsyncApiExample {
             cfg.setCacheMode(CacheMode.PARTITIONED);
             cfg.setName(CACHE_NAME);
 
-            try (IgniteCache<Integer, String> cache = ignite.createCache(cfg)) {
+            try (IgniteCache<Integer, String> cache = ignite.getOrCreateCache(cfg))
{
                 // Enable asynchronous mode.
                 IgniteCache<Integer, String> asyncCache = cache.withAsync();
 
@@ -82,4 +82,4 @@ public class CacheAsyncApiExample {
             }
         }
     }
-}
\ No newline at end of file
+}


Mime
View raw message