You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/12/21 08:23:20 UTC

[01/11] ignite git commit: IGNITE-2123: Need to add EntryProcessorExample to cache examples

Repository: ignite
Updated Branches:
  refs/heads/ignite-1537 1a00ab5af -> e97a96c7e


IGNITE-2123: Need to add EntryProcessorExample to cache examples


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

Branch: refs/heads/ignite-1537
Commit: 32cec99465e667e98010da87140a9eb80bfca743
Parents: 24eccb8
Author: Roman Shtykh <ap...@gmail.com>
Authored: Fri Dec 18 15:09:00 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Dec 18 15:09:00 2015 +0300

----------------------------------------------------------------------
 RELEASE_NOTES.txt                               |   1 +
 .../datagrid/CacheEntryProcessorExample.java    | 157 +++++++++++++++++++
 .../datagrid/CacheEntryProcessorExample.java    | 147 +++++++++++++++++
 .../ScalarCacheEntryProcessorExample.scala      | 125 +++++++++++++++
 .../ignite/examples/CacheExamplesSelfTest.java  |   8 +
 .../java8/examples/CacheExamplesSelfTest.java   |   8 +
 .../tests/examples/ScalarExamplesSelfTest.scala |   5 +
 7 files changed, 451 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/32cec994/RELEASE_NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index 243ec18..b0822c9 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -18,6 +18,7 @@ Apache Ignite In-Memory Data Fabric 1.5
 * Fixed and improved cache types configuration.
 * Fixed cache rebalancing.
 * Many stability and fault-tolerance fixes.
+* Added example to demonstrate the usage of EntryProcessor.
 
 Complete list of closed issues: https://issues.apache.org/jira/issues/?jql=project%20%3D%20IGNITE%20AND%20fixVersion%20%3D%201.5%20AND%20status%20%3D%20closed
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/32cec994/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEntryProcessorExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEntryProcessorExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEntryProcessorExample.java
new file mode 100644
index 0000000..38d9631
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEntryProcessorExample.java
@@ -0,0 +1,157 @@
+/*
+ * 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.examples.datagrid;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import javax.cache.processor.EntryProcessor;
+import javax.cache.processor.EntryProcessorException;
+import javax.cache.processor.MutableEntry;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.examples.ExampleNodeStartup;
+
+/**
+ * This example demonstrates the simplest code that populates the distributed cache
+ * and co-locates simple closure execution with each key. The goal of this particular
+ * example is to provide the simplest code example of this logic using EntryProcessor.
+ * <p>
+ * Remote nodes should always be started with special configuration file which
+ * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-ignite.xml'}.
+ * <p>
+ * Alternatively you can run {@link ExampleNodeStartup} in another JVM which will
+ * start node with {@code examples/config/example-ignite.xml} configuration.
+ */
+public class CacheEntryProcessorExample {
+    /** Cache name. */
+    private static final String CACHE_NAME = CacheEntryProcessorExample.class.getSimpleName();
+
+    /** Number of keys. */
+    private static final int KEY_CNT = 20;
+
+    /** Keys predefined set. */
+    private static final Set<Integer> KEYS_SET;
+
+    /**
+     * Initializes keys set that is used in bulked operations in the example.
+     */
+    static {
+        KEYS_SET = new HashSet<>();
+
+        for (int i = 0; i < KEY_CNT; i++)
+            KEYS_SET.add(i);
+    }
+
+    /**
+     * Executes example.
+     *
+     * @param args Command line arguments, none required.
+     * @throws IgniteException If example execution failed.
+     */
+    public static void main(String[] args) throws IgniteException {
+        try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
+            System.out.println();
+            System.out.println(">>> Entry processor example started.");
+
+            try (IgniteCache<Integer, Integer> cache = ignite.getOrCreateCache(CACHE_NAME)) {
+                // Demonstrates usage of EntryProcessor.invoke(...) method.
+                populateEntriesWithInvoke(cache);
+
+                // Demonstrates usage of EntryProcessor.invokeAll(...) method.
+                incrementEntriesWithInvokeAll(cache);
+            }
+        }
+    }
+
+    /**
+     * Populates cache with values using {@link IgniteCache#invoke(Object, EntryProcessor, Object...)} method.
+     *
+     * @param cache Cache that must be populated.
+     */
+    private static void populateEntriesWithInvoke(IgniteCache<Integer, Integer> cache) {
+        // Must be no entry in the cache at this point.
+        printCacheEntries(cache);
+
+        System.out.println("");
+        System.out.println(">> Populating the cache using EntryProcessor.");
+
+        // Invokes EntryProcessor for every key sequentially.
+        for (int i = 0; i < KEY_CNT; i++) {
+            cache.invoke(i, new EntryProcessor<Integer, Integer, Object>() {
+                @Override public Object process(MutableEntry<Integer, Integer> entry,
+                    Object... objects) throws EntryProcessorException {
+                    // Initializes entry's value if it's not set.
+                    if (entry.getValue() == null)
+                        entry.setValue((entry.getKey() + 1) * 10);
+
+                    return null;
+                }
+            });
+        }
+
+        // Print outs entries that are set using the EntryProcessor above.
+        printCacheEntries(cache);
+    }
+
+    /**
+     * Increments values of entries stored in the cache using
+     * {@link IgniteCache#invokeAll(Set, EntryProcessor, Object...)} method.
+     *
+     * @param cache Cache instance.
+     */
+    private static void incrementEntriesWithInvokeAll(IgniteCache<Integer, Integer> cache) {
+        System.out.println("");
+        System.out.println(">> Incrementing values in the cache using EntryProcessor.");
+
+        // Using EntryProcessor.invokeAll to increment every value in place.
+        cache.invokeAll(KEYS_SET, new EntryProcessor<Integer, Integer, Object>() {
+            @Override public Object process(MutableEntry<Integer, Integer> entry,
+                Object... arguments) throws EntryProcessorException {
+
+                entry.setValue(entry.getValue() + 5);
+
+                return null;
+            }
+        });
+
+        // Print outs entries that are incremented using the EntryProcessor above.
+        printCacheEntries(cache);
+    }
+
+    /**
+     * Prints out all the entries that are stored in a cache.
+     *
+     * @param cache Cache.
+     */
+    private static void printCacheEntries(IgniteCache<Integer, Integer> cache) {
+        System.out.println();
+        System.out.println(">>> Entries in the cache.");
+
+        Map<Integer, Integer> entries = cache.getAll(KEYS_SET);
+
+        if (entries.isEmpty())
+            System.out.println("No entries in the cache.");
+        else {
+            for (Map.Entry<Integer, Integer> entry : entries.entrySet())
+                System.out.println("Entry [key=" + entry.getKey() + ", value=" + entry.getValue() + ']');
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/32cec994/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheEntryProcessorExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheEntryProcessorExample.java b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheEntryProcessorExample.java
new file mode 100644
index 0000000..fd07fa5
--- /dev/null
+++ b/examples/src/main/java8/org/apache/ignite/examples/java8/datagrid/CacheEntryProcessorExample.java
@@ -0,0 +1,147 @@
+/*
+ * 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.examples.java8.datagrid;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import javax.cache.processor.EntryProcessor;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.examples.ExampleNodeStartup;
+
+/**
+ * This example demonstrates the simplest code that populates the distributed cache and co-locates simple closure
+ * execution with each key. The goal of this particular example is to provide the simplest code example of this logic
+ * using EntryProcessor.
+ * <p>
+ * Remote nodes should always be started with special configuration file which enables P2P
+ * class loading: {@code 'ignite.{sh|bat} examples/config/example-ignite.xml'}.
+ * <p>
+ * Alternatively you can run {@link ExampleNodeStartup} in another JVM which will start node with
+ * {@code examples/config/example-ignite.xml} configuration.
+ */
+public class CacheEntryProcessorExample {
+    /** Cache name. */
+    private static final String CACHE_NAME = CacheEntryProcessorExample.class.getSimpleName();
+
+    /** Number of keys. */
+    private static final int KEY_CNT = 20;
+
+    /** Set of predefined keys. */
+    private static final Set<Integer> KEYS_SET;
+
+    /**
+     * Initializes keys set that is used in bulked operations in the example.
+     */
+    static {
+        KEYS_SET = new HashSet<>();
+
+        for (int i = 0; i < KEY_CNT; i++)
+            KEYS_SET.add(i);
+    }
+
+    /**
+     * Executes example.
+     *
+     * @param args Command line arguments, none required.
+     * @throws IgniteException If example execution failed.
+     */
+    public static void main(String[] args) throws IgniteException {
+        try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
+            System.out.println();
+            System.out.println(">>> Entry processor example started.");
+
+            try (IgniteCache<Integer, Integer> cache = ignite.getOrCreateCache(CACHE_NAME)) {
+                // Demonstrates usage of EntryProcessor.invoke(...) method.
+                populateEntriesWithInvoke(cache);
+
+                // Demonstrates usage of EntryProcessor.invokeAll(...) method.
+                incrementEntriesWithInvokeAll(cache);
+            }
+        }
+    }
+
+    /**
+     * Populates cache with values using {@link IgniteCache#invoke(Object, EntryProcessor, Object...)} method.
+     *
+     * @param cache Cache that must be populated.
+     */
+    private static void populateEntriesWithInvoke(IgniteCache<Integer, Integer> cache) {
+        // Must be no entry in the cache at this point.
+        printCacheEntries(cache);
+
+        System.out.println("");
+        System.out.println(">> Populating the cache using EntryProcessor.");
+
+        // Invokes EntryProcessor for every key sequentially.
+        for (int i = 0; i < KEY_CNT; i++) {
+            cache.invoke(i, (entry, object) -> {
+                // Initializes entry's value if it's not set.
+                if (entry.getValue() == null)
+                    entry.setValue((entry.getKey() + 1) * 10);
+                return null;
+            });
+        }
+
+        // Print outs entries that are set using the EntryProcessor above.
+        printCacheEntries(cache);
+    }
+
+    /**
+     * Increments values of entries stored in the cache using {@link IgniteCache#invokeAll(Set, EntryProcessor,
+     * Object...)} method.
+     *
+     * @param cache Cache instance.
+     */
+    private static void incrementEntriesWithInvokeAll(IgniteCache<Integer, Integer> cache) {
+        System.out.println("");
+        System.out.println(">> Incrementing values in the cache using EntryProcessor.");
+
+        // Using EntryProcessor.invokeAll to increment every value in place.
+        cache.invokeAll(KEYS_SET, (entry, object) -> {
+            entry.setValue(entry.getValue() + 5);
+
+            return null;
+        });
+
+        // Print outs entries that are incremented using the EntryProcessor above.
+        printCacheEntries(cache);
+    }
+
+    /**
+     * Prints out all the entries that are stored in a cache.
+     *
+     * @param cache Cache.
+     */
+    private static void printCacheEntries(IgniteCache<Integer, Integer> cache) {
+        System.out.println();
+        System.out.println(">>> Entries in the cache.");
+
+        Map<Integer, Integer> entries = cache.getAll(KEYS_SET);
+
+        if (entries.isEmpty())
+            System.out.println("No entries in the cache.");
+        else {
+            for (Map.Entry<Integer, Integer> entry : entries.entrySet())
+                System.out.println("Entry [key=" + entry.getKey() + ", value=" + entry.getValue() + ']');
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/32cec994/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheEntryProcessorExample.scala
----------------------------------------------------------------------
diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheEntryProcessorExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheEntryProcessorExample.scala
new file mode 100644
index 0000000..ffcbbfd
--- /dev/null
+++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheEntryProcessorExample.scala
@@ -0,0 +1,125 @@
+/*
+ * 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.scalar.examples
+
+import javax.cache.processor.{EntryProcessor, MutableEntry}
+
+import org.apache.ignite.IgniteCache
+import org.apache.ignite.scalar.scalar
+import org.apache.ignite.scalar.scalar._
+
+/**
+ * This example demonstrates the simplest code that populates the distributed cache
+ * and co-locates simple closure execution with each key. The goal of this particular
+ * example is to provide the simplest code example of this logic using EntryProcessor.
+ * <p>
+ * Remote nodes should always be started with special configuration file which
+ * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-ignite.xml'}.
+ * <p>
+ * Alternatively you can run {@link ExampleNodeStartup} in another JVM which will
+ * start node with {@code examples/config/example-ignite.xml} configuration.
+ */
+object ScalarCacheEntryProcessorExample extends App {
+    /** Configuration file name. */
+    private val CONFIG = "examples/config/example-ignite.xml"
+
+    /** Name of cache. */
+    private val CACHE_NAME = ScalarCacheEntryProcessorExample.getClass.getSimpleName
+
+    /** Number of keys. */
+    private val KEY_CNT = 20
+
+    /** Type alias. */
+    type Cache = IgniteCache[String, Int]
+
+    /*
+     * Note that in case of `LOCAL` configuration,
+     * since there is no distribution, values may come back as `nulls`.
+     */
+    scalar(CONFIG) {
+        println()
+        println(">>> Entry processor example started.")
+
+        val cache = createCache$[String, Int](CACHE_NAME)
+
+        try {
+            populateEntriesWithInvoke(cache)
+
+            checkEntriesInCache(cache)
+
+            incrementEntriesWithInvoke(cache)
+
+            checkEntriesInCache(cache)
+        }
+        finally {
+            cache.destroy()
+        }
+    }
+
+    private def checkEntriesInCache(cache: Cache) {
+        println()
+        println(">>> Entries in the cache.")
+
+        (0 until KEY_CNT).foreach(i =>
+            println("Entry: " + cache.get(i.toString)))
+    }
+
+    /**
+     * Runs jobs on primary nodes with {@link IgniteCache#invoke(Object, CacheEntryProcessor, Object...)} to create
+     * entries when they don't exist.
+     *
+     * @param cache Cache to populate.
+     */
+    private def populateEntriesWithInvoke(cache: Cache) {
+        (0 until KEY_CNT).foreach(i =>
+            cache.invoke(i.toString,
+                new EntryProcessor[String, Int, Object]() {
+                    override def process(e: MutableEntry[String, Int], args: AnyRef*): Object = {
+                        if (e.getValue == null)
+                            e.setValue(i)
+
+                        null
+                    }
+                }
+            )
+        )
+    }
+
+    /**
+     * Runs jobs on primary nodes with {@link IgniteCache#invoke(Object, CacheEntryProcessor, Object...)} to increment
+     * entries values.
+     *
+     * @param cache Cache to populate.
+     */
+    private def incrementEntriesWithInvoke(cache: Cache) {
+        println()
+        println(">>> Incrementing values.")
+
+        (0 until KEY_CNT).foreach(i =>
+            cache.invoke(i.toString,
+                new EntryProcessor[String, Int, Object]() {
+                    override def process(e: MutableEntry[String, Int], args: AnyRef*): Object = {
+                        Option(e.getValue) foreach (v => e.setValue(v + 1))
+
+                        null
+                    }
+                }
+            )
+        )
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/32cec994/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java b/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java
index 050c59f..39c2ea6 100644
--- a/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java
+++ b/examples/src/test/java/org/apache/ignite/examples/CacheExamplesSelfTest.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.examples;
 
 import org.apache.ignite.examples.datagrid.CacheAffinityExample;
+import org.apache.ignite.examples.datagrid.CacheEntryProcessorExample;
 import org.apache.ignite.examples.datagrid.CacheApiExample;
 import org.apache.ignite.examples.datagrid.CacheContinuousQueryExample;
 import org.apache.ignite.examples.datagrid.CacheDataStreamerExample;
@@ -49,6 +50,13 @@ public class CacheExamplesSelfTest extends GridAbstractExamplesTest {
     /**
      * @throws Exception If failed.
      */
+    public void testCacheEntryProcessorExample() throws Exception {
+        CacheEntryProcessorExample.main(EMPTY_ARGS);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testCacheAtomicLongExample() throws Exception {
         IgniteAtomicLongExample.main(EMPTY_ARGS);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/32cec994/examples/src/test/java8/org/apache/ignite/java8/examples/CacheExamplesSelfTest.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java8/org/apache/ignite/java8/examples/CacheExamplesSelfTest.java b/examples/src/test/java8/org/apache/ignite/java8/examples/CacheExamplesSelfTest.java
index 4446521..e44fec3 100644
--- a/examples/src/test/java8/org/apache/ignite/java8/examples/CacheExamplesSelfTest.java
+++ b/examples/src/test/java8/org/apache/ignite/java8/examples/CacheExamplesSelfTest.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.java8.examples;
 
 import org.apache.ignite.examples.java8.datagrid.CacheAffinityExample;
+import org.apache.ignite.examples.java8.datagrid.CacheEntryProcessorExample;
 import org.apache.ignite.examples.java8.datagrid.CacheApiExample;
 import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest;
 
@@ -36,6 +37,13 @@ public class CacheExamplesSelfTest extends GridAbstractExamplesTest {
         CacheAffinityExample.main(EMPTY_ARGS);
     }
 
+    /**
+     * @throws Exception If failed.
+     */
+    public void testCacheEntryProcessorExample() throws Exception {
+        CacheEntryProcessorExample.main(EMPTY_ARGS);
+    }
+
 //    TODO: IGNITE-711 next example(s) should be implemented for java 8
 //    or testing method(s) should be removed if example(s) does not applicable for java 8.
 //    /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/32cec994/examples/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarExamplesSelfTest.scala
----------------------------------------------------------------------
diff --git a/examples/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarExamplesSelfTest.scala b/examples/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarExamplesSelfTest.scala
index ef56434..94c41ad 100644
--- a/examples/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarExamplesSelfTest.scala
+++ b/examples/src/test/scala/org/apache/ignite/scalar/tests/examples/ScalarExamplesSelfTest.scala
@@ -35,6 +35,11 @@ class ScalarExamplesSelfTest extends GridAbstractExamplesTest with JUnitSuiteLik
     }
 
     /** */
+    def testScalarCacheEntryProcessorExample() {
+        ScalarCacheEntryProcessorExample.main(EMPTY_ARGS)
+    }
+
+    /** */
     def testScalarCacheExample() {
         ScalarCacheExample.main(EMPTY_ARGS)
     }


[09/11] ignite git commit: IGNITE-2169 Fixed incorrect null schema generation.

Posted by sb...@apache.org.
IGNITE-2169 Fixed incorrect null schema generation.


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

Branch: refs/heads/ignite-1537
Commit: 58b55b53f15f0752c8fff97e31b94984a67d081b
Parents: 0c7dfec
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Mon Dec 21 10:20:37 2015 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Dec 21 10:20:37 2015 +0700

----------------------------------------------------------------------
 .../ignite/schema/generator/CodeGenerator.java  |   7 +-
 .../schema/test/AbstractSchemaImportTest.java   |  18 +
 .../org/apache/ignite/schema/test/model/Tst.txt | 506 +++++++++++++++++++
 .../apache/ignite/schema/test/model/TstKey.txt  |  96 ++++
 .../schema/test/model/ignite-type-metadata.xml  | 180 +++++++
 .../test/parser/DbMetadataParserTest.java       |  17 +-
 6 files changed, 820 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/58b55b53/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 0e52acc..769c7d9 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
@@ -606,8 +606,11 @@ public class CodeGenerator {
 
             add2(src, "jdbcType.setCacheName(cacheName);");
 
-            // Database info.
-            add2(src, "jdbcType.setDatabaseSchema(\"" + pojo.schema() + "\");");
+            // Database schema.
+            if (pojo.schema() != null)
+                add2(src, "jdbcType.setDatabaseSchema(\"" + pojo.schema() + "\");");
+
+            // Database table.
             add2(src, "jdbcType.setDatabaseTable(\"" + tbl + "\");");
 
             // Java info.

http://git-wip-us.apache.org/repos/asf/ignite/blob/58b55b53/modules/schema-import/src/test/java/org/apache/ignite/schema/test/AbstractSchemaImportTest.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/test/java/org/apache/ignite/schema/test/AbstractSchemaImportTest.java b/modules/schema-import/src/test/java/org/apache/ignite/schema/test/AbstractSchemaImportTest.java
index bf0f94a..97f0f87 100644
--- a/modules/schema-import/src/test/java/org/apache/ignite/schema/test/AbstractSchemaImportTest.java
+++ b/modules/schema-import/src/test/java/org/apache/ignite/schema/test/AbstractSchemaImportTest.java
@@ -97,6 +97,24 @@ public abstract class AbstractSchemaImportTest extends TestCase {
             " tsCol TIMESTAMP," +
             " arrCol BINARY(10))");
 
+        stmt.executeUpdate("CREATE SCHEMA IF NOT EXISTS TESTSCHEMA");
+
+        stmt.executeUpdate("CREATE TABLE IF NOT EXISTS TESTSCHEMA.TST(pk INTEGER PRIMARY KEY, " +
+            " boolCol BOOLEAN NOT NULL," +
+            " byteCol TINYINT NOT NULL," +
+            " shortCol SMALLINT NOT NULL," +
+            " intCol INTEGER NOT NULL, " +
+            " longCol BIGINT NOT NULL," +
+            " floatCol REAL NOT NULL," +
+            " doubleCol DOUBLE NOT NULL," +
+            " doubleCol2 DOUBLE NOT NULL, " +
+            " bigDecimalCol DECIMAL(10, 0)," +
+            " strCol VARCHAR(10)," +
+            " dateCol DATE," +
+            " timeCol TIME," +
+            " tsCol TIMESTAMP, " +
+            " arrCol BINARY(10))");
+
         conn.commit();
 
         U.closeQuiet(stmt);

http://git-wip-us.apache.org/repos/asf/ignite/blob/58b55b53/modules/schema-import/src/test/java/org/apache/ignite/schema/test/model/Tst.txt
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/test/java/org/apache/ignite/schema/test/model/Tst.txt b/modules/schema-import/src/test/java/org/apache/ignite/schema/test/model/Tst.txt
new file mode 100644
index 0000000..23d61d0
--- /dev/null
+++ b/modules/schema-import/src/test/java/org/apache/ignite/schema/test/model/Tst.txt
@@ -0,0 +1,506 @@
+/*
+ * 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.schema.test.model;
+
+import java.io.*;
+
+/**
+ * Tst definition.
+ *
+ * Code generated by Apache Ignite Schema Import utility: 01/27/2015.
+ */
+public class Tst implements Serializable {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Value for pk. */
+    private int pk;
+
+    /** Value for boolcol. */
+    private boolean boolcol;
+
+    /** Value for bytecol. */
+    private byte bytecol;
+
+    /** Value for shortcol. */
+    private short shortcol;
+
+    /** Value for intcol. */
+    private int intcol;
+
+    /** Value for longcol. */
+    private long longcol;
+
+    /** Value for floatcol. */
+    private float floatcol;
+
+    /** Value for doublecol. */
+    private double doublecol;
+
+    /** Value for doublecol2. */
+    private double doublecol2;
+
+    /** Value for bigdecimalcol. */
+    private java.math.BigDecimal bigdecimalcol;
+
+    /** Value for strcol. */
+    private String strcol;
+
+    /** Value for datecol. */
+    private java.sql.Date datecol;
+
+    /** Value for timecol. */
+    private java.sql.Time timecol;
+
+    /** Value for tscol. */
+    private java.sql.Timestamp tscol;
+
+    /** Value for arrcol. */
+    private Object arrcol;
+
+    /**
+     * Empty constructor.
+     */
+    public Tst() {
+        // No-op.
+    }
+
+    /**
+     * Full constructor.
+     */
+    public Tst(
+        int pk,
+        boolean boolcol,
+        byte bytecol,
+        short shortcol,
+        int intcol,
+        long longcol,
+        float floatcol,
+        double doublecol,
+        double doublecol2,
+        java.math.BigDecimal bigdecimalcol,
+        String strcol,
+        java.sql.Date datecol,
+        java.sql.Time timecol,
+        java.sql.Timestamp tscol,
+        Object arrcol
+    ) {
+        this.pk = pk;
+        this.boolcol = boolcol;
+        this.bytecol = bytecol;
+        this.shortcol = shortcol;
+        this.intcol = intcol;
+        this.longcol = longcol;
+        this.floatcol = floatcol;
+        this.doublecol = doublecol;
+        this.doublecol2 = doublecol2;
+        this.bigdecimalcol = bigdecimalcol;
+        this.strcol = strcol;
+        this.datecol = datecol;
+        this.timecol = timecol;
+        this.tscol = tscol;
+        this.arrcol = arrcol;
+    }
+
+    /**
+     * Gets pk.
+     *
+     * @return Value for pk.
+     */
+    public int getPk() {
+        return pk;
+    }
+
+    /**
+     * Sets pk.
+     *
+     * @param pk New value for pk.
+     */
+    public void setPk(int pk) {
+        this.pk = pk;
+    }
+
+    /**
+     * Gets boolcol.
+     *
+     * @return Value for boolcol.
+     */
+    public boolean getBoolcol() {
+        return boolcol;
+    }
+
+    /**
+     * Sets boolcol.
+     *
+     * @param boolcol New value for boolcol.
+     */
+    public void setBoolcol(boolean boolcol) {
+        this.boolcol = boolcol;
+    }
+
+    /**
+     * Gets bytecol.
+     *
+     * @return Value for bytecol.
+     */
+    public byte getBytecol() {
+        return bytecol;
+    }
+
+    /**
+     * Sets bytecol.
+     *
+     * @param bytecol New value for bytecol.
+     */
+    public void setBytecol(byte bytecol) {
+        this.bytecol = bytecol;
+    }
+
+    /**
+     * Gets shortcol.
+     *
+     * @return Value for shortcol.
+     */
+    public short getShortcol() {
+        return shortcol;
+    }
+
+    /**
+     * Sets shortcol.
+     *
+     * @param shortcol New value for shortcol.
+     */
+    public void setShortcol(short shortcol) {
+        this.shortcol = shortcol;
+    }
+
+    /**
+     * Gets intcol.
+     *
+     * @return Value for intcol.
+     */
+    public int getIntcol() {
+        return intcol;
+    }
+
+    /**
+     * Sets intcol.
+     *
+     * @param intcol New value for intcol.
+     */
+    public void setIntcol(int intcol) {
+        this.intcol = intcol;
+    }
+
+    /**
+     * Gets longcol.
+     *
+     * @return Value for longcol.
+     */
+    public long getLongcol() {
+        return longcol;
+    }
+
+    /**
+     * Sets longcol.
+     *
+     * @param longcol New value for longcol.
+     */
+    public void setLongcol(long longcol) {
+        this.longcol = longcol;
+    }
+
+    /**
+     * Gets floatcol.
+     *
+     * @return Value for floatcol.
+     */
+    public float getFloatcol() {
+        return floatcol;
+    }
+
+    /**
+     * Sets floatcol.
+     *
+     * @param floatcol New value for floatcol.
+     */
+    public void setFloatcol(float floatcol) {
+        this.floatcol = floatcol;
+    }
+
+    /**
+     * Gets doublecol.
+     *
+     * @return Value for doublecol.
+     */
+    public double getDoublecol() {
+        return doublecol;
+    }
+
+    /**
+     * Sets doublecol.
+     *
+     * @param doublecol New value for doublecol.
+     */
+    public void setDoublecol(double doublecol) {
+        this.doublecol = doublecol;
+    }
+
+    /**
+     * Gets doublecol2.
+     *
+     * @return Value for doublecol2.
+     */
+    public double getDoublecol2() {
+        return doublecol2;
+    }
+
+    /**
+     * Sets doublecol2.
+     *
+     * @param doublecol2 New value for doublecol2.
+     */
+    public void setDoublecol2(double doublecol2) {
+        this.doublecol2 = doublecol2;
+    }
+
+    /**
+     * Gets bigdecimalcol.
+     *
+     * @return Value for bigdecimalcol.
+     */
+    public java.math.BigDecimal getBigdecimalcol() {
+        return bigdecimalcol;
+    }
+
+    /**
+     * Sets bigdecimalcol.
+     *
+     * @param bigdecimalcol New value for bigdecimalcol.
+     */
+    public void setBigdecimalcol(java.math.BigDecimal bigdecimalcol) {
+        this.bigdecimalcol = bigdecimalcol;
+    }
+
+    /**
+     * Gets strcol.
+     *
+     * @return Value for strcol.
+     */
+    public String getStrcol() {
+        return strcol;
+    }
+
+    /**
+     * Sets strcol.
+     *
+     * @param strcol New value for strcol.
+     */
+    public void setStrcol(String strcol) {
+        this.strcol = strcol;
+    }
+
+    /**
+     * Gets datecol.
+     *
+     * @return Value for datecol.
+     */
+    public java.sql.Date getDatecol() {
+        return datecol;
+    }
+
+    /**
+     * Sets datecol.
+     *
+     * @param datecol New value for datecol.
+     */
+    public void setDatecol(java.sql.Date datecol) {
+        this.datecol = datecol;
+    }
+
+    /**
+     * Gets timecol.
+     *
+     * @return Value for timecol.
+     */
+    public java.sql.Time getTimecol() {
+        return timecol;
+    }
+
+    /**
+     * Sets timecol.
+     *
+     * @param timecol New value for timecol.
+     */
+    public void setTimecol(java.sql.Time timecol) {
+        this.timecol = timecol;
+    }
+
+    /**
+     * Gets tscol.
+     *
+     * @return Value for tscol.
+     */
+    public java.sql.Timestamp getTscol() {
+        return tscol;
+    }
+
+    /**
+     * Sets tscol.
+     *
+     * @param tscol New value for tscol.
+     */
+    public void setTscol(java.sql.Timestamp tscol) {
+        this.tscol = tscol;
+    }
+
+    /**
+     * Gets arrcol.
+     *
+     * @return Value for arrcol.
+     */
+    public Object getArrcol() {
+        return arrcol;
+    }
+
+    /**
+     * Sets arrcol.
+     *
+     * @param arrcol New value for arrcol.
+     */
+    public void setArrcol(Object arrcol) {
+        this.arrcol = arrcol;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object o) {
+        if (this == o)
+            return true;
+
+        if (!(o instanceof Tst))
+            return false;
+
+        Tst that = (Tst)o;
+
+        if (pk != that.pk)
+            return false;
+
+        if (boolcol != that.boolcol)
+            return false;
+
+        if (bytecol != that.bytecol)
+            return false;
+
+        if (shortcol != that.shortcol)
+            return false;
+
+        if (intcol != that.intcol)
+            return false;
+
+        if (longcol != that.longcol)
+            return false;
+
+        if (Float.compare(floatcol, that.floatcol) != 0)
+            return false;
+
+        if (Double.compare(doublecol, that.doublecol) != 0)
+            return false;
+
+        if (Double.compare(doublecol2, that.doublecol2) != 0)
+            return false;
+
+        if (bigdecimalcol != null ? !bigdecimalcol.equals(that.bigdecimalcol) : that.bigdecimalcol != null)
+            return false;
+
+        if (strcol != null ? !strcol.equals(that.strcol) : that.strcol != null)
+            return false;
+
+        if (datecol != null ? !datecol.equals(that.datecol) : that.datecol != null)
+            return false;
+
+        if (timecol != null ? !timecol.equals(that.timecol) : that.timecol != null)
+            return false;
+
+        if (tscol != null ? !tscol.equals(that.tscol) : that.tscol != null)
+            return false;
+
+        if (arrcol != null ? !arrcol.equals(that.arrcol) : that.arrcol != null)
+            return false;
+
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int hashCode() {
+        int res = pk;
+
+        res = 31 * res + (boolcol ? 1 : 0);
+
+        res = 31 * res + (int)bytecol;
+
+        res = 31 * res + (int)shortcol;
+
+        res = 31 * res + intcol;
+
+        res = 31 * res + (int)(longcol ^ (longcol >>> 32));
+
+        res = 31 * res + (floatcol != +0.0f ? Float.floatToIntBits(floatcol) : 0);
+
+        long ig_hash_temp = Double.doubleToLongBits(doublecol);
+
+        res = 31 * res + (int)(ig_hash_temp ^ (ig_hash_temp >>> 32));
+
+        ig_hash_temp = Double.doubleToLongBits(doublecol2);
+
+        res = 31 * res + (int)(ig_hash_temp ^ (ig_hash_temp >>> 32));
+
+        res = 31 * res + (bigdecimalcol != null ? bigdecimalcol.hashCode() : 0);
+
+        res = 31 * res + (strcol != null ? strcol.hashCode() : 0);
+
+        res = 31 * res + (datecol != null ? datecol.hashCode() : 0);
+
+        res = 31 * res + (timecol != null ? timecol.hashCode() : 0);
+
+        res = 31 * res + (tscol != null ? tscol.hashCode() : 0);
+
+        res = 31 * res + (arrcol != null ? arrcol.hashCode() : 0);
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return "Tst [pk=" + pk +
+            ", boolcol=" + boolcol +
+            ", bytecol=" + bytecol +
+            ", shortcol=" + shortcol +
+            ", intcol=" + intcol +
+            ", longcol=" + longcol +
+            ", floatcol=" + floatcol +
+            ", doublecol=" + doublecol +
+            ", doublecol2=" + doublecol2 +
+            ", bigdecimalcol=" + bigdecimalcol +
+            ", strcol=" + strcol +
+            ", datecol=" + datecol +
+            ", timecol=" + timecol +
+            ", tscol=" + tscol +
+            ", arrcol=" + arrcol +
+            "]";
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/58b55b53/modules/schema-import/src/test/java/org/apache/ignite/schema/test/model/TstKey.txt
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/test/java/org/apache/ignite/schema/test/model/TstKey.txt b/modules/schema-import/src/test/java/org/apache/ignite/schema/test/model/TstKey.txt
new file mode 100644
index 0000000..e2ce3c0
--- /dev/null
+++ b/modules/schema-import/src/test/java/org/apache/ignite/schema/test/model/TstKey.txt
@@ -0,0 +1,96 @@
+/*
+ * 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.schema.test.model;
+
+import java.io.*;
+
+/**
+ * TstKey definition.
+ *
+ * Code generated by Apache Ignite Schema Import utility: 01/27/2015.
+ */
+public class TstKey implements Serializable {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Value for pk. */
+    private int pk;
+
+    /**
+     * Empty constructor.
+     */
+    public TstKey() {
+        // No-op.
+    }
+
+    /**
+     * Full constructor.
+     */
+    public TstKey(
+        int pk
+    ) {
+        this.pk = pk;
+    }
+
+    /**
+     * Gets pk.
+     *
+     * @return Value for pk.
+     */
+    public int getPk() {
+        return pk;
+    }
+
+    /**
+     * Sets pk.
+     *
+     * @param pk New value for pk.
+     */
+    public void setPk(int pk) {
+        this.pk = pk;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object o) {
+        if (this == o)
+            return true;
+
+        if (!(o instanceof TstKey))
+            return false;
+
+        TstKey that = (TstKey)o;
+
+        if (pk != that.pk)
+            return false;
+
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int hashCode() {
+        int res = pk;
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return "TstKey [pk=" + pk +
+            "]";
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/58b55b53/modules/schema-import/src/test/java/org/apache/ignite/schema/test/model/ignite-type-metadata.xml
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/test/java/org/apache/ignite/schema/test/model/ignite-type-metadata.xml b/modules/schema-import/src/test/java/org/apache/ignite/schema/test/model/ignite-type-metadata.xml
index f03f24f..92d065c 100644
--- a/modules/schema-import/src/test/java/org/apache/ignite/schema/test/model/ignite-type-metadata.xml
+++ b/modules/schema-import/src/test/java/org/apache/ignite/schema/test/model/ignite-type-metadata.xml
@@ -314,6 +314,148 @@
                         </list>
                     </property>
                 </bean>
+                <bean class="org.apache.ignite.cache.store.jdbc.JdbcType">
+                    <property name="databaseSchema" value="TESTSCHEMA"/>
+                    <property name="databaseTable" value="TST"/>
+                    <property name="keyType" value="org.apache.ignite.schema.test.model.TstKey"/>
+                    <property name="valueType" value="org.apache.ignite.schema.test.model.Tst"/>
+                    <property name="keyFields">
+                        <list>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.INTEGER"/>
+                                </property>
+                                <property name="databaseFieldName" value="PK"/>
+                                <property name="javaFieldType" value="int"/>
+                                <property name="javaFieldName" value="pk"/>
+                            </bean>
+                        </list>
+                    </property>
+                    <property name="valueFields">
+                        <list>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.INTEGER"/>
+                                </property>
+                                <property name="databaseFieldName" value="PK"/>
+                                <property name="javaFieldType" value="int"/>
+                                <property name="javaFieldName" value="pk"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.BOOLEAN"/>
+                                </property>
+                                <property name="databaseFieldName" value="BOOLCOL"/>
+                                <property name="javaFieldType" value="boolean"/>
+                                <property name="javaFieldName" value="boolcol"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.TINYINT"/>
+                                </property>
+                                <property name="databaseFieldName" value="BYTECOL"/>
+                                <property name="javaFieldType" value="byte"/>
+                                <property name="javaFieldName" value="bytecol"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.SMALLINT"/>
+                                </property>
+                                <property name="databaseFieldName" value="SHORTCOL"/>
+                                <property name="javaFieldType" value="short"/>
+                                <property name="javaFieldName" value="shortcol"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.INTEGER"/>
+                                </property>
+                                <property name="databaseFieldName" value="INTCOL"/>
+                                <property name="javaFieldType" value="int"/>
+                                <property name="javaFieldName" value="intcol"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.BIGINT"/>
+                                </property>
+                                <property name="databaseFieldName" value="LONGCOL"/>
+                                <property name="javaFieldType" value="long"/>
+                                <property name="javaFieldName" value="longcol"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.REAL"/>
+                                </property>
+                                <property name="databaseFieldName" value="FLOATCOL"/>
+                                <property name="javaFieldType" value="float"/>
+                                <property name="javaFieldName" value="floatcol"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.DOUBLE"/>
+                                </property>
+                                <property name="databaseFieldName" value="DOUBLECOL"/>
+                                <property name="javaFieldType" value="double"/>
+                                <property name="javaFieldName" value="doublecol"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.DOUBLE"/>
+                                </property>
+                                <property name="databaseFieldName" value="DOUBLECOL2"/>
+                                <property name="javaFieldType" value="double"/>
+                                <property name="javaFieldName" value="doublecol2"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.DECIMAL"/>
+                                </property>
+                                <property name="databaseFieldName" value="BIGDECIMALCOL"/>
+                                <property name="javaFieldType" value="java.math.BigDecimal"/>
+                                <property name="javaFieldName" value="bigdecimalcol"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.VARCHAR"/>
+                                </property>
+                                <property name="databaseFieldName" value="STRCOL"/>
+                                <property name="javaFieldType" value="java.lang.String"/>
+                                <property name="javaFieldName" value="strcol"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.DATE"/>
+                                </property>
+                                <property name="databaseFieldName" value="DATECOL"/>
+                                <property name="javaFieldType" value="java.sql.Date"/>
+                                <property name="javaFieldName" value="datecol"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.TIME"/>
+                                </property>
+                                <property name="databaseFieldName" value="TIMECOL"/>
+                                <property name="javaFieldType" value="java.sql.Time"/>
+                                <property name="javaFieldName" value="timecol"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.TIMESTAMP"/>
+                                </property>
+                                <property name="databaseFieldName" value="TSCOL"/>
+                                <property name="javaFieldType" value="java.sql.Timestamp"/>
+                                <property name="javaFieldName" value="tscol"/>
+                            </bean>
+                            <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
+                                <property name="databaseFieldType">
+                                    <util:constant static-field="java.sql.Types.VARBINARY"/>
+                                </property>
+                                <property name="databaseFieldName" value="ARRCOL"/>
+                                <property name="javaFieldType" value="java.lang.Object"/>
+                                <property name="javaFieldName" value="arrcol"/>
+                            </bean>
+                        </list>
+                    </property>
+                </bean>
             </list>
         </property>
     </bean>
@@ -393,4 +535,42 @@
             </list>
         </property>
     </bean>
+    <bean class="org.apache.ignite.cache.QueryEntity">
+        <property name="keyType" value="org.apache.ignite.schema.test.model.TstKey"/>
+        <property name="valueType" value="org.apache.ignite.schema.test.model.Tst"/>
+        <property name="fields">
+            <util:map map-class="java.util.LinkedHashMap">
+                <entry key="pk" value="int"/>
+                <entry key="boolcol" value="boolean"/>
+                <entry key="bytecol" value="byte"/>
+                <entry key="shortcol" value="short"/>
+                <entry key="intcol" value="int"/>
+                <entry key="longcol" value="long"/>
+                <entry key="floatcol" value="float"/>
+                <entry key="doublecol" value="double"/>
+                <entry key="doublecol2" value="double"/>
+                <entry key="bigdecimalcol" value="java.math.BigDecimal"/>
+                <entry key="strcol" value="java.lang.String"/>
+                <entry key="datecol" value="java.sql.Date"/>
+                <entry key="timecol" value="java.sql.Time"/>
+                <entry key="tscol" value="java.sql.Timestamp"/>
+                <entry key="arrcol" value="java.lang.Object"/>
+            </util:map>
+        </property>
+        <property name="indexes">
+            <list>
+                <bean class="org.apache.ignite.cache.QueryIndex">
+                    <property name="name" value="PRIMARY_KEY_1"/>
+                    <property name="indexType">
+                        <util:constant static-field="org.apache.ignite.cache.QueryIndexType.SORTED"/>
+                    </property>
+                    <property name="fields">
+                        <map>
+                            <entry key="PK" value="true"/>
+                        </map>
+                    </property>
+                </bean>
+            </list>
+        </property>
+    </bean>
 </beans>

http://git-wip-us.apache.org/repos/asf/ignite/blob/58b55b53/modules/schema-import/src/test/java/org/apache/ignite/schema/test/parser/DbMetadataParserTest.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/test/java/org/apache/ignite/schema/test/parser/DbMetadataParserTest.java b/modules/schema-import/src/test/java/org/apache/ignite/schema/test/parser/DbMetadataParserTest.java
index 6a2bf1d..a954029 100644
--- a/modules/schema-import/src/test/java/org/apache/ignite/schema/test/parser/DbMetadataParserTest.java
+++ b/modules/schema-import/src/test/java/org/apache/ignite/schema/test/parser/DbMetadataParserTest.java
@@ -102,10 +102,19 @@ public class DbMetadataParserTest extends AbstractSchemaImportTest {
     }
 
     /**
+     * Check that type has not null full db name.
+     *
+     * @param type Type to check.
+     */
+    public void checkSchemaHasFullDbName(PojoDescriptor type) {
+        assertNotNull("The DB schema should have a non-null fullDbName", type.fullDbName());
+    }
+
+    /**
      * Test that metadata generated correctly.
      */
     public void testCheckMetadata() {
-        assertEquals("Metadata should contain 3 element", 3, pojos.size());
+        assertEquals("Metadata should contain 5 elements", 5, pojos.size());
 
         Iterator<PojoDescriptor> it = pojos.iterator();
 
@@ -117,5 +126,9 @@ public class DbMetadataParserTest extends AbstractSchemaImportTest {
         checkType(it.next());
 
         checkType(it.next());
+
+        checkSchemaHasFullDbName(it.next());
+
+        checkType(it.next());
     }
-}
\ No newline at end of file
+}


[10/11] ignite git commit: ignite-1.5 Fixed client discovery impl to skip node failed message processing while disconnected.

Posted by sb...@apache.org.
ignite-1.5 Fixed client discovery impl to skip node failed message processing while disconnected.


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

Branch: refs/heads/ignite-1537
Commit: d4687d9f636b38736d327351ca4b22c3262a2ae8
Parents: 58b55b5
Author: sboikov <sb...@gridgain.com>
Authored: Mon Dec 21 10:19:51 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Dec 21 10:19:51 2015 +0300

----------------------------------------------------------------------
 .../discovery/GridDiscoveryManager.java         |  4 +-
 .../dht/preloader/GridDhtPreloader.java         | 29 ------------
 .../ignite/spi/discovery/tcp/ClientImpl.java    | 48 +++++++++++---------
 .../IgniteClientReconnectCacheTest.java         | 26 +++++++++--
 .../cache/IgniteCachePutAllRestartTest.java     |  2 +-
 5 files changed, 53 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d4687d9f/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index 92d66d7..72a2bef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -1641,7 +1641,9 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
 
         if (cache == null) {
             throw new IgniteException("Failed to resolve nodes topology [cacheName=" + cacheName +
-                ", topVer=" + topVer + ", history=" + discoCacheHist.keySet() +
+                ", topVer=" + topVer +
+                ", history=" + discoCacheHist.keySet() +
+                ", snap=" + snap +
                 ", locNode=" + ctx.discovery().localNode() + ']');
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/d4687d9f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
index c46a66c..f0054e4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPreloader.java
@@ -48,7 +48,6 @@ import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtFuture
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtInvalidPartitionException;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtLocalPartition;
 import org.apache.ignite.internal.processors.cache.distributed.dht.GridDhtPartitionTopology;
-import org.apache.ignite.internal.util.GridAtomicLong;
 import org.apache.ignite.internal.util.future.GridCompoundFuture;
 import org.apache.ignite.internal.util.future.GridFinishedFuture;
 import org.apache.ignite.internal.util.future.GridFutureAdapter;
@@ -92,9 +91,6 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
     /** */
     private GridDhtPartitionTopology top;
 
-    /** Topology version. */
-    private final GridAtomicLong topVer = new GridAtomicLong();
-
     /** Force key futures. */
     private final ConcurrentMap<IgniteUuid, GridDhtForceKeysFuture<?, ?>> forceKeyFuts = newMap();
 
@@ -149,11 +145,6 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
                 assert e.type() != EVT_NODE_JOINED || n.order() > loc.order() : "Node joined with smaller-than-local " +
                     "order [newOrder=" + n.order() + ", locOrder=" + loc.order() + ']';
 
-                boolean set = topVer.setIfGreater(e.topologyVersion());
-
-                assert set : "Have you configured TcpDiscoverySpi for your in-memory data grid? [newVer=" +
-                    e.topologyVersion() + ", curVer=" + topVer.get() + ", evt=" + e + ']';
-
                 if (e.type() == EVT_NODE_LEFT || e.type() == EVT_NODE_FAILED) {
                     for (GridDhtAssignmentFetchFuture fut : pendingAssignmentFetchFuts.values())
                         fut.onNodeLeft(e.eventNode().id());
@@ -238,20 +229,6 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
     }
 
     /** {@inheritDoc} */
-    @Override public void onKernalStart() throws IgniteCheckedException {
-        if (log.isDebugEnabled())
-            log.debug("DHT rebalancer onKernalStart callback.");
-
-        ClusterNode loc = cctx.localNode();
-
-        assert loc.metrics().getStartTime() > 0;
-
-        final long startTopVer = loc.order();
-
-        topVer.setIfGreater(startTopVer);
-    }
-
-    /** {@inheritDoc} */
     @Override public void preloadPredicate(IgnitePredicate<GridCacheEntryInfo> preloadPred) {
         super.preloadPredicate(preloadPred);
 
@@ -382,12 +359,6 @@ public class GridDhtPreloader extends GridCachePreloaderAdapter {
     /** {@inheritDoc} */
     @Override public void onReconnected() {
         startFut = new GridFutureAdapter<>();
-
-        long topVer0 = cctx.kernalContext().discovery().topologyVersion();
-
-        assert topVer0 > 0 : topVer0;
-
-        topVer.set(topVer0);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/d4687d9f/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 8f6c8a9..850cc24 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@ -1828,36 +1828,42 @@ class ClientImpl extends TcpDiscoveryImpl {
                 return;
             }
 
-            if (!getLocalNodeId().equals(msg.creatorNodeId())) {
-                TcpDiscoveryNode node = rmtNodes.remove(msg.failedNodeId());
+            if (nodeAdded()) {
+                if (!getLocalNodeId().equals(msg.creatorNodeId())) {
+                    TcpDiscoveryNode node = rmtNodes.remove(msg.failedNodeId());
 
-                if (node == null) {
-                    if (log.isDebugEnabled())
-                        log.debug("Discarding node failed message since node is not found [msg=" + msg + ']');
+                    if (node == null) {
+                        if (log.isDebugEnabled())
+                            log.debug("Discarding node failed message since node is not found [msg=" + msg + ']');
 
-                    return;
-                }
+                        return;
+                    }
 
-                Collection<ClusterNode> top = updateTopologyHistory(msg.topologyVersion(), msg);
+                    Collection<ClusterNode> top = updateTopologyHistory(msg.topologyVersion(), msg);
 
-                if (state != CONNECTED) {
-                    if (log.isDebugEnabled())
-                        log.debug("Discarding node failed message (join process is not finished): " + msg);
+                    if (state != CONNECTED) {
+                        if (log.isDebugEnabled())
+                            log.debug("Discarding node failed message (join process is not finished): " + msg);
 
-                    return;
-                }
+                        return;
+                    }
 
-                if (msg.warning() != null) {
-                    ClusterNode creatorNode = rmtNodes.get(msg.creatorNodeId());
+                    if (msg.warning() != null) {
+                        ClusterNode creatorNode = rmtNodes.get(msg.creatorNodeId());
 
-                    U.warn(log, "Received EVT_NODE_FAILED event with warning [" +
-                        "nodeInitiatedEvt=" + (creatorNode != null ? creatorNode : msg.creatorNodeId()) +
-                        ", msg=" + msg.warning() + ']');
-                }
+                        U.warn(log, "Received EVT_NODE_FAILED event with warning [" +
+                            "nodeInitiatedEvt=" + (creatorNode != null ? creatorNode : msg.creatorNodeId()) +
+                            ", msg=" + msg.warning() + ']');
+                    }
 
-                notifyDiscovery(EVT_NODE_FAILED, msg.topologyVersion(), node, top);
+                    notifyDiscovery(EVT_NODE_FAILED, msg.topologyVersion(), node, top);
 
-                spi.stats.onNodeFailed();
+                    spi.stats.onNodeFailed();
+                }
+            }
+            else {
+                if (log.isDebugEnabled())
+                    log.debug("Ignore topology message, local node not added to topology: " + msg);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/d4687d9f/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
index 5234d6e..ad6c46f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java
@@ -1088,7 +1088,7 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
 
         clientMode = true;
 
-        final int CLIENTS = 2;
+        final int CLIENTS = 5;
 
         List<Ignite> clients = new ArrayList<>();
 
@@ -1103,12 +1103,14 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
         int nodes = SRV_CNT + CLIENTS;
         int srvNodes = SRV_CNT;
 
-        for (int iter = 0; iter < 3; iter++) {
+        for (int iter = 0; iter < 5; iter++) {
             log.info("Iteration: " + iter);
 
             reconnectClientNodes(log, clients, grid(0), null);
 
-            for (Ignite client : clients) {
+            final int expNodes = CLIENTS + srvNodes;
+
+            for (final Ignite client : clients) {
                 IgniteCache<Object, Object> cache = client.cache(null);
 
                 assertNotNull(cache);
@@ -1117,6 +1119,14 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
 
                 assertEquals(1, cache.get(client.name()));
 
+                GridTestUtils.waitForCondition(new GridAbsPredicate() {
+                    @Override public boolean apply() {
+                        ClusterGroup grp = client.cluster().forCacheNodes(null);
+
+                        return grp.nodes().size() == expNodes;
+                    }
+                }, 5000);
+
                 ClusterGroup grp = client.cluster().forCacheNodes(null);
 
                 assertEquals(CLIENTS + srvNodes, grp.nodes().size());
@@ -1127,7 +1137,15 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
             }
 
             for (int i = 0; i < nodes; i++) {
-                Ignite ignite = grid(i);
+                final Ignite ignite = grid(i);
+
+                GridTestUtils.waitForCondition(new GridAbsPredicate() {
+                    @Override public boolean apply() {
+                        ClusterGroup grp = ignite.cluster().forCacheNodes(null);
+
+                        return grp.nodes().size() == expNodes;
+                    }
+                }, 5000);
 
                 ClusterGroup grp = ignite.cluster().forCacheNodes(null);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/d4687d9f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePutAllRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePutAllRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePutAllRestartTest.java
index 3e124f3..96a396c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePutAllRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePutAllRestartTest.java
@@ -121,7 +121,7 @@ public class IgniteCachePutAllRestartTest extends GridCommonAbstractTest {
 
                     iter++;
 
-                    if (iter % 10 == 0)
+                    if (iter % 1000 == 0)
                         log.info("Iteration: " + iter);
                 }
 


[11/11] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1537

Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-1.5' into ignite-1537


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

Branch: refs/heads/ignite-1537
Commit: e97a96c7eadc2161b7b84d73098343f0c9f3bb78
Parents: 1a00ab5 d4687d9
Author: sboikov <sb...@gridgain.com>
Authored: Mon Dec 21 10:22:50 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Dec 21 10:22:50 2015 +0300

----------------------------------------------------------------------
 RELEASE_NOTES.txt                               |   1 +
 ...ComputeClientBinaryTaskExecutionExample.java |   4 +-
 .../CacheClientBinaryPutGetExample.java         |   6 +-
 .../datagrid/CacheClientBinaryQueryExample.java |  10 +-
 .../datagrid/CacheEntryProcessorExample.java    | 157 ++++++
 .../examples/datagrid/CacheQueryExample.java    |   4 +-
 .../apache/ignite/examples/model/Address.java   |  72 +++
 .../apache/ignite/examples/model/Employee.java  |  93 ++++
 .../ignite/examples/model/EmployeeKey.java      |  93 ++++
 .../ignite/examples/model/Organization.java     |  85 +++-
 .../ignite/examples/model/OrganizationType.java |  32 ++
 .../apache/ignite/examples/model/Person.java    |   2 +-
 .../ignite/examples/model/binary/Address.java   |  72 ---
 .../ignite/examples/model/binary/Employee.java  |  93 ----
 .../examples/model/binary/EmployeeKey.java      |  93 ----
 .../examples/model/binary/Organization.java     |  93 ----
 .../examples/model/binary/OrganizationType.java |  32 --
 .../ignite/examples/model/package-info.java     |  23 +
 .../datagrid/CacheEntryProcessorExample.java    | 147 ++++++
 .../ScalarCacheEntryProcessorExample.scala      | 125 +++++
 .../ignite/examples/CacheExamplesSelfTest.java  |   8 +
 .../java8/examples/CacheExamplesSelfTest.java   |   8 +
 .../tests/examples/ScalarExamplesSelfTest.scala |   5 +
 .../ignite/internal/binary/BinaryContext.java   |  16 +-
 .../processors/cache/CacheObjectAdapter.java    |   3 +
 .../cache/BinarySerializationQuerySelfTest.java |   2 +-
 .../IgniteCacheAbstractFieldsQuerySelfTest.java |  68 ++-
 modules/platforms/cpp/core/impl/doxygen.h       |  53 --
 .../cpp/core/include/ignite/binary/binary.h     |   5 +
 .../core/include/ignite/binary/binary_consts.h  |   5 +
 .../include/ignite/binary/binary_containers.h   |   5 +
 .../include/ignite/binary/binary_raw_reader.h   |   5 +
 .../include/ignite/binary/binary_raw_writer.h   |   5 +
 .../core/include/ignite/binary/binary_reader.h  |   5 +
 .../core/include/ignite/binary/binary_type.h    |  17 +
 .../core/include/ignite/binary/binary_writer.h  |   5 +
 .../cpp/core/include/ignite/cache/cache.h       |   5 +
 .../cpp/core/include/ignite/cache/cache_entry.h |   5 +
 .../core/include/ignite/cache/cache_peek_mode.h |   5 +
 .../cpp/core/include/ignite/cache/query/query.h |   5 +
 .../include/ignite/cache/query/query_argument.h |   6 +
 .../include/ignite/cache/query/query_cursor.h   |   5 +
 .../ignite/cache/query/query_fields_cursor.h    |   5 +
 .../ignite/cache/query/query_fields_row.h       |   5 +
 .../include/ignite/cache/query/query_scan.h     |   5 +
 .../core/include/ignite/cache/query/query_sql.h |   5 +
 .../ignite/cache/query/query_sql_fields.h       |   5 +
 .../include/ignite/cache/query/query_text.h     |   5 +
 .../platforms/cpp/core/include/ignite/guid.h    |   5 +
 .../platforms/cpp/core/include/ignite/ignite.h  |   5 +
 .../core/include/ignite/ignite_configuration.h  |   5 +
 .../cpp/core/include/ignite/ignite_error.h      |   5 +
 .../cpp/core/include/ignite/ignition.h          |   5 +
 modules/platforms/cpp/core/namespaces.dox       |  53 ++
 .../ignite/schema/generator/CodeGenerator.java  |   7 +-
 .../schema/test/AbstractSchemaImportTest.java   |  18 +
 .../org/apache/ignite/schema/test/model/Tst.txt | 506 +++++++++++++++++++
 .../apache/ignite/schema/test/model/TstKey.txt  |  96 ++++
 .../schema/test/model/ignite-type-metadata.xml  | 180 +++++++
 .../test/parser/DbMetadataParserTest.java       |  17 +-
 60 files changed, 1935 insertions(+), 480 deletions(-)
----------------------------------------------------------------------



[08/11] ignite git commit: IGNITE-2187: CPP: Added documentation for files.

Posted by sb...@apache.org.
IGNITE-2187: CPP: Added documentation for files.


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

Branch: refs/heads/ignite-1537
Commit: 0c7dfec5d802832b0798c1982a543fd85af50acc
Parents: a34bcc8
Author: isapego <is...@gridgain.com>
Authored: Fri Dec 18 18:04:46 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Dec 18 18:04:46 2015 +0300

----------------------------------------------------------------------
 modules/platforms/cpp/core/impl/doxygen.h       | 53 --------------------
 .../cpp/core/include/ignite/binary/binary.h     |  5 ++
 .../core/include/ignite/binary/binary_consts.h  |  5 ++
 .../include/ignite/binary/binary_containers.h   |  5 ++
 .../include/ignite/binary/binary_raw_reader.h   |  5 ++
 .../include/ignite/binary/binary_raw_writer.h   |  5 ++
 .../core/include/ignite/binary/binary_reader.h  |  5 ++
 .../core/include/ignite/binary/binary_type.h    | 17 +++++++
 .../core/include/ignite/binary/binary_writer.h  |  5 ++
 .../cpp/core/include/ignite/cache/cache.h       |  5 ++
 .../cpp/core/include/ignite/cache/cache_entry.h |  5 ++
 .../core/include/ignite/cache/cache_peek_mode.h |  5 ++
 .../cpp/core/include/ignite/cache/query/query.h |  5 ++
 .../include/ignite/cache/query/query_argument.h |  6 +++
 .../include/ignite/cache/query/query_cursor.h   |  5 ++
 .../ignite/cache/query/query_fields_cursor.h    |  5 ++
 .../ignite/cache/query/query_fields_row.h       |  5 ++
 .../include/ignite/cache/query/query_scan.h     |  5 ++
 .../core/include/ignite/cache/query/query_sql.h |  5 ++
 .../ignite/cache/query/query_sql_fields.h       |  5 ++
 .../include/ignite/cache/query/query_text.h     |  5 ++
 .../platforms/cpp/core/include/ignite/guid.h    |  5 ++
 .../platforms/cpp/core/include/ignite/ignite.h  |  5 ++
 .../core/include/ignite/ignite_configuration.h  |  5 ++
 .../cpp/core/include/ignite/ignite_error.h      |  5 ++
 .../cpp/core/include/ignite/ignition.h          |  5 ++
 modules/platforms/cpp/core/namespaces.dox       | 53 ++++++++++++++++++++
 27 files changed, 191 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/impl/doxygen.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/impl/doxygen.h b/modules/platforms/cpp/core/impl/doxygen.h
deleted file mode 100644
index ed237f6..0000000
--- a/modules/platforms/cpp/core/impl/doxygen.h
+++ /dev/null
@@ -1,53 +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.
- */
-
-/**
- * \mainpage Apache Ignite C++
- *
- * Apache Ignite In-Memory Data Fabric is a high-performance, integrated and distributed in-memory platform for
- * computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with
- * traditional disk-based or flash-based technologies.
- */
- 
- /**
-  * Apache %Ignite API.
-  */
- namespace ignite
- {
-	 /**
-	  * %Ignite Binary Objects API.
-	  */
-	 namespace binary
-	 {
-		 // Empty.
-	 }
-	 
-	 /**
-	  * %Ignite %Cache API.
-	  */
-	 namespace cache
-	 {
-		 /**
-		  * Contains APIs for creating and executing cache queries.
-		  */
-		 namespace query
-		 {
-			 // Empty.
-		 }
-	 }
- }
- 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/binary/binary.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary.h b/modules/platforms/cpp/core/include/ignite/binary/binary.h
index 15476fe..1ffa3e5 100644
--- a/modules/platforms/cpp/core/include/ignite/binary/binary.h
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Includes all binary API headers.
+ */
+
 #ifndef _IGNITE_BINARY
 #define _IGNITE_BINARY
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/binary/binary_consts.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary_consts.h b/modules/platforms/cpp/core/include/ignite/binary/binary_consts.h
index 7f0fd1e..db7cc38 100644
--- a/modules/platforms/cpp/core/include/ignite/binary/binary_consts.h
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary_consts.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares specific binary constatants
+ */
+
 #ifndef _IGNITE_BINARY_CONSTS
 #define _IGNITE_BINARY_CONSTS
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/binary/binary_containers.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary_containers.h b/modules/platforms/cpp/core/include/ignite/binary/binary_containers.h
index 61b7265..94b2c81 100644
--- a/modules/platforms/cpp/core/include/ignite/binary/binary_containers.h
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary_containers.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares binary reader and writer types for the collections.
+ */
+
 #ifndef _IGNITE_BINARY_CONTAINERS
 #define _IGNITE_BINARY_CONTAINERS
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/binary/binary_raw_reader.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary_raw_reader.h b/modules/platforms/cpp/core/include/ignite/binary/binary_raw_reader.h
index eb39c2d..d986225 100644
--- a/modules/platforms/cpp/core/include/ignite/binary/binary_raw_reader.h
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary_raw_reader.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::binary::BinaryRawReader class.
+ */
+
 #ifndef _IGNITE_BINARY_RAW_READER
 #define _IGNITE_BINARY_RAW_READER
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/binary/binary_raw_writer.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary_raw_writer.h b/modules/platforms/cpp/core/include/ignite/binary/binary_raw_writer.h
index 2c3e75b..9bbf4ed 100644
--- a/modules/platforms/cpp/core/include/ignite/binary/binary_raw_writer.h
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary_raw_writer.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::binary::BinaryRawWriter class.
+ */
+
 #ifndef _IGNITE_BINARY_RAW_WRITER
 #define _IGNITE_BINARY_RAW_WRITER
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/binary/binary_reader.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary_reader.h b/modules/platforms/cpp/core/include/ignite/binary/binary_reader.h
index 75d2384..e991d4e 100644
--- a/modules/platforms/cpp/core/include/ignite/binary/binary_reader.h
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary_reader.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::binary::BinaryReader class.
+ */
+
 #ifndef _IGNITE_BINARY_READER
 #define _IGNITE_BINARY_READER
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/binary/binary_type.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary_type.h b/modules/platforms/cpp/core/include/ignite/binary/binary_type.h
index 353b3bb..636171e 100644
--- a/modules/platforms/cpp/core/include/ignite/binary/binary_type.h
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary_type.h
@@ -15,6 +15,12 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::binary::BinaryType class template and helping macros
+ * to declare binary type specialisation for user types.
+ */
+
 #ifndef _IGNITE_BINARY_TYPE
 #define _IGNITE_BINARY_TYPE
 
@@ -25,6 +31,7 @@
 #include "ignite/ignite_error.h"
 
 /**
+ * @def IGNITE_BINARY_TYPE_START(T)
  * Start binary type definition.
  */
 #define IGNITE_BINARY_TYPE_START(T) \
@@ -33,12 +40,14 @@ struct BinaryType<T> \
 {
 
 /**
+ * @def IGNITE_BINARY_TYPE_END
  * End binary type definition.
  */
 #define IGNITE_BINARY_TYPE_END \
 };
 
 /**
+ * @def IGNITE_BINARY_GET_TYPE_ID_AS_CONST(id)
  * Implementation of GetTypeId() which returns predefined constant.
  */
 #define IGNITE_BINARY_GET_TYPE_ID_AS_CONST(id) \
@@ -48,6 +57,7 @@ int32_t GetTypeId() \
 }
 
 /**
+ * @def IGNITE_BINARY_GET_TYPE_ID_AS_HASH(typeName)
  * Implementation of GetTypeId() which returns hash of passed type name.
  */
 #define IGNITE_BINARY_GET_TYPE_ID_AS_HASH(typeName) \
@@ -57,6 +67,7 @@ int32_t GetTypeId() \
 }
 
 /**
+ * @def IGNITE_BINARY_GET_TYPE_NAME_AS_IS(typeName)
  * Implementation of GetTypeName() which returns type name as is.
  */
 #define IGNITE_BINARY_GET_TYPE_NAME_AS_IS(typeName) \
@@ -66,6 +77,7 @@ std::string GetTypeName() \
 }
 
 /**
+ * @def IGNITE_BINARY_GET_FIELD_ID_AS_HASH
  * Default implementation of GetFieldId() function which returns Java-way hash code of the string.
  */
 #define IGNITE_BINARY_GET_FIELD_ID_AS_HASH \
@@ -75,6 +87,7 @@ int32_t GetFieldId(const char* name) \
 }
 
 /**
+ * @def IGNITE_BINARY_GET_HASH_CODE_ZERO(T)
  * Implementation of GetHashCode() function which always returns 0.
  */
 #define IGNITE_BINARY_GET_HASH_CODE_ZERO(T) \
@@ -84,6 +97,7 @@ int32_t GetHashCode(const T& obj) \
 }
 
 /**
+ * @def IGNITE_BINARY_IS_NULL_FALSE(T)
  * Implementation of IsNull() function which always returns false.
  */
 #define IGNITE_BINARY_IS_NULL_FALSE(T) \
@@ -93,6 +107,7 @@ bool IsNull(const T& obj) \
 }
 
 /**
+ * @def IGNITE_BINARY_IS_NULL_IF_NULLPTR(T)
  * Implementation of IsNull() function which return true if passed object is null pointer.
  */
 #define IGNITE_BINARY_IS_NULL_IF_NULLPTR(T) \
@@ -102,6 +117,7 @@ bool IsNull(const T& obj) \
 }
 
 /**
+ * @def IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(T)
  * Implementation of GetNull() function which returns an instance created with defult constructor.
  */
 #define IGNITE_BINARY_GET_NULL_DEFAULT_CTOR(T) \
@@ -111,6 +127,7 @@ T GetNull() \
 }
 
 /**
+ * @def IGNITE_BINARY_GET_NULL_NULLPTR(T)
  * Implementation of GetNull() function which returns NULL pointer.
  */
 #define IGNITE_BINARY_GET_NULL_NULLPTR(T) \

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/binary/binary_writer.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/binary/binary_writer.h b/modules/platforms/cpp/core/include/ignite/binary/binary_writer.h
index 0c7cc68..475f454 100644
--- a/modules/platforms/cpp/core/include/ignite/binary/binary_writer.h
+++ b/modules/platforms/cpp/core/include/ignite/binary/binary_writer.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::binary::BinaryWriter class.
+ */
+
 #ifndef _IGNITE_BINARY_WRITER
 #define _IGNITE_BINARY_WRITER
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/cache/cache.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/cache.h b/modules/platforms/cpp/core/include/ignite/cache/cache.h
index ad23d62..6727293 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/cache.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/cache.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::cache::Cache class.
+ */
+
 #ifndef _IGNITE_CACHE
 #define _IGNITE_CACHE
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/cache/cache_entry.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/cache_entry.h b/modules/platforms/cpp/core/include/ignite/cache/cache_entry.h
index d6d244d..9ca3946 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/cache_entry.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/cache_entry.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::cache::CacheEntry class.
+ */
+
 #ifndef _IGNITE_CACHE_ENTRY
 #define _IGNITE_CACHE_ENTRY
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h b/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h
index be61887..192013d 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/cache_peek_mode.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::cache::CachePeekMode enum.
+ */
+
 #ifndef _IGNITE_CACHE_PEEK_MODE
 #define _IGNITE_CACHE_PEEK_MODE
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/cache/query/query.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query.h b/modules/platforms/cpp/core/include/ignite/cache/query/query.h
index c469e85..de7578e 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Includes all query API headers.
+ */
+
 #ifndef _IGNITE_QUERY
 #define _IGNITE_QUERY
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/cache/query/query_argument.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_argument.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_argument.h
index 37871c9..5cd22a6 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_argument.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_argument.h
@@ -15,6 +15,12 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::cache::query::QueryArgument class template and
+ * ignite::cache::query::QueryArgumentBase interface.
+ */
+
 #ifndef _IGNITE_CACHE_QUERY_ARGUMENT
 #define _IGNITE_CACHE_QUERY_ARGUMENT
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h
index 4ef2405..6f507d2 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_cursor.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::cache::query::QueryCursor class template.
+ */
+
 #ifndef _IGNITE_CACHE_QUERY_CURSOR
 #define _IGNITE_CACHE_QUERY_CURSOR
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_cursor.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_cursor.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_cursor.h
index 8410c81..b74ae5a 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_cursor.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_cursor.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::cache::query::QueryFieldsCursor class.
+ */
+
 #ifndef _IGNITE_CACHE_QUERY_FIELDS_CURSOR
 #define _IGNITE_CACHE_QUERY_FIELDS_CURSOR
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_row.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_row.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_row.h
index 1e70a8d..bb10e9e 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_row.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_fields_row.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::cache::query::QueryFieldsRow class.
+ */
+
 #ifndef _IGNITE_CACHE_QUERY_FIELDS_ROW
 #define _IGNITE_CACHE_QUERY_FIELDS_ROW
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/cache/query/query_scan.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_scan.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_scan.h
index fa47269..7bd6bbb 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_scan.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_scan.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::cache::query::ScanQuery class.
+ */
+
 #ifndef _IGNITE_CACHE_QUERY_SCAN
 #define _IGNITE_CACHE_QUERY_SCAN
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h
index 8feb785..186e6e3 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::cache::query::SqlQuery class.
+ */
+
 #ifndef _IGNITE_CACHE_QUERY_SQL
 #define _IGNITE_CACHE_QUERY_SQL
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
index e720cdf..7076595 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_sql_fields.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::cache::query::SqlFieldsQuery class.
+ */
+
 #ifndef _IGNITE_CACHE_QUERY_SQL_FIELDS
 #define _IGNITE_CACHE_QUERY_SQL_FIELDS
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/cache/query/query_text.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/cache/query/query_text.h b/modules/platforms/cpp/core/include/ignite/cache/query/query_text.h
index 4494883..b68f65e 100644
--- a/modules/platforms/cpp/core/include/ignite/cache/query/query_text.h
+++ b/modules/platforms/cpp/core/include/ignite/cache/query/query_text.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::cache::query::TextQuery class.
+ */
+
 #ifndef _IGNITE_CACHE_QUERY_TEXT
 #define _IGNITE_CACHE_QUERY_TEXT
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/guid.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/guid.h b/modules/platforms/cpp/core/include/ignite/guid.h
index 9469769..a9999e7 100644
--- a/modules/platforms/cpp/core/include/ignite/guid.h
+++ b/modules/platforms/cpp/core/include/ignite/guid.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::Guid class.
+ */
+
 #ifndef _IGNITE_GUID
 #define _IGNITE_GUID
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/ignite.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/ignite.h b/modules/platforms/cpp/core/include/ignite/ignite.h
index f194b1a..25b9f0c 100644
--- a/modules/platforms/cpp/core/include/ignite/ignite.h
+++ b/modules/platforms/cpp/core/include/ignite/ignite.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::Ignite class.
+ */
+
 #ifndef _IGNITE
 #define _IGNITE
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/ignite_configuration.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/ignite_configuration.h b/modules/platforms/cpp/core/include/ignite/ignite_configuration.h
index c4c6c8e..e46e2bd 100644
--- a/modules/platforms/cpp/core/include/ignite/ignite_configuration.h
+++ b/modules/platforms/cpp/core/include/ignite/ignite_configuration.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::IgniteConfiguration class.
+ */
+
 #ifndef _IGNITE_CONFIGURATION
 #define _IGNITE_CONFIGURATION
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/ignite_error.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/ignite_error.h b/modules/platforms/cpp/core/include/ignite/ignite_error.h
index b1fc772..3b192b1 100644
--- a/modules/platforms/cpp/core/include/ignite/ignite_error.h
+++ b/modules/platforms/cpp/core/include/ignite/ignite_error.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::IgniteError class.
+ */
+
 #ifndef _IGNITE_ERROR
 #define _IGNITE_ERROR
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/include/ignite/ignition.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/ignition.h b/modules/platforms/cpp/core/include/ignite/ignition.h
index f0046b0..fe594ec 100644
--- a/modules/platforms/cpp/core/include/ignite/ignition.h
+++ b/modules/platforms/cpp/core/include/ignite/ignition.h
@@ -15,6 +15,11 @@
  * limitations under the License.
  */
 
+/**
+ * @file
+ * Declares ignite::Ignition class.
+ */
+
 #ifndef _IGNITE_IGNITION
 #define _IGNITE_IGNITION
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/0c7dfec5/modules/platforms/cpp/core/namespaces.dox
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/namespaces.dox b/modules/platforms/cpp/core/namespaces.dox
new file mode 100644
index 0000000..ed237f6
--- /dev/null
+++ b/modules/platforms/cpp/core/namespaces.dox
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+/**
+ * \mainpage Apache Ignite C++
+ *
+ * Apache Ignite In-Memory Data Fabric is a high-performance, integrated and distributed in-memory platform for
+ * computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with
+ * traditional disk-based or flash-based technologies.
+ */
+ 
+ /**
+  * Apache %Ignite API.
+  */
+ namespace ignite
+ {
+	 /**
+	  * %Ignite Binary Objects API.
+	  */
+	 namespace binary
+	 {
+		 // Empty.
+	 }
+	 
+	 /**
+	  * %Ignite %Cache API.
+	  */
+	 namespace cache
+	 {
+		 /**
+		  * Contains APIs for creating and executing cache queries.
+		  */
+		 namespace query
+		 {
+			 // Empty.
+		 }
+	 }
+ }
+ 
\ No newline at end of file


[07/11] ignite git commit: Minor fix.

Posted by sb...@apache.org.
Minor fix.


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

Branch: refs/heads/ignite-1537
Commit: a34bcc8ac44c7db168e49a336596396389b00e1e
Parents: ece33ec
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Dec 18 17:40:33 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Dec 18 17:40:33 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/processors/cache/CacheObjectAdapter.java      | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a34bcc8a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java
index df20646..70f5ea6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectAdapter.java
@@ -33,6 +33,9 @@ import org.apache.ignite.plugin.extensions.communication.MessageWriter;
  */
 public abstract class CacheObjectAdapter implements CacheObject, Externalizable {
     /** */
+    private static final long serialVersionUID = 2006765505127197251L;
+
+    /** */
     @GridToStringInclude
     @GridDirectTransient
     protected Object val;


[03/11] ignite git commit: IGNITE-2201 - Fixed affinity collocation with AffinityKey and examples model

Posted by sb...@apache.org.
IGNITE-2201 - Fixed affinity collocation with AffinityKey and examples model


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

Branch: refs/heads/ignite-1537
Commit: bda0b19c7f4af8f51823ddeb2e23583a3217dd5a
Parents: d391daa
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Fri Dec 18 15:29:09 2015 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Fri Dec 18 15:30:23 2015 +0300

----------------------------------------------------------------------
 ...ComputeClientBinaryTaskExecutionExample.java |  4 +-
 .../CacheClientBinaryPutGetExample.java         |  6 +-
 .../datagrid/CacheClientBinaryQueryExample.java | 10 +--
 .../examples/datagrid/CacheQueryExample.java    |  4 +-
 .../apache/ignite/examples/model/Address.java   | 72 +++++++++++++++
 .../apache/ignite/examples/model/Employee.java  | 93 ++++++++++++++++++++
 .../ignite/examples/model/EmployeeKey.java      | 93 ++++++++++++++++++++
 .../ignite/examples/model/Organization.java     | 85 ++++++++++++++++--
 .../ignite/examples/model/OrganizationType.java | 32 +++++++
 .../apache/ignite/examples/model/Person.java    |  2 +-
 .../ignite/examples/model/binary/Address.java   | 72 ---------------
 .../ignite/examples/model/binary/Employee.java  | 93 --------------------
 .../examples/model/binary/EmployeeKey.java      | 93 --------------------
 .../examples/model/binary/Organization.java     | 93 --------------------
 .../examples/model/binary/OrganizationType.java | 32 -------
 .../ignite/examples/model/package-info.java     | 23 +++++
 .../ignite/internal/binary/BinaryContext.java   | 16 +++-
 17 files changed, 417 insertions(+), 406 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/binary/computegrid/ComputeClientBinaryTaskExecutionExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/binary/computegrid/ComputeClientBinaryTaskExecutionExample.java b/examples/src/main/java/org/apache/ignite/examples/binary/computegrid/ComputeClientBinaryTaskExecutionExample.java
index d839c96..aced78c 100644
--- a/examples/src/main/java/org/apache/ignite/examples/binary/computegrid/ComputeClientBinaryTaskExecutionExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/binary/computegrid/ComputeClientBinaryTaskExecutionExample.java
@@ -22,8 +22,8 @@ import java.util.Arrays;
 import java.util.Collection;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.Ignition;
-import org.apache.ignite.examples.model.binary.Address;
-import org.apache.ignite.examples.model.binary.Employee;
+import org.apache.ignite.examples.model.Address;
+import org.apache.ignite.examples.model.Employee;
 import org.apache.ignite.binary.BinaryObject;
 
 /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/CacheClientBinaryPutGetExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/CacheClientBinaryPutGetExample.java b/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/CacheClientBinaryPutGetExample.java
index b6fc455..f0f57af 100644
--- a/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/CacheClientBinaryPutGetExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/CacheClientBinaryPutGetExample.java
@@ -28,9 +28,9 @@ import org.apache.ignite.Ignition;
 import org.apache.ignite.cache.CacheAtomicityMode;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.examples.model.binary.Address;
-import org.apache.ignite.examples.model.binary.Organization;
-import org.apache.ignite.examples.model.binary.OrganizationType;
+import org.apache.ignite.examples.model.Address;
+import org.apache.ignite.examples.model.Organization;
+import org.apache.ignite.examples.model.OrganizationType;
 import org.apache.ignite.binary.BinaryObject;
 
 /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/CacheClientBinaryQueryExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/CacheClientBinaryQueryExample.java b/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/CacheClientBinaryQueryExample.java
index b05cbb5..11c00e9 100644
--- a/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/CacheClientBinaryQueryExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/binary/datagrid/CacheClientBinaryQueryExample.java
@@ -34,11 +34,11 @@ import org.apache.ignite.cache.query.SqlFieldsQuery;
 import org.apache.ignite.cache.query.SqlQuery;
 import org.apache.ignite.cache.query.TextQuery;
 import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.examples.model.binary.Address;
-import org.apache.ignite.examples.model.binary.Employee;
-import org.apache.ignite.examples.model.binary.EmployeeKey;
-import org.apache.ignite.examples.model.binary.Organization;
-import org.apache.ignite.examples.model.binary.OrganizationType;
+import org.apache.ignite.examples.model.Address;
+import org.apache.ignite.examples.model.Employee;
+import org.apache.ignite.examples.model.EmployeeKey;
+import org.apache.ignite.examples.model.Organization;
+import org.apache.ignite.examples.model.OrganizationType;
 import org.apache.ignite.binary.BinaryObject;
 
 /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/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 ace7395..98af93c 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
@@ -273,8 +273,8 @@ public class CacheQueryExample {
         Organization org1 = new Organization("ApacheIgnite");
         Organization org2 = new Organization("Other");
 
-        orgCache.put(org1.id, org1);
-        orgCache.put(org2.id, org2);
+        orgCache.put(org1.id(), org1);
+        orgCache.put(org2.id(), org2);
 
         IgniteCache<AffinityKey<Long>, Person> personCache = Ignition.ignite().cache(PERSON_CACHE);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/model/Address.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/model/Address.java b/examples/src/main/java/org/apache/ignite/examples/model/Address.java
new file mode 100644
index 0000000..184de4a
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/model/Address.java
@@ -0,0 +1,72 @@
+/*
+ * 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.examples.model;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+
+/**
+ * Employee address.
+ * <p>
+ * This class implements {@link org.apache.ignite.binary.Binarylizable} only for example purposes,
+ * in order to show how to customize serialization and deserialization of
+ * binary objects.
+ */
+public class Address implements Binarylizable {
+    /** Street. */
+    private String street;
+
+    /** ZIP code. */
+    private int zip;
+
+    /**
+     * Required for binary deserialization.
+     */
+    public Address() {
+        // No-op.
+    }
+
+    /**
+     * @param street Street.
+     * @param zip ZIP code.
+     */
+    public Address(String street, int zip) {
+        this.street = street;
+        this.zip = zip;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+        writer.writeString("street", street);
+        writer.writeInt("zip", zip);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+        street = reader.readString("street");
+        zip = reader.readInt("zip");
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return "Address [street=" + street +
+            ", zip=" + zip + ']';
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/model/Employee.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/model/Employee.java b/examples/src/main/java/org/apache/ignite/examples/model/Employee.java
new file mode 100644
index 0000000..a59ffce
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/model/Employee.java
@@ -0,0 +1,93 @@
+/*
+ * 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.examples.model;
+
+import java.util.Collection;
+
+/**
+ * This class represents employee object.
+ */
+public class Employee {
+    /** Name. */
+    private String name;
+
+    /** Salary. */
+    private long salary;
+
+    /** Address. */
+    private Address addr;
+
+    /** Departments. */
+    private Collection<String> departments;
+
+    /**
+     * Required for binary deserialization.
+     */
+    public Employee() {
+        // No-op.
+    }
+
+    /**
+     * @param name Name.
+     * @param salary Salary.
+     * @param addr Address.
+     * @param departments Departments.
+     */
+    public Employee(String name, long salary, Address addr, Collection<String> departments) {
+        this.name = name;
+        this.salary = salary;
+        this.addr = addr;
+        this.departments = departments;
+    }
+
+    /**
+     * @return Name.
+     */
+    public String name() {
+        return name;
+    }
+
+    /**
+     * @return Salary.
+     */
+    public long salary() {
+        return salary;
+    }
+
+    /**
+     * @return Address.
+     */
+    public Address address() {
+        return addr;
+    }
+
+    /**
+     * @return Departments.
+     */
+    public Collection<String> departments() {
+        return departments;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return "Employee [name=" + name +
+            ", salary=" + salary +
+            ", address=" + addr +
+            ", departments=" + departments + ']';
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/model/EmployeeKey.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/model/EmployeeKey.java b/examples/src/main/java/org/apache/ignite/examples/model/EmployeeKey.java
new file mode 100644
index 0000000..55e7967
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/model/EmployeeKey.java
@@ -0,0 +1,93 @@
+/*
+ * 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.examples.model;
+
+import org.apache.ignite.cache.affinity.AffinityKeyMapped;
+
+/**
+ * This class represents key for employee object.
+ * <p>
+ * Used in query example to collocate employees
+ * with their organizations.
+ */
+public class EmployeeKey {
+    /** ID. */
+    private int id;
+
+    /** Organization ID. */
+    @AffinityKeyMapped
+    private int organizationId;
+
+    /**
+     * Required for binary deserialization.
+     */
+    public EmployeeKey() {
+        // No-op.
+    }
+
+    /**
+     * @param id ID.
+     * @param organizationId Organization ID.
+     */
+    public EmployeeKey(int id, int organizationId) {
+        this.id = id;
+        this.organizationId = organizationId;
+    }
+
+    /**
+     * @return ID.
+     */
+    public int id() {
+        return id;
+    }
+
+    /**
+     * @return Organization ID.
+     */
+    public int organizationId() {
+        return organizationId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object o) {
+        if (this == o)
+            return true;
+
+        if (o == null || getClass() != o.getClass())
+            return false;
+
+        EmployeeKey key = (EmployeeKey)o;
+
+        return id == key.id && organizationId == key.organizationId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int hashCode() {
+        int res = id;
+
+        res = 31 * res + organizationId;
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return "EmployeeKey [id=" + id +
+            ", organizationId=" + organizationId + ']';
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/model/Organization.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/model/Organization.java b/examples/src/main/java/org/apache/ignite/examples/model/Organization.java
index 2500584..70d4eee 100644
--- a/examples/src/main/java/org/apache/ignite/examples/model/Organization.java
+++ b/examples/src/main/java/org/apache/ignite/examples/model/Organization.java
@@ -17,28 +17,42 @@
 
 package org.apache.ignite.examples.model;
 
-import java.io.Serializable;
+import java.sql.Timestamp;
 import java.util.concurrent.atomic.AtomicLong;
 import org.apache.ignite.cache.query.annotations.QuerySqlField;
 
 /**
- * Organization class.
+ * This class represents organization object.
  */
-public class Organization implements Serializable {
+public class Organization {
     /** */
     private static final AtomicLong ID_GEN = new AtomicLong();
 
     /** Organization ID (indexed). */
     @QuerySqlField(index = true)
-    public Long id;
+    private Long id;
 
     /** Organization name (indexed). */
     @QuerySqlField(index = true)
-    public String name;
+    private String name;
+
+    /** Address. */
+    private Address addr;
+
+    /** Type. */
+    private OrganizationType type;
+
+    /** Last update time. */
+    private Timestamp lastUpdated;
+
+    /**
+     * Required for binary deserialization.
+     */
+    public Organization() {
+        // No-op.
+    }
 
     /**
-     * Create organization.
-     *
      * @param name Organization name.
      */
     public Organization(String name) {
@@ -47,8 +61,63 @@ public class Organization implements Serializable {
         this.name = name;
     }
 
+    /**
+     * @param name Name.
+     * @param addr Address.
+     * @param type Type.
+     * @param lastUpdated Last update time.
+     */
+    public Organization(String name, Address addr, OrganizationType type, Timestamp lastUpdated) {
+        id = ID_GEN.incrementAndGet();
+
+        this.name = name;
+        this.addr = addr;
+        this.type = type;
+
+        this.lastUpdated = lastUpdated;
+    }
+
+    /**
+     * @return Organization ID.
+     */
+    public Long id() {
+        return id;
+    }
+
+    /**
+     * @return Name.
+     */
+    public String name() {
+        return name;
+    }
+
+    /**
+     * @return Address.
+     */
+    public Address address() {
+        return addr;
+    }
+
+    /**
+     * @return Type.
+     */
+    public OrganizationType type() {
+        return type;
+    }
+
+    /**
+     * @return Last update time.
+     */
+    public Timestamp lastUpdated() {
+        return lastUpdated;
+    }
+
     /** {@inheritDoc} */
     @Override public String toString() {
-        return "Organization [id=" + id + ", name=" + name + ']';
+        return "Organization [id=" + id +
+            ", name=" + name +
+            ", address=" + addr +
+            ", type=" + type +
+            ", lastUpdated=" + lastUpdated + ']';
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/model/OrganizationType.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/model/OrganizationType.java b/examples/src/main/java/org/apache/ignite/examples/model/OrganizationType.java
new file mode 100644
index 0000000..8b22600
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/model/OrganizationType.java
@@ -0,0 +1,32 @@
+/*
+ * 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.examples.model;
+
+/**
+ * Organization type enum.
+ */
+public enum OrganizationType {
+    /** Non-profit organization. */
+    NON_PROFIT,
+
+    /** Private organization. */
+    PRIVATE,
+
+    /** Government organization. */
+    GOVERNMENT
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/model/Person.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/model/Person.java b/examples/src/main/java/org/apache/ignite/examples/model/Person.java
index 618fa5c..6d3a6df 100644
--- a/examples/src/main/java/org/apache/ignite/examples/model/Person.java
+++ b/examples/src/main/java/org/apache/ignite/examples/model/Person.java
@@ -77,7 +77,7 @@ public class Person implements Serializable {
         // Generate unique ID for this person.
         id = ID_GEN.incrementAndGet();
 
-        orgId = org.id;
+        orgId = org.id();
 
         this.firstName = firstName;
         this.lastName = lastName;

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/model/binary/Address.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/model/binary/Address.java b/examples/src/main/java/org/apache/ignite/examples/model/binary/Address.java
deleted file mode 100644
index 2d17cb8..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/model/binary/Address.java
+++ /dev/null
@@ -1,72 +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.examples.model.binary;
-
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.Binarylizable;
-import org.apache.ignite.binary.BinaryReader;
-import org.apache.ignite.binary.BinaryWriter;
-
-/**
- * Employee address.
- * <p>
- * This class implements {@link org.apache.ignite.binary.Binarylizable} only for example purposes,
- * in order to show how to customize serialization and deserialization of
- * binary objects.
- */
-public class Address implements Binarylizable {
-    /** Street. */
-    private String street;
-
-    /** ZIP code. */
-    private int zip;
-
-    /**
-     * Required for binary deserialization.
-     */
-    public Address() {
-        // No-op.
-    }
-
-    /**
-     * @param street Street.
-     * @param zip ZIP code.
-     */
-    public Address(String street, int zip) {
-        this.street = street;
-        this.zip = zip;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
-        writer.writeString("street", street);
-        writer.writeInt("zip", zip);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
-        street = reader.readString("street");
-        zip = reader.readInt("zip");
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return "Address [street=" + street +
-            ", zip=" + zip + ']';
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/model/binary/Employee.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/model/binary/Employee.java b/examples/src/main/java/org/apache/ignite/examples/model/binary/Employee.java
deleted file mode 100644
index ad82065..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/model/binary/Employee.java
+++ /dev/null
@@ -1,93 +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.examples.model.binary;
-
-import java.util.Collection;
-
-/**
- * This class represents employee object.
- */
-public class Employee {
-    /** Name. */
-    private String name;
-
-    /** Salary. */
-    private long salary;
-
-    /** Address. */
-    private Address addr;
-
-    /** Departments. */
-    private Collection<String> departments;
-
-    /**
-     * Required for binary deserialization.
-     */
-    public Employee() {
-        // No-op.
-    }
-
-    /**
-     * @param name Name.
-     * @param salary Salary.
-     * @param addr Address.
-     * @param departments Departments.
-     */
-    public Employee(String name, long salary, Address addr, Collection<String> departments) {
-        this.name = name;
-        this.salary = salary;
-        this.addr = addr;
-        this.departments = departments;
-    }
-
-    /**
-     * @return Name.
-     */
-    public String name() {
-        return name;
-    }
-
-    /**
-     * @return Salary.
-     */
-    public long salary() {
-        return salary;
-    }
-
-    /**
-     * @return Address.
-     */
-    public Address address() {
-        return addr;
-    }
-
-    /**
-     * @return Departments.
-     */
-    public Collection<String> departments() {
-        return departments;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return "Employee [name=" + name +
-            ", salary=" + salary +
-            ", address=" + addr +
-            ", departments=" + departments + ']';
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/model/binary/EmployeeKey.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/model/binary/EmployeeKey.java b/examples/src/main/java/org/apache/ignite/examples/model/binary/EmployeeKey.java
deleted file mode 100644
index 20367ac..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/model/binary/EmployeeKey.java
+++ /dev/null
@@ -1,93 +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.examples.model.binary;
-
-import org.apache.ignite.cache.affinity.AffinityKeyMapped;
-
-/**
- * This class represents key for employee object.
- * <p>
- * Used in query example to collocate employees
- * with their organizations.
- */
-public class EmployeeKey {
-    /** ID. */
-    private int id;
-
-    /** Organization ID. */
-    @AffinityKeyMapped
-    private int organizationId;
-
-    /**
-     * Required for binary deserialization.
-     */
-    public EmployeeKey() {
-        // No-op.
-    }
-
-    /**
-     * @param id ID.
-     * @param organizationId Organization ID.
-     */
-    public EmployeeKey(int id, int organizationId) {
-        this.id = id;
-        this.organizationId = organizationId;
-    }
-
-    /**
-     * @return ID.
-     */
-    public int id() {
-        return id;
-    }
-
-    /**
-     * @return Organization ID.
-     */
-    public int organizationId() {
-        return organizationId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean equals(Object o) {
-        if (this == o)
-            return true;
-
-        if (o == null || getClass() != o.getClass())
-            return false;
-
-        EmployeeKey key = (EmployeeKey)o;
-
-        return id == key.id && organizationId == key.organizationId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int hashCode() {
-        int res = id;
-
-        res = 31 * res + organizationId;
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return "EmployeeKey [id=" + id +
-            ", organizationId=" + organizationId + ']';
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/model/binary/Organization.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/model/binary/Organization.java b/examples/src/main/java/org/apache/ignite/examples/model/binary/Organization.java
deleted file mode 100644
index 6b7aca4..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/model/binary/Organization.java
+++ /dev/null
@@ -1,93 +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.examples.model.binary;
-
-import java.sql.Timestamp;
-
-/**
- * This class represents organization object.
- */
-public class Organization {
-    /** Name. */
-    private String name;
-
-    /** Address. */
-    private Address addr;
-
-    /** Type. */
-    private OrganizationType type;
-
-    /** Last update time. */
-    private Timestamp lastUpdated;
-
-    /**
-     * Required for binary deserialization.
-     */
-    public Organization() {
-        // No-op.
-    }
-
-    /**
-     * @param name Name.
-     * @param addr Address.
-     * @param type Type.
-     * @param lastUpdated Last update time.
-     */
-    public Organization(String name, Address addr, OrganizationType type, Timestamp lastUpdated) {
-        this.name = name;
-        this.addr = addr;
-        this.type = type;
-        this.lastUpdated = lastUpdated;
-    }
-
-    /**
-     * @return Name.
-     */
-    public String name() {
-        return name;
-    }
-
-    /**
-     * @return Address.
-     */
-    public Address address() {
-        return addr;
-    }
-
-    /**
-     * @return Type.
-     */
-    public OrganizationType type() {
-        return type;
-    }
-
-    /**
-     * @return Last update time.
-     */
-    public Timestamp lastUpdated() {
-        return lastUpdated;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return "Organization [name=" + name +
-            ", address=" + addr +
-            ", type=" + type +
-            ", lastUpdated=" + lastUpdated + ']';
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/model/binary/OrganizationType.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/model/binary/OrganizationType.java b/examples/src/main/java/org/apache/ignite/examples/model/binary/OrganizationType.java
deleted file mode 100644
index 69804c0..0000000
--- a/examples/src/main/java/org/apache/ignite/examples/model/binary/OrganizationType.java
+++ /dev/null
@@ -1,32 +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.examples.model.binary;
-
-/**
- * Organization type enum.
- */
-public enum OrganizationType {
-    /** Non-profit organization. */
-    NON_PROFIT,
-
-    /** Private organization. */
-    PRIVATE,
-
-    /** Government organization. */
-    GOVERNMENT
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/examples/src/main/java/org/apache/ignite/examples/model/package-info.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/model/package-info.java b/examples/src/main/java/org/apache/ignite/examples/model/package-info.java
new file mode 100644
index 0000000..9ddba67
--- /dev/null
+++ b/examples/src/main/java/org/apache/ignite/examples/model/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * 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 description. -->
+ * Model classes for Apache Ignite examples.
+ */
+
+package org.apache.ignite.examples.model;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/bda0b19c/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
index abe283e..5c63fbd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
@@ -212,7 +212,7 @@ public class BinaryContext implements Externalizable {
         registerPredefinedType(LinkedHashMap.class, 0);
 
         // Classes with overriden default serialization flag.
-        registerPredefinedType(AffinityKey.class, 0);
+        registerPredefinedType(AffinityKey.class, 0, affinityFieldName(AffinityKey.class));
 
         registerPredefinedType(GridMapEntry.class, 60);
         registerPredefinedType(IgniteBiTuple.class, 61);
@@ -761,6 +761,15 @@ public class BinaryContext implements Externalizable {
      * @return GridBinaryClassDescriptor.
      */
     public BinaryClassDescriptor registerPredefinedType(Class<?> cls, int id) {
+        return registerPredefinedType(cls, id, null);
+    }
+
+    /**
+     * @param cls Class.
+     * @param id Type ID.
+     * @return GridBinaryClassDescriptor.
+     */
+    public BinaryClassDescriptor registerPredefinedType(Class<?> cls, int id, String affFieldName) {
         String typeName = typeName(cls.getName());
 
         if (id == 0)
@@ -772,7 +781,7 @@ public class BinaryContext implements Externalizable {
             false,
             id,
             typeName,
-            null,
+            affFieldName,
             BinaryInternalIdMapper.defaultInstance(),
             new BinaryReflectiveSerializer(),
             false,
@@ -784,6 +793,9 @@ public class BinaryContext implements Externalizable {
 
         descByCls.put(cls, desc);
 
+        if (affFieldName != null)
+            affKeyFieldNames.putIfAbsent(id, affFieldName);
+
         return desc;
     }
 


[04/11] ignite git commit: Fixed a single query test.

Posted by sb...@apache.org.
Fixed a single query test.


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

Branch: refs/heads/ignite-1537
Commit: 10bb798d11fe806657412b5f1ae8a917d13f6ee8
Parents: d391daa
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Dec 18 15:54:29 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Dec 18 15:54:29 2015 +0300

----------------------------------------------------------------------
 .../IgniteCacheAbstractFieldsQuerySelfTest.java | 54 ++++++++++++++++----
 1 file changed, 44 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/10bb798d/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
index 07e44da..4c952fc 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
@@ -41,6 +41,7 @@ import org.apache.ignite.cache.query.annotations.QuerySqlField;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.IgniteKernal;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
 import org.apache.ignite.internal.processors.cache.query.GridCacheSqlIndexMetadata;
 import org.apache.ignite.internal.processors.cache.query.GridCacheSqlMetadata;
 import org.apache.ignite.internal.processors.datastructures.GridCacheAtomicLongValue;
@@ -84,6 +85,9 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
     /** Flag indicating if starting node should have cache. */
     protected boolean hasCache;
 
+    /** Whether BinaryMarshaller is set. */
+    protected boolean binaryMarshaller;
+
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -206,6 +210,11 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
     }
 
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        binaryMarshaller = grid(0).configuration().getMarshaller() instanceof BinaryMarshaller;
+    }
+
+    /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
         stopAllGrids();
     }
@@ -249,31 +258,56 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
                     assert types.contains("String");
                     assert types.contains("Integer");
 
-                    assert AffinityKey.class.getName().equals(meta.keyClass("Person"));
+                    if (binaryMarshaller) {
+                        assert Object.class.getName().equals(meta.keyClass("Person"));
+                        assert Object.class.getName().equals(meta.valueClass("Person"));
+                        assert Object.class.getName().equals(meta.valueClass("Organization"));
+                    }
+                    else {
+                        assert AffinityKey.class.getName().equals(meta.keyClass("Person"));
+                        assert Person.class.getName().equals(meta.valueClass("Person"));
+                        assert Organization.class.getName().equals(meta.valueClass("Organization"));
+                    }
+
                     assert String.class.getName().equals(meta.keyClass("Organization"));
                     assert String.class.getName().equals(meta.keyClass("String"));
-
-                    assert Person.class.getName().equals(meta.valueClass("Person"));
-                    assert Organization.class.getName().equals(meta.valueClass("Organization"));
                     assert String.class.getName().equals(meta.valueClass("String"));
 
                     Map<String, String> fields = meta.fields("Person");
 
                     assert fields != null;
                     assert fields.size() == 5;
-                    assert AffinityKey.class.getName().equals(fields.get("_KEY"));
-                    assert Person.class.getName().equals(fields.get("_VAL"));
+
+                    if (binaryMarshaller) {
+                        assert Object.class.getName().equals(fields.get("_KEY"));
+                        assert Object.class.getName().equals(fields.get("_VAL"));
+                        assert Integer.class.getName().equals(fields.get("AGE"));
+                        assert Integer.class.getName().equals(fields.get("ORGID"));
+                    }
+                    else {
+                        assert AffinityKey.class.getName().equals(fields.get("_KEY"));
+                        assert Person.class.getName().equals(fields.get("_VAL"));
+                        assert int.class.getName().equals(fields.get("AGE"));
+                        assert int.class.getName().equals(fields.get("ORGID"));
+                    }
+
                     assert String.class.getName().equals(fields.get("NAME"));
-                    assert int.class.getName().equals(fields.get("AGE"));
-                    assert int.class.getName().equals(fields.get("ORGID"));
 
                     fields = meta.fields("Organization");
 
                     assert fields != null;
                     assertEquals("Fields: " + fields, 5, fields.size());
+
+                    if (binaryMarshaller) {
+                        assert Object.class.getName().equals(fields.get("_VAL"));
+                        assert Integer.class.getName().equals(fields.get("ID"));
+                    }
+                    else {
+                        assert Organization.class.getName().equals(fields.get("_VAL"));
+                        assert int.class.getName().equals(fields.get("ID"));
+                    }
+
                     assert String.class.getName().equals(fields.get("_KEY"));
-                    assert Organization.class.getName().equals(fields.get("_VAL"));
-                    assert int.class.getName().equals(fields.get("ID"));
                     assert String.class.getName().equals(fields.get("NAME"));
 
                     fields = meta.fields("String");


[05/11] ignite git commit: IGNITE-2210: Fixed testMethodAnnotationWithoutGet - it cannot work with BinaryMarshaller at the moment.

Posted by sb...@apache.org.
IGNITE-2210: Fixed testMethodAnnotationWithoutGet - it cannot work with BinaryMarshaller at the moment.


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

Branch: refs/heads/ignite-1537
Commit: 48a1e0a949aadcf28729b27b5413f53cff905981
Parents: 10bb798
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Dec 18 16:08:24 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Dec 18 16:08:24 2015 +0300

----------------------------------------------------------------------
 .../cache/IgniteCacheAbstractFieldsQuerySelfTest.java | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/48a1e0a9/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
index 4c952fc..926d294 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractFieldsQuerySelfTest.java
@@ -846,15 +846,17 @@ public abstract class IgniteCacheAbstractFieldsQuerySelfTest extends GridCommonA
      * @throws Exception If failed.
      */
     public void testMethodAnnotationWithoutGet() throws Exception {
-        QueryCursor<List<?>> qry = grid(0).cache(null)
-            .query(new SqlFieldsQuery("select methodField from Organization where methodField='name-A'")
-            .setPageSize(10));
+        if (!binaryMarshaller) {
+            QueryCursor<List<?>> qry = grid(0).cache(null)
+                .query(new SqlFieldsQuery("select methodField from Organization where methodField='name-A'")
+                    .setPageSize(10));
 
-        List<List<?>> flds = qry.getAll();
+            List<List<?>> flds = qry.getAll();
 
-        assertEquals(1, flds.size());
+            assertEquals(1, flds.size());
 
-        assertEquals("name-A", flds.get(0).get(0));
+            assertEquals("name-A", flds.get(0).get(0));
+        }
     }
 
     /**


[02/11] ignite git commit: fixed compilation error for Java 8

Posted by sb...@apache.org.
fixed compilation error for Java 8


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

Branch: refs/heads/ignite-1537
Commit: d391daaf24f0f1545e223d6d47d58ba8c592e850
Parents: 32cec99
Author: Denis Magda <dm...@gridgain.com>
Authored: Fri Dec 18 15:09:55 2015 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Fri Dec 18 15:09:55 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/BinarySerializationQuerySelfTest.java         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/d391daaf/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinarySerializationQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinarySerializationQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinarySerializationQuerySelfTest.java
index 1eba7d1..669c482 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinarySerializationQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinarySerializationQuerySelfTest.java
@@ -221,7 +221,7 @@ public class BinarySerializationQuerySelfTest extends GridCommonAbstractTest {
         Cache.Entry res = (Cache.Entry)iter.next();
 
         assertEquals(2, res.getKey());
-        assertEquals(20, U.field(res.getValue(), "val"));
+        assertEquals(Integer.valueOf(20), U.field(res.getValue(), "val"));
 
         assert !iter.hasNext();
 


[06/11] ignite git commit: Merge remote-tracking branch 'origin/ignite-1.5' into ignite-1.5

Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-1.5' into ignite-1.5


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

Branch: refs/heads/ignite-1537
Commit: ece33ec4fa7f8c0d53014bda02ab0b7c1a89eef2
Parents: 48a1e0a bda0b19
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Fri Dec 18 16:08:46 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Fri Dec 18 16:08:46 2015 +0300

----------------------------------------------------------------------
 ...ComputeClientBinaryTaskExecutionExample.java |  4 +-
 .../CacheClientBinaryPutGetExample.java         |  6 +-
 .../datagrid/CacheClientBinaryQueryExample.java | 10 +--
 .../examples/datagrid/CacheQueryExample.java    |  4 +-
 .../apache/ignite/examples/model/Address.java   | 72 +++++++++++++++
 .../apache/ignite/examples/model/Employee.java  | 93 ++++++++++++++++++++
 .../ignite/examples/model/EmployeeKey.java      | 93 ++++++++++++++++++++
 .../ignite/examples/model/Organization.java     | 85 ++++++++++++++++--
 .../ignite/examples/model/OrganizationType.java | 32 +++++++
 .../apache/ignite/examples/model/Person.java    |  2 +-
 .../ignite/examples/model/binary/Address.java   | 72 ---------------
 .../ignite/examples/model/binary/Employee.java  | 93 --------------------
 .../examples/model/binary/EmployeeKey.java      | 93 --------------------
 .../examples/model/binary/Organization.java     | 93 --------------------
 .../examples/model/binary/OrganizationType.java | 32 -------
 .../ignite/examples/model/package-info.java     | 23 +++++
 .../ignite/internal/binary/BinaryContext.java   | 16 +++-
 17 files changed, 417 insertions(+), 406 deletions(-)
----------------------------------------------------------------------