ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [17/20] ignite git commit: Revert "IGNITE-3154: Fix for optimized BinaryType field lookup."
Date Fri, 01 Jul 2016 10:41:07 GMT
Revert "IGNITE-3154: Fix for optimized BinaryType field lookup."

This reverts commit 1873fd8196a3d44482575a78dea8da86461e0ba4.


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

Branch: refs/heads/ignite-3410
Commit: 02d395cffb63bf5b446d26440cc129fa90381824
Parents: 6664ce8
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Thu Jun 30 09:26:44 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Thu Jun 30 09:26:44 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/binary/BinaryEnumObjectImpl.java  |  7 +------
 .../apache/ignite/internal/binary/BinaryObjectEx.java | 11 -----------
 .../ignite/internal/binary/BinaryObjectExImpl.java    |  4 ++--
 .../ignite/internal/binary/BinaryObjectImpl.java      |  5 -----
 .../internal/binary/BinaryObjectOffheapImpl.java      |  5 -----
 .../ignite/internal/binary/BinaryTypeProxy.java       |  6 +-----
 .../apache/ignite/internal/binary/BinaryUtils.java    | 14 --------------
 .../cache/binary/CacheObjectBinaryProcessorImpl.java  |  7 +++----
 .../internal/processors/query/GridQueryProcessor.java | 11 +++++------
 9 files changed, 12 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/02d395cf/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
index 8cdd4d8..eea85ef9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
@@ -135,11 +135,6 @@ public class BinaryEnumObjectImpl implements BinaryObjectEx, Externalizable,
Cac
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public BinaryType rawType() throws BinaryObjectException {
-        return BinaryUtils.type(ctx, this);
-    }
-
-    /** {@inheritDoc} */
     @Override public <F> F field(String fieldName) throws BinaryObjectException {
         return null;
     }
@@ -204,7 +199,7 @@ public class BinaryEnumObjectImpl implements BinaryObjectEx, Externalizable,
Cac
         BinaryType type;
 
         try {
-            type = rawType();
+            type = type();
         }
         catch (Exception e) {
             type = null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/02d395cf/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectEx.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectEx.java
index e3566bc..ba15d13 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectEx.java
@@ -18,9 +18,6 @@
 package org.apache.ignite.internal.binary;
 
 import org.apache.ignite.binary.BinaryObject;
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.BinaryType;
-import org.jetbrains.annotations.Nullable;
 
 /**
  * Extended binary object interface.
@@ -30,12 +27,4 @@ public interface BinaryObjectEx extends BinaryObject {
      * @return Type ID.
      */
     public int typeId();
-
-    /**
-     * Get raw type.
-     *
-     * @return Raw type
-     * @throws BinaryObjectException If failed.
-     */
-    @Nullable public BinaryType rawType() throws BinaryObjectException;
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/02d395cf/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
index b4e909e..ddf17f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectExImpl.java
@@ -176,7 +176,7 @@ public abstract class BinaryObjectExImpl implements BinaryObjectEx {
         BinaryType meta;
 
         try {
-            meta = rawType();
+            meta = type();
         }
         catch (BinaryObjectException ignore) {
             meta = null;
@@ -222,7 +222,7 @@ public abstract class BinaryObjectExImpl implements BinaryObjectEx {
                         Integer idHash0 = handles.get(val);
 
                         if (idHash0 != null) {  // Circular reference.
-                            BinaryType meta0 = po.rawType();
+                            BinaryType meta0 = po.type();
 
                             assert meta0 != null;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/02d395cf/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java
index 468cc25..9ebee0b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectImpl.java
@@ -231,11 +231,6 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements
Extern
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public BinaryType rawType() throws BinaryObjectException {
-        return BinaryUtils.type(ctx, this);
-    }
-
-    /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Nullable @Override public <F> F field(String fieldName) throws BinaryObjectException
{
         return (F) reader(null).unmarshalField(fieldName);

http://git-wip-us.apache.org/repos/asf/ignite/blob/02d395cf/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java
index 5e9ee95..60527d1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryObjectOffheapImpl.java
@@ -146,11 +146,6 @@ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements
Exter
     }
 
     /** {@inheritDoc} */
-    @Nullable @Override public BinaryType rawType() throws BinaryObjectException {
-        return BinaryUtils.type(ctx, this);
-    }
-
-    /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Nullable @Override public <F> F field(String fieldName) throws BinaryObjectException
{
         return (F) reader(null).unmarshalField(fieldName);

http://git-wip-us.apache.org/repos/asf/ignite/blob/02d395cf/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeProxy.java
index 17b0bc6..e10f2f7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeProxy.java
@@ -18,7 +18,6 @@
 package org.apache.ignite.internal.binary;
 
 import org.apache.ignite.binary.BinaryField;
-import org.apache.ignite.binary.BinaryObjectException;
 import org.apache.ignite.binary.BinaryType;
 import org.apache.ignite.internal.util.tostring.GridToStringExclude;
 import org.apache.ignite.internal.util.typedef.internal.S;
@@ -87,16 +86,13 @@ public class BinaryTypeProxy implements BinaryType {
     }
 
     /**
-     * @return Target type.
+     * @return Target ype.
      */
     private BinaryType target() {
         if (target == null) {
             synchronized (this) {
                 if (target == null) {
                     target = ctx.metadata(typeId);
-
-                    if (target == null)
-                        throw new BinaryObjectException("Failed to get binary type details
[typeId=" + typeId + ']');
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/02d395cf/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
index b7ab310..e986228 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
@@ -2200,20 +2200,6 @@ public class BinaryUtils {
     }
 
     /**
-     * Create binary type.
-     *
-     * @param ctx Context.
-     * @param obj Binary object.
-     * @return Binary type.
-     */
-    public static BinaryType type(BinaryContext ctx, BinaryObjectEx obj) {
-        if (ctx == null)
-            throw new BinaryObjectException("BinaryContext is not set for the object.");
-
-        return ctx.metadata(obj.typeId());
-    }
-
-    /**
      * Enum type.
      */
     private static class EnumType {

http://git-wip-us.apache.org/repos/asf/ignite/blob/02d395cf/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
index 18364f0..d5756a3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessorImpl.java
@@ -26,6 +26,7 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CountDownLatch;
 import javax.cache.Cache;
@@ -670,9 +671,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
      */
     public Object affinityKey(BinaryObject po) {
         try {
-            assert po instanceof BinaryObjectEx;
-
-            BinaryType meta = ((BinaryObjectEx)po).rawType();
+            BinaryType meta = po.type();
 
             if (meta != null) {
                 String affKeyFieldName = meta.affinityKeyFieldName();
@@ -680,7 +679,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
                 if (affKeyFieldName != null)
                     return po.field(affKeyFieldName);
             }
-            else {
+            else if (po instanceof BinaryObjectEx) {
                 int id = ((BinaryObjectEx)po).typeId();
 
                 String affKeyFieldName = binaryCtx.affinityKeyFieldName(id);

http://git-wip-us.apache.org/repos/asf/ignite/blob/02d395cf/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 c4c3ad6..074e7e5 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
@@ -36,7 +36,6 @@ import org.apache.ignite.events.CacheQueryExecutedEvent;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.internal.binary.BinaryObjectEx;
 import org.apache.ignite.internal.processors.GridProcessorAdapter;
 import org.apache.ignite.internal.processors.cache.CacheEntryImpl;
 import org.apache.ignite.internal.processors.cache.CacheObject;
@@ -2005,9 +2004,9 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                 obj = isKeyProp0 == 1 ? key : val;
             }
 
-            assert obj instanceof BinaryObjectEx;
+            assert obj instanceof BinaryObject;
 
-            BinaryObjectEx obj0 = (BinaryObjectEx)obj;
+            BinaryObject obj0 = (BinaryObject)obj;
 
             return fieldValue(obj0);
         }
@@ -2018,11 +2017,11 @@ public class GridQueryProcessor extends GridProcessorAdapter {
          * @param obj Target object.
          * @return Binary field.
          */
-        private BinaryField binaryField(BinaryObjectEx obj) {
+        private BinaryField binaryField(BinaryObject obj) {
             BinaryField field0 = field;
 
             if (field0 == null && !fieldTaken) {
-                BinaryType type = obj.rawType();
+                BinaryType type = obj.type();
 
                 if (type != null) {
                     field0 = type.field(propName);
@@ -2045,7 +2044,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
          * @return Field value.
          */
         @SuppressWarnings("IfMayBeConditional")
-        private Object fieldValue(BinaryObjectEx obj) {
+        private Object fieldValue(BinaryObject obj) {
             BinaryField field = binaryField(obj);
 
             if (field != null)


Mime
View raw message