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: Added PortablePositionReadable interface.
Date Mon, 26 Oct 2015 13:10:32 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1770 40aa800a2 -> 99f4fd3ad


IGNITE-1770: Added PortablePositionReadable interface.


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

Branch: refs/heads/ignite-1770
Commit: 99f4fd3adc69892f2e8f2f8dd1a7bf75aeeaf4b7
Parents: 40aa800
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Mon Oct 26 16:10:57 2015 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Mon Oct 26 16:10:57 2015 +0300

----------------------------------------------------------------------
 .../portable/PortablePositionReadable.java      | 31 ++++++++++++++
 .../internal/portable/PortableReaderExImpl.java |  5 +--
 .../ignite/internal/portable/PortableUtils.java | 43 ++++----------------
 .../portable/builder/PortableBuilderImpl.java   | 10 ++---
 .../portable/builder/PortableBuilderReader.java | 11 ++---
 .../portable/builder/PortableLazyArrayList.java |  6 +--
 .../builder/PortableLazyLinkedList.java         |  6 +--
 .../portable/builder/PortableLazyMap.java       |  6 +--
 .../portable/builder/PortableLazySet.java       |  4 +-
 .../streams/PortableAbstractInputStream.java    |  6 +--
 .../streams/PortableHeapInputStream.java        |  2 +-
 .../portable/streams/PortableInputStream.java   | 12 ++----
 .../streams/PortableOffheapInputStream.java     |  2 +-
 .../PlatformBigEndianInputStreamImpl.java       |  4 +-
 .../memory/PlatformInputStreamImpl.java         |  2 +-
 15 files changed, 73 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortablePositionReadable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortablePositionReadable.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortablePositionReadable.java
new file mode 100644
index 0000000..8536f70
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortablePositionReadable.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.portable;
+
+/**
+ * Interface allowing for positioned read.
+ */
+public interface PortablePositionReadable {
+    /**
+     * Read integer at the given position.
+     *
+     * @param pos Position.
+     * @return Value.
+     */
+    public int readIntPositioned(int pos);
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/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 2e16ee1..c1adc92 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
@@ -96,7 +96,6 @@ import static org.apache.ignite.internal.portable.GridPortableMarshaller.OBJ_ARR
 import static org.apache.ignite.internal.portable.GridPortableMarshaller.OPTM_MARSH;
 import static org.apache.ignite.internal.portable.GridPortableMarshaller.PORTABLE_OBJ;
 import static org.apache.ignite.internal.portable.GridPortableMarshaller.PROPERTIES_MAP;
-import static org.apache.ignite.internal.portable.GridPortableMarshaller.SCHEMA_ID_POS;
 import static org.apache.ignite.internal.portable.GridPortableMarshaller.SHORT;
 import static org.apache.ignite.internal.portable.GridPortableMarshaller.SHORT_ARR;
 import static org.apache.ignite.internal.portable.GridPortableMarshaller.STRING;
@@ -2539,7 +2538,7 @@ public class PortableReaderExImpl implements PortableReader, PortableRawReaderEx
             if (searchHead >= searchTail)
                 return false;
 
-            int id0 = in.readInt(searchHead);
+            int id0 = in.readIntPositioned(searchHead);
 
             if (id0 == id) {
                 in.position(searchHead + 8);
@@ -2547,7 +2546,7 @@ public class PortableReaderExImpl implements PortableReader, PortableRawReaderEx
                 return true;
             }
 
-            int len = in.readInt(searchHead + 4);
+            int len = in.readIntPositioned(searchHead + 4);
 
             searchHead += (8 + len);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableUtils.java
index ed11574..d2bf579 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/PortableUtils.java
@@ -17,9 +17,7 @@
 
 package org.apache.ignite.internal.portable;
 
-import org.apache.ignite.internal.portable.builder.PortableBuilderReader;
 import org.apache.ignite.internal.portable.builder.PortableLazyValue;
-import org.apache.ignite.internal.portable.streams.PortableInputStream;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.portable.PortableException;
 import org.apache.ignite.portable.PortableObject;
@@ -79,7 +77,7 @@ import static org.apache.ignite.internal.portable.GridPortableMarshaller.UUID;
 import static org.apache.ignite.internal.portable.GridPortableMarshaller.UUID_ARR;
 
 /**
- *
+ * Portable utils.
  */
 public class PortableUtils {
     /** */
@@ -565,50 +563,23 @@ public class PortableUtils {
      * @param start Object start position inside the stream.
      * @return Raw offset.
      */
-    public static int rawOffset(PortableInputStream in, int start) {
-        int len = in.readInt(start + GridPortableMarshaller.TOTAL_LEN_POS);
-        int schemaId = in.readInt(start + GridPortableMarshaller.SCHEMA_ID_POS);
-
-        if (schemaId == 0)
-            // No schema, raw offset is located on schema offset position.
-            return in.readInt(start + GridPortableMarshaller.SCHEMA_OR_RAW_OFF_POS);
-        else {
-            // Schema exists.
-            int schemaOff = in.readInt(start + GridPortableMarshaller.SCHEMA_OR_RAW_OFF_POS);
-
-            if ((((len - schemaOff) >> 2) & 0x1) == 0x0)
-                // Even amount of records in schema => no raw offset.
-                return len;
-            else
-                // Odd amount of records in schema => raw offset is the very last 4 bytes
in object.
-                return in.readInt(start + len - 4);
-        }
-    }
-
-    /**
-     * Get raw offset of the object.
-     *
-     * @param in Input stream.
-     * @param start Object start position inside the stream.
-     * @return Raw offset.
-     */
-    public static int rawOffset(PortableBuilderReader in, int start) {
-        int len = in.readIntAbsolute(start + GridPortableMarshaller.TOTAL_LEN_POS);
-        int schemaId = in.readIntAbsolute(start + GridPortableMarshaller.SCHEMA_ID_POS);
+    public static int rawOffset(PortablePositionReadable in, int start) {
+        int len = in.readIntPositioned(start + GridPortableMarshaller.TOTAL_LEN_POS);
+        int schemaId = in.readIntPositioned(start + GridPortableMarshaller.SCHEMA_ID_POS);
 
         if (schemaId == 0)
             // No schema, raw offset is located on schema offset position.
-            return in.readIntAbsolute(start + GridPortableMarshaller.SCHEMA_OR_RAW_OFF_POS);
+            return in.readIntPositioned(start + GridPortableMarshaller.SCHEMA_OR_RAW_OFF_POS);
         else {
             // Schema exists.
-            int schemaOff = in.readIntAbsolute(start + GridPortableMarshaller.SCHEMA_OR_RAW_OFF_POS);
+            int schemaOff = in.readIntPositioned(start + GridPortableMarshaller.SCHEMA_OR_RAW_OFF_POS);
 
             if ((((len - schemaOff) >> 2) & 0x1) == 0x0)
                 // Even amount of records in schema => no raw offset.
                 return len;
             else
                 // Odd amount of records in schema => raw offset is the very last 4 bytes
in object.
-                return in.readIntAbsolute(start + len - 4);
+                return in.readIntPositioned(start + len - 4);
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderImpl.java
index a9698eb..9180d27 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableBuilderImpl.java
@@ -141,9 +141,9 @@ public class PortableBuilderImpl implements PortableBuilder {
 
         PortableUtils.checkProtocolVersion(ver);
 
-        int typeId = reader.readIntAbsolute(start + TYPE_ID_POS);
+        int typeId = reader.readIntPositioned(start + TYPE_ID_POS);
         ctx = reader.portableContext();
-        hashCode = reader.readIntAbsolute(start + HASH_CODE_POS);
+        hashCode = reader.readIntPositioned(start + HASH_CODE_POS);
 
         if (typeId == UNREGISTERED_TYPE_ID) {
             int mark = reader.position();
@@ -383,7 +383,7 @@ public class PortableBuilderImpl implements PortableBuilder {
 
         if (reader != null) {
             int rawOff = PortableUtils.rawOffset(reader, start);
-            int len = reader.readIntAbsolute(start + TOTAL_LEN_POS);
+            int len = reader.readIntPositioned(start + TOTAL_LEN_POS);
 
             if (rawOff < len)
                 writer.write(reader.array(), rawOff, len - rawOff);
@@ -410,11 +410,11 @@ public class PortableBuilderImpl implements PortableBuilder {
             int end = start + PortableUtils.rawOffset(reader, start);
 
             while (pos < end) {
-                int fieldId = reader.readIntAbsolute(pos);
+                int fieldId = reader.readIntPositioned(pos);
 
                 pos += 4;
 
-                int len = reader.readIntAbsolute(pos);
+                int len = reader.readIntPositioned(pos);
 
                 pos += 4;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/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 2a1e43e..7494721 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
@@ -24,6 +24,7 @@ import java.util.Map;
 import org.apache.ignite.internal.portable.GridPortableMarshaller;
 import org.apache.ignite.internal.portable.PortableContext;
 import org.apache.ignite.internal.portable.PortableObjectImpl;
+import org.apache.ignite.internal.portable.PortablePositionReadable;
 import org.apache.ignite.internal.portable.PortablePrimitives;
 import org.apache.ignite.internal.portable.PortableReaderExImpl;
 import org.apache.ignite.internal.portable.PortableUtils;
@@ -37,7 +38,7 @@ import static org.apache.ignite.internal.portable.GridPortableMarshaller.STRING;
 /**
  *
  */
-public class PortableBuilderReader {
+public class PortableBuilderReader implements PortablePositionReadable {
     /** */
     private static final PortablePrimitives PRIM = PortablePrimitives.get();
 
@@ -134,7 +135,7 @@ public class PortableBuilderReader {
      * @param pos Position in the source array.
      * @return Read int value.
      */
-    public int readIntAbsolute(int pos) {
+    public int readIntPositioned(int pos) {
         return PRIM.readInt(arr, pos);
     }
 
@@ -357,7 +358,7 @@ public class PortableBuilderReader {
                 return null;
 
             case GridPortableMarshaller.HANDLE: {
-                int objStart = pos - readIntAbsolute(pos + 1);
+                int objStart = pos - readIntPositioned(pos + 1);
 
                 PortableBuilderImpl res = objMap.get(objStart);
 
@@ -451,9 +452,9 @@ public class PortableBuilderReader {
             }
 
             case GridPortableMarshaller.PORTABLE_OBJ: {
-                int size = readIntAbsolute(pos + 1);
+                int size = readIntPositioned(pos + 1);
 
-                int start = readIntAbsolute(pos + 4 + size);
+                int start = readIntPositioned(pos + 4 + size);
 
                 PortableObjectImpl portableObj = new PortableObjectImpl(ctx, arr, pos + 4
+ start);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyArrayList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyArrayList.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyArrayList.java
index a08cfdd..f29872e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyArrayList.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyArrayList.java
@@ -56,7 +56,7 @@ class PortableLazyArrayList extends AbstractList<Object> implements
PortableBuil
      */
     private void ensureDelegateInit() {
         if (delegate == null) {
-            int size = reader.readIntAbsolute(off + 1);
+            int size = reader.readIntPositioned(off + 1);
 
             reader.position(off + 1/* flag */ + 4/* size */ + 1/* col type */);
 
@@ -125,7 +125,7 @@ class PortableLazyArrayList extends AbstractList<Object> implements
PortableBuil
     /** {@inheritDoc} */
     @Override public int size() {
         if (delegate == null)
-            return reader.readIntAbsolute(off + 1);
+            return reader.readIntPositioned(off + 1);
 
         return delegate.size();
     }
@@ -133,7 +133,7 @@ class PortableLazyArrayList extends AbstractList<Object> implements
PortableBuil
     /** {@inheritDoc} */
     @Override public void writeTo(PortableWriterExImpl writer, PortableBuilderSerializer
ctx) {
         if (delegate == null) {
-            int size = reader.readIntAbsolute(off + 1);
+            int size = reader.readIntPositioned(off + 1);
 
             int hdrSize = 1 /* flag */ + 4 /* size */ + 1 /* col type */;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyLinkedList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyLinkedList.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyLinkedList.java
index f793d7a..4940311 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyLinkedList.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyLinkedList.java
@@ -58,7 +58,7 @@ class PortableLazyLinkedList extends AbstractList<Object> implements
PortableBui
      */
     private void ensureDelegateInit() {
         if (delegate == null) {
-            int size = reader.readIntAbsolute(off + 1);
+            int size = reader.readIntPositioned(off + 1);
 
             reader.position(off + 1/* flag */ + 4/* size */ + 1/* col type */);
 
@@ -129,7 +129,7 @@ class PortableLazyLinkedList extends AbstractList<Object> implements
PortableBui
     /** {@inheritDoc} */
     @Override public int size() {
         if (delegate == null)
-            return reader.readIntAbsolute(off + 1);
+            return reader.readIntPositioned(off + 1);
 
         return delegate.size();
     }
@@ -190,7 +190,7 @@ class PortableLazyLinkedList extends AbstractList<Object> implements
PortableBui
     /** {@inheritDoc} */
     @Override public void writeTo(PortableWriterExImpl writer, PortableBuilderSerializer
ctx) {
         if (delegate == null) {
-            int size = reader.readIntAbsolute(off + 1);
+            int size = reader.readIntPositioned(off + 1);
 
             int hdrSize = 1 /* flag */ + 4 /* size */ + 1 /* col type */;
             writer.write(reader.array(), off, hdrSize);

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyMap.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyMap.java
index 12cbfd6..74bd4c4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazyMap.java
@@ -73,7 +73,7 @@ class PortableLazyMap extends AbstractMap<Object, Object> implements
PortableBui
      */
     private void ensureDelegateInit() {
         if (delegate == null) {
-            int size = reader.readIntAbsolute(off + 1);
+            int size = reader.readIntPositioned(off + 1);
 
             reader.position(off + 1/* flag */ + 4/* size */ + 1/* col type */);
 
@@ -87,7 +87,7 @@ class PortableLazyMap extends AbstractMap<Object, Object> implements
PortableBui
     /** {@inheritDoc} */
     @Override public void writeTo(PortableWriterExImpl writer, PortableBuilderSerializer
ctx) {
         if (delegate == null) {
-            int size = reader.readIntAbsolute(off + 1);
+            int size = reader.readIntPositioned(off + 1);
 
             int hdrSize = 1 /* flag */ + 4 /* size */ + 1 /* col type */;
             writer.write(reader.array(), off, hdrSize);
@@ -117,7 +117,7 @@ class PortableLazyMap extends AbstractMap<Object, Object> implements
PortableBui
     /** {@inheritDoc} */
     @Override public int size() {
         if (delegate == null)
-            return reader.readIntAbsolute(off + 1);
+            return reader.readIntPositioned(off + 1);
 
         return delegate.size();
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazySet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazySet.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazySet.java
index 16772af..c1099eb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazySet.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/builder/PortableLazySet.java
@@ -49,7 +49,7 @@ class PortableLazySet extends PortableAbstractLazyValue {
     /** {@inheritDoc} */
     @Override public void writeTo(PortableWriterExImpl writer, PortableBuilderSerializer
ctx) {
         if (val == null) {
-            int size = reader.readIntAbsolute(off + 1);
+            int size = reader.readIntPositioned(off + 1);
 
             int hdrSize = 1 /* flag */ + 4 /* size */ + 1 /* col type */;
             writer.write(reader.array(), off, hdrSize);
@@ -78,7 +78,7 @@ class PortableLazySet extends PortableAbstractLazyValue {
 
     /** {@inheritDoc} */
     @Override protected Object init() {
-        int size = reader.readIntAbsolute(off + 1);
+        int size = reader.readIntPositioned(off + 1);
 
         reader.position(off + 1/* flag */ + 4/* size */ + 1/* col type */);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableAbstractInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableAbstractInputStream.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableAbstractInputStream.java
index 107b02e..00d5658 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableAbstractInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableAbstractInputStream.java
@@ -158,13 +158,13 @@ public abstract class PortableAbstractInputStream extends PortableAbstractStream
     }
 
     /** {@inheritDoc} */
-    @Override public int readInt(int pos) {
+    @Override public int readIntPositioned(int pos) {
         int delta = pos + 4 - this.pos;
 
         if (delta > 0)
             ensureEnoughData(delta);
 
-        return readIntPositioned(pos);
+        return readIntPositioned0(pos);
     }
 
     /** {@inheritDoc} */
@@ -339,5 +339,5 @@ public abstract class PortableAbstractInputStream extends PortableAbstractStream
      * @param pos Position.
      * @return Int value.
      */
-    protected abstract int readIntPositioned(int pos);
+    protected abstract int readIntPositioned0(int pos);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableHeapInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableHeapInputStream.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableHeapInputStream.java
index c7ec576..d5618b3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableHeapInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableHeapInputStream.java
@@ -123,7 +123,7 @@ public final class PortableHeapInputStream extends PortableAbstractInputStream
{
     }
 
     /** {@inheritDoc} */
-    @Override protected int readIntPositioned(int pos) {
+    @Override protected int readIntPositioned0(int pos) {
         int res = UNSAFE.getInt(data, BYTE_ARR_OFF + pos);
 
         if (!LITTLE_ENDIAN)

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableInputStream.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableInputStream.java
index a1d7fd5..a2273d1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableInputStream.java
@@ -17,10 +17,12 @@
 
 package org.apache.ignite.internal.portable.streams;
 
+import org.apache.ignite.internal.portable.PortablePositionReadable;
+
 /**
  * Portable input stream.
  */
-public interface PortableInputStream extends PortableStream {
+public interface PortableInputStream extends PortableStream, PortablePositionReadable {
     /**
      * Read byte value.
      *
@@ -99,14 +101,6 @@ public interface PortableInputStream extends PortableStream {
     public int readInt();
 
     /**
-     * Read int value at the given position.
-     *
-     * @param pos Position.
-     * @return Value.
-     */
-    public int readInt(int pos);
-
-    /**
      * Read int array.
      *
      * @param cnt Expected item count.

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableOffheapInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableOffheapInputStream.java
b/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableOffheapInputStream.java
index f5ecf95..187ded5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableOffheapInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/portable/streams/PortableOffheapInputStream.java
@@ -113,7 +113,7 @@ public class PortableOffheapInputStream extends PortableAbstractInputStream
{
     }
 
     /** {@inheritDoc} */
-    @Override protected int readIntPositioned(int pos) {
+    @Override protected int readIntPositioned0(int pos) {
         int res = UNSAFE.getInt(ptr + pos);
 
         if (!LITTLE_ENDIAN)

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformBigEndianInputStreamImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformBigEndianInputStreamImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformBigEndianInputStreamImpl.java
index b54b151..b25471d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformBigEndianInputStreamImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformBigEndianInputStreamImpl.java
@@ -65,8 +65,8 @@ public class PlatformBigEndianInputStreamImpl extends PlatformInputStreamImpl
{
     }
 
     /** {@inheritDoc} */
-    @Override public int readInt(int pos) {
-        return Integer.reverseBytes(super.readInt(pos));
+    @Override public int readIntPositioned(int pos) {
+        return Integer.reverseBytes(super.readIntPositioned(pos));
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/99f4fd3a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformInputStreamImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformInputStreamImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformInputStreamImpl.java
index 03a166e..68af0e7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformInputStreamImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformInputStreamImpl.java
@@ -146,7 +146,7 @@ public class PlatformInputStreamImpl implements PlatformInputStream {
     }
 
     /** {@inheritDoc} */
-    @Override public int readInt(int pos) {
+    @Override public int readIntPositioned(int pos) {
         int delta = pos + 4 - this.pos;
 
         if (delta > 0)


Mime
View raw message