ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [50/50] incubator-ignite git commit: IGNITE-950 - Optimizations.
Date Tue, 07 Jul 2015 06:51:22 GMT
IGNITE-950 - Optimizations.


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

Branch: refs/heads/ignite-950
Commit: b10836d9d1b6998f73c48e18fa5330cb170d359f
Parents: bfabbec
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Mon Jul 6 23:50:08 2015 -0700
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Mon Jul 6 23:50:08 2015 -0700

----------------------------------------------------------------------
 .../processors/query/GridQueryProcessor.java    | 32 +++++++++++---------
 .../optimized/OptimizedObjectInputStream.java   |  8 ++++-
 2 files changed, 25 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b10836d9/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index a60cfd1..a2d330a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -1741,6 +1741,9 @@ public class GridQueryProcessor extends GridProcessorAdapter {
         /** Result class. */
         private Class<?> type;
 
+        /** */
+        private volatile int isKeyProp;
+
         /**
          * Constructor.
          *
@@ -1771,25 +1774,26 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                 return ctx.cacheObjects().field(obj, propName);
             }
             else {
-                try {
+                int isKeyProp0 = isKeyProp;
 
-                    return ctx.cacheObjects().field(key, propName);
-                }
-                catch (IgniteFieldNotFoundException e) {
-                    // Ignore
-                }
+                if (isKeyProp0 == 0) {
+                    // Key is allowed to be a non-portable object here.
+                    // We check key before value consistently with ClassProperty.
+                    if (ctx.cacheObjects().hasField(key, propName))
+                        isKeyProp = isKeyProp0 = 1;
+                    else if (ctx.cacheObjects().hasField(val, propName))
+                        isKeyProp = isKeyProp0 = -1;
+                    else {
+                        U.warn(log, "Neither key nor value have property " +
+                            "[propName=" + propName + ", key=" + key + ", val=" + val + "]");
 
-                try {
-                    return ctx.cacheObjects().field(val, propName);
-                }
-                catch (IgniteFieldNotFoundException e) {
-                    // Ignore
+                        return null;
+                    }
                 }
 
-                U.warn(log, "Neither key nor value has property " +
-                    "[propName=" + propName + ", key=" + key + ", val=" + val + "]");
+                obj = isKeyProp0 == 1 ? key : val;
 
-                return null;
+                return ctx.cacheObjects().field(obj, propName);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b10836d9/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
index 69d5e88..b6681ec 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
@@ -1333,7 +1333,7 @@ public class OptimizedObjectInputStream extends ObjectInputStream implements
Opt
             else {
                 in.position(range.start);
 
-                F obj = (F)readObject();
+                F obj = (F)readObjectOverride();
 
                 in.position(start);
 
@@ -1449,7 +1449,13 @@ public class OptimizedObjectInputStream extends ObjectInputStream implements
Opt
          */
         public FieldRange() {
         }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(FieldRange.class, this);
+        }
     }
+
     /** {@inheritDoc} */
     @Override public void registerValidation(ObjectInputValidation obj, int pri) {
         // No-op.


Mime
View raw message