ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [25/50] ignite git commit: IGNITE-2208 Queries with object arguments doesn't work wth BinaryMarshaller: use 'toBinary' for arguments conversion.
Date Wed, 14 Sep 2016 11:10:41 GMT
IGNITE-2208 Queries with object arguments doesn't work wth BinaryMarshaller: use 'toBinary'
for arguments conversion.


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

Branch: refs/heads/ignite-3661
Commit: bdc1b10cabcefb6684adcdb22bb6106e44148516
Parents: 385355a
Author: sboikov <sboikov@gridgain.com>
Authored: Tue Sep 6 14:45:01 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Tue Sep 6 14:45:01 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/IgniteCacheProxy.java      | 12 +++++-----
 .../IgniteBinaryObjectQueryArgumentsTest.java   | 25 ++++++++++----------
 2 files changed, 19 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/bdc1b10c/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 8b2e605..81d4b49 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -777,11 +777,13 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
                 final SqlQuery sqlQry = (SqlQuery) qry;
 
                 convertToBinary(sqlQry.getArgs());
-            } else if (qry instanceof SpiQuery) {
+            }
+            else if (qry instanceof SpiQuery) {
                 final SpiQuery spiQry = (SpiQuery) qry;
 
                 convertToBinary(spiQry.getArgs());
-            } else if (qry instanceof SqlFieldsQuery) {
+            }
+            else if (qry instanceof SqlFieldsQuery) {
                 final SqlFieldsQuery fieldsQry = (SqlFieldsQuery) qry;
 
                 convertToBinary(fieldsQry.getArgs());
@@ -798,10 +800,8 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
         if (args == null)
             return;
 
-        for (int i = 0; i < args.length; i++) {
-            if (args[i] != null && !BinaryUtils.isBinaryType(args[i].getClass()))
-                args[i] = ctx.toCacheObject(args[i]);
-        }
+        for (int i = 0; i < args.length; i++)
+            args[i] = ctx.cacheObjects().binary().toBinary(args[i]);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/bdc1b10c/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsTest.java
index 8a0c5c8..d87b8b5 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectQueryArgumentsTest.java
@@ -56,31 +56,31 @@ public class IgniteBinaryObjectQueryArgumentsTest extends GridCommonAbstractTest
     private static final int NODES = 3;
 
     /** */
-    public static final String PRIM_CACHE = "prim-cache";
+    private static final String PRIM_CACHE = "prim-cache";
 
     /** */
-    public static final String STR_CACHE = "str-cache";
+    private static final String STR_CACHE = "str-cache";
 
     /** */
-    public static final String ENUM_CACHE = "enum-cache";
+    private static final String ENUM_CACHE = "enum-cache";
 
     /** */
-    public static final String UUID_CACHE = "uuid-cache";
+    private static final String UUID_CACHE = "uuid-cache";
 
     /** */
-    public static final String DATE_CACHE = "date-cache";
+    private static final String DATE_CACHE = "date-cache";
 
     /** */
-    public static final String TIMESTAMP_CACHE = "timestamp-cache";
+    private static final String TIMESTAMP_CACHE = "timestamp-cache";
 
     /** */
-    public static final String BIG_DECIMAL_CACHE = "decimal-cache";
+    private static final String BIG_DECIMAL_CACHE = "decimal-cache";
 
     /** */
-    public static final String OBJECT_CACHE = "obj-cache";
+    private static final String OBJECT_CACHE = "obj-cache";
 
     /** */
-    public static final String FIELD_CACHE = "field-cache";
+    private static final String FIELD_CACHE = "field-cache";
 
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
@@ -110,6 +110,7 @@ public class IgniteBinaryObjectQueryArgumentsTest extends GridCommonAbstractTest
     }
 
     /**
+     * @param cacheName Cache name.
      * @return Cache config.
      */
     protected CacheConfiguration getCacheConfiguration(final String cacheName) {
@@ -368,7 +369,7 @@ public class IgniteBinaryObjectQueryArgumentsTest extends GridCommonAbstractTest
     }
 
     /**
-     * @throws Exception
+     * @throws Exception If failed.
      */
     public void testFieldSearch() throws Exception {
         final IgniteCache<Integer, SearchValue> cache = ignite(0).cache(FIELD_CACHE);
@@ -455,7 +456,7 @@ public class IgniteBinaryObjectQueryArgumentsTest extends GridCommonAbstractTest
         /**
          * @param id Key.
          */
-        public TestKey(int id) {
+        TestKey(int id) {
             this.id = id;
         }
 
@@ -536,7 +537,7 @@ public class IgniteBinaryObjectQueryArgumentsTest extends GridCommonAbstractTest
          * @param person Person.
          * @param enumKey Enum.
          */
-        public SearchValue(
+        SearchValue(
             final UUID uuid,
             final String str,
             final BigDecimal decimal,


Mime
View raw message