You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2015/11/19 11:10:34 UTC

[1/4] ignite git commit: IGNITE-1917: IDs are always initialized in schema.

Repository: ignite
Updated Branches:
  refs/heads/ignite-1917 29762a291 -> 16194b14b


IGNITE-1917: IDs are always initialized in schema.


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

Branch: refs/heads/ignite-1917
Commit: db988fe1742a13719772454e3f1c7731a63f4cb5
Parents: 29762a2
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Nov 19 11:55:30 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Nov 19 11:55:30 2015 +0300

----------------------------------------------------------------------
 .../internal/portable/PortableSchema.java       | 89 +++++++++-----------
 1 file changed, 39 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/db988fe1/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java
index ff7124e..af4b1b2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java
@@ -99,6 +99,13 @@ public class PortableSchema implements Externalizable {
     private PortableSchema(int schemaId, List<Integer> fieldIds) {
         this.schemaId = schemaId;
 
+        ids = new int[fieldIds.size()];
+
+        for (int i = 0; i < fieldIds.size(); i++)
+            ids[i] = fieldIds.get(i);
+
+        names = new String[fieldIds.size()];
+
         if (fieldIds.size() <= 8) {
             Iterator<Integer> iter = fieldIds.iterator();
 
@@ -114,15 +121,8 @@ public class PortableSchema implements Externalizable {
         else {
             id0 = id1 = id2 = id3 = id4 = id5 = id6 = id7 = 0;
 
-            ids = new int[fieldIds.size()];
-
-            for (int i = 0; i < fieldIds.size(); i++)
-                ids[i] = fieldIds.get(i);
-
             initializeMap(ids);
         }
-
-        names = new String[fieldIds.size()];
     }
 
     /**
@@ -177,41 +177,7 @@ public class PortableSchema implements Externalizable {
      * @return Field ID.
      */
     public int fieldId(int order) {
-        if (idToOrderData == null) {
-            switch (order) {
-                case 0:
-                    return id0;
-
-                case 1:
-                    return id1;
-
-                case 2:
-                    return id2;
-
-                case 3:
-                    return id3;
-
-                case 4:
-                    return id4;
-
-                case 5:
-                    return id5;
-
-                case 6:
-                    return id6;
-
-                case 7:
-                    return id7;
-
-                default:
-                    assert false : "Should not reach here.";
-
-                    return 0;
-            }
-        }
-        else
-            // TODO: Fix possible out of bounds problem.
-            return ids[order];
+        return order < ids.length ? ids[order] : 0;
     }
 
     /**
@@ -320,37 +286,60 @@ public class PortableSchema implements Externalizable {
         if (in.readBoolean()) {
             int size = 0;
 
+            List<Integer> ids0 = new ArrayList<>();
+
             id0 = in.readInt();
-            if (id0 != 0)
+            if (id0 != 0) {
+                ids0.add(id0);
                 size++;
+            }
 
             id1 = in.readInt();
-            if (id1 != 0)
+            if (id1 != 0) {
+                ids0.add(id1);
                 size++;
+            }
 
             id2 = in.readInt();
-            if (id2 != 0)
+            if (id2 != 0) {
+                ids0.add(id2);
                 size++;
+            }
 
             id3 = in.readInt();
-            if (id3 != 0)
+            if (id3 != 0) {
+                ids0.add(id3);
                 size++;
+            }
 
             id4 = in.readInt();
-            if (id4 != 0)
+            if (id4 != 0) {
+                ids0.add(id4);
                 size++;
+            }
 
             id5 = in.readInt();
-            if (id5 != 0)
+            if (id5 != 0) {
+                ids0.add(id5);
                 size++;
+            }
 
             id6 = in.readInt();
-            if (id6 != 0)
+            if (id6 != 0) {
+                ids0.add(id6);
                 size++;
+            }
 
             id7 = in.readInt();
-            if (id7 != 0)
+            if (id7 != 0) {
+                ids0.add(id7);
                 size++;
+            }
+
+            ids = new int[size];
+
+            for (int i = 0; i < size; i++)
+                ids[i] = ids0.get(i);
 
             names = new String[size];
         }


[2/4] ignite git commit: IGNITE-1917: Decreased amount of fields in schema, fixed a bug in builder.

Posted by vo...@apache.org.
IGNITE-1917: Decreased amount of fields in schema, fixed a bug in builder.


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

Branch: refs/heads/ignite-1917
Commit: af4d9be665adf12e41e416298ab432e31133a56d
Parents: db988fe
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Nov 19 12:23:28 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Nov 19 12:23:28 2015 +0300

----------------------------------------------------------------------
 .../internal/portable/BinaryReaderExImpl.java   |  7 +++
 .../internal/portable/PortableSchema.java       | 60 +-------------------
 .../builder/BinaryObjectBuilderImpl.java        |  4 +-
 .../portable/builder/PortableBuilderReader.java | 57 ++++++++++++-------
 4 files changed, 46 insertions(+), 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/af4d9be6/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java
index 35f0488..89160a5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/BinaryReaderExImpl.java
@@ -259,6 +259,13 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Obje
     }
 
     /**
+     * @return Handles.
+     */
+    public BinaryReaderHandles handles() {
+        return rCtx;
+    }
+
+    /**
      * @return Descriptor.
      */
     PortableClassDescriptor descriptor() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/af4d9be6/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java
index af4b1b2..664fb95 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java
@@ -71,18 +71,6 @@ public class PortableSchema implements Externalizable {
     /** ID 4. */
     private int id3;
 
-    /** ID 1. */
-    private int id4;
-
-    /** ID 2. */
-    private int id5;
-
-    /** ID 3. */
-    private int id6;
-
-    /** ID 4. */
-    private int id7;
-
     /**
      * {@link Externalizable} support.
      */
@@ -106,20 +94,16 @@ public class PortableSchema implements Externalizable {
 
         names = new String[fieldIds.size()];
 
-        if (fieldIds.size() <= 8) {
+        if (fieldIds.size() <= 4) {
             Iterator<Integer> iter = fieldIds.iterator();
 
             id0 = iter.hasNext() ? iter.next() : 0;
             id1 = iter.hasNext() ? iter.next() : 0;
             id2 = iter.hasNext() ? iter.next() : 0;
             id3 = iter.hasNext() ? iter.next() : 0;
-            id4 = iter.hasNext() ? iter.next() : 0;
-            id5 = iter.hasNext() ? iter.next() : 0;
-            id6 = iter.hasNext() ? iter.next() : 0;
-            id7 = iter.hasNext() ? iter.next() : 0;
         }
         else {
-            id0 = id1 = id2 = id3 = id4 = id5 = id6 = id7 = 0;
+            id0 = id1 = id2 = id3 = 0;
 
             initializeMap(ids);
         }
@@ -200,18 +184,6 @@ public class PortableSchema implements Externalizable {
             if (id == id3)
                 return 3;
 
-            if (id == id4)
-                return 4;
-
-            if (id == id5)
-                return 5;
-
-            if (id == id6)
-                return 6;
-
-            if (id == id7)
-                return 7;
-
             return ORDER_NOT_FOUND;
         }
         else {
@@ -264,10 +236,6 @@ public class PortableSchema implements Externalizable {
             out.writeInt(id1);
             out.writeInt(id2);
             out.writeInt(id3);
-            out.writeInt(id4);
-            out.writeInt(id5);
-            out.writeInt(id6);
-            out.writeInt(id7);
         }
         else {
             out.writeBoolean(false);
@@ -312,30 +280,6 @@ public class PortableSchema implements Externalizable {
                 size++;
             }
 
-            id4 = in.readInt();
-            if (id4 != 0) {
-                ids0.add(id4);
-                size++;
-            }
-
-            id5 = in.readInt();
-            if (id5 != 0) {
-                ids0.add(id5);
-                size++;
-            }
-
-            id6 = in.readInt();
-            if (id6 != 0) {
-                ids0.add(id6);
-                size++;
-            }
-
-            id7 = in.readInt();
-            if (id7 != 0) {
-                ids0.add(id7);
-                size++;
-            }
-
             ids = new int[size];
 
             for (int i = 0; i < size; i++)

http://git-wip-us.apache.org/repos/asf/ignite/blob/af4d9be6/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java
index 509bd6f..2ce2416 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/BinaryObjectBuilderImpl.java
@@ -208,7 +208,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
             Set<Integer> remainsFlds = null;
 
             if (reader != null) {
-                PortableSchema schema = reader.schema(start);
+                PortableSchema schema = reader.schema();
 
                 Map<Integer, Object> assignedFldsById;
 
@@ -442,7 +442,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
             int fieldIdLen = PortableUtils.fieldIdLength(flags);
             int fieldOffsetLen = PortableUtils.fieldOffsetLength(flags);
 
-            PortableSchema schema = reader.schema(start);
+            PortableSchema schema = reader.schema();
 
             Map<Integer, Object> readCache = new HashMap<>();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/af4d9be6/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderReader.java
index 907c360..f5a66f8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderReader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderReader.java
@@ -44,30 +44,53 @@ import static org.apache.ignite.internal.portable.GridPortableMarshaller.STRING;
  */
 public class PortableBuilderReader implements PortablePositionReadable {
     /** */
-    private final Map<Integer, BinaryObjectBuilderImpl> objMap = new HashMap<>();
+    private final PortableContext ctx;
 
     /** */
-    private final PortableContext ctx;
+    private final byte[] arr;
+
+    /** Object start position. */
+    private final int start;
 
     /** */
     private final BinaryReaderExImpl reader;
 
     /** */
-    private byte[] arr;
+    private final Map<Integer, BinaryObjectBuilderImpl> objMap;
 
     /** */
     private int pos;
 
-    /**
+    /*
+     * Constructor.
+     *
      * @param objImpl Portable object
      */
     PortableBuilderReader(BinaryObjectImpl objImpl) {
         ctx = objImpl.context();
         arr = objImpl.array();
-        pos = objImpl.start();
+        start = pos = objImpl.start();
 
         // TODO: IGNITE-1272 - Is class loader needed here?
-        reader = new BinaryReaderExImpl(ctx, PortableHeapInputStream.create(arr, pos), null, new BinaryReaderHandles());
+        reader = new BinaryReaderExImpl(ctx, PortableHeapInputStream.create(arr, start), null, new BinaryReaderHandles());
+
+        objMap = new HashMap<>();
+    }
+
+    /**
+     * Copying constructor.
+     *
+     * @param other Other reader.
+     * @param start Start position.
+     */
+    PortableBuilderReader(PortableBuilderReader other, int start) {
+        this.ctx = other.ctx;
+        this.arr = other.arr;
+        this.start = pos = start;
+
+        reader = new BinaryReaderExImpl(ctx, PortableHeapInputStream.create(arr, start), null, other.reader.handles());
+
+        this.objMap = other.objMap;
     }
 
     /**
@@ -87,20 +110,10 @@ public class PortableBuilderReader implements PortablePositionReadable {
     /**
      * Get schema of the object, starting at the given position.
      *
-     * @param start Start position.
      * @return Object's schema.
      */
-    public PortableSchema schema(int start) {
-        // We can use current reader in case start is equal to initially recorded position.
-        BinaryReaderExImpl targetReader;
-
-        if (start == pos)
-            targetReader = reader;
-        else
-            targetReader = new BinaryReaderExImpl(ctx, PortableHeapInputStream.create(arr, start), null,
-                new BinaryReaderHandles());
-
-        return targetReader.getOrCreateSchema();
+    public PortableSchema schema() {
+        return reader.getOrCreateSchema();
     }
 
     /**
@@ -371,7 +384,7 @@ public class PortableBuilderReader implements PortablePositionReadable {
                 BinaryObjectBuilderImpl res = objMap.get(objStart);
 
                 if (res == null) {
-                    res = new BinaryObjectBuilderImpl(this, objStart);
+                    res = new BinaryObjectBuilderImpl(new PortableBuilderReader(this, objStart), objStart);
 
                     objMap.put(objStart, res);
                 }
@@ -383,7 +396,7 @@ public class PortableBuilderReader implements PortablePositionReadable {
                 BinaryObjectBuilderImpl res = objMap.get(pos);
 
                 if (res == null) {
-                    res = new BinaryObjectBuilderImpl(this, pos);
+                    res = new BinaryObjectBuilderImpl(new PortableBuilderReader(this, pos), pos);
 
                     objMap.put(pos, res);
                 }
@@ -496,7 +509,7 @@ public class PortableBuilderReader implements PortablePositionReadable {
                 BinaryObjectBuilderImpl res = objMap.get(objStart);
 
                 if (res == null) {
-                    res = new BinaryObjectBuilderImpl(this, objStart);
+                    res = new BinaryObjectBuilderImpl(new PortableBuilderReader(this, objStart), objStart);
 
                     objMap.put(objStart, res);
                 }
@@ -510,7 +523,7 @@ public class PortableBuilderReader implements PortablePositionReadable {
                 BinaryObjectBuilderImpl res = objMap.get(pos);
 
                 if (res == null) {
-                    res = new BinaryObjectBuilderImpl(this, pos);
+                    res = new BinaryObjectBuilderImpl(new PortableBuilderReader(this, pos), pos);
 
                     objMap.put(pos, res);
                 }


[4/4] ignite git commit: IGNITE-1917: Schema simplification.

Posted by vo...@apache.org.
IGNITE-1917: Schema simplification.


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

Branch: refs/heads/ignite-1917
Commit: 16194b14bde19832fed8cb3aa05ef9ac8cef9a22
Parents: 3194234
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Nov 19 13:10:11 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Nov 19 13:10:11 2015 +0300

----------------------------------------------------------------------
 .../internal/portable/PortableSchema.java       | 119 ++++++-------------
 1 file changed, 39 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/16194b14/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java
index 664fb95..72a96b9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableSchema.java
@@ -85,28 +85,11 @@ public class PortableSchema implements Externalizable {
      * @param fieldIds Field IDs.
      */
     private PortableSchema(int schemaId, List<Integer> fieldIds) {
-        this.schemaId = schemaId;
-
-        ids = new int[fieldIds.size()];
-
-        for (int i = 0; i < fieldIds.size(); i++)
-            ids[i] = fieldIds.get(i);
-
-        names = new String[fieldIds.size()];
-
-        if (fieldIds.size() <= 4) {
-            Iterator<Integer> iter = fieldIds.iterator();
+        assert fieldIds != null;
 
-            id0 = iter.hasNext() ? iter.next() : 0;
-            id1 = iter.hasNext() ? iter.next() : 0;
-            id2 = iter.hasNext() ? iter.next() : 0;
-            id3 = iter.hasNext() ? iter.next() : 0;
-        }
-        else {
-            id0 = id1 = id2 = id3 = 0;
+        this.schemaId = schemaId;
 
-            initializeMap(ids);
-        }
+        initialize(fieldIds);
     }
 
     /**
@@ -229,76 +212,24 @@ public class PortableSchema implements Externalizable {
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         out.writeInt(schemaId);
 
-        if (idToOrderData == null) {
-            out.writeBoolean(true);
+        out.writeInt(ids.length);
 
-            out.writeInt(id0);
-            out.writeInt(id1);
-            out.writeInt(id2);
-            out.writeInt(id3);
-        }
-        else {
-            out.writeBoolean(false);
-
-            out.writeInt(ids.length);
-
-            for (Integer id : ids)
-                out.writeInt(id);
-        }
+        for (Integer id : ids)
+            out.writeInt(id);
     }
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
         schemaId = in.readInt();
 
-        if (in.readBoolean()) {
-            int size = 0;
-
-            List<Integer> ids0 = new ArrayList<>();
-
-            id0 = in.readInt();
-            if (id0 != 0) {
-                ids0.add(id0);
-                size++;
-            }
-
-            id1 = in.readInt();
-            if (id1 != 0) {
-                ids0.add(id1);
-                size++;
-            }
-
-            id2 = in.readInt();
-            if (id2 != 0) {
-                ids0.add(id2);
-                size++;
-            }
-
-            id3 = in.readInt();
-            if (id3 != 0) {
-                ids0.add(id3);
-                size++;
-            }
-
-            ids = new int[size];
-
-            for (int i = 0; i < size; i++)
-                ids[i] = ids0.get(i);
+        int idsCnt = in.readInt();
 
-            names = new String[size];
-        }
-        else {
-            int size = in.readInt();
+        List<Integer> fieldIds = new ArrayList<>(idsCnt);
 
-            ids = new int[size];
+        for (int i = 0; i < idsCnt; i++)
+            fieldIds.add(in.readInt());
 
-            for (int i = 0; i < size; i++)
-                ids[i] = in.readInt();
-
-            initializeMap(ids);
-
-            names = new String[size];
-        }
+        initialize(fieldIds);
     }
 
     /**
@@ -393,6 +324,34 @@ public class PortableSchema implements Externalizable {
     }
 
     /**
+     * Initialization routine.
+     *
+     * @param fieldIds Field IDs.
+     */
+    private void initialize(List<Integer> fieldIds) {
+        ids = new int[fieldIds.size()];
+
+        for (int i = 0; i < fieldIds.size(); i++)
+            ids[i] = fieldIds.get(i);
+
+        names = new String[fieldIds.size()];
+
+        if (fieldIds.size() <= 4) {
+            Iterator<Integer> iter = fieldIds.iterator();
+
+            id0 = iter.hasNext() ? iter.next() : 0;
+            id1 = iter.hasNext() ? iter.next() : 0;
+            id2 = iter.hasNext() ? iter.next() : 0;
+            id3 = iter.hasNext() ? iter.next() : 0;
+        }
+        else {
+            id0 = id1 = id2 = id3 = 0;
+
+            initializeMap(ids);
+        }
+    }
+
+    /**
      * Initialize the map.
      *
      * @param vals Values.


[3/4] ignite git commit: IGNITE-1917: Minors.

Posted by vo...@apache.org.
IGNITE-1917: Minors.


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

Branch: refs/heads/ignite-1917
Commit: 3194234c96f6070a6d33f35ed1063aac17939ac1
Parents: af4d9be
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Thu Nov 19 12:27:44 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Thu Nov 19 12:27:44 2015 +0300

----------------------------------------------------------------------
 .../internal/portable/builder/PortableBuilderReader.java    | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3194234c/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderReader.java
index f5a66f8..538c26c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderReader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderReader.java
@@ -49,9 +49,6 @@ public class PortableBuilderReader implements PortablePositionReadable {
     /** */
     private final byte[] arr;
 
-    /** Object start position. */
-    private final int start;
-
     /** */
     private final BinaryReaderExImpl reader;
 
@@ -69,10 +66,10 @@ public class PortableBuilderReader implements PortablePositionReadable {
     PortableBuilderReader(BinaryObjectImpl objImpl) {
         ctx = objImpl.context();
         arr = objImpl.array();
-        start = pos = objImpl.start();
+        pos = objImpl.start();
 
         // TODO: IGNITE-1272 - Is class loader needed here?
-        reader = new BinaryReaderExImpl(ctx, PortableHeapInputStream.create(arr, start), null, new BinaryReaderHandles());
+        reader = new BinaryReaderExImpl(ctx, PortableHeapInputStream.create(arr, pos), null, new BinaryReaderHandles());
 
         objMap = new HashMap<>();
     }
@@ -86,7 +83,7 @@ public class PortableBuilderReader implements PortablePositionReadable {
     PortableBuilderReader(PortableBuilderReader other, int start) {
         this.ctx = other.ctx;
         this.arr = other.arr;
-        this.start = pos = start;
+        this.pos = start;
 
         reader = new BinaryReaderExImpl(ctx, PortableHeapInputStream.create(arr, start), null, other.reader.handles());