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/18 14:40:05 UTC

[31/50] [abbrv] ignite git commit: IGNITE-1917: Simplifying schema (2).

IGNITE-1917: Simplifying schema (2).


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

Branch: refs/heads/ignite-1917
Commit: 19dddcc9c89574e8ae143f02f58b1fb3466f37d7
Parents: 678314f
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Tue Nov 17 18:14:28 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Tue Nov 17 18:14:28 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/portable/PortableSchema.java   | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/19dddcc9/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 7738ae5..2d840ad 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
@@ -44,9 +44,6 @@ public class PortableSchema implements Externalizable {
     /** Empty cell. */
     private static final int MAP_EMPTY = 0;
 
-    /** Inline flag. */
-    private boolean inline;
-
     /** IDs depending on order. */
     private int[] ids;
 
@@ -100,8 +97,6 @@ public class PortableSchema implements Externalizable {
         this.schemaId = schemaId;
 
         if (fieldIds.size() <= 8) {
-            inline = true;
-
             Iterator<Integer> iter = fieldIds.iterator();
 
             id0 = iter.hasNext() ? iter.next() : 0;
@@ -114,8 +109,6 @@ public class PortableSchema implements Externalizable {
             id7 = iter.hasNext() ? iter.next() : 0;
         }
         else {
-            inline = false;
-
             id0 = id1 = id2 = id3 = id4 = id5 = id6 = id7 = 0;
 
             ids = new int[fieldIds.size()];
@@ -141,7 +134,7 @@ public class PortableSchema implements Externalizable {
      * @return Field ID.
      */
     public int fieldId(int order) {
-        if (inline) {
+        if (idToOrderData == null) {
             switch (order) {
                 case 0:
                     return id0;
@@ -184,7 +177,7 @@ public class PortableSchema implements Externalizable {
      * @return Offset or {@code 0} if there is no such field.
      */
     public int order(int id) {
-        if (inline) {
+        if (idToOrderData == null) {
             if (id == id0)
                 return 0;
 
@@ -254,7 +247,7 @@ public class PortableSchema implements Externalizable {
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         out.writeInt(schemaId);
 
-        if (inline) {
+        if (idToOrderData == null) {
             out.writeBoolean(true);
 
             out.writeInt(id0);
@@ -281,8 +274,6 @@ public class PortableSchema implements Externalizable {
         schemaId = in.readInt();
 
         if (in.readBoolean()) {
-            inline = true;
-
             id0 = in.readInt();
             id1 = in.readInt();
             id2 = in.readInt();
@@ -293,8 +284,6 @@ public class PortableSchema implements Externalizable {
             id7 = in.readInt();
         }
         else {
-            inline = false;
-
             int size = in.readInt();
 
             ids = new int[size];