ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [45/50] incubator-ignite git commit: # sprint-2 Fixed code generator. Added generics.
Date Tue, 24 Mar 2015 21:10:02 GMT
# sprint-2 Fixed code generator. Added generics.


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

Branch: refs/heads/ignite-341
Commit: 6d70ce2dc6ac1a006da372c44713515d9a72a324
Parents: 4e7eef3
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Wed Mar 25 00:03:46 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Wed Mar 25 00:03:46 2015 +0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/schema/Demo.java            | 3 ++-
 .../java/org/apache/ignite/schema/generator/CodeGenerator.java  | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6d70ce2d/examples/schema-import/src/main/java/org/apache/ignite/schema/Demo.java
----------------------------------------------------------------------
diff --git a/examples/schema-import/src/main/java/org/apache/ignite/schema/Demo.java b/examples/schema-import/src/main/java/org/apache/ignite/schema/Demo.java
index c44d285..e6f3ccf 100644
--- a/examples/schema-import/src/main/java/org/apache/ignite/schema/Demo.java
+++ b/examples/schema-import/src/main/java/org/apache/ignite/schema/Demo.java
@@ -61,7 +61,8 @@ public class Demo {
         // Start Ignite node.
         try (Ignite ignite = Ignition.start()) {
             // Configure cache store.
-            CacheConfiguration<PersonKey, Person> cfg = CacheConfig.cache("PersonCache",
new H2DemoStoreFactory<>());
+            CacheConfiguration<PersonKey, Person> cfg =
+                CacheConfig.cache("PersonCache", new H2DemoStoreFactory<PersonKey, Person>());
 
             try (IgniteCache<PersonKey, Person> cache = ignite.getOrCreateCache(cfg))
{
                 // Preload cache from database.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6d70ce2d/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
b/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
index 316e620..8b3da49 100644
--- a/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
+++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/generator/CodeGenerator.java
@@ -548,11 +548,12 @@ public class CodeGenerator {
         add1(src, "* @param name Cache name.");
         add1(src, "* @param storeFactory Cache store factory.");
         add1(src, "*/");
-        add1(src, " public static CacheConfiguration cache(String name, Factory<CacheStore>
storeFactory) {");
+        add1(src, "public static <K, V> CacheConfiguration<K, V> cache(String
name," +
+            " Factory<CacheStore<K, V>> storeFactory) {");
         add2(src, "if (storeFactory == null)");
         add3(src, " throw new IllegalArgumentException(\"Cache store factory cannot be null.\");");
         add0(src, "");
-        add2(src, "CacheConfiguration ccfg = new CacheConfiguration(name);");
+        add2(src, "CacheConfiguration<K, V> ccfg = new CacheConfiguration<>(name);");
         add0(src, "");
         add2(src, "ccfg.setCacheStoreFactory(storeFactory);");
         add2(src, "ccfg.setReadThrough(true);");


Mime
View raw message