ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-1770: WIP.
Date Wed, 28 Oct 2015 15:29:48 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1770 d6a5d8e31 -> c066b6552


IGNITE-1770: WIP.


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

Branch: refs/heads/ignite-1770
Commit: c066b6552993c9d607f84f10a6b654005c837ed2
Parents: d6a5d8e
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Wed Oct 28 18:30:27 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Wed Oct 28 18:30:27 2015 +0300

----------------------------------------------------------------------
 .../internal/portable/PortableReaderExImpl.java | 95 ++++++++++----------
 1 file changed, 48 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c066b655/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableReaderExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableReaderExImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableReaderExImpl.java
index 12ef3bf..1ed59c5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableReaderExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableReaderExImpl.java
@@ -2533,63 +2533,64 @@ public class PortableReaderExImpl implements PortableReader, PortableRawReaderEx
      * @return Field offset.
      */
     private boolean hasField(int id) {
-        if (schema == null) {
-            PortableObjectSchema schema0 = ctx.schema(typeId, schemaId);
+        // TODO: Move to IGNITE-1803.
+//        if (schema == null) {
+//            PortableObjectSchema schema0 = ctx.schema(typeId, schemaId);
+//
+//            if (schema0 == null) {
+//                Map<Integer, Integer> fields = new HashMap<>(256, 0.5f);
+//
+//                int searchPos = footerStart;
+//
+//                while (searchPos < footerEnd) {
+//                    int fieldId = in.readIntPositioned(searchPos);
+//
+//                    fields.put(fieldId, searchPos + 4 - footerStart);
+//
+//                    searchPos += 8;
+//                }
+//
+//                schema0 = new PortableObjectSchema(schemaId, fields);
+//
+//                ctx.addSchema(typeId, schemaId, schema0);
+//            }
+//
+//            schema = schema0;
+//        }
+//
+//        int fieldOffsetPos = schema.fieldOffsetPosition(id);
+//
+//        if (fieldOffsetPos != 0) {
+//            int fieldOffset = in.readIntPositioned(start + footerStart + fieldOffsetPos);
+//
+//            in.position(start + fieldOffset);
+//
+//            return true;
+//        }
+//        else
+//            return false;
 
-            if (schema0 == null) {
-                Map<Integer, Integer> fields = new HashMap<>(256, 0.5f);
+        assert hdrLen != 0;
 
-                int searchPos = footerStart;
+        int searchHead = footerStart;
+        int searchTail = footerEnd;
 
-                while (searchPos < footerEnd) {
-                    int fieldId = in.readIntPositioned(searchPos);
+        while (true) {
+            if (searchHead >= searchTail)
+                return false;
 
-                    fields.put(fieldId, searchPos + 4 - footerStart);
+            int id0 = in.readIntPositioned(searchHead);
 
-                    searchPos += 8;
-                }
+            if (id0 == id) {
+                int offset = in.readIntPositioned(searchHead + 4);
 
-                schema0 = new PortableObjectSchema(schemaId, fields);
+                in.position(start + offset);
 
-                ctx.addSchema(typeId, schemaId, schema0);
+                return true;
             }
 
-            schema = schema0;
+            searchHead += 8;
         }
-
-        int fieldOffsetPos = schema.fieldOffsetPosition(id);
-
-        if (fieldOffsetPos != 0) {
-            int fieldOffset = in.readIntPositioned(start + footerStart + fieldOffsetPos);
-
-            in.position(start + fieldOffset);
-
-            return true;
-        }
-        else
-            return false;
-
-//        assert hdrLen != 0;
-//
-//        int searchHead = footerStart;
-//        int searchTail = footerEnd;
-//
-//        while (true) {
-//            if (searchHead >= searchTail)
-//                return false;
-//
-//            int id0 = in.readIntPositioned(searchHead);
-//
-//            if (id0 == id) {
-//                int offset = in.readIntPositioned(searchHead + 4);
-//
-//                in.position(start + offset);
-//
-//                return true;
-//            }
-//
-//            searchHead += 8;
-//        }
     }
 
     /** {@inheritDoc} */


Mime
View raw message