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/12/14 13:02:21 UTC

[01/50] [abbrv] ignite git commit: IGNITE-2124 - Fixed key deserialization on server node. - Fixes #313.

Repository: ignite
Updated Branches:
  refs/heads/ignite-2100 0d72b7e7c -> 74e478d40


IGNITE-2124 - Fixed key deserialization on server node. - Fixes #313.

Signed-off-by: Alexey Goncharuk <al...@gmail.com>


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

Branch: refs/heads/ignite-2100
Commit: 9a02acbe5bc1deeefe1b79063c6938984a25baae
Parents: 91760b9
Author: Alexey Goncharuk <al...@gmail.com>
Authored: Fri Dec 11 16:11:32 2015 +0300
Committer: Alexey Goncharuk <al...@gmail.com>
Committed: Fri Dec 11 16:11:32 2015 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/cache/QueryEntity.java    |   3 +-
 .../CacheDataStructuresManager.java             |   5 +
 .../processors/query/GridQueryProcessor.java    |  21 +-
 .../apache/ignite/tests/p2p/cache/Person.java   |  77 ++++++
 .../ignite/tests/p2p/cache/PersonKey.java       |  74 ++++++
 .../IgniteBinaryObjectFieldsQuerySelfTest.java  | 246 +++++++++++++++++++
 .../IgnitePortableCacheQueryTestSuite.java      |   2 +
 7 files changed, 426 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9a02acbe/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java b/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
index cb84c47..7901bec 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java
@@ -14,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.ignite.cache;
 
 import java.io.Serializable;
@@ -124,7 +125,7 @@ public class QueryEntity implements Serializable {
     /**
      * Sets mapping from full property name in dot notation to an alias that will be used as SQL column name.
      * Example: {"parent.name" -> "parentName"}.
-
+     *
      * @param aliases Aliases map.
      */
     public void setAliases(Map<String, String> aliases) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/9a02acbe/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
index 6ec29b4..6447194 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
@@ -314,6 +314,11 @@ public class CacheDataStructuresManager extends GridCacheManagerAdapter {
      * @param keepPortable Keep portable flag.
      */
     public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepPortable) {
+        // No need to notify data structures manager for a user cache since all DS objects are stored
+        // in system caches.
+        if (cctx.userCache())
+            return;
+
         Object key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false);
 
         if (key0 instanceof SetItemKey)

http://git-wip-us.apache.org/repos/asf/ignite/blob/9a02acbe/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 64f2415..005f617 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
@@ -205,7 +205,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                     Class<?> keyCls = U.classForName(qryEntity.getKeyType(), Object.class);
                     Class<?> valCls = U.classForName(qryEntity.getValueType(), null);
 
-                    String simpleValType = valCls == null ? qryEntity.getValueType() : typeName(valCls);
+                    String simpleValType = valCls == null ? typeName(qryEntity.getValueType()) : typeName(valCls);
 
                     desc.name(simpleValType);
 
@@ -982,6 +982,25 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     }
 
     /**
+     * Gets type name by class.
+     *
+     * @param clsName Class name.
+     * @return Type name.
+     */
+    public static String typeName(String clsName) {
+        int packageEnd = clsName.lastIndexOf('.');
+
+        if (packageEnd >= 0 && packageEnd < clsName.length() - 1)
+            clsName = clsName.substring(packageEnd + 1);
+
+        if (clsName.endsWith("[]")) {
+            clsName = clsName.substring(0, clsName.length() - 2) + "_array";
+        }
+
+        return clsName;
+    }
+
+    /**
      * @param space Space.
      * @param clause Clause.
      * @param resType Result type.

http://git-wip-us.apache.org/repos/asf/ignite/blob/9a02acbe/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/cache/Person.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/cache/Person.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/cache/Person.java
index 3452cea..7cb7dd2 100644
--- a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/cache/Person.java
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/cache/Person.java
@@ -18,14 +18,35 @@
 package org.apache.ignite.tests.p2p.cache;
 
 import java.io.Serializable;
+import org.apache.ignite.cache.query.annotations.QuerySqlField;
 
 /**
  *
  */
 public class Person implements Serializable {
     /** */
+    @QuerySqlField
     private String name;
 
+    /** */
+    @QuerySqlField(index = true)
+    private int id;
+
+    /** */
+    @QuerySqlField
+    private String lastName;
+
+    /** */
+    @QuerySqlField
+    private double salary;
+
+    /**
+     *
+     */
+    public Person() {
+        // No-op.
+    }
+
     /**
      * @param name Name.
      */
@@ -39,4 +60,60 @@ public class Person implements Serializable {
     public String name() {
         return name;
     }
+
+    /**
+     * @return Name.
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * @param name Name.
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * @return ID.
+     */
+    public int getId() {
+        return id;
+    }
+
+    /**
+     * @param id ID.
+     */
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    /**
+     * @return Last name.
+     */
+    public String getLastName() {
+        return lastName;
+    }
+
+    /**
+     * @param lastName Last name.
+     */
+    public void setLastName(String lastName) {
+        this.lastName = lastName;
+    }
+
+    /**
+     * @return Salary.
+     */
+    public double getSalary() {
+        return salary;
+    }
+
+    /**
+     * @param salary Salary.
+     */
+    public void setSalary(double salary) {
+        this.salary = salary;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/9a02acbe/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/cache/PersonKey.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/cache/PersonKey.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/cache/PersonKey.java
new file mode 100644
index 0000000..3233f9b
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/cache/PersonKey.java
@@ -0,0 +1,74 @@
+/*
+ * 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.tests.p2p.cache;
+
+import java.io.Serializable;
+
+/**
+ * Person key.
+ */
+public class PersonKey implements Serializable {
+    /** */
+    private int id;
+
+    /**
+     * Empty constructor for tests.
+     */
+    public PersonKey() {
+        // No-op.
+    }
+
+    /**
+     * @param id ID.
+     */
+    public PersonKey(int id) {
+        this.id = id;
+    }
+
+    /**
+     * @return ID.
+     */
+    public int id() {
+        return id;
+    }
+
+    /**
+     * @param id ID.
+     */
+    public void id(int id) {
+        this.id = id;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object o) {
+        if (this == o)
+            return true;
+
+        if (!(o instanceof PersonKey))
+            return false;
+
+        PersonKey key = (PersonKey)o;
+
+        return id == key.id;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int hashCode() {
+        return id;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9a02acbe/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectFieldsQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectFieldsQuerySelfTest.java
new file mode 100644
index 0000000..3a08824
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteBinaryObjectFieldsQuerySelfTest.java
@@ -0,0 +1,246 @@
+/*
+ * 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.processors.cache;
+
+import java.util.List;
+import javax.cache.Cache;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.CacheRebalanceMode;
+import org.apache.ignite.cache.CacheWriteSynchronizationMode;
+import org.apache.ignite.cache.query.QueryCursor;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.cache.query.SqlQuery;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ * Tests that server nodes do not need class definitions to execute queries.
+ */
+public class IgniteBinaryObjectFieldsQuerySelfTest extends GridCommonAbstractTest {
+    /** */
+    public static final String PERSON_KEY_CLS_NAME = "org.apache.ignite.tests.p2p.cache.PersonKey";
+
+    /** */
+    public static final String PERSON_CLS_NAME = "org.apache.ignite.tests.p2p.cache.Person";
+
+    /** IP finder. */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    private static ClassLoader extClassLoader;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        cfg.setPeerClassLoadingEnabled(false);
+
+        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
+
+        discoSpi.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(discoSpi);
+
+        cfg.setMarshaller(null);
+
+        if (getTestGridName(3).equals(gridName)) {
+            cfg.setClientMode(true);
+            cfg.setClassLoader(extClassLoader);
+        }
+
+        return cfg;
+    }
+
+    /**
+     * @return Cache.
+     */
+    protected CacheConfiguration cache(CacheMode cacheMode, CacheAtomicityMode atomicity) throws Exception {
+        CacheConfiguration cache = defaultCacheConfiguration();
+
+        cache.setName(null);
+        cache.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
+        cache.setRebalanceMode(CacheRebalanceMode.SYNC);
+        cache.setCacheMode(cacheMode);
+        cache.setAtomicityMode(atomicity);
+
+        cache.setIndexedTypes(extClassLoader.loadClass(PERSON_KEY_CLS_NAME), extClassLoader.loadClass(PERSON_CLS_NAME));
+
+        return cache;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        extClassLoader = getExternalClassLoader();
+
+        startGrids(4);
+
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+
+        extClassLoader = null;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testQueryPartitionedAtomic() throws Exception {
+        checkQuery(CacheMode.PARTITIONED, CacheAtomicityMode.ATOMIC);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testQueryReplicatedAtomic() throws Exception {
+        checkQuery(CacheMode.REPLICATED, CacheAtomicityMode.ATOMIC);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testQueryPartitionedTransactional() throws Exception {
+        checkQuery(CacheMode.PARTITIONED, CacheAtomicityMode.TRANSACTIONAL);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testQueryReplicatedTransactional() throws Exception {
+        checkQuery(CacheMode.REPLICATED, CacheAtomicityMode.TRANSACTIONAL);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testFieldsQueryPartitionedAtomic() throws Exception {
+        checkFieldsQuery(CacheMode.PARTITIONED, CacheAtomicityMode.ATOMIC);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testFieldsQueryReplicatedAtomic() throws Exception {
+        checkFieldsQuery(CacheMode.REPLICATED, CacheAtomicityMode.ATOMIC);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testFieldsQueryPartitionedTransactional() throws Exception {
+        checkFieldsQuery(CacheMode.PARTITIONED, CacheAtomicityMode.TRANSACTIONAL);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testFieldsQueryReplicatedTransactional() throws Exception {
+        checkFieldsQuery(CacheMode.REPLICATED, CacheAtomicityMode.TRANSACTIONAL);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    private void checkFieldsQuery(CacheMode cacheMode, CacheAtomicityMode atomicity) throws Exception {
+        IgniteCache<Object, Object>cache = grid(3).getOrCreateCache(cache(cacheMode, atomicity));
+
+        try {
+            populate(cache);
+
+            QueryCursor<List<?>> cur = cache.query(new SqlFieldsQuery("select id, name, lastName, salary from " +
+                "Person order by id asc"));
+
+            List<List<?>> all = cur.getAll();
+
+            assertEquals(100, all.size());
+
+            for (int i = 0; i < 100; i++) {
+                List<?> row = all.get(i);
+
+                assertEquals(i, row.get(0));
+                assertEquals("person-" + i, row.get(1));
+                assertEquals("person-last-" + i, row.get(2));
+                assertEquals((double)(i * 25), row.get(3));
+            }
+        }
+        finally {
+            grid(3).destroyCache(null);
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    private void checkQuery(CacheMode cacheMode, CacheAtomicityMode atomicity) throws Exception {
+        IgniteCache<Object, Object> cache = grid(3).getOrCreateCache(cache(cacheMode, atomicity));
+
+        try {
+            populate(cache);
+
+            QueryCursor<Cache.Entry<Object, Object>> cur = cache.query(new SqlQuery("Person", "order " +
+                "by id asc"));
+
+            List<Cache.Entry<Object, Object>> all = cur.getAll();
+
+            assertEquals(100, all.size());
+
+            for (int i = 0; i < 100; i++) {
+                Object person = all.get(i).getValue();
+
+                assertEquals(i, U.field(person, "id"));
+                assertEquals("person-" + i, U.field(person, "name"));
+                assertEquals("person-last-" + i, U.field(person, "lastName"));
+                assertEquals((double)(i * 25), U.field(person, "salary"));
+            }
+        }
+        finally {
+            grid(3).destroyCache(null);
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    private void populate(IgniteCache<Object, Object> cache) throws Exception {
+        Class<?> keyCls = extClassLoader.loadClass(PERSON_KEY_CLS_NAME);
+        Class<?> cls = extClassLoader.loadClass(PERSON_CLS_NAME);
+
+        for (int i = 0; i < 100; i++) {
+            Object key = keyCls.newInstance();
+
+            GridTestUtils.setFieldValue(key, "id", i);
+
+            Object person = cls.newInstance();
+
+            GridTestUtils.setFieldValue(person, "id", i);
+            GridTestUtils.setFieldValue(person, "name", "person-" + i);
+            GridTestUtils.setFieldValue(person, "lastName", "person-last-" + i);
+            GridTestUtils.setFieldValue(person, "salary", (double)(i * 25));
+
+            cache.put(key, person);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/9a02acbe/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java
index da34d75..3773f8c 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java
@@ -26,6 +26,7 @@ import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsLo
 import org.apache.ignite.internal.processors.cache.GridCacheQueryIndexDisabledSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheQueryIndexingDisabledSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheReduceQueryMultithreadedSelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteBinaryObjectFieldsQuerySelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheFieldsQueryNoDataSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheLargeResultSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheOffheapTieredMultithreadedSelfTest;
@@ -79,6 +80,7 @@ public class IgnitePortableCacheQueryTestSuite extends TestSuite {
 
         // Fields queries.
         suite.addTestSuite(IgniteCacheFieldsQueryNoDataSelfTest.class);
+        suite.addTestSuite(IgniteBinaryObjectFieldsQuerySelfTest.class);
 
         // Continuous queries.
         suite.addTestSuite(GridCacheContinuousQueryLocalAtomicSelfTest.class);


[30/50] [abbrv] ignite git commit: IGNITE-2105 - Fixed nested collections in direct marshalling

Posted by vo...@apache.org.
IGNITE-2105 - Fixed nested collections in direct marshalling


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

Branch: refs/heads/ignite-2100
Commit: 6c61598bc66594e535af4fb10f34abe6797b72c0
Parents: 10b83fb
Author: Valentin Kulichenko <va...@gmail.com>
Authored: Fri Dec 11 17:00:25 2015 -0800
Committer: Valentin Kulichenko <va...@gmail.com>
Committed: Fri Dec 11 17:00:25 2015 -0800

----------------------------------------------------------------------
 .../internal/direct/DirectMessageWriter.java    | 108 ++++++++++++++-----
 .../ignite/util/GridMessageCollectionTest.java  |  34 ++++--
 2 files changed, 111 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/6c61598b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
index ad122ba..085cf68 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/direct/DirectMessageWriter.java
@@ -38,44 +38,29 @@ import org.jetbrains.annotations.Nullable;
  * Message writer implementation.
  */
 public class DirectMessageWriter implements MessageWriter {
-    /** Stream. */
-    private final DirectByteBufferStream stream;
-
     /** State. */
-    private final DirectMessageState<StateItem> state = new DirectMessageState<>(StateItem.class,
-        new IgniteOutClosure<StateItem>() {
-            @Override public StateItem apply() {
-                return new StateItem();
-            }
-        });
+    private final DirectMessageState<StateItem> state;
 
     /**
      * @param protoVer Protocol version.
      */
-    public DirectMessageWriter(byte protoVer) {
-        switch (protoVer) {
-            case 1:
-                stream = new DirectByteBufferStreamImplV1(null);
-
-                break;
-
-            case 2:
-                stream = new DirectByteBufferStreamImplV2(null);
-
-                break;
-
-            default:
-                throw new IllegalStateException("Invalid protocol version: " + protoVer);
-        }
+    public DirectMessageWriter(final byte protoVer) {
+        state = new DirectMessageState<>(StateItem.class, new IgniteOutClosure<StateItem>() {
+            @Override public StateItem apply() {
+                return new StateItem(protoVer);
+            }
+        });
     }
 
     /** {@inheritDoc} */
     @Override public void setBuffer(ByteBuffer buf) {
-        stream.setBuffer(buf);
+        state.item().stream.setBuffer(buf);
     }
 
     /** {@inheritDoc} */
     @Override public boolean writeHeader(byte type, byte fieldCnt) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeByte(type);
 
         return stream.lastFinished();
@@ -83,6 +68,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeByte(String name, byte val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeByte(val);
 
         return stream.lastFinished();
@@ -90,6 +77,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeShort(String name, short val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeShort(val);
 
         return stream.lastFinished();
@@ -97,6 +86,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeInt(String name, int val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeInt(val);
 
         return stream.lastFinished();
@@ -104,6 +95,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeLong(String name, long val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeLong(val);
 
         return stream.lastFinished();
@@ -111,6 +104,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeFloat(String name, float val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeFloat(val);
 
         return stream.lastFinished();
@@ -118,6 +113,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeDouble(String name, double val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeDouble(val);
 
         return stream.lastFinished();
@@ -125,6 +122,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeChar(String name, char val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeChar(val);
 
         return stream.lastFinished();
@@ -132,6 +131,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeBoolean(String name, boolean val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeBoolean(val);
 
         return stream.lastFinished();
@@ -139,6 +140,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeByteArray(String name, @Nullable byte[] val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeByteArray(val);
 
         return stream.lastFinished();
@@ -146,6 +149,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeByteArray(String name, byte[] val, long off, int len) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeByteArray(val, off, len);
 
         return stream.lastFinished();
@@ -153,6 +158,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeShortArray(String name, @Nullable short[] val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeShortArray(val);
 
         return stream.lastFinished();
@@ -160,6 +167,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeIntArray(String name, @Nullable int[] val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeIntArray(val);
 
         return stream.lastFinished();
@@ -167,6 +176,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeLongArray(String name, @Nullable long[] val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeLongArray(val);
 
         return stream.lastFinished();
@@ -174,6 +185,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeFloatArray(String name, @Nullable float[] val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeFloatArray(val);
 
         return stream.lastFinished();
@@ -181,6 +194,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeDoubleArray(String name, @Nullable double[] val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeDoubleArray(val);
 
         return stream.lastFinished();
@@ -188,6 +203,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeCharArray(String name, @Nullable char[] val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeCharArray(val);
 
         return stream.lastFinished();
@@ -195,6 +212,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeBooleanArray(String name, @Nullable boolean[] val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeBooleanArray(val);
 
         return stream.lastFinished();
@@ -202,6 +221,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeString(String name, String val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeString(val);
 
         return stream.lastFinished();
@@ -209,6 +230,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeBitSet(String name, BitSet val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeBitSet(val);
 
         return stream.lastFinished();
@@ -216,6 +239,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeUuid(String name, UUID val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeUuid(val);
 
         return stream.lastFinished();
@@ -223,6 +248,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeIgniteUuid(String name, IgniteUuid val) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeIgniteUuid(val);
 
         return stream.lastFinished();
@@ -230,6 +257,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public boolean writeMessage(String name, @Nullable Message msg) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeMessage(msg, this);
 
         return stream.lastFinished();
@@ -237,6 +266,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public <T> boolean writeObjectArray(String name, T[] arr, MessageCollectionItemType itemType) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeObjectArray(arr, itemType, this);
 
         return stream.lastFinished();
@@ -244,6 +275,8 @@ public class DirectMessageWriter implements MessageWriter {
 
     /** {@inheritDoc} */
     @Override public <T> boolean writeCollection(String name, Collection<T> col, MessageCollectionItemType itemType) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeCollection(col, itemType, this);
 
         return stream.lastFinished();
@@ -252,6 +285,8 @@ public class DirectMessageWriter implements MessageWriter {
     /** {@inheritDoc} */
     @Override public <K, V> boolean writeMap(String name, Map<K, V> map, MessageCollectionItemType keyType,
         MessageCollectionItemType valType) {
+        DirectByteBufferStream stream = state.item().stream;
+
         stream.writeMap(map, keyType, valType, this);
 
         return stream.lastFinished();
@@ -296,11 +331,34 @@ public class DirectMessageWriter implements MessageWriter {
      */
     private static class StateItem implements DirectMessageStateItem {
         /** */
+        private final DirectByteBufferStream stream;
+
+        /** */
         private int state;
 
         /** */
         private boolean hdrWritten;
 
+        /**
+         * @param protoVer Protocol version.
+         */
+        public StateItem(byte protoVer) {
+            switch (protoVer) {
+                case 1:
+                    stream = new DirectByteBufferStreamImplV1(null);
+
+                    break;
+
+                case 2:
+                    stream = new DirectByteBufferStreamImplV2(null);
+
+                    break;
+
+                default:
+                    throw new IllegalStateException("Invalid protocol version: " + protoVer);
+            }
+        }
+
         /** {@inheritDoc} */
         @Override public void reset() {
             state = 0;

http://git-wip-us.apache.org/repos/asf/ignite/blob/6c61598b/modules/core/src/test/java/org/apache/ignite/util/GridMessageCollectionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/util/GridMessageCollectionTest.java b/modules/core/src/test/java/org/apache/ignite/util/GridMessageCollectionTest.java
index e910a8a..44df767 100644
--- a/modules/core/src/test/java/org/apache/ignite/util/GridMessageCollectionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/util/GridMessageCollectionTest.java
@@ -24,6 +24,9 @@ import org.apache.ignite.internal.direct.DirectMessageWriter;
 import org.apache.ignite.internal.managers.communication.GridIoMessageFactory;
 import org.apache.ignite.internal.util.UUIDCollectionMessage;
 import org.apache.ignite.plugin.extensions.communication.Message;
+import org.apache.ignite.plugin.extensions.communication.MessageFactory;
+import org.apache.ignite.plugin.extensions.communication.MessageReader;
+import org.apache.ignite.plugin.extensions.communication.MessageWriter;
 
 import static java.util.UUID.randomUUID;
 import static org.apache.ignite.internal.util.GridMessageCollection.of;
@@ -36,6 +39,23 @@ public class GridMessageCollectionTest extends TestCase {
     private byte proto;
 
     /**
+     * @param proto Protocol version.
+     * @return Writer.
+     */
+    protected MessageWriter writer(byte proto) {
+        return new DirectMessageWriter(proto);
+    }
+
+    /**
+     * @param msgFactory Message factory.
+     * @param proto Protocol version.
+     * @return Writer.
+     */
+    protected MessageReader reader(MessageFactory msgFactory, byte proto) {
+        return new DirectMessageReader(msgFactory, proto);
+    }
+
+    /**
      *
      */
     public void testMarshal() {
@@ -88,17 +108,19 @@ public class GridMessageCollectionTest extends TestCase {
     private void doTestMarshal(Message m) {
         ByteBuffer buf = ByteBuffer.allocate(8 * 1024);
 
-        DirectMessageWriter w = new DirectMessageWriter(proto);
-
-        m.writeTo(buf, w);
+        m.writeTo(buf, writer(proto));
 
         buf.flip();
 
-        DirectMessageReader r = new DirectMessageReader(new GridIoMessageFactory(null), proto);
+        byte type = buf.get();
+
+        assertEquals(m.directType(), type);
+
+        GridIoMessageFactory msgFactory = new GridIoMessageFactory(null);
 
-        r.setBuffer(buf);
+        Message mx = msgFactory.create(type);
 
-        Message mx = r.readMessage(null);
+        mx.readFrom(buf, reader(msgFactory, proto));
 
         assertEquals(m, mx);
     }


[27/50] [abbrv] ignite git commit: ignite-2065: portable -> binary renaming (methods, javadoc and etc.)

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
index 6645d8a..c10ebf3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheContext.java
@@ -320,7 +320,7 @@ public class GridCacheContext<K, V> implements Externalizable {
         this.cacheType = cacheType;
         this.affNode = affNode;
         this.updatesAllowed = updatesAllowed;
-        this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isPortableEnabled(cacheCfg);
+        this.depEnabled = ctx.deploy().enabled() && !cacheObjects().isBinaryEnabled(cacheCfg);
 
         /*
          * Managers in starting order!
@@ -1677,7 +1677,7 @@ public class GridCacheContext<K, V> implements Externalizable {
     }
 
     /**
-     * @return Portable processor.
+     * @return Binary processor.
      */
     public IgniteCacheObjectProcessor cacheObjects() {
         return kernalContext().cacheObjects();
@@ -1691,9 +1691,9 @@ public class GridCacheContext<K, V> implements Externalizable {
     }
 
     /**
-     * @return Keep portable flag.
+     * @return Keep binary flag.
      */
-    public boolean keepPortable() {
+    public boolean keepBinary() {
         CacheOperationContext opCtx = operationContextPerCall();
 
         return opCtx != null && opCtx.isKeepBinary();
@@ -1730,34 +1730,34 @@ public class GridCacheContext<K, V> implements Externalizable {
      * Unwraps collection.
      *
      * @param col Collection to unwrap.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @return Unwrapped collection.
      */
-    public Collection<Object> unwrapPortablesIfNeeded(Collection<Object> col, boolean keepPortable) {
-        return cacheObjCtx.unwrapPortablesIfNeeded(col, keepPortable);
+    public Collection<Object> unwrapBinariesIfNeeded(Collection<Object> col, boolean keepBinary) {
+        return cacheObjCtx.unwrapBinariesIfNeeded(col, keepBinary);
     }
 
     /**
      * Unwraps object for binary.
      *
      * @param o Object to unwrap.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @return Unwrapped object.
      */
-    public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) {
-        return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable);
+    public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) {
+        return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary);
     }
 
     /**
      * Unwraps object for binary.
      *
      * @param o Object to unwrap.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @param cpy Copy value flag.
      * @return Unwrapped object.
      */
-    public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) {
-        return cacheObjCtx.unwrapPortableIfNeeded(o, keepPortable, cpy);
+    public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) {
+        return cacheObjCtx.unwrapBinaryIfNeeded(o, keepBinary, cpy);
     }
 
     /**
@@ -1772,7 +1772,7 @@ public class GridCacheContext<K, V> implements Externalizable {
                     CacheInvokeResult invokeRes = (CacheInvokeResult)res;
 
                     if (invokeRes.result() != null)
-                        res = CacheInvokeResult.fromResult(unwrapPortableIfNeeded(invokeRes.result(),
+                        res = CacheInvokeResult.fromResult(unwrapBinaryIfNeeded(invokeRes.result(),
                             keepBinary, false));
                 }
 
@@ -1872,7 +1872,7 @@ public class GridCacheContext<K, V> implements Externalizable {
      * @param val Value.
      * @param skipVals Skip values flag.
      * @param keepCacheObjects Keep cache objects flag.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param cpy Copy flag.
      */
     @SuppressWarnings("unchecked")
@@ -1881,15 +1881,15 @@ public class GridCacheContext<K, V> implements Externalizable {
         CacheObject val,
         boolean skipVals,
         boolean keepCacheObjects,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         boolean cpy) {
         assert key != null;
         assert val != null || skipVals;
 
         if (!keepCacheObjects) {
-            Object key0 = unwrapPortableIfNeeded(key, !deserializePortable);
+            Object key0 = unwrapBinaryIfNeeded(key, !deserializeBinary);
 
-            Object val0 = skipVals ? true : unwrapPortableIfNeeded(val, !deserializePortable);
+            Object val0 = skipVals ? true : unwrapBinaryIfNeeded(val, !deserializeBinary);
 
             assert key0 != null : key;
             assert val0 != null : val;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
index a0c9c3c..ccbaf38 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEntryEx.java
@@ -378,7 +378,7 @@ public interface GridCacheEntryEx {
         long ttl,
         boolean evt,
         boolean metrics,
-        boolean keepPortable,
+        boolean keepBinary,
         AffinityTopologyVersion topVer,
         CacheEntryPredicate[] filter,
         GridDrType drType,
@@ -416,7 +416,7 @@ public interface GridCacheEntryEx {
         boolean retval,
         boolean evt,
         boolean metrics,
-        boolean keepPortable,
+        boolean keepBinary,
         AffinityTopologyVersion topVer,
         CacheEntryPredicate[] filter,
         GridDrType drType,
@@ -472,7 +472,7 @@ public interface GridCacheEntryEx {
         boolean writeThrough,
         boolean readThrough,
         boolean retval,
-        boolean keepPortable,
+        boolean keepBinary,
         @Nullable IgniteCacheExpiryPolicy expiryPlc,
         boolean evt,
         boolean metrics,
@@ -521,7 +521,7 @@ public interface GridCacheEntryEx {
         boolean writeThrough,
         boolean readThrough,
         boolean retval,
-        boolean keepPortable,
+        boolean keepBinary,
         @Nullable ExpiryPolicy expiryPlc,
         boolean evt,
         boolean metrics,

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
index 98579c2..ec8b8cc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheEventManager.java
@@ -154,7 +154,7 @@ public class GridCacheEventManager extends GridCacheManagerAdapter {
         UUID subjId,
         String cloClsName,
         String taskName,
-        boolean keepPortable)
+        boolean keepBinary)
     {
         addEvent(part,
             key,
@@ -168,7 +168,7 @@ public class GridCacheEventManager extends GridCacheManagerAdapter {
             subjId,
             cloClsName,
             taskName,
-            keepPortable);
+            keepBinary);
     }
 
     /**
@@ -246,7 +246,7 @@ public class GridCacheEventManager extends GridCacheManagerAdapter {
         UUID subjId,
         @Nullable String cloClsName,
         @Nullable String taskName,
-        boolean keepPortable
+        boolean keepBinary
     ) {
         assert key != null || type == EVT_CACHE_STARTED || type == EVT_CACHE_STOPPED;
 
@@ -265,19 +265,19 @@ public class GridCacheEventManager extends GridCacheManagerAdapter {
                     "(try to increase topology history size configuration property of configured " +
                     "discovery SPI): " + evtNodeId);
 
-            keepPortable = keepPortable || forceKeepBinary;
+            keepBinary = keepBinary || forceKeepBinary;
 
             Object key0;
             Object val0;
             Object oldVal0;
 
             try {
-                key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false);
-                val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, keepPortable, false);
-                oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, keepPortable, false);
+                key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false);
+                val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, keepBinary, false);
+                oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, keepBinary, false);
             }
             catch (Exception e) {
-                if (!cctx.cacheObjectContext().processor().isPortableEnabled(cctx.config()))
+                if (!cctx.cacheObjectContext().processor().isBinaryEnabled(cctx.config()))
                     throw e;
 
                 if (log.isDebugEnabled())
@@ -289,9 +289,9 @@ public class GridCacheEventManager extends GridCacheManagerAdapter {
 
                 forceKeepBinary = true;
 
-                key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, true, false);
-                val0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(newVal, true, false);
-                oldVal0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(oldVal, true, false);
+                key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, true, false);
+                val0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(newVal, true, false);
+                oldVal0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(oldVal, true, false);
             }
 
             cctx.gridEvents().record(new CacheEvent(cctx.name(),
@@ -387,4 +387,4 @@ public class GridCacheEventManager extends GridCacheManagerAdapter {
         X.println(">>> Cache event manager memory stats [grid=" + cctx.gridName() + ", cache=" + cctx.name() +
             ", stats=" + "N/A" + ']');
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
index ae0b412..c896a82 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMapEntry.java
@@ -1069,7 +1069,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
         long ttl,
         boolean evt,
         boolean metrics,
-        boolean keepPortable,
+        boolean keepBinary,
         AffinityTopologyVersion topVer,
         CacheEntryPredicate[] filter,
         GridDrType drType,
@@ -1127,10 +1127,10 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
             if (intercept) {
                 val0 = CU.value(val, cctx, false);
 
-                CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepPortable);
+                CacheLazyEntry e = new CacheLazyEntry(cctx, key, old, keepBinary);
 
                 Object interceptorVal = cctx.config().getInterceptor().onBeforePut(
-                    new CacheLazyEntry(cctx, key, old, keepPortable),
+                    new CacheLazyEntry(cctx, key, old, keepBinary),
                     val0);
 
                 key0 = e.key();
@@ -1203,7 +1203,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                     evtOld,
                     evtOld != null || hasValueUnlocked(),
                     subjId, null, taskName,
-                    keepPortable);
+                    keepBinary);
             }
 
             if (cctx.isLocal() || cctx.isReplicated() ||
@@ -1211,7 +1211,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                 cctx.continuousQueries().onEntryUpdated(key, val, old, isInternal() || !context().userCache(),
                     partition(), tx.local(), false, updateCntr0, topVer);
 
-            cctx.dataStructures().onEntryUpdated(key, false, keepPortable);
+            cctx.dataStructures().onEntryUpdated(key, false, keepBinary);
         }
 
         if (log.isDebugEnabled())
@@ -1223,7 +1223,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
             cctx.store().put(tx, keyValue(false), CU.value(val, cctx, false), newVer);
 
         if (intercept)
-            cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepPortable));
+            cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, val, val0, keepBinary));
 
         return valid ? new GridCacheUpdateTxResult(true, retval ? old : null, updateCntr0) :
             new GridCacheUpdateTxResult(false, null);
@@ -1245,7 +1245,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
         boolean retval,
         boolean evt,
         boolean metrics,
-        boolean keepPortable,
+        boolean keepBinary,
         AffinityTopologyVersion topVer,
         CacheEntryPredicate[] filter,
         GridDrType drType,
@@ -1307,7 +1307,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
             old = (retval || intercept) ? rawGetOrUnmarshalUnlocked(!retval) : val;
 
             if (intercept) {
-                entry0 = new CacheLazyEntry(cctx, key, old, keepPortable);
+                entry0 = new CacheLazyEntry(cctx, key, old, keepBinary);
 
                 interceptRes = cctx.config().getInterceptor().onBeforeRemove(entry0);
 
@@ -1385,7 +1385,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                     subjId,
                     null,
                     taskName,
-                    keepPortable);
+                    keepBinary);
             }
 
             if (cctx.isLocal() || cctx.isReplicated() ||
@@ -1393,7 +1393,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                 cctx.continuousQueries().onEntryUpdated(key, null, old, isInternal()
                     || !context().userCache(),partition(), tx.local(), false, updateCntr0, topVer);
 
-            cctx.dataStructures().onEntryUpdated(key, true, keepPortable);
+            cctx.dataStructures().onEntryUpdated(key, true, keepBinary);
 
             deferred = cctx.deferredDelete() && !detached() && !isInternal();
 
@@ -1534,7 +1534,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                         updateTtl(expiryPlc);
 
                     Object val = retval ?
-                        cctx.cacheObjectContext().unwrapPortableIfNeeded(CU.value(old, cctx, false), keepBinary, false)
+                        cctx.cacheObjectContext().unwrapBinaryIfNeeded(CU.value(old, cctx, false), keepBinary, false)
                         : null;
 
                     return new T3<>(false, val, null);
@@ -1751,7 +1751,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
         return new GridTuple3<>(res,
             cctx.unwrapTemporary(interceptorRes != null ?
                 interceptorRes.get2() :
-                cctx.cacheObjectContext().unwrapPortableIfNeeded(old, keepBinary, false)),
+                cctx.cacheObjectContext().unwrapBinaryIfNeeded(old, keepBinary, false)),
             invokeRes);
     }
 
@@ -1767,7 +1767,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
         boolean writeThrough,
         boolean readThrough,
         boolean retval,
-        boolean keepPortable,
+        boolean keepBinary,
         @Nullable IgniteCacheExpiryPolicy expiryPlc,
         boolean evt,
         boolean metrics,
@@ -1839,7 +1839,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
                         oldVal = rawGetOrUnmarshalUnlocked(true);
 
-                        CacheInvokeEntry<Object, Object> entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable);
+                        CacheInvokeEntry<Object, Object> entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary);
 
                         try {
                             Object computed = entryProcessor.process(entry, invokeArgs);
@@ -1977,7 +1977,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                                     (EntryProcessor<Object, Object, ?>)writeObj;
 
                                 CacheInvokeEntry<Object, Object> entry =
-                                    new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepPortable);
+                                    new CacheInvokeEntry<>(cctx, key, prevVal, version(), keepBinary);
 
                                 try {
                                     entryProcessor.process(entry, invokeArgs);
@@ -2099,7 +2099,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
                 EntryProcessor<Object, Object, ?> entryProcessor = (EntryProcessor<Object, Object, ?>)writeObj;
 
-                CacheInvokeEntry<Object, Object> entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepPortable);
+                CacheInvokeEntry<Object, Object> entry = new CacheInvokeEntry(cctx, key, oldVal, version(), keepBinary);
 
                 try {
                     Object computed = entryProcessor.process(entry, invokeArgs);
@@ -2224,7 +2224,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                     updated0 = value(updated0, updated, false);
 
                     Object interceptorVal = cctx.config().getInterceptor()
-                        .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable), updated0);
+                        .onBeforePut(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary), updated0);
 
                     if (interceptorVal == null)
                         return new GridCacheUpdateAtomicResult(false,
@@ -2291,7 +2291,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                         cctx.events().addEvent(partition(), key, evtNodeId, null,
                             newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld,
                             evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName,
-                            keepPortable);
+                            keepBinary);
                     }
 
                     if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_PUT)) {
@@ -2300,14 +2300,14 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
                         cctx.events().addEvent(partition(), key, evtNodeId, null,
                             newVer, EVT_CACHE_OBJECT_PUT, updated, updated != null, evtOld,
-                            evtOld != null || hadVal, subjId, null, taskName, keepPortable);
+                            evtOld != null || hadVal, subjId, null, taskName, keepBinary);
                     }
                 }
             }
             else {
                 if (intercept) {
                     interceptRes = cctx.config().getInterceptor().onBeforeRemove(new CacheLazyEntry(cctx, key, key0,
-                        oldVal, old0, keepPortable));
+                        oldVal, old0, keepBinary));
 
                     if (cctx.cancelRemove(interceptRes))
                         return new GridCacheUpdateAtomicResult(false,
@@ -2387,7 +2387,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
                         cctx.events().addEvent(partition(), key, evtNodeId, null,
                             newVer, EVT_CACHE_OBJECT_READ, evtOld, evtOld != null || hadVal, evtOld,
                             evtOld != null || hadVal, subjId, transformClo.getClass().getName(), taskName,
-                            keepPortable);
+                            keepBinary);
                     }
 
                     if (newVer != null && cctx.events().isRecordable(EVT_CACHE_OBJECT_REMOVED)) {
@@ -2396,7 +2396,7 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
                         cctx.events().addEvent(partition(), key, evtNodeId, null, newVer,
                             EVT_CACHE_OBJECT_REMOVED, null, false, evtOld, evtOld != null || hadVal,
-                            subjId, null, taskName, keepPortable);
+                            subjId, null, taskName, keepBinary);
                     }
                 }
 
@@ -2406,13 +2406,13 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
             if (res)
                 updateMetrics(op, metrics);
 
-            cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepPortable);
+            cctx.dataStructures().onEntryUpdated(key, op == GridCacheOperation.DELETE, keepBinary);
 
             if (intercept) {
                 if (op == GridCacheOperation.UPDATE)
-                    cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepPortable));
+                    cctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(cctx, key, key0, updated, updated0, keepBinary));
                 else
-                    cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepPortable));
+                    cctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(cctx, key, key0, oldVal, old0, keepBinary));
 
                 if (interceptRes != null)
                     oldVal = cctx.toCacheObject(cctx.unwrapTemporary(interceptRes.get2()));
@@ -4330,13 +4330,13 @@ public abstract class GridCacheMapEntry extends GridMetadataAwareAdapter impleme
 
         /** {@inheritDoc} */
         @Override public K getKey() {
-            return (K)cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepBinary);
+            return (K)cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary);
         }
 
         /** {@inheritDoc} */
         @SuppressWarnings("unchecked")
         @Override public V getValue() {
-            return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(peekVisibleValue(), keepBinary);
+            return (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(peekVisibleValue(), keepBinary);
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java
index f4ddf89..ea036af 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheOffheapSwapEntry.java
@@ -34,7 +34,7 @@ import sun.misc.Unsafe;
  *     <li>Expire time</li>
  *     <li>GridCacheVersion or GridCacheVersionEx</li>
  *     <li>Value is byte array flag</li>
- *     <li>Value byte array (marshalled with portable or grid marshaller)</li>
+ *     <li>Value byte array (marshalled with binary or grid marshaller)</li>
  *     <li>Value classloader UUID</li>
  *     <li>Key classloader UUID</li>
  * </ul>
@@ -192,4 +192,4 @@ public class GridCacheOffheapSwapEntry implements GridCacheSwapEntry {
     @Override public String toString() {
         return S.toString(GridCacheOffheapSwapEntry.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
index 68e70c3..d1d93d8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProxyImpl.java
@@ -229,7 +229,7 @@ public class GridCacheProxyImpl<K, V> implements IgniteInternalCache<K, V>, Exte
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public <K1, V1> GridCacheProxyImpl<K1, V1> keepPortable() {
+    @Override public <K1, V1> GridCacheProxyImpl<K1, V1> keepBinary() {
         if (opCtx != null && opCtx.isKeepBinary())
             return (GridCacheProxyImpl<K1, V1>)this;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java
index 2d179fa..21154c9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheReturn.java
@@ -190,7 +190,7 @@ public class GridCacheReturn implements Externalizable, Message {
      */
     private void initValue(GridCacheContext cctx, @Nullable CacheObject cacheObj, boolean keepBinary) {
         if (loc)
-            v = cctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, keepBinary, true);
+            v = cctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, keepBinary, true);
         else {
             assert cacheId == 0 || cacheId == cctx.cacheId();
 
@@ -318,7 +318,7 @@ public class GridCacheReturn implements Externalizable, Message {
         if (cacheObj != null) {
             cacheObj.finishUnmarshal(ctx.cacheObjectContext(), ldr);
 
-            v = ctx.cacheObjectContext().unwrapPortableIfNeeded(cacheObj, true, false);
+            v = ctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheObj, true, false);
         }
 
         if (invokeRes && invokeResCol != null) {
@@ -329,10 +329,10 @@ public class GridCacheReturn implements Externalizable, Message {
 
             for (CacheInvokeDirectResult res : invokeResCol) {
                 CacheInvokeResult<?> res0 = res.error() == null ?
-                    CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.result(), true, false)) :
+                    CacheInvokeResult.fromResult(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.result(), true, false)) :
                     CacheInvokeResult.fromError(res.error());
 
-                map0.put(ctx.cacheObjectContext().unwrapPortableIfNeeded(res.key(), true, false), res0);
+                map0.put(ctx.cacheObjectContext().unwrapBinaryIfNeeded(res.key(), true, false), res0);
             }
 
             v = map0;
@@ -464,4 +464,4 @@ public class GridCacheReturn implements Externalizable, Message {
     @Override public String toString() {
         return S.toString(GridCacheReturn.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 8fd4323..1768ecf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -322,7 +322,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
 
     /** {@inheritDoc} */
     @Override public <K1, V1> IgniteCache<K1, V1> withKeepBinary() {
-        return keepPortable();
+        return keepBinary();
     }
 
     /** {@inheritDoc} */
@@ -455,13 +455,13 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
         final CacheQuery<Map.Entry<K,V>> qry;
         final CacheQueryFuture<Map.Entry<K,V>> fut;
 
-        boolean isKeepPortable = opCtx != null && opCtx.isKeepBinary();
+        boolean isKeepBinary = opCtx != null && opCtx.isKeepBinary();
 
         if (filter instanceof ScanQuery) {
             IgniteBiPredicate<K, V> p = ((ScanQuery)filter).getFilter();
 
             qry = ctx.queries().createScanQuery(p != null ? p : ACCEPT_ALL, ((ScanQuery)filter).getPartition(),
-                isKeepPortable);
+                isKeepBinary);
 
             if (grp != null)
                 qry.projection(grp);
@@ -476,7 +476,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
         else if (filter instanceof TextQuery) {
             TextQuery p = (TextQuery)filter;
 
-            qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepPortable);
+            qry = ctx.queries().createFullTextQuery(p.getType(), p.getText(), isKeepBinary);
 
             if (grp != null)
                 qry.projection(grp);
@@ -489,7 +489,7 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
                 }, false);
         }
         else if (filter instanceof SpiQuery) {
-            qry = ctx.queries().createSpiQuery(isKeepPortable);
+            qry = ctx.queries().createSpiQuery(isKeepBinary);
 
             if (grp != null)
                 qry.projection(grp);
@@ -1718,30 +1718,30 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K, V
     }
 
     /**
-     * Creates projection that will operate with portable objects. <p> Projection returned by this method will force
-     * cache not to deserialize portable objects, so keys and values will be returned from cache API methods without
-     * changes. Therefore, signature of the projection can contain only following types: <ul> <li>{@code PortableObject}
-     * for portable classes</li> <li>All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...)</li>
+     * Creates projection that will operate with binary objects. <p> Projection returned by this method will force
+     * cache not to deserialize binary objects, so keys and values will be returned from cache API methods without
+     * changes. Therefore, signature of the projection can contain only following types: <ul> <li>{@code BinaryObject}
+     * for binary classes</li> <li>All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...)</li>
      * <li>Arrays of primitives (byte[], int[], ...)</li> <li>{@link String} and array of {@link String}s</li>
      * <li>{@link UUID} and array of {@link UUID}s</li> <li>{@link Date} and array of {@link Date}s</li> <li>{@link
      * java.sql.Timestamp} and array of {@link java.sql.Timestamp}s</li> <li>Enums and array of enums</li> <li> Maps,
-     * collections and array of objects (but objects inside them will still be converted if they are portable) </li>
+     * collections and array of objects (but objects inside them will still be converted if they are binary) </li>
      * </ul> <p> For example, if you use {@link Integer} as a key and {@code Value} class as a value (which will be
-     * stored in portable format), you should acquire following projection to avoid deserialization:
+     * stored in binary format), you should acquire following projection to avoid deserialization:
      * <pre>
-     * IgniteInternalCache<Integer, GridPortableObject> prj = cache.keepBinary();
+     * IgniteInternalCache<Integer, GridBinaryObject> prj = cache.keepBinary();
      *
-     * // Value is not deserialized and returned in portable format.
-     * GridPortableObject po = prj.get(1);
+     * // Value is not deserialized and returned in binary format.
+     * GridBinaryObject po = prj.get(1);
      * </pre>
-     * <p> Note that this method makes sense only if cache is working in portable mode ({@code
-     * CacheConfiguration#isPortableEnabled()} returns {@code true}. If not, this method is no-op and will return
+     * <p> Note that this method makes sense only if cache is working in binary mode ({@code
+     * CacheConfiguration#isBinaryEnabled()} returns {@code true}. If not, this method is no-op and will return
      * current projection.
      *
-     * @return Projection for portable objects.
+     * @return Projection for binary objects.
      */
     @SuppressWarnings("unchecked")
-    public <K1, V1> IgniteCache<K1, V1> keepPortable() {
+    public <K1, V1> IgniteCache<K1, V1> keepBinary() {
         GridCacheGateway<K, V> gate = this.gate;
 
         CacheOperationContext prev = onEnter(gate, opCtx);

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
index 3150ea9..186de68 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteInternalCache.java
@@ -169,31 +169,31 @@ import org.jetbrains.annotations.Nullable;
  * to any participating grid nodes. However, in case of redeployment, caches will be cleared and
  * all entries will be removed. This behavior is useful during development, but should not be
  * used in production.
- * <h1 class="header">Portable Objects</h1>
- * If an object is defined as portable Ignite cache will automatically store it in portable (i.e. binary)
- * format. User can choose to work either with the portable format or with the deserialized form (assuming
+ * <h1 class="header">Binary Objects</h1>
+ * If an object is defined as binary Ignite cache will automatically store it in binary (i.e. binary)
+ * format. User can choose to work either with the binary format or with the deserialized form (assuming
  * that class definitions are present in the classpath). By default, cache works with deserialized form
- * (example shows the case when {@link Integer} is used as a key for a portable object):
+ * (example shows the case when {@link Integer} is used as a key for a binary object):
  * <pre>
  * IgniteInternalCache<Integer, Value> prj = Ignition.grid().cache(null);
  *
- * // Value will be serialized and stored in cache in portable format.
+ * // Value will be serialized and stored in cache in binary format.
  * prj.put(1, new Value());
  *
- * // Value will be deserialized since it's stored in portable format.
+ * // Value will be deserialized since it's stored in binary format.
  * Value val = prj.get(1);
  * </pre>
  * You won't be able to work with deserialized form if class definition for the {@code Value} is not on
  * classpath. Even if you have the class definition, you should always avoid full deserialization if it's not
- * needed for performance reasons. To work with portable format directly you should create special projection
- * using {@link #keepPortable()} method:
+ * needed for performance reasons. To work with binary format directly you should create special projection
+ * using {@link #keepBinary()} method:
  * <pre>
- * IgniteInternalCache<Integer, GridPortableObject> prj = Ignition.grid().cache(null).keepBinary();
+ * IgniteInternalCache<Integer, GridBinaryObject> prj = Ignition.grid().cache(null).keepBinary();
  *
- * // Value is not deserialized and returned in portable format.
- * GridPortableObject po = prj.get(1);
+ * // Value is not deserialized and returned in binary format.
+ * GridBinaryObject po = prj.get(1);
  * </pre>
- * See {@link #keepPortable()} method JavaDoc for more details.
+ * See {@link #keepBinary()} method JavaDoc for more details.
  */
 public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
     /**
@@ -225,13 +225,13 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
     public IgniteInternalCache<K, V> setSkipStore(boolean skipStore);
 
     /**
-     * Creates projection that will operate with portable objects.
+     * Creates projection that will operate with binary objects.
      * <p>
-     * Projection returned by this method will force cache not to deserialize portable objects,
+     * Projection returned by this method will force cache not to deserialize binary objects,
      * so keys and values will be returned from cache API methods without changes. Therefore,
      * signature of the projection can contain only following types:
      * <ul>
-     *     <li><code>org.gridgain.grid.binary.PortableObject</code> for portable classes</li>
+     *     <li><code>org.gridgain.grid.binary.BinaryObject</code> for binary classes</li>
      *     <li>All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...)</li>
      *     <li>Arrays of primitives (byte[], int[], ...)</li>
      *     <li>{@link String} and array of {@link String}s</li>
@@ -241,27 +241,27 @@ public interface IgniteInternalCache<K, V> extends Iterable<Cache.Entry<K, V>> {
      *     <li>Enums and array of enums</li>
      *     <li>
      *         Maps, collections and array of objects (but objects inside
-     *         them will still be converted if they are portable)
+     *         them will still be converted if they are binary)
      *     </li>
      * </ul>
      * <p>
      * For example, if you use {@link Integer} as a key and {@code Value} class as a value
-     * (which will be stored in portable format), you should acquire following projection
+     * (which will be stored in binary format), you should acquire following projection
      * to avoid deserialization:
      * <pre>
-     * IgniteInternalCache<Integer, GridPortableObject> prj = cache.keepBinary();
+     * IgniteInternalCache<Integer, GridBinaryObject> prj = cache.keepBinary();
      *
-     * // Value is not deserialized and returned in portable format.
-     * GridPortableObject po = prj.get(1);
+     * // Value is not deserialized and returned in binary format.
+     * GridBinaryObject po = prj.get(1);
      * </pre>
      * <p>
-     * Note that this method makes sense only if cache is working in portable mode
-     * (<code>org.apache.ignite.configuration.CacheConfiguration#isPortableEnabled()</code> returns {@code true}. If not,
+     * Note that this method makes sense only if cache is working in binary mode
+     * (<code>org.apache.ignite.configuration.CacheConfiguration#isBinaryEnabled()</code> returns {@code true}. If not,
      * this method is no-op and will return current projection.
      *
-     * @return New internal cache instance for portable objects.
+     * @return New internal cache instance for binary objects.
      */
-    public <K1, V1> IgniteInternalCache<K1, V1> keepPortable();
+    public <K1, V1> IgniteInternalCache<K1, V1> keepBinary();
 
     /**
      * Returns {@code true} if this map contains no key-value mappings.

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java
index f6204fb..1f2678b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java
@@ -25,7 +25,7 @@ import org.apache.ignite.internal.processors.cache.GridCacheUtilityKey;
 import org.apache.ignite.internal.util.typedef.internal.S;
 
 /**
- * Key for portable meta data.
+ * Key for binary meta data.
  */
 class BinaryMetadataKey extends GridCacheUtilityKey<BinaryMetadataKey> implements Externalizable {
     /** */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java
index c0a4612..0ca06e3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java
@@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit
         CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects();
 
         try {
-            key = proc.toPortable(key);
+            key = proc.toBinary(key);
         }
         catch (IgniteException e) {
-            U.error(log, "Failed to marshal key to portable: " + key, e);
+            U.error(log, "Failed to marshal key to binary: " + key, e);
         }
 
         if (key instanceof BinaryObject)

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java
index 039f5ce..ec01f48 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java
@@ -27,11 +27,11 @@ import org.apache.ignite.internal.processors.cache.GridCacheDefaultAffinityKeyMa
  */
 public class CacheObjectBinaryContext extends CacheObjectContext {
     /** */
-    private boolean portableEnabled;
+    private boolean binaryEnabled;
 
     /**
      * @param kernalCtx Kernal context.
-     * @param portableEnabled Portable enabled flag.
+     * @param binaryEnabled Binary enabled flag.
      * @param cpyOnGet Copy on get flag.
      * @param storeVal {@code True} if should store unmarshalled value in cache.
      * @param depEnabled {@code true} if deployment is enabled for the given cache.
@@ -39,18 +39,18 @@ public class CacheObjectBinaryContext extends CacheObjectContext {
     public CacheObjectBinaryContext(GridKernalContext kernalCtx,
         boolean cpyOnGet,
         boolean storeVal,
-        boolean portableEnabled,
+        boolean binaryEnabled,
         boolean depEnabled) {
-        super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() :
+        super(kernalCtx, binaryEnabled ? new CacheDefaultBinaryAffinityKeyMapper() :
             new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled);
 
-        this.portableEnabled = portableEnabled;
+        this.binaryEnabled = binaryEnabled;
     }
 
     /**
-     * @return Portable enabled flag.
+     * @return Binary enabled flag.
      */
-    public boolean portableEnabled() {
-        return portableEnabled;
+    public boolean binaryEnabled() {
+        return binaryEnabled;
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java
index d5638a5..3578f7a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryProcessor.java
@@ -38,12 +38,12 @@ public interface CacheObjectBinaryProcessor extends IgniteCacheObjectProcessor {
     public BinaryObjectBuilder builder(String clsName);
 
     /**
-     * Creates builder initialized by existing portable object.
+     * Creates builder initialized by existing binary object.
      *
-     * @param portableObj Portable object to edit.
-     * @return Portable builder.
+     * @param binaryObj Binary object to edit.
+     * @return Binary builder.
      */
-    public BinaryObjectBuilder builder(BinaryObject portableObj);
+    public BinaryObjectBuilder builder(BinaryObject binaryObj);
 
     /**
      * @param typeId Type ID.
@@ -92,15 +92,15 @@ public interface CacheObjectBinaryProcessor extends IgniteCacheObjectProcessor {
     public BinaryObject buildEnum(String typeName, int ord) throws IgniteException;
 
     /**
-     * @return Portables interface.
+     * @return Binaries interface.
      * @throws IgniteException If failed.
      */
     public IgniteBinary binary() throws IgniteException;
 
     /**
      * @param obj Original object.
-     * @return Portable object (in case portable marshaller is used).
+     * @return Binary object (in case binary marshaller is used).
      * @throws IgniteException If failed.
      */
-    public Object marshalToPortable(Object obj) throws IgniteException;
+    public Object marshalToBinary(Object obj) throws IgniteException;
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/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 a9f0d74..e77b85a 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
@@ -98,7 +98,7 @@ import org.jsr166.ConcurrentHashMap8;
 import sun.misc.Unsafe;
 
 /**
- * Portable processor implementation.
+ * Binary processor implementation.
  */
 public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorImpl implements
     CacheObjectBinaryProcessor {
@@ -117,7 +117,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     /** */
     private final ConcurrentHashMap8<Integer, BinaryTypeImpl> clientMetaDataCache;
 
-    /** Predicate to filter portable meta data in utility cache. */
+    /** Predicate to filter binary meta data in utility cache. */
     private final CacheEntryPredicate metaPred = new CacheEntryPredicateAdapter() {
         private static final long serialVersionUID = 0L;
 
@@ -127,17 +127,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     };
 
     /** */
-    private BinaryContext portableCtx;
+    private BinaryContext binaryCtx;
 
     /** */
     private Marshaller marsh;
 
     /** */
-    private GridBinaryMarshaller portableMarsh;
+    private GridBinaryMarshaller binaryMarsh;
 
     /** */
     @GridToStringExclude
-    private IgniteBinary portables;
+    private IgniteBinary binaries;
 
     /** Metadata updates collected before metadata cache is initialized. */
     private final Map<Integer, BinaryMetadata> metaBuf = new ConcurrentHashMap<>();
@@ -193,7 +193,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
                     assert metaDataCache != null;
 
-                    CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(portableCtx));
+                    CacheObjectBinaryProcessorImpl.this.addMeta(typeId, newMeta0.wrap(binaryCtx));
                 }
 
                 @Override public BinaryType metadata(int typeId) throws BinaryObjectException {
@@ -206,14 +206,14 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
             BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh;
 
-            portableCtx = new BinaryContext(metaHnd, ctx.config());
+            binaryCtx = new BinaryContext(metaHnd, ctx.config());
 
-            IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx,
+            IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setBinaryContext", binaryCtx,
                 ctx.config());
 
-            portableMarsh = new GridBinaryMarshaller(portableCtx);
+            binaryMarsh = new GridBinaryMarshaller(binaryCtx);
 
-            portables = new IgniteBinaryImpl(ctx, this);
+            binaries = new IgniteBinaryImpl(ctx, this);
         }
     }
 
@@ -286,7 +286,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
         }
 
         for (Map.Entry<Integer, BinaryMetadata> e : metaBuf.entrySet())
-            addMeta(e.getKey(), e.getValue().wrap(portableCtx));
+            addMeta(e.getKey(), e.getValue().wrap(binaryCtx));
 
         metaBuf.clear();
 
@@ -321,17 +321,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
                     res = oldMeta0;
                 }
 
-                return res != null ? res.wrap(portableCtx) : null;
+                return res != null ? res.wrap(binaryCtx) : null;
             }
         });
     }
 
     /** {@inheritDoc} */
     @Override public int typeId(String typeName) {
-        if (portableCtx == null)
+        if (binaryCtx == null)
             return super.typeId(typeName);
 
-        return portableCtx.typeId(typeName);
+        return binaryCtx.typeId(typeName);
     }
 
     /**
@@ -340,7 +340,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
      * @throws org.apache.ignite.binary.BinaryObjectException If failed.
      */
     public byte[] marshal(@Nullable Object obj) throws BinaryObjectException {
-        byte[] arr = portableMarsh.marshal(obj);
+        byte[] arr = binaryMarsh.marshal(obj);
 
         assert arr.length > 0;
 
@@ -367,7 +367,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
             BinaryInputStream in = new BinaryOffheapInputStream(ptr, size, forceHeap);
 
-            return portableMarsh.unmarshal(in);
+            return binaryMarsh.unmarshal(in);
         }
         else
             return U.copyMemory(ptr, size);
@@ -375,11 +375,11 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public Object marshalToPortable(@Nullable Object obj) throws BinaryObjectException {
+    @Override public Object marshalToBinary(@Nullable Object obj) throws BinaryObjectException {
         if (obj == null)
             return null;
 
-        if (BinaryUtils.isPortableType(obj.getClass()))
+        if (BinaryUtils.isBinaryType(obj.getClass()))
             return obj;
 
         if (obj instanceof Object[]) {
@@ -388,7 +388,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
             Object[] pArr = new Object[arr.length];
 
             for (int i = 0; i < arr.length; i++)
-                pArr[i] = marshalToPortable(arr[i]);
+                pArr[i] = marshalToBinary(arr[i]);
 
             return pArr;
         }
@@ -397,9 +397,9 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
             IgniteBiTuple tup = (IgniteBiTuple)obj;
 
             if (obj instanceof T2)
-                return new T2<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2()));
+                return new T2<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2()));
 
-            return new IgniteBiTuple<>(marshalToPortable(tup.get1()), marshalToPortable(tup.get2()));
+            return new IgniteBiTuple<>(marshalToBinary(tup.get1()), marshalToBinary(tup.get2()));
         }
 
         if (obj instanceof Collection) {
@@ -413,7 +413,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
                 pCol = new ArrayList<>(col.size());
 
             for (Object item : col)
-                pCol.add(marshalToPortable(item));
+                pCol.add(marshalToBinary(item));
 
             return pCol;
         }
@@ -424,7 +424,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
             Map<Object, Object> pMap = BinaryUtils.newMap((Map<Object, Object>)obj);
 
             for (Map.Entry<?, ?> e : map.entrySet())
-                pMap.put(marshalToPortable(e.getKey()), marshalToPortable(e.getValue()));
+                pMap.put(marshalToBinary(e.getKey()), marshalToBinary(e.getValue()));
 
             return pMap;
         }
@@ -432,14 +432,14 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
         if (obj instanceof Map.Entry) {
             Map.Entry<?, ?> e = (Map.Entry<?, ?>)obj;
 
-            return new GridMapEntry<>(marshalToPortable(e.getKey()), marshalToPortable(e.getValue()));
+            return new GridMapEntry<>(marshalToBinary(e.getKey()), marshalToBinary(e.getValue()));
         }
 
-        byte[] arr = portableMarsh.marshal(obj);
+        byte[] arr = binaryMarsh.marshal(obj);
 
         assert arr.length > 0;
 
-        Object obj0 = portableMarsh.unmarshal(arr, null);
+        Object obj0 = binaryMarsh.unmarshal(arr, null);
 
         // Possible if a class has writeObject method.
         if (obj0 instanceof BinaryObject)
@@ -452,17 +452,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
      * @return Marshaller.
      */
     public GridBinaryMarshaller marshaller() {
-        return portableMarsh;
+        return binaryMarsh;
     }
 
     /** {@inheritDoc} */
     @Override public BinaryObjectBuilder builder(String clsName) {
-        return new BinaryObjectBuilderImpl(portableCtx, clsName);
+        return new BinaryObjectBuilderImpl(binaryCtx, clsName);
     }
 
     /** {@inheritDoc} */
-    @Override public BinaryObjectBuilder builder(BinaryObject portableObj) {
-        return BinaryObjectBuilderImpl.wrap(portableObj);
+    @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) {
+        return BinaryObjectBuilderImpl.wrap(binaryObj);
     }
 
     /** {@inheritDoc} */
@@ -470,7 +470,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
         Map<String, Integer> fieldTypeIds, boolean isEnum) throws BinaryObjectException {
         BinaryMetadata meta = new BinaryMetadata(typeId, typeName, fieldTypeIds, affKeyFieldName, null, isEnum);
 
-        portableCtx.updateMetadata(typeId, meta);
+        binaryCtx.updateMetadata(typeId, meta);
     }
 
     /** {@inheritDoc} */
@@ -507,7 +507,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
                 BinaryMetadata meta = metaDataCache.getTopologySafe(new BinaryMetadataKey(typeId));
 
-                return meta != null ? meta.wrap(portableCtx) : null;
+                return meta != null ? meta.wrap(binaryCtx) : null;
             }
             else {
                 BinaryMetadataKey key = new BinaryMetadataKey(typeId);
@@ -517,7 +517,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
                 if (meta == null && !metaDataCache.context().preloader().syncFuture().isDone())
                     meta = metaDataCache.getTopologySafe(key);
 
-                return meta != null ? meta.wrap(portableCtx) : null;
+                return meta != null ? meta.wrap(binaryCtx) : null;
             }
         }
         catch (CacheException e) {
@@ -539,7 +539,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
             Map<Integer, BinaryType> res = U.newHashMap(meta.size());
 
             for (Map.Entry<BinaryMetadataKey, BinaryMetadata> e : meta.entrySet())
-                res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx));
+                res.put(e.getKey().typeId(), e.getValue().wrap(binaryCtx));
 
             return res;
         }
@@ -563,7 +563,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
                     private static final long serialVersionUID = 0L;
 
                     @Override public BinaryType apply(Cache.Entry<BinaryMetadataKey, BinaryMetadata> e) {
-                        return e.getValue().wrap(portableCtx);
+                        return e.getValue().wrap(binaryCtx);
                     }
                 });
         }
@@ -573,30 +573,30 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     @Override public BinaryObject buildEnum(String typeName, int ord) throws IgniteException {
         typeName = BinaryContext.typeName(typeName);
 
-        int typeId = portableCtx.typeId(typeName);
+        int typeId = binaryCtx.typeId(typeName);
 
         updateMetadata(typeId, typeName, null, null, true);
 
-        return new BinaryEnumObjectImpl(portableCtx, typeId, null, ord);
+        return new BinaryEnumObjectImpl(binaryCtx, typeId, null, ord);
     }
 
     /** {@inheritDoc} */
     @Override public IgniteBinary binary() throws IgniteException {
-        return portables;
+        return binaries;
     }
 
     /** {@inheritDoc} */
-    @Override public boolean isPortableObject(Object obj) {
+    @Override public boolean isBinaryObject(Object obj) {
         return obj instanceof BinaryObject;
     }
 
     /** {@inheritDoc} */
-    @Override public boolean isPortableEnabled(CacheConfiguration<?, ?> ccfg) {
+    @Override public boolean isBinaryEnabled(CacheConfiguration<?, ?> ccfg) {
         return marsh instanceof BinaryMarshaller;
     }
 
     /**
-     * @param po Portable object.
+     * @param po Binary object.
      * @return Affinity key.
      */
     public Object affinityKey(BinaryObject po) {
@@ -612,14 +612,14 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
             else if (po instanceof BinaryObjectEx) {
                 int id = ((BinaryObjectEx)po).typeId();
 
-                String affKeyFieldName = portableCtx.affinityKeyFieldName(id);
+                String affKeyFieldName = binaryCtx.affinityKeyFieldName(id);
 
                 if (affKeyFieldName != null)
                     return po.field(affKeyFieldName);
             }
         }
         catch (BinaryObjectException e) {
-            U.error(log, "Failed to get affinity field from portable object: " + po, e);
+            U.error(log, "Failed to get affinity field from binary object: " + po, e);
         }
 
         return po;
@@ -630,7 +630,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
         if (obj == null)
             return 0;
 
-        return isPortableObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName());
+        return isBinaryObject(obj) ? ((BinaryObjectEx)obj).typeId() : typeId(obj.getClass().getSimpleName());
     }
 
     /** {@inheritDoc} */
@@ -638,7 +638,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
         if (obj == null)
             return null;
 
-        return isPortableObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName);
+        return isBinaryObject(obj) ? ((BinaryObject)obj).field(fieldName) : super.field(obj, fieldName);
     }
 
     /** {@inheritDoc} */
@@ -647,17 +647,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     }
 
     /**
-     * @return Portable context.
+     * @return Binary context.
      */
-    public BinaryContext portableContext() {
-        return portableCtx;
+    public BinaryContext binaryContext() {
+        return binaryCtx;
     }
 
     /** {@inheritDoc} */
     @Override public CacheObjectContext contextForCache(CacheConfiguration cfg) throws IgniteCheckedException {
         assert cfg != null;
 
-        boolean portableEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) &&
+        boolean binaryEnabled = marsh instanceof BinaryMarshaller && !GridCacheUtils.isSystemCache(cfg.getName()) &&
             !GridCacheUtils.isIgfsCache(ctx.config(), cfg.getName());
 
         CacheObjectContext ctx0 = super.contextForCache(cfg);
@@ -665,7 +665,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
         CacheObjectContext res = new CacheObjectBinaryContext(ctx,
             ctx0.copyOnGet(),
             ctx0.storeValue(),
-            portableEnabled,
+            binaryEnabled,
             ctx0.addDeploymentInfo());
 
         ctx.resource().injectGeneric(res.defaultAffMapper());
@@ -675,10 +675,10 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
     /** {@inheritDoc} */
     @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException {
-        if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null)
+        if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null)
             return super.marshal(ctx, val);
 
-        byte[] arr = portableMarsh.marshal(val);
+        byte[] arr = binaryMarsh.marshal(val);
 
         assert arr.length > 0;
 
@@ -688,22 +688,22 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     /** {@inheritDoc} */
     @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr)
         throws IgniteCheckedException {
-        if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null)
+        if (!((CacheObjectBinaryContext)ctx).binaryEnabled() || binaryMarsh == null)
             return super.unmarshal(ctx, bytes, clsLdr);
 
-        return portableMarsh.unmarshal(bytes, clsLdr);
+        return binaryMarsh.unmarshal(bytes, clsLdr);
     }
 
     /** {@inheritDoc} */
     @Override public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, Object obj, boolean userObj) {
-        if (!((CacheObjectBinaryContext)ctx).portableEnabled())
+        if (!((CacheObjectBinaryContext)ctx).binaryEnabled())
             return super.toCacheKeyObject(ctx, obj, userObj);
 
         if (obj instanceof KeyCacheObject)
             return (KeyCacheObject)obj;
 
-        if (((CacheObjectBinaryContext)ctx).portableEnabled()) {
-            obj = toPortable(obj);
+        if (((CacheObjectBinaryContext)ctx).binaryEnabled()) {
+            obj = toBinary(obj);
 
             if (obj instanceof BinaryObject)
                 return (BinaryObjectImpl)obj;
@@ -715,13 +715,13 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     /** {@inheritDoc} */
     @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj,
         boolean userObj) {
-        if (!((CacheObjectBinaryContext)ctx).portableEnabled())
+        if (!((CacheObjectBinaryContext)ctx).binaryEnabled())
             return super.toCacheObject(ctx, obj, userObj);
 
         if (obj == null || obj instanceof CacheObject)
             return (CacheObject)obj;
 
-        obj = toPortable(obj);
+        obj = toBinary(obj);
 
         if (obj instanceof BinaryObject)
             return (BinaryObjectImpl)obj;
@@ -732,7 +732,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     /** {@inheritDoc} */
     @Override public CacheObject toCacheObject(CacheObjectContext ctx, byte type, byte[] bytes) {
         if (type == BinaryObjectImpl.TYPE_BINARY)
-            return new BinaryObjectImpl(portableContext(), bytes, 0);
+            return new BinaryObjectImpl(binaryContext(), bytes, 0);
 
         return super.toCacheObject(ctx, type, bytes);
     }
@@ -740,7 +740,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     /** {@inheritDoc} */
     @Override public CacheObject toCacheObject(GridCacheContext ctx, long valPtr, boolean tmp)
         throws IgniteCheckedException {
-        if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled())
+        if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled())
             return super.toCacheObject(ctx, valPtr, tmp);
 
         Object val = unmarshal(valPtr, !tmp);
@@ -753,7 +753,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
     /** {@inheritDoc} */
     @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException {
-        if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled())
+        if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).binaryEnabled())
             return obj;
 
         if (obj instanceof BinaryObjectOffheapImpl)
@@ -764,17 +764,17 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
     /**
      * @param obj Object.
-     * @return Portable object.
+     * @return Binary object.
      * @throws IgniteException In case of error.
      */
-    @Nullable public Object toPortable(@Nullable Object obj) throws IgniteException {
+    @Nullable public Object toBinary(@Nullable Object obj) throws IgniteException {
         if (obj == null)
             return null;
 
-        if (isPortableObject(obj))
+        if (isBinaryObject(obj))
             return obj;
 
-        return marshalToPortable(obj);
+        return marshalToBinary(obj);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java
index 4a225a5..1a2d0a9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/IgniteBinaryImpl.java
@@ -64,7 +64,7 @@ public class IgniteBinaryImpl implements IgniteBinary {
         guard();
 
         try {
-            return (T)proc.marshalToPortable(obj);
+            return (T)proc.marshalToBinary(obj);
         }
         finally {
             unguard();
@@ -84,11 +84,11 @@ public class IgniteBinaryImpl implements IgniteBinary {
     }
 
     /** {@inheritDoc} */
-    @Override public BinaryObjectBuilder builder(BinaryObject portableObj) {
+    @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) {
         guard();
 
         try {
-            return proc.builder(portableObj);
+            return proc.builder(binaryObj);
         }
         finally {
             unguard();
@@ -156,7 +156,7 @@ public class IgniteBinaryImpl implements IgniteBinary {
     }
 
     /**
-     * @return Portable processor.
+     * @return Binary processor.
      */
     public IgniteCacheObjectProcessor processor() {
         return proc;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java
index b0e5c2f..4e65d9c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/package-info.java
@@ -17,6 +17,6 @@
 
 /**
  * <!-- Package description. -->
- * Implementation of portable processor.
+ * Implementation of binary processor.
  */
 package org.apache.ignite.internal.processors.cache.binary;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
index 6447194..f56cbf8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/datastructures/CacheDataStructuresManager.java
@@ -311,15 +311,15 @@ public class CacheDataStructuresManager extends GridCacheManagerAdapter {
      *
      * @param key Key.
      * @param rmv {@code True} if entry was removed.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      */
-    public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepPortable) {
+    public void onEntryUpdated(KeyCacheObject key, boolean rmv, boolean keepBinary) {
         // No need to notify data structures manager for a user cache since all DS objects are stored
         // in system caches.
         if (cctx.userCache())
             return;
 
-        Object key0 = cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepPortable, false);
+        Object key0 = cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false);
 
         if (key0 instanceof SetItemKey)
             onSetItemUpdated((SetItemKey)key0, rmv);

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
index 360eb0f..5d07b6f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedLockRequest.java
@@ -251,7 +251,7 @@ public class GridDistributedLockRequest extends GridDistributedBaseMessage {
     }
 
     /**
-     * @return Keep portable.
+     * @return Keep binary.
      */
     public boolean keepBinary() {
         return (flags & KEEP_BINARY_FLAG_MASK) != 0;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
index 245ffc6..320c3c2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/CacheDistributedGetFutureAdapter.java
@@ -77,8 +77,8 @@ public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCompoun
     /** Task name. */
     protected String taskName;
 
-    /** Whether to deserialize portable objects. */
-    protected boolean deserializePortable;
+    /** Whether to deserialize binary objects. */
+    protected boolean deserializeBinary;
 
     /** Skip values flag. */
     protected boolean skipVals;
@@ -103,7 +103,7 @@ public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCompoun
      *          if called on backup node.
      * @param subjId Subject ID.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param expiryPlc Expiry policy.
      * @param skipVals Skip values flag.
      * @param canRemap Flag indicating whether future can be remapped on a newer topology version.
@@ -117,7 +117,7 @@ public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCompoun
         boolean forcePrimary,
         @Nullable UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         @Nullable IgniteCacheExpiryPolicy expiryPlc,
         boolean skipVals,
         boolean canRemap,
@@ -134,7 +134,7 @@ public abstract class CacheDistributedGetFutureAdapter<K, V> extends GridCompoun
         this.forcePrimary = forcePrimary;
         this.subjId = subjId;
         this.taskName = taskName;
-        this.deserializePortable = deserializePortable;
+        this.deserializeBinary = deserializeBinary;
         this.expiryPlc = expiryPlc;
         this.skipVals = skipVals;
         this.canRemap = canRemap;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
index ff8d315..9199e70 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
@@ -625,7 +625,7 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
         boolean skipTx,
         @Nullable UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         boolean skipVals,
         boolean canRemap
     ) {
@@ -636,7 +636,7 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
             /*don't check local tx. */false,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             forcePrimary,
             null,
             skipVals,
@@ -1164,7 +1164,7 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
         assert primary || backup;
 
         if (primary && backup)
-            return iterator(map.entries0().iterator(), !ctx.keepPortable());
+            return iterator(map.entries0().iterator(), !ctx.keepBinary());
         else {
             final AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
 
@@ -1228,7 +1228,7 @@ public abstract class GridDhtCacheAdapter<K, V> extends GridDistributedCacheAdap
                 }
             };
 
-            return iterator(it, !ctx.keepPortable());
+            return iterator(it, !ctx.keepBinary());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
index 626713a..e410228 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtGetFuture.java
@@ -380,7 +380,7 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
             else {
                 fut = tx.getAllAsync(cctx,
                     keys.keySet(),
-                    /*deserialize portable*/false,
+                    /*deserialize binary*/false,
                     skipVals,
                     /*keep cache objects*/true,
                     /*skip store*/!readThrough);
@@ -410,7 +410,7 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
                         else {
                             return tx.getAllAsync(cctx,
                                 keys.keySet(),
-                                /*deserialize portable*/false,
+                                /*deserialize binary*/false,
                                 skipVals,
                                 /*keep cache objects*/true,
                                 /*skip store*/!readThrough);

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
index 90a9da8..6867e21 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedGetFuture.java
@@ -88,7 +88,7 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
      *          if called on backup node.
      * @param subjId Subject ID.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param expiryPlc Expiry policy.
      * @param skipVals Skip values flag.
      * @param canRemap Flag indicating whether future can be remapped on a newer topology version.
@@ -103,7 +103,7 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
         boolean forcePrimary,
         @Nullable UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         @Nullable IgniteCacheExpiryPolicy expiryPlc,
         boolean skipVals,
         boolean canRemap,
@@ -116,7 +116,7 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
             forcePrimary,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             expiryPlc,
             skipVals,
             canRemap,
@@ -400,7 +400,7 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
                                     null,
                                     taskName,
                                     expiryPlc,
-                                    !deserializePortable);
+                                    !deserializeBinary);
 
                                 if (res != null) {
                                     v = res.get1();
@@ -420,7 +420,7 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
                                     null,
                                     taskName,
                                     expiryPlc,
-                                    !deserializePortable);
+                                    !deserializeBinary);
                             }
 
                             colocated.context().evicts().touch(entry, topVer);
@@ -439,7 +439,7 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
                                         v,
                                         skipVals,
                                         keepCacheObjects,
-                                        deserializePortable,
+                                        deserializeBinary,
                                         true);
 
                                 return false;
@@ -524,7 +524,7 @@ public class GridPartitionedGetFuture<K, V> extends CacheDistributedGetFutureAda
                         info.value(),
                         skipVals,
                         keepCacheObjects,
-                        deserializePortable,
+                        deserializeBinary,
                         false);
                 }
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
index 99cf210..f955bb6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridPartitionedSingleGetFuture.java
@@ -101,8 +101,8 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter<Object> im
     /** Task name. */
     private final String taskName;
 
-    /** Whether to deserialize portable objects. */
-    private boolean deserializePortable;
+    /** Whether to deserialize binary objects. */
+    private boolean deserializeBinary;
 
     /** Skip values flag. */
     private boolean skipVals;
@@ -130,7 +130,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter<Object> im
      * @param forcePrimary If {@code true} then will force network trip to primary node even if called on backup node.
      * @param subjId Subject ID.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param expiryPlc Expiry policy.
      * @param skipVals Skip values flag.
      * @param canRemap Flag indicating whether future can be remapped on a newer topology version.
@@ -145,7 +145,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter<Object> im
         boolean forcePrimary,
         @Nullable UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         @Nullable IgniteCacheExpiryPolicy expiryPlc,
         boolean skipVals,
         boolean canRemap,
@@ -160,7 +160,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter<Object> im
         this.forcePrimary = forcePrimary;
         this.subjId = subjId;
         this.taskName = taskName;
-        this.deserializePortable = deserializePortable;
+        this.deserializeBinary = deserializeBinary;
         this.expiryPlc = expiryPlc;
         this.skipVals = skipVals;
         this.canRemap = canRemap;
@@ -580,7 +580,7 @@ public class GridPartitionedSingleGetFuture extends GridFutureAdapter<Object> im
                 }
                 else {
                     if (!keepCacheObjects) {
-                        Object res = cctx.unwrapPortableIfNeeded(val, !deserializePortable && !skipVals);
+                        Object res = cctx.unwrapBinaryIfNeeded(val, !deserializeBinary && !skipVals);
 
                         onDone(res);
                     }


[43/50] [abbrv] ignite git commit: Merge remote-tracking branch 'origin/ignite-1.5' into ignite-1.5

Posted by vo...@apache.org.
Merge remote-tracking branch 'origin/ignite-1.5' into ignite-1.5


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

Branch: refs/heads/ignite-2100
Commit: 72e5b9adfdcfcad4b0002bbfc1cf20fd3a0ed149
Parents: beb64c3 de0b1ba
Author: sboikov <sb...@gridgain.com>
Authored: Mon Dec 14 11:34:32 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Dec 14 11:34:32 2015 +0300

----------------------------------------------------------------------
 .../resources/META-INF/classnames.properties    | 68 +++++++++++++-------
 1 file changed, 44 insertions(+), 24 deletions(-)
----------------------------------------------------------------------



[45/50] [abbrv] ignite git commit: ignite-1.5 Fixed test for offheap mode.

Posted by vo...@apache.org.
ignite-1.5 Fixed test for offheap mode.


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

Branch: refs/heads/ignite-2100
Commit: 345fc27d90f8ae28697fc021d55c7b7a015faeee
Parents: 4291edc
Author: sboikov <sb...@gridgain.com>
Authored: Mon Dec 14 12:18:16 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Dec 14 12:18:16 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAbstractFullApiSelfTest.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/345fc27d/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index cbb19fb..b984afa 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -3233,7 +3233,7 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         boolean wait = waitForCondition(new GridAbsPredicate() {
             @Override public boolean apply() {
-                return cache.localPeek(key, ONHEAP) == null;
+                return cache.localPeek(key) == null;
             }
         }, ttl + 1000);
 
@@ -3814,12 +3814,12 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         waitForCondition(new GridAbsPredicate() {
             @Override public boolean apply() {
-                return cache.localPeek(key, ONHEAP) == null;
+                return cache.localPeek(key) == null;
             }
         }, ttl + 1000);
 
         // Peek will actually remove entry from cache.
-        assertNull(cache.localPeek(key, ONHEAP));
+        assertNull(cache.localPeek(key));
 
         assert cache.localSize() == 0;
 


[49/50] [abbrv] ignite git commit: Merge branch 'ignite-1.5' into ignite-2100

Posted by vo...@apache.org.
Merge branch 'ignite-1.5' into ignite-2100


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

Branch: refs/heads/ignite-2100
Commit: c482298cf244547e2a4725db620b3a562d77ef40
Parents: 0d72b7e f87b80f
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Dec 14 13:05:19 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Dec 14 13:05:19 2015 +0300

----------------------------------------------------------------------
 .gitignore                                      |    1 +
 assembly/release-fabric-base.xml                |    6 +
 bin/ignite.bat                                  |    4 +-
 bin/include/parseargs.bat                       |    4 +-
 examples/schema-import/README.txt               |    2 +-
 ...ComputeClientBinaryTaskExecutionExample.java |    4 +-
 .../CacheClientBinaryPutGetExample.java         |    2 +-
 .../datagrid/CacheClientBinaryQueryExample.java |    8 +-
 .../store/auto/CacheBinaryAutoStoreExample.java |   38 +-
 .../examples/datagrid/CacheQueryExample.java    |    6 +
 .../datagrid/CacheTransactionExample.java       |    4 +-
 .../store/auto/CacheAutoStoreExample.java       |   32 +-
 .../ignite/examples/model/Organization.java     |   16 +-
 .../apache/ignite/examples/model/Person.java    |   40 +-
 .../ignite/examples/util/DbH2ServerStartup.java |   31 +-
 .../examples/CacheClientBinaryExampleTest.java  |   46 +
 .../CacheClientPortableExampleTest.java         |   46 -
 .../ComputeClientBinaryExampleTest.java         |   37 +
 .../ComputeClientPortableExampleTest.java       |   37 -
 .../testsuites/IgniteExamplesSelfTestSuite.java |   15 +-
 .../client/impl/ClientCacheFlagsCodecTest.java  |    8 +-
 .../src/test/resources/spring-server-node.xml   |    8 +-
 .../test/resources/spring-server-ssl-node.xml   |    8 +-
 modules/core/pom.xml                            |    8 +-
 .../java/org/apache/ignite/IgniteBinary.java    |  124 +-
 .../java/org/apache/ignite/IgniteCache.java     |    8 +-
 .../org/apache/ignite/binary/BinaryReader.java  |    4 +-
 .../org/apache/ignite/cache/QueryEntity.java    |    3 +-
 .../affinity/AffinityNodeHashResolver.java      |    6 +-
 .../store/jdbc/CacheAbstractJdbcStore.java      |    2 +-
 .../cache/store/jdbc/CacheJdbcPojoStore.java    |    2 +-
 .../configuration/BinaryConfiguration.java      |    4 +-
 .../configuration/IgniteConfiguration.java      |    2 +-
 .../ignite/internal/GridKernalContextImpl.java  |    2 +-
 .../apache/ignite/internal/IgniteKernal.java    |   32 +-
 .../ignite/internal/IgniteNodeAttributes.java   |    4 +-
 .../org/apache/ignite/internal/IgnitionEx.java  |    2 +-
 .../binary/BinaryCachingMetadataHandler.java    |   70 +
 .../internal/binary/BinaryClassDescriptor.java  |  813 ++++
 .../ignite/internal/binary/BinaryContext.java   | 1102 +++++
 .../ignite/internal/binary/BinaryEnumCache.java |   69 +
 .../internal/binary/BinaryEnumObjectImpl.java   |  311 ++
 .../internal/binary/BinaryFieldAccessor.java    |  856 ++++
 .../ignite/internal/binary/BinaryFieldImpl.java |  116 +
 .../internal/binary/BinaryInternalIdMapper.java |  161 +
 .../internal/binary/BinaryMarshaller.java       |  142 +
 .../ignite/internal/binary/BinaryMetadata.java  |  180 +
 .../binary/BinaryMetadataCollector.java         |  277 ++
 .../internal/binary/BinaryMetadataHandler.java  |   44 +
 .../binary/BinaryNoopMetadataHandler.java       |   53 +
 .../ignite/internal/binary/BinaryObjectEx.java  |   30 +
 .../internal/binary/BinaryObjectExImpl.java     |  251 ++
 .../internal/binary/BinaryObjectImpl.java       |  569 +++
 .../binary/BinaryObjectOffheapImpl.java         |  417 ++
 .../internal/binary/BinaryPositionReadable.java |   47 +
 .../internal/binary/BinaryPrimitives.java       |  382 ++
 .../internal/binary/BinaryRawReaderEx.java      |   33 +
 .../internal/binary/BinaryRawWriterEx.java      |   60 +
 .../internal/binary/BinaryReaderExImpl.java     | 2028 +++++++++
 .../internal/binary/BinaryReaderHandles.java    |  108 +
 .../binary/BinaryReaderHandlesHolder.java       |   46 +
 .../binary/BinaryReaderHandlesHolderImpl.java   |   44 +
 .../ignite/internal/binary/BinarySchema.java    |  466 ++
 .../internal/binary/BinarySchemaRegistry.java   |  172 +
 .../binary/BinaryThreadLocalContext.java        |   69 +
 .../ignite/internal/binary/BinaryTypeImpl.java  |   93 +
 .../ignite/internal/binary/BinaryUtils.java     | 1864 ++++++++
 .../ignite/internal/binary/BinaryWriteMode.java |  178 +
 .../internal/binary/BinaryWriterExImpl.java     | 1768 ++++++++
 .../internal/binary/BinaryWriterHandles.java    |  101 +
 .../binary/BinaryWriterSchemaHolder.java        |  148 +
 .../internal/binary/GridBinaryMarshaller.java   |  286 ++
 .../binary/builder/BinaryAbstractLazyValue.java |   57 +
 .../binary/builder/BinaryBuilderEnum.java       |  115 +
 .../binary/builder/BinaryBuilderReader.java     |  846 ++++
 .../BinaryBuilderSerializationAware.java        |   31 +
 .../binary/builder/BinaryBuilderSerializer.java |  217 +
 .../builder/BinaryEnumArrayLazyValue.java       |  113 +
 .../binary/builder/BinaryLazyArrayList.java     |  167 +
 .../binary/builder/BinaryLazyLinkedList.java    |  218 +
 .../internal/binary/builder/BinaryLazyMap.java  |  221 +
 .../internal/binary/builder/BinaryLazySet.java  |   92 +
 .../binary/builder/BinaryLazyValue.java         |   28 +
 .../builder/BinaryModifiableLazyValue.java      |   52 +
 .../builder/BinaryObjectArrayLazyValue.java     |   90 +
 .../binary/builder/BinaryObjectBuilderImpl.java |  572 +++
 .../binary/builder/BinaryPlainBinaryObject.java |   53 +
 .../binary/builder/BinaryPlainLazyValue.java    |   49 +
 .../binary/builder/BinaryValueWithType.java     |   76 +
 .../internal/binary/builder/package-info.java   |   22 +
 .../ignite/internal/binary/package-info.java    |   22 +
 .../streams/BinaryAbstractInputStream.java      |  379 ++
 .../streams/BinaryAbstractOutputStream.java     |  347 ++
 .../binary/streams/BinaryAbstractStream.java    |   80 +
 .../binary/streams/BinaryHeapInputStream.java   |  166 +
 .../binary/streams/BinaryHeapOutputStream.java  |  176 +
 .../binary/streams/BinaryInputStream.java       |  162 +
 .../binary/streams/BinaryMemoryAllocator.java   |   57 +
 .../streams/BinaryMemoryAllocatorChunk.java     |  117 +
 .../streams/BinaryOffheapInputStream.java       |  144 +
 .../streams/BinaryOffheapOutputStream.java      |  222 +
 .../binary/streams/BinaryOutputStream.java      |  259 ++
 .../internal/binary/streams/BinaryStream.java   |   53 +
 .../internal/binary/streams/package-info.java   |   22 +
 .../internal/client/GridClientCacheFlag.java    |   10 +-
 .../internal/client/GridClientCompute.java      |    4 +-
 .../client/GridClientConfiguration.java         |    4 +-
 .../client/impl/GridClientComputeImpl.java      |   20 +-
 .../impl/connection/GridClientConnection.java   |    6 +-
 .../GridClientConnectionManagerAdapter.java     |    6 +-
 .../connection/GridClientNioTcpConnection.java  |   34 +-
 .../internal/direct/DirectMessageWriter.java    |  108 +-
 .../communication/GridIoMessageFactory.java     |    4 +-
 .../portable/BinaryCachingMetadataHandler.java  |   70 -
 .../internal/portable/BinaryEnumCache.java      |   69 -
 .../internal/portable/BinaryEnumObjectImpl.java |  311 --
 .../internal/portable/BinaryFieldAccessor.java  |  856 ----
 .../internal/portable/BinaryFieldImpl.java      |  116 -
 .../portable/BinaryInternalIdMapper.java        |  161 -
 .../internal/portable/BinaryMarshaller.java     |  142 -
 .../internal/portable/BinaryMetadata.java       |  180 -
 .../portable/BinaryMetadataCollector.java       |  277 --
 .../portable/BinaryMetadataHandler.java         |   44 -
 .../portable/BinaryNoopMetadataHandler.java     |   53 -
 .../internal/portable/BinaryObjectEx.java       |   30 -
 .../internal/portable/BinaryObjectExImpl.java   |  251 --
 .../internal/portable/BinaryObjectImpl.java     |  584 ---
 .../portable/BinaryObjectOffheapImpl.java       |  429 --
 .../internal/portable/BinaryRawReaderEx.java    |   33 -
 .../internal/portable/BinaryRawWriterEx.java    |   60 -
 .../internal/portable/BinaryReaderExImpl.java   | 2028 ---------
 .../internal/portable/BinaryReaderHandles.java  |  108 -
 .../portable/BinaryReaderHandlesHolder.java     |   46 -
 .../portable/BinaryReaderHandlesHolderImpl.java |   44 -
 .../portable/BinaryThreadLocalContext.java      |   69 -
 .../internal/portable/BinaryTypeImpl.java       |   93 -
 .../internal/portable/BinaryWriteMode.java      |  178 -
 .../internal/portable/BinaryWriterExImpl.java   | 1807 --------
 .../internal/portable/BinaryWriterHandles.java  |  101 -
 .../portable/BinaryWriterSchemaHolder.java      |  148 -
 .../portable/GridPortableMarshaller.java        |  286 --
 .../portable/PortableClassDescriptor.java       |  809 ----
 .../internal/portable/PortableContext.java      | 1102 -----
 .../portable/PortablePositionReadable.java      |   47 -
 .../internal/portable/PortablePrimitives.java   |  382 --
 .../internal/portable/PortableSchema.java       |  466 --
 .../portable/PortableSchemaRegistry.java        |  172 -
 .../ignite/internal/portable/PortableUtils.java | 1907 --------
 .../builder/BinaryObjectBuilderImpl.java        |  580 ---
 .../builder/PortableAbstractLazyValue.java      |   57 -
 .../portable/builder/PortableBuilderEnum.java   |  116 -
 .../portable/builder/PortableBuilderReader.java |  847 ----
 .../PortableBuilderSerializationAware.java      |   31 -
 .../builder/PortableBuilderSerializer.java      |  217 -
 .../builder/PortableEnumArrayLazyValue.java     |  114 -
 .../portable/builder/PortableLazyArrayList.java |  166 -
 .../builder/PortableLazyLinkedList.java         |  217 -
 .../portable/builder/PortableLazyMap.java       |  220 -
 .../portable/builder/PortableLazySet.java       |   92 -
 .../portable/builder/PortableLazyValue.java     |   28 -
 .../builder/PortableModifiableLazyValue.java    |   52 -
 .../builder/PortableObjectArrayLazyValue.java   |   91 -
 .../builder/PortablePlainLazyValue.java         |   49 -
 .../builder/PortablePlainPortableObject.java    |   53 -
 .../portable/builder/PortableValueWithType.java |   76 -
 .../internal/portable/builder/package-info.java |   22 -
 .../ignite/internal/portable/package-info.java  |   22 -
 .../streams/PortableAbstractInputStream.java    |  379 --
 .../streams/PortableAbstractOutputStream.java   |  347 --
 .../streams/PortableAbstractStream.java         |   80 -
 .../streams/PortableHeapInputStream.java        |  166 -
 .../streams/PortableHeapOutputStream.java       |  176 -
 .../portable/streams/PortableInputStream.java   |  162 -
 .../streams/PortableMemoryAllocator.java        |   57 -
 .../streams/PortableMemoryAllocatorChunk.java   |  117 -
 .../streams/PortableOffheapInputStream.java     |  144 -
 .../streams/PortableOffheapOutputStream.java    |  222 -
 .../portable/streams/PortableOutputStream.java  |  259 --
 .../portable/streams/PortableStream.java        |   53 -
 .../internal/portable/streams/package-info.java |   22 -
 .../CacheDefaultBinaryAffinityKeyMapper.java    |    8 +-
 .../processors/cache/CacheInvokeEntry.java      |   10 +-
 .../processors/cache/CacheLazyEntry.java        |   28 +-
 .../processors/cache/CacheObjectContext.java    |   74 +-
 .../processors/cache/CacheOperationContext.java |   12 +-
 .../processors/cache/GridCacheAdapter.java      |  100 +-
 .../cache/GridCacheConcurrentMap.java           |    2 +-
 .../processors/cache/GridCacheContext.java      |   38 +-
 .../processors/cache/GridCacheEntryEx.java      |    8 +-
 .../processors/cache/GridCacheEventManager.java |   24 +-
 .../processors/cache/GridCacheIoManager.java    |    5 +-
 .../processors/cache/GridCacheMapEntry.java     |   54 +-
 .../cache/GridCacheOffheapSwapEntry.java        |    4 +-
 .../processors/cache/GridCacheProcessor.java    |   19 +-
 .../processors/cache/GridCacheProxyImpl.java    |    2 +-
 .../processors/cache/GridCacheReturn.java       |   10 +-
 .../processors/cache/IgniteCacheProxy.java      |   36 +-
 .../processors/cache/IgniteInternalCache.java   |   48 +-
 .../cache/binary/BinaryMetadataKey.java         |   82 +
 .../CacheDefaultBinaryAffinityKeyMapper.java    |   51 +
 .../cache/binary/CacheObjectBinaryContext.java  |   56 +
 .../binary/CacheObjectBinaryProcessor.java      |  106 +
 .../binary/CacheObjectBinaryProcessorImpl.java  |  903 ++++
 .../cache/binary/IgniteBinaryImpl.java          |  178 +
 .../processors/cache/binary/package-info.java   |   22 +
 .../CacheDataStructuresManager.java             |   11 +-
 .../distributed/GridDistributedLockRequest.java |    2 +-
 .../dht/CacheDistributedGetFutureAdapter.java   |   10 +-
 .../distributed/dht/GridDhtCacheAdapter.java    |    8 +-
 .../cache/distributed/dht/GridDhtGetFuture.java |    4 +-
 .../dht/GridPartitionedGetFuture.java           |   14 +-
 .../dht/GridPartitionedSingleGetFuture.java     |   12 +-
 .../dht/atomic/GridDhtAtomicCache.java          |   26 +-
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  |    4 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |    4 +-
 .../dht/atomic/GridNearAtomicUpdateRequest.java |    4 +-
 .../dht/colocated/GridDhtColocatedCache.java    |   36 +-
 .../GridDhtPartitionsExchangeFuture.java        |    4 +-
 .../preloader/GridDhtPartitionsFullMessage.java |    8 +-
 .../distributed/near/GridNearAtomicCache.java   |   10 +-
 .../distributed/near/GridNearCacheAdapter.java  |   10 +-
 .../distributed/near/GridNearCacheEntry.java    |    6 +
 .../distributed/near/GridNearGetFuture.java     |   22 +-
 .../near/GridNearTransactionalCache.java        |   12 +-
 .../cache/distributed/near/GridNearTxLocal.java |    6 +-
 .../local/atomic/GridLocalAtomicCache.java      |   74 +-
 .../CacheDefaultPortableAffinityKeyMapper.java  |   51 -
 .../portable/CacheObjectBinaryProcessor.java    |  106 -
 .../CacheObjectBinaryProcessorImpl.java         |  895 ----
 .../portable/CacheObjectPortableContext.java    |   56 -
 .../cache/portable/IgniteBinaryImpl.java        |  178 -
 .../cache/portable/PortableMetadataKey.java     |   82 -
 .../processors/cache/portable/package-info.java |   22 -
 .../query/GridCacheDistributedQueryManager.java |    8 +-
 .../cache/query/GridCacheQueryAdapter.java      |   32 +-
 .../query/GridCacheQueryFutureAdapter.java      |    4 +-
 .../cache/query/GridCacheQueryManager.java      |   64 +-
 .../cache/query/GridCacheQueryRequest.java      |   22 +-
 .../continuous/CacheContinuousQueryEvent.java   |    8 +-
 .../cache/store/CacheOsStoreManager.java        |   12 +-
 .../cache/store/CacheStoreManager.java          |   10 +-
 .../store/GridCacheStoreManagerAdapter.java     |   18 +-
 .../transactions/IgniteTxLocalAdapter.java      |   44 +-
 .../cache/transactions/IgniteTxLocalEx.java     |    6 +-
 .../cacheobject/IgniteCacheObjectProcessor.java |   16 +-
 .../IgniteCacheObjectProcessorImpl.java         |    6 +-
 .../processors/cacheobject/NoOpBinary.java      |    2 +-
 .../datastreamer/DataStreamerEntry.java         |    6 +-
 .../datastructures/DataStructuresProcessor.java |  161 +-
 .../jobmetrics/GridJobMetricsProcessor.java     |    8 +-
 .../platform/PlatformAbstractPredicate.java     |    6 +-
 .../platform/PlatformAbstractTarget.java        |   20 +-
 .../processors/platform/PlatformContext.java    |   10 +-
 .../platform/PlatformContextImpl.java           |   27 +-
 .../platform/PlatformExtendedException.java     |    4 +-
 .../platform/PlatformNoopProcessor.java         |    4 +-
 .../processors/platform/PlatformProcessor.java  |    8 +-
 .../platform/PlatformProcessorImpl.java         |   38 +-
 .../platform/cache/PlatformCache.java           |   34 +-
 .../cache/PlatformCacheEntryFilterImpl.java     |    6 +-
 .../cache/PlatformCacheEntryProcessorImpl.java  |   16 +-
 .../platform/cache/PlatformCacheIterator.java   |    4 +-
 .../PlatformCachePartialUpdateException.java    |   16 +-
 .../cache/affinity/PlatformAffinity.java        |    6 +-
 .../query/PlatformAbstractQueryCursor.java      |    4 +-
 .../PlatformContinuousQueryRemoteFilter.java    |    4 +-
 .../cache/query/PlatformFieldsQueryCursor.java  |    4 +-
 .../cache/query/PlatformQueryCursor.java        |    4 +-
 .../cache/store/PlatformCacheStoreCallback.java |    4 +-
 .../callback/PlatformCallbackGateway.java       |    8 +-
 .../callback/PlatformCallbackUtils.java         |    6 +-
 .../platform/cluster/PlatformClusterGroup.java  |    6 +-
 .../cluster/PlatformClusterNodeFilterImpl.java  |    6 +-
 .../platform/compute/PlatformAbstractJob.java   |    4 +-
 .../platform/compute/PlatformAbstractTask.java  |    4 +-
 .../platform/compute/PlatformClosureJob.java    |    4 +-
 .../platform/compute/PlatformCompute.java       |   20 +-
 .../platform/compute/PlatformFullJob.java       |    4 +-
 .../platform/compute/PlatformFullTask.java      |    6 +-
 .../cpp/PlatformCppConfigurationClosure.java    |    4 +-
 .../datastreamer/PlatformDataStreamer.java      |   15 +-
 .../PlatformStreamReceiverImpl.java             |   20 +-
 .../dotnet/PlatformDotNetCacheStore.java        |   18 +-
 .../PlatformDotNetConfigurationClosure.java     |   20 +-
 .../dotnet/PlatformDotNetServiceImpl.java       |    8 +-
 .../events/PlatformEventFilterListenerImpl.java |    6 +-
 .../platform/events/PlatformEvents.java         |    4 +-
 .../platform/memory/PlatformInputStream.java    |    6 +-
 .../platform/memory/PlatformOutputStream.java   |    6 +-
 .../messaging/PlatformMessageFilterImpl.java    |    6 +-
 .../messaging/PlatformMessageLocalFilter.java   |    2 +-
 .../platform/messaging/PlatformMessaging.java   |    6 +-
 .../services/PlatformAbstractService.java       |   32 +-
 .../platform/services/PlatformService.java      |    6 +-
 .../platform/services/PlatformServices.java     |   32 +-
 .../transactions/PlatformTransactions.java      |    4 +-
 .../platform/utils/PlatformFutureUtils.java     |    4 +-
 .../platform/utils/PlatformReaderBiClosure.java |    4 +-
 .../platform/utils/PlatformReaderClosure.java   |    4 +-
 .../platform/utils/PlatformUtils.java           |    6 +-
 .../platform/utils/PlatformWriterBiClosure.java |    4 +-
 .../platform/utils/PlatformWriterClosure.java   |    4 +-
 .../query/GridQueryCacheObjectsIterator.java    |   14 +-
 .../processors/query/GridQueryProcessor.java    |   93 +-
 .../message/GridClientBinaryMetaData.java       |   71 +
 .../message/GridClientPortableMetaData.java     |   71 -
 .../client/message/GridClientTaskRequest.java   |   14 +-
 .../ignite/internal/util/nio/GridNioServer.java |   11 +-
 .../internal/visor/util/VisorMimeTypes.java     |   10 +-
 .../marshaller/optimized/package-info.java      |    2 +-
 .../marshaller/portable/package-info.java       |   22 -
 .../PlatformDotNetBinaryConfiguration.java      |    6 +-
 .../dotnet/PlatformDotNetConfiguration.java     |    8 +-
 .../sharedfs/SharedFsCheckpointSpi.java         |    4 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java    |    6 +-
 .../TcpDiscoveryMulticastIpFinder.java          |  106 +-
 .../java/org/jsr166/ConcurrentHashMap8.java     |    2 +-
 .../resources/META-INF/classnames.properties    |   68 +-
 .../ignite/binary/test1/1.1/test1-1.1.jar       |  Bin 0 -> 2548 bytes
 .../ignite/binary/test1/1.1/test1-1.1.pom       |    9 +
 .../binary/test1/maven-metadata-local.xml       |   12 +
 .../ignite/binary/test2/1.1/test2-1.1.jar       |  Bin 0 -> 1361 bytes
 .../ignite/binary/test2/1.1/test2-1.1.pom       |    9 +
 .../binary/test2/maven-metadata-local.xml       |   12 +
 ...heJdbcPojoStoreBinaryMarshallerSelfTest.java |    2 +-
 ...eJdbcStoreAbstractMultithreadedSelfTest.java |    5 +-
 ...CacheJdbcBlobStoreMultithreadedSelfTest.java |    2 +-
 .../GridEventStorageCheckAllEventsSelfTest.java |   22 +-
 .../internal/binary/BinaryEnumsSelfTest.java    |  446 ++
 .../binary/BinaryFieldsAbstractSelfTest.java    |  718 +++
 .../binary/BinaryFieldsHeapSelfTest.java        |   30 +
 .../binary/BinaryFieldsOffheapSelfTest.java     |   60 +
 .../BinaryFooterOffsetsAbstractSelfTest.java    |  205 +
 .../binary/BinaryFooterOffsetsHeapSelfTest.java |   30 +
 .../BinaryFooterOffsetsOffheapSelfTest.java     |   60 +
 .../binary/BinaryMarshallerSelfTest.java        | 4167 ++++++++++++++++++
 .../BinaryObjectBuilderAdditionalSelfTest.java  | 1264 ++++++
 .../binary/BinaryObjectBuilderSelfTest.java     | 1108 +++++
 .../binary/GridBinaryAffinityKeySelfTest.java   |  234 +
 ...GridBinaryMarshallerCtxDisabledSelfTest.java |  247 ++
 .../binary/GridBinaryMetaDataSelfTest.java      |  371 ++
 .../binary/GridBinaryWildcardsSelfTest.java     |  464 ++
 .../binary/TestCachingMetadataHandler.java      |   45 +
 .../GridBinaryMarshalerAwareTestClass.java      |   67 +
 .../mutabletest/GridBinaryTestClasses.java      |  484 ++
 .../binary/mutabletest/package-info.java        |   22 +
 .../BinaryFieldsHeapNonCompactSelfTest.java     |   30 +
 .../BinaryFieldsOffheapNonCompactSelfTest.java  |   30 +
 ...naryFooterOffsetsHeapNonCompactSelfTest.java |   30 +
 ...yFooterOffsetsOffheapNonCompactSelfTest.java |   30 +
 .../BinaryMarshallerNonCompactSelfTest.java     |   30 +
 ...jectBuilderAdditionalNonCompactSelfTest.java |   30 +
 .../BinaryObjectBuilderNonCompactSelfTest.java  |   30 +
 .../ignite/internal/binary/package-info.java    |   22 +
 .../binary/test/GridBinaryTestClass1.java       |   28 +
 .../binary/test/GridBinaryTestClass2.java       |   24 +
 .../internal/binary/test/package-info.java      |   22 +
 .../test/subpackage/GridBinaryTestClass3.java   |   24 +
 .../binary/test/subpackage/package-info.java    |   22 +
 .../internal/portable/BinaryEnumsSelfTest.java  |  446 --
 .../portable/BinaryFieldsAbstractSelfTest.java  |  718 ---
 .../portable/BinaryFieldsHeapSelfTest.java      |   30 -
 .../portable/BinaryFieldsOffheapSelfTest.java   |   60 -
 .../BinaryFooterOffsetsAbstractSelfTest.java    |  205 -
 .../BinaryFooterOffsetsHeapSelfTest.java        |   30 -
 .../BinaryFooterOffsetsOffheapSelfTest.java     |   60 -
 .../portable/BinaryMarshallerSelfTest.java      | 4012 -----------------
 .../BinaryObjectBuilderAdditionalSelfTest.java  | 1272 ------
 .../portable/BinaryObjectBuilderSelfTest.java   | 1103 -----
 .../GridPortableAffinityKeySelfTest.java        |  234 -
 ...idPortableMarshallerCtxDisabledSelfTest.java |  247 --
 .../portable/GridPortableMetaDataSelfTest.java  |  371 --
 .../portable/GridPortableWildcardsSelfTest.java |  464 --
 .../portable/TestCachingMetadataHandler.java    |   45 -
 .../GridBinaryMarshalerAwareTestClass.java      |   67 -
 .../mutabletest/GridPortableTestClasses.java    |  484 --
 .../portable/mutabletest/package-info.java      |   22 -
 .../BinaryFieldsHeapNonCompactSelfTest.java     |   30 -
 .../BinaryFieldsOffheapNonCompactSelfTest.java  |   30 -
 ...naryFooterOffsetsHeapNonCompactSelfTest.java |   30 -
 ...yFooterOffsetsOffheapNonCompactSelfTest.java |   30 -
 .../BinaryMarshallerNonCompactSelfTest.java     |   30 -
 ...jectBuilderAdditionalNonCompactSelfTest.java |   30 -
 .../BinaryObjectBuilderNonCompactSelfTest.java  |   30 -
 .../ignite/internal/portable/package-info.java  |   22 -
 .../portable/test/GridPortableTestClass1.java   |   28 -
 .../portable/test/GridPortableTestClass2.java   |   24 -
 .../internal/portable/test/package-info.java    |   22 -
 .../test/subpackage/GridPortableTestClass3.java |   24 -
 .../portable/test/subpackage/package-info.java  |   22 -
 .../cache/GridCacheAbstractFullApiSelfTest.java |   25 +-
 .../GridCacheConditionalDeploymentSelfTest.java |    2 +-
 .../cache/GridCacheDeploymentSelfTest.java      |   21 +-
 .../GridCacheOffHeapTieredAbstractSelfTest.java |    8 +-
 .../GridCacheOnCopyFlagAbstractSelfTest.java    |    6 +-
 .../processors/cache/GridCacheTestEntryEx.java  |    8 +-
 .../IgniteCacheStoreValueAbstractTest.java      |    6 +-
 .../GridBinaryCacheEntryMemorySizeSelfTest.java |   48 +
 ...ryDuplicateIndexObjectsAbstractSelfTest.java |  161 +
 ...yAtomicEntryProcessorDeploymentSelfTest.java |  129 +
 ...naryObjectsAbstractDataStreamerSelfTest.java |  192 +
 ...aryObjectsAbstractMultiThreadedSelfTest.java |  241 +
 .../GridCacheBinaryObjectsAbstractSelfTest.java |  981 +++++
 .../GridCacheBinaryStoreAbstractSelfTest.java   |  300 ++
 .../GridCacheBinaryStoreBinariesSelfTest.java   |   66 +
 .../GridCacheBinaryStoreObjectsSelfTest.java    |   55 +
 ...ctionalEntryProcessorDeploymentSelfTest.java |   31 +
 ...ntNodeBinaryObjectMetadataMultinodeTest.java |  295 ++
 ...CacheClientNodeBinaryObjectMetadataTest.java |  221 +
 .../DataStreamProcessorBinarySelfTest.java      |   71 +
 .../GridDataStreamerImplSelfTest.java           |  345 ++
 .../GridCacheAffinityRoutingBinarySelfTest.java |   54 +
 ...OnlyBinaryDataStreamerMultiNodeSelfTest.java |   29 +
 ...BinaryDataStreamerMultithreadedSelfTest.java |   47 +
 ...cPartitionedOnlyBinaryMultiNodeSelfTest.java |   28 +
 ...titionedOnlyBinaryMultithreadedSelfTest.java |   47 +
 ...sNearPartitionedByteArrayValuesSelfTest.java |   41 +
 ...sPartitionedOnlyByteArrayValuesSelfTest.java |   42 +
 ...ateIndexObjectPartitionedAtomicSelfTest.java |   38 +
 ...xObjectPartitionedTransactionalSelfTest.java |   41 +
 ...AtomicNearDisabledOffheapTieredSelfTest.java |   29 +
 ...BinaryObjectsAtomicNearDisabledSelfTest.java |   51 +
 ...inaryObjectsAtomicOffheapTieredSelfTest.java |   29 +
 .../GridCacheBinaryObjectsAtomicSelfTest.java   |   51 +
 ...tionedNearDisabledOffheapTieredSelfTest.java |   30 +
 ...yObjectsPartitionedNearDisabledSelfTest.java |   51 +
 ...ObjectsPartitionedOffheapTieredSelfTest.java |   30 +
 ...idCacheBinaryObjectsPartitionedSelfTest.java |   51 +
 .../dht/GridCacheMemoryModeBinarySelfTest.java  |   36 +
 ...dCacheOffHeapTieredAtomicBinarySelfTest.java |   48 +
 .../GridCacheOffHeapTieredBinarySelfTest.java   |   48 +
 ...fHeapTieredEvictionAtomicBinarySelfTest.java |   96 +
 ...acheOffHeapTieredEvictionBinarySelfTest.java |   96 +
 ...ridCacheBinaryObjectsReplicatedSelfTest.java |   51 +
 ...idCacheBinaryObjectsAtomicLocalSelfTest.java |   32 +
 ...BinaryObjectsLocalOffheapTieredSelfTest.java |   29 +
 .../GridCacheBinaryObjectsLocalSelfTest.java    |   51 +
 ...IgniteCacheAbstractExecutionContextTest.java |    7 +-
 .../near/NearCachePutAllMultinodeTest.java      |  167 +
 ...eRebalancingUnmarshallingFailedSelfTest.java |    2 +-
 ...idCacheReplicatedUnswapAdvancedSelfTest.java |   44 +-
 .../GridCacheReplicatedPreloadSelfTest.java     |   44 +-
 ...yAtomicEntryProcessorDeploymentSelfTest.java |  129 -
 ...naryObjectsAbstractDataStreamerSelfTest.java |  192 -
 ...aryObjectsAbstractMultiThreadedSelfTest.java |  241 -
 .../GridCacheBinaryObjectsAbstractSelfTest.java |  981 -----
 ...ctionalEntryProcessorDeploymentSelfTest.java |   31 -
 ...ntNodeBinaryObjectMetadataMultinodeTest.java |  295 --
 ...CacheClientNodeBinaryObjectMetadataTest.java |  221 -
 .../GridCachePortableStoreAbstractSelfTest.java |  300 --
 .../GridCachePortableStoreObjectsSelfTest.java  |   55 -
 ...GridCachePortableStorePortablesSelfTest.java |   66 -
 ...ridPortableCacheEntryMemorySizeSelfTest.java |   48 -
 ...leDuplicateIndexObjectsAbstractSelfTest.java |  161 -
 .../DataStreamProcessorPortableSelfTest.java    |   71 -
 .../GridDataStreamerImplSelfTest.java           |  345 --
 ...ridCacheAffinityRoutingPortableSelfTest.java |   54 -
 ...lyPortableDataStreamerMultiNodeSelfTest.java |   29 -
 ...rtableDataStreamerMultithreadedSelfTest.java |   47 -
 ...artitionedOnlyPortableMultiNodeSelfTest.java |   28 -
 ...tionedOnlyPortableMultithreadedSelfTest.java |   47 -
 ...AtomicNearDisabledOffheapTieredSelfTest.java |   29 -
 ...BinaryObjectsAtomicNearDisabledSelfTest.java |   51 -
 ...inaryObjectsAtomicOffheapTieredSelfTest.java |   29 -
 .../GridCacheBinaryObjectsAtomicSelfTest.java   |   51 -
 ...tionedNearDisabledOffheapTieredSelfTest.java |   30 -
 ...yObjectsPartitionedNearDisabledSelfTest.java |   51 -
 ...ObjectsPartitionedOffheapTieredSelfTest.java |   30 -
 ...idCacheBinaryObjectsPartitionedSelfTest.java |   51 -
 .../GridCacheMemoryModePortableSelfTest.java    |   36 -
 ...acheOffHeapTieredAtomicPortableSelfTest.java |   48 -
 ...eapTieredEvictionAtomicPortableSelfTest.java |   96 -
 ...heOffHeapTieredEvictionPortableSelfTest.java |   96 -
 .../GridCacheOffHeapTieredPortableSelfTest.java |   48 -
 ...ateIndexObjectPartitionedAtomicSelfTest.java |   38 -
 ...xObjectPartitionedTransactionalSelfTest.java |   41 -
 ...sNearPartitionedByteArrayValuesSelfTest.java |   41 -
 ...sPartitionedOnlyByteArrayValuesSelfTest.java |   42 -
 ...ridCacheBinaryObjectsReplicatedSelfTest.java |   51 -
 ...idCacheBinaryObjectsAtomicLocalSelfTest.java |   32 -
 ...BinaryObjectsLocalOffheapTieredSelfTest.java |   29 -
 .../GridCacheBinaryObjectsLocalSelfTest.java    |   51 -
 ...ContinuousQueryFailoverAbstractSelfTest.java |  186 +-
 .../PlatformComputeBinarizableArgTask.java      |    4 +-
 .../platform/PlatformComputeEchoTask.java       |   20 +-
 .../platform/PlatformEventsWriteEventTask.java  |    4 +-
 .../session/GridSessionCheckpointSelfTest.java  |   12 +-
 .../tcp/TcpClientDiscoverySpiMulticastTest.java |   97 +-
 .../spi/discovery/tcp/TcpDiscoverySelfTest.java |   67 +
 .../TcpDiscoveryIpFinderAbstractSelfTest.java   |    2 +-
 .../TcpDiscoveryMulticastIpFinderSelfTest.java  |   16 +-
 .../testframework/junits/GridAbstractTest.java  |    4 +-
 .../ignite/testframework/junits/IgniteMock.java |   10 +-
 .../junits/IgniteTestResources.java             |   12 +-
 .../IgniteBinaryCacheFullApiTestSuite.java      |   37 +
 .../testsuites/IgniteBinaryCacheTestSuite.java  |  101 +
 ...ObjectsCacheDataStructuresSelfTestSuite.java |    2 +-
 ...BinaryObjectsCacheExpiryPolicyTestSuite.java |    2 +-
 ...gniteBinaryObjectsCacheRestartTestSuite.java |    2 +-
 .../IgniteBinaryObjectsCacheTestSuite2.java     |    2 +-
 .../IgniteBinaryObjectsCacheTestSuite3.java     |    8 +-
 .../IgniteBinaryObjectsCacheTestSuite4.java     |    2 +-
 ...IgniteBinaryObjectsComputeGridTestSuite.java |    2 +-
 .../IgniteBinaryObjectsTestSuite.java           |  114 +
 .../IgnitePortableCacheFullApiTestSuite.java    |   37 -
 .../IgnitePortableCacheTestSuite.java           |  101 -
 .../IgnitePortableObjectsTestSuite.java         |  114 -
 .../ignite/util/GridMessageCollectionTest.java  |   34 +-
 .../ignite/portable/test1/1.1/test1-1.1.jar     |  Bin 2548 -> 0 bytes
 .../ignite/portable/test1/1.1/test1-1.1.pom     |    9 -
 .../portable/test1/maven-metadata-local.xml     |   12 -
 .../ignite/portable/test2/1.1/test2-1.1.jar     |  Bin 1361 -> 0 bytes
 .../ignite/portable/test2/1.1/test2-1.1.pom     |    9 -
 .../portable/test2/maven-metadata-local.xml     |   12 -
 modules/docker/1.0.0/Dockerfile                 |   40 +
 modules/docker/1.0.0/run.sh                     |   50 +
 modules/docker/1.1.0/Dockerfile                 |   40 +
 modules/docker/1.1.0/run.sh                     |   50 +
 modules/docker/1.2.0/Dockerfile                 |   40 +
 modules/docker/1.2.0/run.sh                     |   50 +
 modules/docker/1.3.0/Dockerfile                 |   40 +
 modules/docker/1.3.0/run.sh                     |   50 +
 modules/docker/1.4.0/Dockerfile                 |   40 +
 modules/docker/1.4.0/run.sh                     |   50 +
 modules/docker/Dockerfile                       |   41 +-
 modules/docker/build_users_libs.sh              |   39 -
 modules/docker/download_ignite.sh               |   49 -
 modules/docker/execute.sh                       |   62 -
 modules/docker/run.sh                           |   36 +-
 .../CacheDeploymentBinaryEntryProcessor.java    |   35 +
 .../CacheDeploymentPortableEntryProcessor.java  |   35 -
 .../tests/p2p/CacheDeploymentTestValue3.java    |   41 +
 .../apache/ignite/tests/p2p/cache/Person.java   |   77 +
 .../ignite/tests/p2p/cache/PersonKey.java       |   74 +
 .../processors/query/h2/IgniteH2Indexing.java   |   10 +-
 .../h2/twostep/GridReduceQueryExecutor.java     |    8 +-
 .../IgniteBinaryObjectFieldsQuerySelfTest.java  |  246 ++
 ...niteCacheP2pUnmarshallingQueryErrorTest.java |   14 +-
 .../query/IgniteSqlSplitterSelfTest.java        |    4 +-
 .../IgniteBinaryCacheQueryTestSuite.java        |  119 +
 .../IgnitePortableCacheQueryTestSuite.java      |  117 -
 .../osgi-karaf/src/main/resources/features.xml  |   11 +-
 .../ignite/osgi/classloaders/package-info.java  |   21 +
 .../org/apache/ignite/osgi/package-info.java    |   21 +
 .../IgniteKarafFeaturesInstallationTest.java    |    2 +-
 .../cpp/core/include/ignite/ignition.h          |   41 +-
 modules/platforms/cpp/cpp.dxg                   | 1722 ++++++++
 .../Config/marshaller-explicit.xml              |    2 +-
 .../dotnet/Apache.Ignite.Core/Impl/Ignite.cs    |    8 +
 .../ignite/internal/GridFactorySelfTest.java    |   16 +
 .../ignite-int-max-values-offheap-config.xml    |    2 +-
 .../ignite-int-max-values-onheap-config.xml     |    2 +-
 .../ignite-int-max-values-swap-config.xml       |    2 +-
 parent/pom.xml                                  |   12 +-
 554 files changed, 40090 insertions(+), 36970 deletions(-)
----------------------------------------------------------------------



[34/50] [abbrv] ignite git commit: Merge remote-tracking branch 'origin/ignite-1.5' into ignite-1.5

Posted by vo...@apache.org.
Merge remote-tracking branch 'origin/ignite-1.5' into ignite-1.5


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

Branch: refs/heads/ignite-2100
Commit: ed27fbdab9d8307b4db427866ed1094526c117c8
Parents: 4ae6292 717dab2
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Dec 14 10:08:47 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Dec 14 10:08:47 2015 +0300

----------------------------------------------------------------------
 .../TcpDiscoveryMulticastIpFinder.java          | 106 +++++++++++++------
 .../tcp/TcpClientDiscoverySpiMulticastTest.java |  91 +++++++++++++++-
 .../TcpDiscoveryIpFinderAbstractSelfTest.java   |   2 +-
 .../TcpDiscoveryMulticastIpFinderSelfTest.java  |  16 ++-
 4 files changed, 174 insertions(+), 41 deletions(-)
----------------------------------------------------------------------



[42/50] [abbrv] ignite git commit: ignite-1.5 Increased test timeouts.

Posted by vo...@apache.org.
ignite-1.5 Increased test timeouts.


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

Branch: refs/heads/ignite-2100
Commit: beb64c34c271b7eac1388179b11f042b34fa0d60
Parents: 4d08673
Author: sboikov <sb...@gridgain.com>
Authored: Mon Dec 14 11:34:07 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Dec 14 11:34:07 2015 +0300

----------------------------------------------------------------------
 .../discovery/tcp/TcpClientDiscoverySpiMulticastTest.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/beb64c34/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMulticastTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMulticastTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMulticastTest.java
index 6611e00..27ce883 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMulticastTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMulticastTest.java
@@ -56,7 +56,11 @@ public class TcpClientDiscoverySpiMulticastTest extends GridCommonAbstractTest {
 
         TcpDiscoverySpi spi = new TcpDiscoverySpi();
 
-        spi.setIpFinder(new TcpDiscoveryMulticastIpFinder());
+        TcpDiscoveryMulticastIpFinder ipFinder = new TcpDiscoveryMulticastIpFinder();
+
+        ipFinder.setAddressRequestAttempts(10);
+
+        spi.setIpFinder(ipFinder);
 
         Boolean clientFlag = client.get();
 
@@ -133,13 +137,13 @@ public class TcpClientDiscoverySpiMulticastTest extends GridCommonAbstractTest {
 
         srv.close();
 
-        assertTrue(disconnectLatch.await(10, SECONDS));
+        assertTrue(disconnectLatch.await(30, SECONDS));
 
         discoPort.set(TcpDiscoverySpi.DFLT_PORT + 100);
 
         startGrid(1);
 
-        assertTrue(reconnectLatch.await(10, SECONDS));
+        assertTrue(reconnectLatch.await(30, SECONDS));
     }
 
     /**


[28/50] [abbrv] ignite git commit: ignite-2065: portable -> binary renaming (methods, javadoc and etc.)

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
index f073dd0..6e05b40 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
@@ -41,7 +41,7 @@ import java.util.UUID;
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 /**
- * Portable writer implementation.
+ * Binary writer implementation.
  */
 public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, ObjectOutput {
     /** Length: integer. */
@@ -145,7 +145,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
         BinaryClassDescriptor desc = ctx.descriptorForClass(cls, false);
 
         if (desc == null)
-            throw new BinaryObjectException("Object is not portable: [class=" + cls + ']');
+            throw new BinaryObjectException("Object is not binary: [class=" + cls + ']');
 
         if (desc.excluded()) {
             out.writeByte(GridBinaryMarshaller.NULL);
@@ -748,7 +748,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     /**
      * @param val Value.
      */
-    void doWritePortableEnum(BinaryEnumObjectImpl val) {
+    void doWriteBinaryEnum(BinaryEnumObjectImpl val) {
         assert val != null;
 
         int typeId = val.typeId();
@@ -819,9 +819,9 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     }
 
     /**
-     * @param po Portable object.
+     * @param po Binary object.
      */
-    public void doWritePortableObject(@Nullable BinaryObjectImpl po) {
+    public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) {
         if (po == null)
             out.writeByte(GridBinaryMarshaller.NULL);
         else {
@@ -829,7 +829,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
 
             out.unsafeEnsure(1 + 4 + poArr.length + 4);
 
-            out.unsafeWriteByte(GridBinaryMarshaller.PORTABLE_OBJ);
+            out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ);
             out.unsafeWriteInt(poArr.length);
             out.writeByteArray(poArr);
             out.unsafeWriteInt(po.start());
@@ -1176,11 +1176,11 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     }
 
     /**
-     * @param po Portable object.
+     * @param po Binary object.
      * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
      */
-    void writePortableObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException {
-        doWritePortableObject(po);
+    void writeBinaryObjectField(@Nullable BinaryObjectImpl po) throws BinaryObjectException {
+        doWriteBinaryObject(po);
     }
 
     /** {@inheritDoc} */
@@ -1760,7 +1760,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     }
 
     /**
-     * @return Portable context.
+     * @return Binary context.
      */
     public BinaryContext context() {
         return ctx;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java
index 277abd0..b21c679 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java
@@ -24,11 +24,11 @@ import org.apache.ignite.binary.BinaryObjectException;
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Portable objects marshaller.
+ * Binary objects marshaller.
  */
 public class GridBinaryMarshaller {
     /** */
-    public static final ThreadLocal<Boolean> KEEP_PORTABLES = new ThreadLocal<Boolean>() {
+    public static final ThreadLocal<Boolean> KEEP_BINARIES = new ThreadLocal<Boolean>() {
         @Override protected Boolean initialValue() {
             return true;
         }
@@ -119,7 +119,7 @@ public class GridBinaryMarshaller {
     public static final byte MAP = 25;
 
     /** */
-    public static final byte PORTABLE_OBJ = 27;
+    public static final byte BINARY_OBJ = 27;
 
     /** */
     public static final byte ENUM = 28;
@@ -230,7 +230,7 @@ public class GridBinaryMarshaller {
 
     /**
      * @param bytes Bytes array.
-     * @return Portable object.
+     * @return Binary object.
      * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
      */
     @SuppressWarnings("unchecked")
@@ -242,7 +242,7 @@ public class GridBinaryMarshaller {
 
     /**
      * @param in Input stream.
-     * @return Portable object.
+     * @return Binary object.
      * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
      */
     @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java
index d8dd00b..bc5eb9e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java
@@ -46,7 +46,7 @@ public class BinaryBuilderEnum implements BinaryBuilderSerializationAware {
     }
 
     /**
-     * @param reader PortableBuilderReader.
+     * @param reader BinaryBuilderReader.
      */
     public BinaryBuilderEnum(BinaryBuilderReader reader) {
         int typeId = reader.readInt();
@@ -57,13 +57,13 @@ public class BinaryBuilderEnum implements BinaryBuilderSerializationAware {
             Class cls;
 
             try {
-                cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader());
+                cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader());
             }
             catch (ClassNotFoundException e) {
                 throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e);
             }
 
-            this.typeId = reader.portableContext().descriptorForClass(cls, false).typeId();
+            this.typeId = reader.binaryContext().descriptorForClass(cls, false).typeId();
         }
         else {
             this.typeId = typeId;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java
index 9b9e8b8..662ad1d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java
@@ -58,7 +58,7 @@ public class BinaryBuilderReader implements BinaryPositionReadable {
     /*
      * Constructor.
      *
-     * @param objImpl Portable object
+     * @param objImpl Binary object
      */
     BinaryBuilderReader(BinaryObjectImpl objImpl) {
         ctx = objImpl.context();
@@ -89,14 +89,14 @@ public class BinaryBuilderReader implements BinaryPositionReadable {
     }
 
     /**
-     * @return Portable context.
+     * @return Binary context.
      */
-    public BinaryContext portableContext() {
+    public BinaryContext binaryContext() {
         return ctx;
     }
 
     /**
-     * @param obj Mutable portable object.
+     * @param obj Mutable binary object.
      */
     public void registerObject(BinaryObjectBuilderImpl obj) {
         objMap.put(obj.start(), obj);
@@ -343,7 +343,7 @@ public class BinaryBuilderReader implements BinaryPositionReadable {
                 return;
             }
 
-            case GridBinaryMarshaller.PORTABLE_OBJ:
+            case GridBinaryMarshaller.BINARY_OBJ:
                 len = readInt() + 4;
 
                 break;
@@ -460,14 +460,14 @@ public class BinaryBuilderReader implements BinaryPositionReadable {
                 return builderEnum;
             }
 
-            case GridBinaryMarshaller.PORTABLE_OBJ: {
+            case GridBinaryMarshaller.BINARY_OBJ: {
                 int size = readIntPositioned(pos + 1);
 
                 int start = readIntPositioned(pos + 4 + size);
 
-                BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start);
+                BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start);
 
-                return new BinaryPlainBinaryObject(portableObj);
+                return new BinaryPlainBinaryObject(binaryObj);
             }
 
             default:
@@ -739,17 +739,17 @@ public class BinaryBuilderReader implements BinaryPositionReadable {
             case GridBinaryMarshaller.ENUM_ARR:
                 return new BinaryEnumArrayLazyValue(this);
 
-            case GridBinaryMarshaller.PORTABLE_OBJ: {
+            case GridBinaryMarshaller.BINARY_OBJ: {
                 int size = readInt();
 
                 pos += size;
 
                 int start = readInt();
 
-                BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr,
+                BinaryObjectImpl binaryObj = new BinaryObjectImpl(ctx, arr,
                     pos - 4 - size + start);
 
-                return new BinaryPlainBinaryObject(portableObj);
+                return new BinaryPlainBinaryObject(binaryObj);
             }
 
             default:

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java
index 458602d..a095242 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java
@@ -37,7 +37,7 @@ class BinaryBuilderSerializer {
     private final Map<BinaryObjectBuilderImpl, Integer> objToPos = new IdentityHashMap<>();
 
     /** */
-    private Map<BinaryObject, BinaryObjectBuilderImpl> portableObjToWrapper;
+    private Map<BinaryObject, BinaryObjectBuilderImpl> binaryObjToWrapper;
 
     /**
      * @param obj Mutable object.
@@ -65,15 +65,15 @@ class BinaryBuilderSerializer {
         }
 
         if (val instanceof BinaryObjectExImpl) {
-            if (portableObjToWrapper == null)
-                portableObjToWrapper = new IdentityHashMap<>();
+            if (binaryObjToWrapper == null)
+                binaryObjToWrapper = new IdentityHashMap<>();
 
-            BinaryObjectBuilderImpl wrapper = portableObjToWrapper.get(val);
+            BinaryObjectBuilderImpl wrapper = binaryObjToWrapper.get(val);
 
             if (wrapper == null) {
                 wrapper = BinaryObjectBuilderImpl.wrap((BinaryObject)val);
 
-                portableObjToWrapper.put((BinaryObject)val, wrapper);
+                binaryObjToWrapper.put((BinaryObject)val, wrapper);
             }
 
             val = wrapper;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java
index db55050..787ff63 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java
@@ -50,13 +50,13 @@ class BinaryEnumArrayLazyValue extends BinaryAbstractLazyValue {
             Class cls;
 
             try {
-                cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader());
+                cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader());
             }
             catch (ClassNotFoundException e) {
                 throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e);
             }
 
-            compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId();
+            compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId();
         }
         else {
             compTypeId = typeId;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java
index 3627b1d..21d7dcb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java
@@ -160,7 +160,7 @@ class BinaryLazyArrayList extends AbstractList<Object> implements BinaryBuilderS
             for (Object o : delegate)
                 ctx.writeValue(writer, o);
 
-            // PortableBuilderImpl might have been written. It could override reader's position.
+            // BinaryBuilderImpl might have been written. It could override reader's position.
             reader.position(oldPos);
         }
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java
index c82ff7d..6afe798 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java
@@ -52,7 +52,7 @@ class BinaryLazyMap extends AbstractMap<Object, Object> implements BinaryBuilder
 
     /**
      * @param reader Reader.
-     * @return PortableLazyMap.
+     * @return BinaryLazyMap.
      */
     @Nullable public static BinaryLazyMap parseMap(BinaryBuilderReader reader) {
         int off = reader.position() - 1;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java
index 05713b4..8962107 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java
@@ -49,13 +49,13 @@ class BinaryObjectArrayLazyValue extends BinaryAbstractLazyValue {
             Class cls;
 
             try {
-                cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader());
+                cls = U.forName(reader.readString(), reader.binaryContext().configuration().getClassLoader());
             }
             catch (ClassNotFoundException e) {
                 throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e);
             }
 
-            compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId();
+            compTypeId = reader.binaryContext().descriptorForClass(cls, true).typeId();
         }
         else {
             compTypeId = typeId;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
index 5e60a20..8353cdb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
@@ -70,7 +70,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
     /** */
     private Map<Integer, Object> readCache;
 
-    /** Position of object in source array, or -1 if object is not created from PortableObject. */
+    /** Position of object in source array, or -1 if object is not created from BinaryObject. */
     private final int start;
 
     /** Flags. */
@@ -79,7 +79,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
     /** Total header length */
     private final int hdrLen;
 
-    /** Context of PortableObject reading process. Or {@code null} if object is not created from PortableObject. */
+    /** Context of BinaryObject reading process. Or {@code null} if object is not created from BinaryObject. */
     private final BinaryBuilderReader reader;
 
     /** */
@@ -87,7 +87,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
 
     /**
      * @param clsName Class name.
-     * @param ctx Portable context.
+     * @param ctx Binary context.
      */
     public BinaryObjectBuilderImpl(BinaryContext ctx, String clsName) {
         this(ctx, ctx.typeId(clsName), BinaryContext.typeName(clsName));
@@ -134,7 +134,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
         BinaryUtils.checkProtocolVersion(ver);
 
         int typeId = reader.readIntPositioned(start + GridBinaryMarshaller.TYPE_ID_POS);
-        ctx = reader.portableContext();
+        ctx = reader.binaryContext();
         hashCode = reader.readIntPositioned(start + GridBinaryMarshaller.HASH_CODE_POS);
 
         if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) {
@@ -525,7 +525,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
     }
 
     /**
-     * Removes field from portable object.
+     * Removes field from binary object.
      *
      * @param name Field name.
      * @return {@code this} instance for chaining.
@@ -540,9 +540,9 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
     }
 
     /**
-     * Creates builder initialized by specified portable object.
+     * Creates builder initialized by specified binary object.
      *
-     * @param obj Portable object to initialize builder.
+     * @param obj Binary object to initialize builder.
      * @return New builder.
      */
     public static BinaryObjectBuilderImpl wrap(BinaryObject obj) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java
index 5ac4e97..f6432c3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java
@@ -27,27 +27,27 @@ import org.apache.ignite.binary.BinaryObject;
  */
 public class BinaryPlainBinaryObject implements BinaryLazyValue {
     /** */
-    private final BinaryObject portableObj;
+    private final BinaryObject binaryObj;
 
     /**
-     * @param portableObj Portable object.
+     * @param binaryObj Binary object.
      */
-    public BinaryPlainBinaryObject(BinaryObject portableObj) {
-        this.portableObj = portableObj;
+    public BinaryPlainBinaryObject(BinaryObject binaryObj) {
+        this.binaryObj = binaryObj;
     }
 
     /** {@inheritDoc} */
     @Override public Object value() {
-        return portableObj;
+        return binaryObj;
     }
 
     /** {@inheritDoc} */
     @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) {
-        BinaryObject val = portableObj;
+        BinaryObject val = binaryObj;
 
         if (val instanceof BinaryObjectOffheapImpl)
             val = ((BinaryObjectOffheapImpl)val).heapCopy();
 
-        writer.doWritePortableObject((BinaryObjectImpl)val);
+        writer.doWriteBinaryObject((BinaryObjectImpl)val);
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java
index f2c4b55..15aa947 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/package-info.java
@@ -17,6 +17,6 @@
 
 /**
  * <!-- Package description. -->
- * Contains classes specific to portable builder API.
+ * Contains classes specific to binary builder API.
  */
 package org.apache.ignite.internal.binary.builder;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java
index 4bb0fb1..849ef5f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/package-info.java
@@ -17,6 +17,6 @@
 
 /**
  * <!-- Package description. -->
- * Contains portable APIs internal implementation.
+ * Contains binary APIs internal implementation.
  */
 package org.apache.ignite.internal.binary;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java
index e3be794..334f455 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.binary.streams;
 import org.apache.ignite.binary.BinaryObjectException;
 
 /**
- * Portable abstract input stream.
+ * Binary abstract input stream.
  */
 public abstract class BinaryAbstractInputStream extends BinaryAbstractStream
     implements BinaryInputStream {

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java
index 199ee71..4221cbe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java
@@ -18,7 +18,7 @@
 package org.apache.ignite.internal.binary.streams;
 
 /**
- * Base portable output stream.
+ * Base binary output stream.
  */
 public abstract class BinaryAbstractOutputStream extends BinaryAbstractStream
     implements BinaryOutputStream {

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java
index ce57631..1e8ce09 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java
@@ -22,7 +22,7 @@ import org.apache.ignite.internal.util.GridUnsafe;
 import sun.misc.Unsafe;
 
 /**
- * Portable abstract stream.
+ * Binary abstract stream.
  */
 public abstract class BinaryAbstractStream implements BinaryStream {
     /** Byte: zero. */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java
index 502b9dc..732b8c7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.binary.streams;
 import java.util.Arrays;
 
 /**
- * Portable off-heap input stream.
+ * Binary off-heap input stream.
  */
 public final class BinaryHeapInputStream extends BinaryAbstractInputStream {
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java
index 02c3441..7553f3b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java
@@ -18,7 +18,7 @@
 package org.apache.ignite.internal.binary.streams;
 
 /**
- * Portable heap output stream.
+ * Binary heap output stream.
  */
 public final class BinaryHeapOutputStream extends BinaryAbstractOutputStream {
     /** Allocator. */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java
index 63457e4..1765715 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.binary.streams;
 import org.apache.ignite.internal.binary.BinaryPositionReadable;
 
 /**
- * Portable input stream.
+ * Binary input stream.
  */
 public interface BinaryInputStream extends BinaryStream, BinaryPositionReadable {
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java
index dc18c9e..cff002f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java
@@ -18,7 +18,7 @@
 package org.apache.ignite.internal.binary.streams;
 
 /**
- * Portable off-heap input stream.
+ * Binary off-heap input stream.
  */
 public class BinaryOffheapInputStream extends BinaryAbstractInputStream {
     /** Pointer. */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java
index 24b65b2..080a357 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java
@@ -18,7 +18,7 @@
 package org.apache.ignite.internal.binary.streams;
 
 /**
- * Portable offheap output stream.
+ * Binary offheap output stream.
  */
 public class BinaryOffheapOutputStream extends BinaryAbstractOutputStream {
     /** Pointer. */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java
index 1c3f4bf..8494120 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java
@@ -18,7 +18,7 @@
 package org.apache.ignite.internal.binary.streams;
 
 /**
- * Portable output stream.
+ * Binary output stream.
  */
 public interface BinaryOutputStream extends BinaryStream, AutoCloseable {
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java
index 229e34c..b868199 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java
@@ -18,7 +18,7 @@
 package org.apache.ignite.internal.binary.streams;
 
 /**
- * Portable stream.
+ * Binary stream.
  */
 public interface BinaryStream {
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java
index 2a6ad62..8ce839c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/package-info.java
@@ -17,6 +17,6 @@
 
 /**
  * <!-- Package description. -->
- * Contains portable APIs implementation for streams.
+ * Contains binary APIs implementation for streams.
  */
 package org.apache.ignite.internal.binary.streams;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java
index 382141c..2e4831e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCacheFlag.java
@@ -27,15 +27,15 @@ public enum GridClientCacheFlag {
     SKIP_STORE,
 
     /**
-     * Disable deserialization of portable objects on get operations.
-     * If set and portable marshaller is used, {@link GridClientData#get(Object)}
+     * Disable deserialization of binary objects on get operations.
+     * If set and binary marshaller is used, {@link GridClientData#get(Object)}
      * and {@link GridClientData#getAll(Collection)} methods will return
-     * instances of {@code PortableObject} class instead of user objects.
+     * instances of {@code BinaryObject} class instead of user objects.
      * Use this flag if you don't have corresponding class on your client of
      * if you want to get access to some individual fields, but do not want to
      * fully deserialize the object.
      */
-    KEEP_PORTABLES;
+    KEEP_BINARIES;
 
     /** */
     private static final GridClientCacheFlag[] VALS = values();
@@ -49,4 +49,4 @@ public enum GridClientCacheFlag {
     public static GridClientCacheFlag fromOrdinal(int ord) {
         return ord >= 0 && ord < VALS.length ? VALS[ord] : null;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java
index e7255f9..c0e31c7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientCompute.java
@@ -416,5 +416,5 @@ public interface GridClientCompute {
     /**
      * Sets keep binary flag for the next task execution in the current thread.
      */
-    public GridClientCompute withKeepPortables();
-}
\ No newline at end of file
+    public GridClientCompute withKeepBinaries();
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
index 2015970..e9d2958 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/GridClientConfiguration.java
@@ -615,7 +615,7 @@ public class GridClientConfiguration {
      * Options, that can be used out-of-the-box:
      * <ul>
      *     <li>{@link GridClientOptimizedMarshaller} (default) - Ignite's optimized marshaller.</li>
-     *     <li>{@code GridClientPortableMarshaller} - Marshaller that supports portable objects.</li>
+     *     <li>{@code GridClientBinaryMarshaller} - Marshaller that supports binary objects.</li>
      *     <li>{@link org.apache.ignite.internal.client.marshaller.jdk.GridClientJdkMarshaller} - JDK marshaller (not recommended).</li>
      * </ul>
      *
@@ -850,4 +850,4 @@ public class GridClientConfiguration {
     public boolean isDaemon() {
         return daemon;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java
index 0c3b155..463a074 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/GridClientComputeImpl.java
@@ -41,7 +41,7 @@ import static org.apache.ignite.internal.client.util.GridClientUtils.applyFilter
  */
 class GridClientComputeImpl extends GridClientAbstractProjection<GridClientComputeImpl> implements GridClientCompute {
     /** */
-    private static final ThreadLocal<Boolean> KEEP_PORTABLES = new ThreadLocal<Boolean>() {
+    private static final ThreadLocal<Boolean> KEEP_BINARIES = new ThreadLocal<Boolean>() {
         @Override protected Boolean initialValue() {
             return false;
         }
@@ -125,14 +125,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection<GridClientCompu
     @Override public <R> GridClientFuture<R> executeAsync(final String taskName, final Object taskArg) {
         A.notNull(taskName, "taskName");
 
-        final boolean keepPortables = KEEP_PORTABLES.get();
+        final boolean keepBinaries = KEEP_BINARIES.get();
 
-        KEEP_PORTABLES.set(false);
+        KEEP_BINARIES.set(false);
 
         return withReconnectHandling(new ClientProjectionClosure<R>() {
             @Override public GridClientFuture<R> apply(GridClientConnection conn, UUID destNodeId)
                 throws GridClientConnectionResetException, GridClientClosedException {
-                return conn.execute(taskName, taskArg, destNodeId, keepPortables);
+                return conn.execute(taskName, taskArg, destNodeId, keepBinaries);
             }
         });
     }
@@ -148,14 +148,14 @@ class GridClientComputeImpl extends GridClientAbstractProjection<GridClientCompu
         Object affKey, final Object taskArg) {
         A.notNull(taskName, "taskName");
 
-        final boolean keepPortables = KEEP_PORTABLES.get();
+        final boolean keepBinaries = KEEP_BINARIES.get();
 
-        KEEP_PORTABLES.set(false);
+        KEEP_BINARIES.set(false);
 
         return withReconnectHandling(new ClientProjectionClosure<R>() {
             @Override public GridClientFuture<R> apply(GridClientConnection conn, UUID destNodeId)
                 throws GridClientConnectionResetException, GridClientClosedException {
-                return conn.execute(taskName, taskArg, destNodeId, keepPortables);
+                return conn.execute(taskName, taskArg, destNodeId, keepBinaries);
             }
         }, cacheName, affKey);
     }
@@ -254,8 +254,8 @@ class GridClientComputeImpl extends GridClientAbstractProjection<GridClientCompu
     }
 
     /** {@inheritDoc} */
-    @Override public GridClientCompute withKeepPortables() {
-        KEEP_PORTABLES.set(true);
+    @Override public GridClientCompute withKeepBinaries() {
+        KEEP_BINARIES.set(true);
 
         return this;
     }
@@ -268,4 +268,4 @@ class GridClientComputeImpl extends GridClientAbstractProjection<GridClientCompu
             return new GridClientComputeImpl(client, nodes, filter, balancer);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnection.java
index 8bdb1d0..c129f54 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnection.java
@@ -313,13 +313,13 @@ public abstract class GridClientConnection {
      * @param taskName Task name.
      * @param arg Task argument.
      * @param destNodeId Destination node ID.
-     * @param keepPortables Keep binary flag.
+     * @param keepBinaries Keep binary flag.
      * @return Task execution result.
      * @throws GridClientConnectionResetException In case of error.
      * @throws GridClientClosedException If client was manually closed before request was sent over network.
      */
     public abstract <R> GridClientFutureAdapter<R> execute(String taskName, Object arg, UUID destNodeId,
-        boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException;
+        boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException;
 
     /**
      * Gets node by node ID.
@@ -514,4 +514,4 @@ public abstract class GridClientConnection {
 
         return null;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java
index dedee10..1bea3cc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientConnectionManagerAdapter.java
@@ -462,7 +462,7 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
             if (cfg.getProtocol() == GridClientProtocol.TCP) {
                 conn = new GridClientNioTcpConnection(srv, clientId, addr, sslCtx, pingExecutor,
                     cfg.getConnectTimeout(), cfg.getPingInterval(), cfg.getPingTimeout(),
-                    cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepPortablesThreadLocal());
+                    cfg.isTcpNoDelay(), cfg.getMarshaller(), marshId, top, cred, keepBinariesThreadLocal());
             }
             else
                 throw new GridServerUnreachableException("Failed to create client (protocol is not supported): " +
@@ -485,7 +485,7 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
     /**
      * @return Get thread local used to enable keep binary mode.
      */
-    protected ThreadLocal<Boolean> keepPortablesThreadLocal() {
+    protected ThreadLocal<Boolean> keepBinariesThreadLocal() {
         return null;
     }
 
@@ -668,4 +668,4 @@ public abstract class GridClientConnectionManagerAdapter implements GridClientCo
             ses.close();
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
index 24c9c70..576df3a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
@@ -79,7 +79,7 @@ import org.apache.ignite.internal.util.typedef.internal.U;
 import org.jetbrains.annotations.Nullable;
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_PORTABLES;
+import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_BINARIES;
 import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.CONN_IDLE;
 import static org.apache.ignite.internal.client.impl.connection.GridClientConnectionCloseReason.FAILED;
 import static org.apache.ignite.internal.processors.rest.client.message.GridClientCacheRequest.GridCacheOperation.APPEND;
@@ -156,7 +156,7 @@ public class GridClientNioTcpConnection extends GridClientConnection {
     private final GridClientMarshaller marsh;
 
     /** */
-    private final ThreadLocal<Boolean> keepPortablesMode;
+    private final ThreadLocal<Boolean> keepBinariesMode;
 
     /**
      * Creates a client facade, tries to connect to remote server, in case of success starts reader thread.
@@ -190,7 +190,7 @@ public class GridClientNioTcpConnection extends GridClientConnection {
         Byte marshId,
         GridClientTopology top,
         Object cred,
-        ThreadLocal<Boolean> keepPortablesMode
+        ThreadLocal<Boolean> keepBinariesMode
     ) throws IOException, GridClientException {
         super(clientId, srvAddr, sslCtx, top, cred);
 
@@ -199,7 +199,7 @@ public class GridClientNioTcpConnection extends GridClientConnection {
         this.marsh = marsh;
         this.pingInterval = pingInterval;
         this.pingTimeout = pingTimeout;
-        this.keepPortablesMode = keepPortablesMode;
+        this.keepBinariesMode = keepBinariesMode;
 
         SocketChannel ch = null;
         Socket sock = null;
@@ -385,16 +385,16 @@ public class GridClientNioTcpConnection extends GridClientConnection {
      *
      * @param msg Message to request,
      * @param destId Destination node identifier.
-     * @param keepPortables Keep binary flag.
+     * @param keepBinaries Keep binary flag.
      * @return Response object.
      * @throws GridClientConnectionResetException If request failed.
      * @throws GridClientClosedException If client was closed.
      */
-    private <R> GridClientFutureAdapter<R> makeRequest(GridClientMessage msg, UUID destId, boolean keepPortables)
+    private <R> GridClientFutureAdapter<R> makeRequest(GridClientMessage msg, UUID destId, boolean keepBinaries)
         throws GridClientConnectionResetException, GridClientClosedException {
         assert msg != null;
 
-        TcpClientFuture<R> res = new TcpClientFuture<>(false, keepPortables);
+        TcpClientFuture<R> res = new TcpClientFuture<>(false, keepBinaries);
 
         msg.destinationId(destId);
 
@@ -667,7 +667,7 @@ public class GridClientNioTcpConnection extends GridClientConnection {
         req.keys((Iterable<Object>)keys);
         req.cacheFlagsOn(encodeCacheFlags(flags));
 
-        return makeRequest(req, destNodeId, flags.contains(KEEP_PORTABLES));
+        return makeRequest(req, destNodeId, flags.contains(KEEP_BINARIES));
     }
 
     /** {@inheritDoc} */
@@ -786,12 +786,12 @@ public class GridClientNioTcpConnection extends GridClientConnection {
 
     /** {@inheritDoc} */
     @Override public <R> GridClientFutureAdapter<R> execute(String taskName, Object arg, UUID destNodeId,
-        final boolean keepPortables) throws GridClientConnectionResetException, GridClientClosedException {
+        final boolean keepBinaries) throws GridClientConnectionResetException, GridClientClosedException {
         GridClientTaskRequest msg = new GridClientTaskRequest();
 
         msg.taskName(taskName);
         msg.argument(arg);
-        msg.keepPortables(keepPortables);
+        msg.keepBinaries(keepBinaries);
 
         return this.<GridClientTaskResultBean>makeRequest(msg, destNodeId).chain(
             new GridClientFutureCallback<GridClientTaskResultBean, R>() {
@@ -1038,7 +1038,7 @@ public class GridClientNioTcpConnection extends GridClientConnection {
         private final boolean forward;
 
         /** Keep binary flag. */
-        private final boolean keepPortables;
+        private final boolean keepBinaries;
 
         /** Pending message for this future. */
         private GridClientMessage pendingMsg;
@@ -1052,7 +1052,7 @@ public class GridClientNioTcpConnection extends GridClientConnection {
          */
         private TcpClientFuture() {
             forward = false;
-            keepPortables = false;
+            keepBinaries = false;
         }
 
         /**
@@ -1060,9 +1060,9 @@ public class GridClientNioTcpConnection extends GridClientConnection {
          *
          * @param forward Flag value.
          */
-        private TcpClientFuture(boolean forward, boolean keepPortables) {
+        private TcpClientFuture(boolean forward, boolean keepBinaries) {
             this.forward = forward;
-            this.keepPortables = keepPortables;
+            this.keepBinaries = keepBinaries;
         }
 
         /**
@@ -1103,8 +1103,8 @@ public class GridClientNioTcpConnection extends GridClientConnection {
         /**
          * @return Keep binary flag.
          */
-        public boolean keepPortables() {
-            return keepPortables;
+        public boolean keepBinaries() {
+            return keepBinaries;
         }
 
         /** {@inheritDoc} */
@@ -1112,4 +1112,4 @@ public class GridClientNioTcpConnection extends GridClientConnection {
             return "TcpClientFuture [state=" + authRetry + ", forward=" + forward + ", message=" + pendingMsg + "]";
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java
index 4f9c188..9b3dd15 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheDefaultBinaryAffinityKeyMapper.java
@@ -37,10 +37,10 @@ public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinit
     /** {@inheritDoc} */
     @Override public Object affinityKey(Object key) {
         try {
-            key = proc.toPortable(key);
+            key = proc.toBinary(key);
         }
         catch (IgniteException e) {
-            U.error(log, "Failed to marshal key to portable: " + key, e);
+            U.error(log, "Failed to marshal key to binary: " + key, e);
         }
 
         if (key instanceof BinaryObject)

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
index 2de26fc..2ecfdbf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheInvokeEntry.java
@@ -50,9 +50,9 @@ public class CacheInvokeEntry<K, V> extends CacheLazyEntry<K, V> implements Muta
         KeyCacheObject keyObj,
         @Nullable CacheObject valObj,
         GridCacheVersion ver,
-        boolean keepPortable
+        boolean keepBinary
     ) {
-        super(cctx, keyObj, valObj, keepPortable);
+        super(cctx, keyObj, valObj, keepBinary);
 
         this.hadVal = valObj != null;
         this.ver = ver;
@@ -72,9 +72,9 @@ public class CacheInvokeEntry<K, V> extends CacheLazyEntry<K, V> implements Muta
         @Nullable CacheObject valObj,
         @Nullable V val,
         GridCacheVersion ver,
-        boolean keepPortable
+        boolean keepBinary
     ) {
-        super(ctx, keyObj, key, valObj, val, keepPortable);
+        super(ctx, keyObj, key, valObj, val, keepBinary);
 
         this.hadVal = valObj != null || val != null;
         this.ver = ver;
@@ -152,4 +152,4 @@ public class CacheInvokeEntry<K, V> extends CacheLazyEntry<K, V> implements Muta
         /** */
         REMOVE
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
index 713bb3f..05a6fef 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLazyEntry.java
@@ -43,19 +43,19 @@ public class CacheLazyEntry<K, V> implements Cache.Entry<K, V> {
     @GridToStringInclude
     protected V val;
 
-    /** Keep portable flag. */
-    private boolean keepPortable;
+    /** Keep binary flag. */
+    private boolean keepBinary;
 
     /**
      * @param cctx Cache context.
      * @param keyObj Key cache object.
      * @param valObj Cache object value.
      */
-    public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepPortable) {
+    public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, CacheObject valObj, boolean keepBinary) {
         this.cctx = cctx;
         this.keyObj = keyObj;
         this.valObj = valObj;
-        this.keepPortable = keepPortable;
+        this.keepBinary = keepBinary;
     }
 
     /**
@@ -63,11 +63,11 @@ public class CacheLazyEntry<K, V> implements Cache.Entry<K, V> {
      * @param val Value.
      * @param cctx Cache context.
      */
-    public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepPortable) {
+    public CacheLazyEntry(GridCacheContext cctx, KeyCacheObject keyObj, V val, boolean keepBinary) {
         this.cctx = cctx;
         this.keyObj = keyObj;
         this.val = val;
-        this.keepPortable = keepPortable;
+        this.keepBinary = keepBinary;
     }
 
     /**
@@ -82,38 +82,38 @@ public class CacheLazyEntry<K, V> implements Cache.Entry<K, V> {
         K key,
         CacheObject valObj,
         V val,
-        boolean keepPortable
+        boolean keepBinary
     ) {
         this.cctx = ctx;
         this.keyObj = keyObj;
         this.key = key;
         this.valObj = valObj;
         this.val = val;
-        this.keepPortable = keepPortable;
+        this.keepBinary = keepBinary;
     }
 
     /** {@inheritDoc} */
     @Override public K getKey() {
         if (key == null)
-            key = (K)cctx.unwrapPortableIfNeeded(keyObj, keepPortable);
+            key = (K)cctx.unwrapBinaryIfNeeded(keyObj, keepBinary);
 
         return key;
     }
 
     /** {@inheritDoc} */
     @Override public V getValue() {
-        return getValue(keepPortable);
+        return getValue(keepBinary);
     }
 
     /**
      * Returns the value stored in the cache when this entry was created.
      *
-     * @param keepPortable Flag to keep portable if needed.
+     * @param keepBinary Flag to keep binary if needed.
      * @return the value corresponding to this entry
      */
-    public V getValue(boolean keepPortable) {
+    public V getValue(boolean keepBinary) {
         if (val == null)
-            val = (V)cctx.unwrapPortableIfNeeded(valObj, keepPortable, false);
+            val = (V)cctx.unwrapBinaryIfNeeded(valObj, keepBinary, false);
 
         return val;
     }
@@ -147,4 +147,4 @@ public class CacheLazyEntry<K, V> implements Cache.Entry<K, V> {
     public String toString() {
         return S.toString(CacheLazyEntry.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
index 88a8027..7401434 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
@@ -125,69 +125,69 @@ import org.apache.ignite.internal.util.typedef.F;
 
     /**
      * @param o Object to unwrap.
-     * @param keepPortable Keep binary flag.
+     * @param keepBinary Keep binary flag.
      * @return Unwrapped object.
      */
-    public Object unwrapPortableIfNeeded(Object o, boolean keepPortable) {
-        return unwrapPortableIfNeeded(o, keepPortable, true);
+    public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary) {
+        return unwrapBinaryIfNeeded(o, keepBinary, true);
     }
 
     /**
      * @param o Object to unwrap.
-     * @param keepPortable Keep binary flag.
+     * @param keepBinary Keep binary flag.
      * @param cpy Copy value flag.
      * @return Unwrapped object.
      */
-    public Object unwrapPortableIfNeeded(Object o, boolean keepPortable, boolean cpy) {
+    public Object unwrapBinaryIfNeeded(Object o, boolean keepBinary, boolean cpy) {
         if (o == null)
             return null;
 
-        return unwrapPortable(o, keepPortable, cpy);
+        return unwrapBinary(o, keepBinary, cpy);
     }
 
     /**
      * @param col Collection of objects to unwrap.
-     * @param keepPortable Keep binary flag.
+     * @param keepBinary Keep binary flag.
      * @return Unwrapped collection.
      */
-    public Collection<Object> unwrapPortablesIfNeeded(Collection<Object> col, boolean keepPortable) {
-        return unwrapPortablesIfNeeded(col, keepPortable, true);
+    public Collection<Object> unwrapBinariesIfNeeded(Collection<Object> col, boolean keepBinary) {
+        return unwrapBinariesIfNeeded(col, keepBinary, true);
     }
 
     /**
      * @param col Collection to unwrap.
-     * @param keepPortable Keep binary flag.
+     * @param keepBinary Keep binary flag.
      * @param cpy Copy value flag.
      * @return Unwrapped collection.
      */
-    public Collection<Object> unwrapPortablesIfNeeded(Collection<Object> col, boolean keepPortable, boolean cpy) {
+    public Collection<Object> unwrapBinariesIfNeeded(Collection<Object> col, boolean keepBinary, boolean cpy) {
         if (col instanceof ArrayList)
-            return unwrapPortables((ArrayList<Object>)col, keepPortable, cpy);
+            return unwrapBinaries((ArrayList<Object>)col, keepBinary, cpy);
 
         if (col instanceof Set)
-            return unwrapPortables((Set<Object>)col, keepPortable, cpy);
+            return unwrapBinaries((Set<Object>)col, keepBinary, cpy);
 
         Collection<Object> col0 = new ArrayList<>(col.size());
 
         for (Object obj : col)
-            col0.add(unwrapPortable(obj, keepPortable, cpy));
+            col0.add(unwrapBinary(obj, keepBinary, cpy));
 
         return col0;
     }
 
     /**
-     * Unwrap array of portables if needed.
+     * Unwrap array of binaries if needed.
      *
      * @param arr Array.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @param cpy Copy.
      * @return Result.
      */
-    public Object[] unwrapPortablesInArrayIfNeeded(Object[] arr, boolean keepPortable, boolean cpy) {
+    public Object[] unwrapBinariesInArrayIfNeeded(Object[] arr, boolean keepBinary, boolean cpy) {
         Object[] res = new Object[arr.length];
 
         for (int i = 0; i < arr.length; i++)
-            res[i] = unwrapPortable(arr[i], keepPortable, cpy);
+            res[i] = unwrapBinary(arr[i], keepBinary, cpy);
 
         return res;
     }
@@ -196,17 +196,17 @@ import org.apache.ignite.internal.util.typedef.F;
      * Unwraps map.
      *
      * @param map Map to unwrap.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @return Unwrapped collection.
      */
-    private Map<Object, Object> unwrapPortablesIfNeeded(Map<Object, Object> map, boolean keepPortable, boolean cpy) {
-        if (keepPortable)
+    private Map<Object, Object> unwrapBinariesIfNeeded(Map<Object, Object> map, boolean keepBinary, boolean cpy) {
+        if (keepBinary)
             return map;
 
         Map<Object, Object> map0 = BinaryUtils.newMap(map);
 
         for (Map.Entry<Object, Object> e : map.entrySet())
-            map0.put(unwrapPortable(e.getKey(), keepPortable, cpy), unwrapPortable(e.getValue(), keepPortable, cpy));
+            map0.put(unwrapBinary(e.getKey(), keepBinary, cpy), unwrapBinary(e.getValue(), keepBinary, cpy));
 
         return map0;
     }
@@ -217,7 +217,7 @@ import org.apache.ignite.internal.util.typedef.F;
      * @param col List to unwrap.
      * @return Unwrapped list.
      */
-    private Collection<Object> unwrapPortables(ArrayList<Object> col, boolean keepPortable, boolean cpy) {
+    private Collection<Object> unwrapBinaries(ArrayList<Object> col, boolean keepBinary, boolean cpy) {
         int size = col.size();
 
         col = new ArrayList<>(col);
@@ -225,7 +225,7 @@ import org.apache.ignite.internal.util.typedef.F;
         for (int i = 0; i < size; i++) {
             Object o = col.get(i);
 
-            Object unwrapped = unwrapPortable(o, keepPortable, cpy);
+            Object unwrapped = unwrapBinary(o, keepBinary, cpy);
 
             if (o != unwrapped)
                 col.set(i, unwrapped);
@@ -240,11 +240,11 @@ import org.apache.ignite.internal.util.typedef.F;
      * @param set Set to unwrap.
      * @return Unwrapped set.
      */
-    private Set<Object> unwrapPortables(Set<Object> set, boolean keepPortable, boolean cpy) {
+    private Set<Object> unwrapBinaries(Set<Object> set, boolean keepBinary, boolean cpy) {
         Set<Object> set0 = BinaryUtils.newSet(set);
 
         for (Object obj : set)
-            set0.add(unwrapPortable(obj, keepPortable, cpy));
+            set0.add(unwrapBinary(obj, keepBinary, cpy));
 
         return set0;
     }
@@ -253,31 +253,31 @@ import org.apache.ignite.internal.util.typedef.F;
      * @param o Object to unwrap.
      * @return Unwrapped object.
      */
-    private Object unwrapPortable(Object o, boolean keepPortable, boolean cpy) {
+    private Object unwrapBinary(Object o, boolean keepBinary, boolean cpy) {
         if (o instanceof Map.Entry) {
             Map.Entry entry = (Map.Entry)o;
 
             Object key = entry.getKey();
 
-            Object uKey = unwrapPortable(key, keepPortable, cpy);
+            Object uKey = unwrapBinary(key, keepBinary, cpy);
 
             Object val = entry.getValue();
 
-            Object uVal = unwrapPortable(val, keepPortable, cpy);
+            Object uVal = unwrapBinary(val, keepBinary, cpy);
 
             return (key != uKey || val != uVal) ? F.t(uKey, uVal) : o;
         }
         else if (o instanceof Collection)
-            return unwrapPortablesIfNeeded((Collection<Object>)o, keepPortable, cpy);
+            return unwrapBinariesIfNeeded((Collection<Object>)o, keepBinary, cpy);
         else if (o instanceof Map)
-            return unwrapPortablesIfNeeded((Map<Object, Object>)o, keepPortable, cpy);
+            return unwrapBinariesIfNeeded((Map<Object, Object>)o, keepBinary, cpy);
         else if (o instanceof Object[])
-            return unwrapPortablesInArrayIfNeeded((Object[])o, keepPortable, cpy);
+            return unwrapBinariesInArrayIfNeeded((Object[])o, keepBinary, cpy);
         else if (o instanceof CacheObject) {
             CacheObject co = (CacheObject)o;
 
-            if (!keepPortable || co.isPlatformType())
-                return unwrapPortable(co.value(this, cpy), keepPortable, cpy);
+            if (!keepBinary || co.isPlatformType())
+                return unwrapBinary(co.value(this, cpy), keepBinary, cpy);
         }
 
         return o;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
index 3993146..21934d0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationContext.java
@@ -42,7 +42,7 @@ public class CacheOperationContext implements Serializable {
     /** Client ID which operates over this projection. */
     private final UUID subjId;
 
-    /** Keep portable flag. */
+    /** Keep binary flag. */
     private final boolean keepBinary;
 
     /** Expiry policy. */
@@ -66,7 +66,7 @@ public class CacheOperationContext implements Serializable {
     /**
      * @param skipStore Skip store flag.
      * @param subjId Subject ID.
-     * @param keepBinary Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @param expiryPlc Expiry policy.
      */
     public CacheOperationContext(
@@ -87,16 +87,16 @@ public class CacheOperationContext implements Serializable {
     }
 
     /**
-     * @return Keep portable flag.
+     * @return Keep binary flag.
      */
     public boolean isKeepBinary() {
         return keepBinary;
     }
 
     /**
-     * See {@link IgniteInternalCache#keepPortable()}.
+     * See {@link IgniteInternalCache#keepBinary()}.
      *
-     * @return New instance of CacheOperationContext with keep portable flag.
+     * @return New instance of CacheOperationContext with keep binary flag.
      */
     public CacheOperationContext keepBinary() {
         return new CacheOperationContext(
@@ -200,4 +200,4 @@ public class CacheOperationContext implements Serializable {
     @Override public String toString() {
         return S.toString(CacheOperationContext.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
index 034640f..ea57caf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
@@ -468,7 +468,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
     }
 
     /** {@inheritDoc} */
-    @Override public <K1, V1> GridCacheProxyImpl<K1, V1> keepPortable() {
+    @Override public <K1, V1> GridCacheProxyImpl<K1, V1> keepBinary() {
         CacheOperationContext opCtx = new CacheOperationContext(false, null, true, null, false);
 
         return new GridCacheProxyImpl<>((GridCacheContext<K1, V1>)ctx, (GridCacheAdapter<K1, V1>)this, opCtx);
@@ -608,7 +608,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
             /*skip tx*/false,
             /*subj id*/null,
             /*task name*/null,
-            /*deserialize portable*/false,
+            /*deserialize binary*/false,
             /*skip values*/true,
             /*can remap*/true
         );
@@ -634,7 +634,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
             /*skip tx*/false,
             /*subj id*/null,
             /*task name*/null,
-            /*deserialize portable*/false,
+            /*deserialize binary*/false,
             /*skip values*/true,
             /*can remap*/true
         ).chain(new CX1<IgniteInternalFuture<Map<K, V>>, Boolean>() {
@@ -669,7 +669,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
             modes.backup = true;
 
             if (modes.heap)
-                its.add(iterator(map.entries0().iterator(), !ctx.keepPortable()));
+                its.add(iterator(map.entries0().iterator(), !ctx.keepBinary()));
         }
         else if (modes.heap) {
             if (modes.near && ctx.isNear())
@@ -799,7 +799,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
             else
                 cacheVal = localCachePeek0(cacheKey, modes.heap, modes.offheap, modes.swap, plc);
 
-            Object val = ctx.unwrapPortableIfNeeded(cacheVal, ctx.keepPortable(), false);
+            Object val = ctx.unwrapBinaryIfNeeded(cacheVal, ctx.keepBinary(), false);
 
             return (V)val;
         }
@@ -1353,7 +1353,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
             /*skip tx*/true,
             null,
             taskName,
-            !ctx.keepPortable(),
+            !ctx.keepBinary(),
             /*skip values*/false,
             /*can remap*/true);
     }
@@ -1375,7 +1375,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
         long start = statsEnabled ? System.nanoTime() : 0L;
 
-        V val = get(key, !ctx.keepPortable());
+        V val = get(key, !ctx.keepBinary());
 
         if (ctx.config().getInterceptor() != null)
             val = (V)ctx.config().getInterceptor().onGet(key, val);
@@ -1394,7 +1394,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
         final long start = statsEnabled ? System.nanoTime() : 0L;
 
-        IgniteInternalFuture<V> fut = getAsync(key, !ctx.keepPortable());
+        IgniteInternalFuture<V> fut = getAsync(key, !ctx.keepBinary());
 
         if (ctx.config().getInterceptor() != null)
             fut =  fut.chain(new CX1<IgniteInternalFuture<V>, V>() {
@@ -1417,7 +1417,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
         long start = statsEnabled ? System.nanoTime() : 0L;
 
-        Map<K, V> map = getAll(keys, !ctx.keepPortable());
+        Map<K, V> map = getAll(keys, !ctx.keepBinary());
 
         if (ctx.config().getInterceptor() != null)
             map = interceptGet(keys, map);
@@ -1436,7 +1436,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
         final long start = statsEnabled ? System.nanoTime() : 0L;
 
-        IgniteInternalFuture<Map<K, V>> fut = getAllAsync(keys, !ctx.keepPortable());
+        IgniteInternalFuture<Map<K, V>> fut = getAllAsync(keys, !ctx.keepBinary());
 
         if (ctx.config().getInterceptor() != null)
             return fut.chain(new CX1<IgniteInternalFuture<Map<K, V>>, Map<K, V>>() {
@@ -1498,7 +1498,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
      * @param skipTx Skip tx.
      * @param subjId Subj Id.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable.
+     * @param deserializeBinary Deserialize binary.
      * @param skipVals Skip values.
      * @param canRemap Can remap flag.
      * @return Future for the get operation.
@@ -1509,7 +1509,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
         boolean skipTx,
         @Nullable UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         final boolean skipVals,
         boolean canRemap
     ) {
@@ -1518,7 +1518,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
             skipTx,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             skipVals,
             canRemap).chain(
             new CX1<IgniteInternalFuture<Map<K, V>>, V>() {
@@ -1544,7 +1544,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
      * @param skipTx Skip tx.
      * @param subjId Subj Id.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable.
+     * @param deserializeBinary Deserialize binary.
      * @param skipVals Skip values.
      * @param canRemap Can remap flag.
      * @return Future for the get operation.
@@ -1556,7 +1556,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
         boolean skipTx,
         @Nullable UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         boolean skipVals,
         boolean canRemap
     ) {
@@ -1569,7 +1569,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
             !skipTx,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             forcePrimary,
             skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null),
             skipVals,
@@ -1582,7 +1582,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
      * @param checkTx Check tx.
      * @param subjId Subj Id.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable.
+     * @param deserializeBinary Deserialize binary.
      * @param forcePrimary Froce primary.
      * @param expiry Expiry policy.
      * @param skipVals Skip values.
@@ -1595,7 +1595,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
         boolean checkTx,
         @Nullable final UUID subjId,
         final String taskName,
-        final boolean deserializePortable,
+        final boolean deserializeBinary,
         final boolean forcePrimary,
         @Nullable IgniteCacheExpiryPolicy expiry,
         final boolean skipVals,
@@ -1611,7 +1611,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
             checkTx,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             expiry,
             skipVals,
             false,
@@ -1625,7 +1625,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
      * @param checkTx Check local transaction flag.
      * @param subjId Subject ID.
      * @param taskName Task name/
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param expiry Expiry policy.
      * @param skipVals Skip values flag.
      * @param keepCacheObjects Keep cache objects.
@@ -1638,7 +1638,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
         boolean checkTx,
         @Nullable final UUID subjId,
         final String taskName,
-        final boolean deserializePortable,
+        final boolean deserializeBinary,
         @Nullable IgniteCacheExpiryPolicy expiry,
         final boolean skipVals,
         final boolean keepCacheObjects,
@@ -1696,7 +1696,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
                                 null,
                                 taskName,
                                 expiry,
-                                !deserializePortable);
+                                !deserializeBinary);
 
                             if (res == null) {
                                 if (storeEnabled) {
@@ -1722,7 +1722,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
                                         res.get1(),
                                         skipVals,
                                         keepCacheObjects,
-                                        deserializePortable,
+                                        deserializeBinary,
                                         true);
                                 }
 
@@ -1797,7 +1797,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
                                                             cacheVal,
                                                             skipVals,
                                                             keepCacheObjects,
-                                                            deserializePortable,
+                                                            deserializeBinary,
                                                             false);
                                                     }
                                                 }
@@ -1896,7 +1896,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
             return asyncOp(tx, new AsyncOp<Map<K1, V1>>(keys) {
                 @Override public IgniteInternalFuture<Map<K1, V1>> op(IgniteTxLocalAdapter tx) {
-                    return tx.getAllAsync(ctx, keys, deserializePortable, skipVals, false, !readThrough);
+                    return tx.getAllAsync(ctx, keys, deserializeBinary, skipVals, false, !readThrough);
                 }
             }, ctx.operationContextPerCall());
         }
@@ -3815,7 +3815,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
         if (!ctx0.isSwapOrOffheapEnabled() && ctx0.kernalContext().discovery().size() == 1)
             return localIteratorHonorExpirePolicy(opCtx);
 
-        CacheQueryFuture<Map.Entry<K, V>> fut = ctx0.queries().createScanQuery(null, null, ctx.keepPortable())
+        CacheQueryFuture<Map.Entry<K, V>> fut = ctx0.queries().createScanQuery(null, null, ctx.keepBinary())
             .keepAll(false)
             .execute();
 
@@ -3842,12 +3842,12 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
     /**
      * @param key Key.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @return Value.
      * @throws IgniteCheckedException If failed.
      */
     @SuppressWarnings("IfMayBeConditional")
-    @Nullable public V promote(K key, boolean deserializePortable) throws IgniteCheckedException {
+    @Nullable public V promote(K key, boolean deserializeBinary) throws IgniteCheckedException {
         A.notNull(key, "key");
 
         if (keyCheck)
@@ -3877,7 +3877,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
         Object val0 = val != null ? val.value(ctx.cacheObjectContext(), true) : null;
 
-        return (V)ctx.unwrapPortableIfNeeded(val0, !deserializePortable);
+        return (V)ctx.unwrapBinaryIfNeeded(val0, !deserializeBinary);
     }
 
     /** {@inheritDoc} */
@@ -4513,21 +4513,21 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
     /**
      * @param key Key.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @return Cached value.
      * @throws IgniteCheckedException If failed.
      */
-    @Nullable public V get(K key, boolean deserializePortable)
+    @Nullable public V get(K key, boolean deserializeBinary)
         throws IgniteCheckedException {
-        return getAsync(key, deserializePortable).get();
+        return getAsync(key, deserializeBinary).get();
     }
 
     /**
      * @param key Key.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @return Read operation future.
      */
-    public final IgniteInternalFuture<V> getAsync(final K key, boolean deserializePortable) {
+    public final IgniteInternalFuture<V> getAsync(final K key, boolean deserializeBinary) {
         try {
             checkJta();
         }
@@ -4542,30 +4542,30 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
             /*skip tx*/false,
             null,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             false,
             /*can remap*/true);
     }
 
     /**
      * @param keys Keys.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @return Map of cached values.
      * @throws IgniteCheckedException If read failed.
      */
-    public Map<K, V> getAll(Collection<? extends K> keys, boolean deserializePortable) throws IgniteCheckedException {
+    public Map<K, V> getAll(Collection<? extends K> keys, boolean deserializeBinary) throws IgniteCheckedException {
         checkJta();
 
-        return getAllAsync(keys, deserializePortable).get();
+        return getAllAsync(keys, deserializeBinary).get();
     }
 
     /**
      * @param keys Keys.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @return Read future.
      */
     public IgniteInternalFuture<Map<K, V>> getAllAsync(@Nullable Collection<? extends K> keys,
-        boolean deserializePortable) {
+        boolean deserializeBinary) {
         String taskName = ctx.kernalContext().job().currentTaskName();
 
         return getAllAsync(keys,
@@ -4573,7 +4573,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
             /*skip tx*/false,
             /*subject id*/null,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             /*skip vals*/false,
             /*can remap*/true);
     }
@@ -4662,11 +4662,11 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
     /**
      * @param it Internal entry iterator.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @return Public API iterator.
      */
     protected Iterator<Cache.Entry<K, V>> iterator(final Iterator<GridCacheEntryEx> it,
-        final boolean deserializePortable) {
+        final boolean deserializeBinary) {
         return new Iterator<Cache.Entry<K, V>>() {
             {
                 advance();
@@ -4704,7 +4704,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
                     GridCacheEntryEx entry = it.next();
 
                     try {
-                        next = toCacheEntry(entry, deserializePortable);
+                        next = toCacheEntry(entry, deserializeBinary);
 
                         if (next == null)
                             continue;
@@ -4724,13 +4724,13 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
 
     /**
      * @param entry Internal entry.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @return Public API entry.
      * @throws IgniteCheckedException If failed.
      * @throws GridCacheEntryRemovedException If entry removed.
      */
     @Nullable private Cache.Entry<K, V> toCacheEntry(GridCacheEntryEx entry,
-        boolean deserializePortable)
+        boolean deserializeBinary)
         throws IgniteCheckedException, GridCacheEntryRemovedException
     {
         CacheObject val = entry.innerGet(
@@ -4746,7 +4746,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
             null,
             null,
             null,
-            !deserializePortable);
+            !deserializeBinary);
 
         if (val == null)
             return null;
@@ -4756,9 +4756,9 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
         Object key0 = key.value(ctx.cacheObjectContext(), true);
         Object val0 = val.value(ctx.cacheObjectContext(), true);
 
-        if (deserializePortable) {
-            key0 = ctx.unwrapPortableIfNeeded(key0, true);
-            val0 = ctx.unwrapPortableIfNeeded(val0, true);
+        if (deserializeBinary) {
+            key0 = ctx.unwrapBinaryIfNeeded(key0, true);
+            val0 = ctx.unwrapBinaryIfNeeded(val0, true);
         }
 
         return new CacheEntryImpl<>((K)key0, (V)val0, entry.version());

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
index f78a606..05ff71a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
@@ -1781,7 +1781,7 @@ public class GridCacheConcurrentMap {
 
         /** {@inheritDoc} */
         @Override public K next() {
-            return (K)it.ctx.cacheObjectContext().unwrapPortableIfNeeded(it.next().key(), keepBinary, true);
+            return (K)it.ctx.cacheObjectContext().unwrapBinaryIfNeeded(it.next().key(), keepBinary, true);
         }
 
         /** {@inheritDoc} */


[29/50] [abbrv] ignite git commit: ignite-2065: portable -> binary renaming (methods, javadoc and etc.)

Posted by vo...@apache.org.
ignite-2065: portable -> binary renaming (methods, javadoc and etc.)


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

Branch: refs/heads/ignite-2100
Commit: 10b83fb852e67ab904453034c1d187d1e7f4f36f
Parents: 1f2af31
Author: ashutak <as...@gridgain.com>
Authored: Fri Dec 11 21:43:33 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Fri Dec 11 21:43:33 2015 +0300

----------------------------------------------------------------------
 .../examples/CacheClientBinaryExampleTest.java  |   6 +-
 .../ComputeClientBinaryExampleTest.java         |   4 +-
 .../testsuites/IgniteExamplesSelfTestSuite.java |   2 +-
 .../client/impl/ClientCacheFlagsCodecTest.java  |   8 +-
 .../src/test/resources/spring-server-node.xml   |   8 +-
 .../test/resources/spring-server-ssl-node.xml   |   8 +-
 modules/core/pom.xml                            |   4 +-
 .../java/org/apache/ignite/IgniteBinary.java    | 124 +++----
 .../java/org/apache/ignite/IgniteCache.java     |   8 +-
 .../org/apache/ignite/binary/BinaryReader.java  |   4 +-
 .../affinity/AffinityNodeHashResolver.java      |   6 +-
 .../configuration/BinaryConfiguration.java      |   4 +-
 .../ignite/internal/IgniteNodeAttributes.java   |   4 +-
 .../internal/binary/BinaryClassDescriptor.java  |  30 +-
 .../ignite/internal/binary/BinaryContext.java   |  14 +-
 .../internal/binary/BinaryEnumObjectImpl.java   |   2 +-
 .../internal/binary/BinaryFieldAccessor.java    |  16 +-
 .../ignite/internal/binary/BinaryFieldImpl.java |   2 +-
 .../internal/binary/BinaryMarshaller.java       |   6 +-
 .../ignite/internal/binary/BinaryMetadata.java  |   4 +-
 .../internal/binary/BinaryMetadataHandler.java  |   2 +-
 .../internal/binary/BinaryObjectExImpl.java     |   4 +-
 .../internal/binary/BinaryObjectImpl.java       |   8 +-
 .../binary/BinaryObjectOffheapImpl.java         |   4 +-
 .../internal/binary/BinaryReaderExImpl.java     |  20 +-
 .../ignite/internal/binary/BinarySchema.java    |   2 +-
 .../internal/binary/BinarySchemaRegistry.java   |   2 +-
 .../ignite/internal/binary/BinaryTypeImpl.java  |   4 +-
 .../ignite/internal/binary/BinaryUtils.java     | 104 +++---
 .../ignite/internal/binary/BinaryWriteMode.java |   8 +-
 .../internal/binary/BinaryWriterExImpl.java     |  20 +-
 .../internal/binary/GridBinaryMarshaller.java   |  10 +-
 .../binary/builder/BinaryBuilderEnum.java       |   6 +-
 .../binary/builder/BinaryBuilderReader.java     |  22 +-
 .../binary/builder/BinaryBuilderSerializer.java |  10 +-
 .../builder/BinaryEnumArrayLazyValue.java       |   4 +-
 .../binary/builder/BinaryLazyArrayList.java     |   2 +-
 .../internal/binary/builder/BinaryLazyMap.java  |   2 +-
 .../builder/BinaryObjectArrayLazyValue.java     |   4 +-
 .../binary/builder/BinaryObjectBuilderImpl.java |  14 +-
 .../binary/builder/BinaryPlainBinaryObject.java |  14 +-
 .../internal/binary/builder/package-info.java   |   2 +-
 .../ignite/internal/binary/package-info.java    |   2 +-
 .../streams/BinaryAbstractInputStream.java      |   2 +-
 .../streams/BinaryAbstractOutputStream.java     |   2 +-
 .../binary/streams/BinaryAbstractStream.java    |   2 +-
 .../binary/streams/BinaryHeapInputStream.java   |   2 +-
 .../binary/streams/BinaryHeapOutputStream.java  |   2 +-
 .../binary/streams/BinaryInputStream.java       |   2 +-
 .../streams/BinaryOffheapInputStream.java       |   2 +-
 .../streams/BinaryOffheapOutputStream.java      |   2 +-
 .../binary/streams/BinaryOutputStream.java      |   2 +-
 .../internal/binary/streams/BinaryStream.java   |   2 +-
 .../internal/binary/streams/package-info.java   |   2 +-
 .../internal/client/GridClientCacheFlag.java    |  10 +-
 .../internal/client/GridClientCompute.java      |   4 +-
 .../client/GridClientConfiguration.java         |   4 +-
 .../client/impl/GridClientComputeImpl.java      |  20 +-
 .../impl/connection/GridClientConnection.java   |   6 +-
 .../GridClientConnectionManagerAdapter.java     |   6 +-
 .../connection/GridClientNioTcpConnection.java  |  34 +-
 .../CacheDefaultBinaryAffinityKeyMapper.java    |   4 +-
 .../processors/cache/CacheInvokeEntry.java      |  10 +-
 .../processors/cache/CacheLazyEntry.java        |  28 +-
 .../processors/cache/CacheObjectContext.java    |  68 ++--
 .../processors/cache/CacheOperationContext.java |  12 +-
 .../processors/cache/GridCacheAdapter.java      | 100 +++---
 .../cache/GridCacheConcurrentMap.java           |   2 +-
 .../processors/cache/GridCacheContext.java      |  36 +-
 .../processors/cache/GridCacheEntryEx.java      |   8 +-
 .../processors/cache/GridCacheEventManager.java |  24 +-
 .../processors/cache/GridCacheMapEntry.java     |  54 +--
 .../cache/GridCacheOffheapSwapEntry.java        |   4 +-
 .../processors/cache/GridCacheProxyImpl.java    |   2 +-
 .../processors/cache/GridCacheReturn.java       |  10 +-
 .../processors/cache/IgniteCacheProxy.java      |  36 +-
 .../processors/cache/IgniteInternalCache.java   |  48 +--
 .../cache/binary/BinaryMetadataKey.java         |   2 +-
 .../CacheDefaultBinaryAffinityKeyMapper.java    |   4 +-
 .../cache/binary/CacheObjectBinaryContext.java  |  16 +-
 .../binary/CacheObjectBinaryProcessor.java      |  14 +-
 .../binary/CacheObjectBinaryProcessorImpl.java  | 132 ++++----
 .../cache/binary/IgniteBinaryImpl.java          |   8 +-
 .../processors/cache/binary/package-info.java   |   2 +-
 .../CacheDataStructuresManager.java             |   6 +-
 .../distributed/GridDistributedLockRequest.java |   2 +-
 .../dht/CacheDistributedGetFutureAdapter.java   |  10 +-
 .../distributed/dht/GridDhtCacheAdapter.java    |   8 +-
 .../cache/distributed/dht/GridDhtGetFuture.java |   4 +-
 .../dht/GridPartitionedGetFuture.java           |  14 +-
 .../dht/GridPartitionedSingleGetFuture.java     |  12 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  26 +-
 .../dht/atomic/GridDhtAtomicUpdateRequest.java  |   4 +-
 .../dht/atomic/GridNearAtomicUpdateFuture.java  |   4 +-
 .../dht/atomic/GridNearAtomicUpdateRequest.java |   4 +-
 .../dht/colocated/GridDhtColocatedCache.java    |  36 +-
 .../distributed/near/GridNearAtomicCache.java   |  10 +-
 .../distributed/near/GridNearCacheAdapter.java  |  10 +-
 .../distributed/near/GridNearGetFuture.java     |  22 +-
 .../near/GridNearTransactionalCache.java        |  12 +-
 .../cache/distributed/near/GridNearTxLocal.java |   6 +-
 .../local/atomic/GridLocalAtomicCache.java      |  74 ++---
 .../query/GridCacheDistributedQueryManager.java |   8 +-
 .../cache/query/GridCacheQueryAdapter.java      |  32 +-
 .../query/GridCacheQueryFutureAdapter.java      |   4 +-
 .../cache/query/GridCacheQueryManager.java      |  64 ++--
 .../cache/query/GridCacheQueryRequest.java      |  22 +-
 .../continuous/CacheContinuousQueryEvent.java   |   8 +-
 .../cache/store/CacheOsStoreManager.java        |   8 +-
 .../cache/store/CacheStoreManager.java          |  10 +-
 .../store/GridCacheStoreManagerAdapter.java     |  18 +-
 .../transactions/IgniteTxLocalAdapter.java      |  44 +--
 .../cache/transactions/IgniteTxLocalEx.java     |   6 +-
 .../cacheobject/IgniteCacheObjectProcessor.java |  16 +-
 .../IgniteCacheObjectProcessorImpl.java         |   6 +-
 .../processors/cacheobject/NoOpBinary.java      |   2 +-
 .../datastreamer/DataStreamerEntry.java         |   6 +-
 .../platform/PlatformAbstractPredicate.java     |   6 +-
 .../platform/PlatformAbstractTarget.java        |  14 +-
 .../processors/platform/PlatformContext.java    |   4 +-
 .../platform/PlatformContextImpl.java           |   6 +-
 .../platform/PlatformNoopProcessor.java         |   4 +-
 .../processors/platform/PlatformProcessor.java  |   8 +-
 .../platform/PlatformProcessorImpl.java         |  34 +-
 .../platform/cache/PlatformCache.java           |  28 +-
 .../cache/PlatformCacheEntryFilterImpl.java     |   2 +-
 .../cache/PlatformCacheEntryProcessorImpl.java  |  10 +-
 .../PlatformCachePartialUpdateException.java    |  12 +-
 .../callback/PlatformCallbackGateway.java       |   8 +-
 .../callback/PlatformCallbackUtils.java         |   6 +-
 .../cluster/PlatformClusterNodeFilterImpl.java  |   2 +-
 .../platform/compute/PlatformCompute.java       |  12 +-
 .../datastreamer/PlatformDataStreamer.java      |  10 +-
 .../PlatformStreamReceiverImpl.java             |  16 +-
 .../dotnet/PlatformDotNetCacheStore.java        |  12 +-
 .../PlatformDotNetConfigurationClosure.java     |   2 +-
 .../dotnet/PlatformDotNetServiceImpl.java       |   8 +-
 .../events/PlatformEventFilterListenerImpl.java |   2 +-
 .../messaging/PlatformMessageFilterImpl.java    |   2 +-
 .../services/PlatformAbstractService.java       |  26 +-
 .../platform/services/PlatformService.java      |   6 +-
 .../platform/services/PlatformServices.java     |  26 +-
 .../query/GridQueryCacheObjectsIterator.java    |  14 +-
 .../processors/query/GridQueryProcessor.java    |  72 ++--
 .../message/GridClientBinaryMetaData.java       |   2 +-
 .../client/message/GridClientTaskRequest.java   |  14 +-
 .../internal/visor/util/VisorMimeTypes.java     |  10 +-
 .../marshaller/portable/package-info.java       |  22 --
 .../PlatformDotNetBinaryConfiguration.java      |   6 +-
 .../dotnet/PlatformDotNetConfiguration.java     |   8 +-
 .../ignite/spi/discovery/tcp/ServerImpl.java    |   4 +-
 .../java/org/jsr166/ConcurrentHashMap8.java     |   2 +-
 .../resources/META-INF/classnames.properties    |  12 +-
 .../ignite/binary/test1/1.1/test1-1.1.jar       | Bin 0 -> 2548 bytes
 .../ignite/binary/test1/1.1/test1-1.1.pom       |   9 +
 .../binary/test1/maven-metadata-local.xml       |  12 +
 .../ignite/binary/test2/1.1/test2-1.1.jar       | Bin 0 -> 1361 bytes
 .../ignite/binary/test2/1.1/test2-1.1.pom       |   9 +
 .../binary/test2/maven-metadata-local.xml       |  12 +
 .../binary/BinaryFieldsAbstractSelfTest.java    |  30 +-
 .../binary/BinaryFieldsHeapSelfTest.java        |   6 +-
 .../binary/BinaryFieldsOffheapSelfTest.java     |   6 +-
 .../BinaryFooterOffsetsAbstractSelfTest.java    |  14 +-
 .../binary/BinaryFooterOffsetsHeapSelfTest.java |   4 +-
 .../BinaryFooterOffsetsOffheapSelfTest.java     |   4 +-
 .../binary/BinaryMarshallerSelfTest.java        | 330 +++++++++----------
 .../BinaryObjectBuilderAdditionalSelfTest.java  |  38 +--
 .../binary/BinaryObjectBuilderSelfTest.java     |  50 +--
 .../binary/GridBinaryAffinityKeySelfTest.java   |   2 +-
 ...GridBinaryMarshallerCtxDisabledSelfTest.java |  12 +-
 .../binary/GridBinaryMetaDataSelfTest.java      |  30 +-
 .../binary/GridBinaryWildcardsSelfTest.java     | 126 +++----
 .../mutabletest/GridBinaryTestClasses.java      |  12 +-
 .../BinaryFieldsHeapNonCompactSelfTest.java     |   2 +-
 .../BinaryFieldsOffheapNonCompactSelfTest.java  |   2 +-
 ...naryFooterOffsetsHeapNonCompactSelfTest.java |   2 +-
 ...yFooterOffsetsOffheapNonCompactSelfTest.java |   2 +-
 .../BinaryObjectBuilderNonCompactSelfTest.java  |   2 +-
 .../GridCacheOffHeapTieredAbstractSelfTest.java |   8 +-
 .../GridCacheOnCopyFlagAbstractSelfTest.java    |   6 +-
 .../processors/cache/GridCacheTestEntryEx.java  |   8 +-
 .../GridBinaryCacheEntryMemorySizeSelfTest.java |   2 +-
 ...ryDuplicateIndexObjectsAbstractSelfTest.java |  20 +-
 ...naryObjectsAbstractDataStreamerSelfTest.java |   2 +-
 ...aryObjectsAbstractMultiThreadedSelfTest.java |  10 +-
 .../GridCacheBinaryObjectsAbstractSelfTest.java |  56 ++--
 .../GridCacheBinaryStoreAbstractSelfTest.java   |   4 +-
 .../GridCacheBinaryStoreBinariesSelfTest.java   |  10 +-
 .../GridCacheBinaryStoreObjectsSelfTest.java    |   2 +-
 ...ntNodeBinaryObjectMetadataMultinodeTest.java |  28 +-
 ...CacheClientNodeBinaryObjectMetadataTest.java |   2 +-
 .../GridDataStreamerImplSelfTest.java           |  22 +-
 ...BinaryObjectsAtomicNearDisabledSelfTest.java |   2 +-
 .../GridCacheBinaryObjectsAtomicSelfTest.java   |   2 +-
 ...yObjectsPartitionedNearDisabledSelfTest.java |   2 +-
 ...idCacheBinaryObjectsPartitionedSelfTest.java |   2 +-
 ...dCacheOffHeapTieredAtomicBinarySelfTest.java |   2 +-
 .../GridCacheOffHeapTieredBinarySelfTest.java   |   2 +-
 ...fHeapTieredEvictionAtomicBinarySelfTest.java |  12 +-
 ...acheOffHeapTieredEvictionBinarySelfTest.java |  12 +-
 ...ridCacheBinaryObjectsReplicatedSelfTest.java |   2 +-
 .../GridCacheBinaryObjectsLocalSelfTest.java    |   2 +-
 .../platform/PlatformComputeEchoTask.java       |  20 +-
 .../session/GridSessionCheckpointSelfTest.java  |   2 +-
 .../junits/IgniteTestResources.java             |   2 +-
 .../IgniteBinaryCacheFullApiTestSuite.java      |   2 +-
 .../testsuites/IgniteBinaryCacheTestSuite.java  |   8 +-
 .../IgniteBinaryObjectsCacheTestSuite3.java     |   2 +-
 .../IgniteBinaryObjectsTestSuite.java           |   2 +-
 .../ignite/binary/test1/1.1/test1-1.1.jar       | Bin 2548 -> 0 bytes
 .../ignite/binary/test1/1.1/test1-1.1.pom       |   9 -
 .../binary/test1/maven-metadata-local.xml       |  12 -
 .../ignite/binary/test2/1.1/test2-1.1.jar       | Bin 1361 -> 0 bytes
 .../ignite/binary/test2/1.1/test2-1.1.pom       |   9 -
 .../binary/test2/maven-metadata-local.xml       |  12 -
 .../processors/query/h2/IgniteH2Indexing.java   |  10 +-
 .../h2/twostep/GridReduceQueryExecutor.java     |   8 +-
 ...niteCacheP2pUnmarshallingQueryErrorTest.java |  14 +-
 .../IgniteBinaryCacheQueryTestSuite.java        |   8 +-
 parent/pom.xml                                  |  12 +-
 220 files changed, 1630 insertions(+), 1652 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/examples/src/test/java/org/apache/ignite/examples/CacheClientBinaryExampleTest.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/examples/CacheClientBinaryExampleTest.java b/examples/src/test/java/org/apache/ignite/examples/CacheClientBinaryExampleTest.java
index d5f8cc0..01be0bc 100644
--- a/examples/src/test/java/org/apache/ignite/examples/CacheClientBinaryExampleTest.java
+++ b/examples/src/test/java/org/apache/ignite/examples/CacheClientBinaryExampleTest.java
@@ -27,20 +27,20 @@ import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest;
 public class CacheClientBinaryExampleTest extends GridAbstractExamplesTest {
     /** {@inheritDoc} */
     @Override protected String defaultConfig() {
-        return "examples/config/portable/example-ignite-portable.xml";
+        return "examples/config/binary/example-ignite-binary.xml";
     }
 
     /**
      * @throws Exception If failed.
      */
-    public void testPortablePutGetExample() throws Exception {
+    public void testBinaryPutGetExample() throws Exception {
         CacheClientBinaryPutGetExample.main(new String[] {});
     }
 
     /**
      * @throws Exception If failed.
      */
-    public void testPortableQueryExample() throws Exception {
+    public void testBinaryQueryExample() throws Exception {
         CacheClientBinaryQueryExample.main(new String[] {});
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/examples/src/test/java/org/apache/ignite/examples/ComputeClientBinaryExampleTest.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/examples/ComputeClientBinaryExampleTest.java b/examples/src/test/java/org/apache/ignite/examples/ComputeClientBinaryExampleTest.java
index bdba7c3..5dcad62 100644
--- a/examples/src/test/java/org/apache/ignite/examples/ComputeClientBinaryExampleTest.java
+++ b/examples/src/test/java/org/apache/ignite/examples/ComputeClientBinaryExampleTest.java
@@ -25,13 +25,13 @@ import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest;
 public class ComputeClientBinaryExampleTest extends GridAbstractExamplesTest {
     /** {@inheritDoc} */
     @Override protected String defaultConfig() {
-        return "examples/config/portable/example-ignite-portable.xml";
+        return "examples/config/binary/example-ignite-binary.xml";
     }
 
     /**
      * @throws Exception If failed.
      */
-    public void testPortableTaskExecutionExample() throws Exception {
+    public void testBinaryTaskExecutionExample() throws Exception {
         ComputeClientBinaryTaskExecutionExample.main(new String[] {});
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java b/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java
index 54fa8a3..fcf9be9 100644
--- a/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java
+++ b/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java
@@ -88,7 +88,7 @@ public class IgniteExamplesSelfTestSuite extends TestSuite {
         suite.addTest(new TestSuite(MemcacheRestExamplesMultiNodeSelfTest.class));
         suite.addTest(new TestSuite(MonteCarloExamplesMultiNodeSelfTest.class));
 
-        // Portable.
+        // Binary.
         suite.addTest(new TestSuite(CacheClientBinaryExampleTest.class));
         suite.addTest(new TestSuite(ComputeClientBinaryExampleTest.class));
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientCacheFlagsCodecTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientCacheFlagsCodecTest.java b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientCacheFlagsCodecTest.java
index bd7ca71..22e9a25 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientCacheFlagsCodecTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/client/impl/ClientCacheFlagsCodecTest.java
@@ -26,7 +26,7 @@ import org.apache.ignite.internal.client.impl.connection.GridClientConnection;
 import org.apache.ignite.internal.processors.rest.handlers.cache.GridCacheCommandHandler;
 import org.apache.ignite.internal.util.typedef.F;
 
-import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_PORTABLES;
+import static org.apache.ignite.internal.client.GridClientCacheFlag.KEEP_BINARIES;
 
 /**
  * Tests conversions between GridClientCacheFlag.
@@ -37,7 +37,7 @@ public class ClientCacheFlagsCodecTest extends TestCase {
      */
     public void testEncodingDecodingFullness() {
         for (GridClientCacheFlag f : GridClientCacheFlag.values()) {
-            if (f == KEEP_PORTABLES)
+            if (f == KEEP_BINARIES)
                 continue;
 
             int bits = GridClientConnection.encodeCacheFlags(Collections.singleton(f));
@@ -71,8 +71,8 @@ public class ClientCacheFlagsCodecTest extends TestCase {
 
         boolean out = GridCacheCommandHandler.parseCacheFlags(bits);
 
-        int length = flagSet.contains(KEEP_PORTABLES) ? flagSet.size() - 1 : flagSet.size();
+        int length = flagSet.contains(KEEP_BINARIES) ? flagSet.size() - 1 : flagSet.size();
 
         assertEquals(length > 0, out);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/clients/src/test/resources/spring-server-node.xml
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/resources/spring-server-node.xml b/modules/clients/src/test/resources/spring-server-node.xml
index 176f0d5..f52640b 100644
--- a/modules/clients/src/test/resources/spring-server-node.xml
+++ b/modules/clients/src/test/resources/spring-server-node.xml
@@ -123,12 +123,12 @@
                         </bean>
                     </property>
 
-                    <property name="portableEnabled" value="true"/>
+                    <property name="binaryEnabled" value="true"/>
 
                     <property name="typeMetadata">
                         <list>
                             <bean class="org.apache.ignite.cache.CacheTypeMetadata">
-                                <property name="valueType" value="GridPortablePerson"/>
+                                <property name="valueType" value="GridBinaryPerson"/>
                                 <property name="ascendingFields">
                                     <map>
                                         <entry key="age" value="java.lang.Integer"/>
@@ -146,7 +146,7 @@
                                 </property>
                             </bean>
                             <bean class="org.apache.ignite.cache.CacheTypeMetadata">
-                                <property name="valueType" value="GridImplicitPortablePerson"/>
+                                <property name="valueType" value="GridImplicitBinaryPerson"/>
                                 <property name="ascendingFields">
                                     <map>
                                         <entry key="age" value="java.lang.Integer"/>
@@ -159,7 +159,7 @@
                                 </property>
                             </bean>
                             <bean class="org.apache.ignite.cache.CacheTypeMetadata">
-                                <property name="valueType" value="GridNoDefPortablePerson"/>
+                                <property name="valueType" value="GridNoDefBinaryPerson"/>
                                 <property name="ascendingFields">
                                     <map>
                                         <entry key="age" value="java.lang.Integer"/>

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/clients/src/test/resources/spring-server-ssl-node.xml
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/resources/spring-server-ssl-node.xml b/modules/clients/src/test/resources/spring-server-ssl-node.xml
index ceaab53..073ac65 100644
--- a/modules/clients/src/test/resources/spring-server-ssl-node.xml
+++ b/modules/clients/src/test/resources/spring-server-ssl-node.xml
@@ -125,12 +125,12 @@
                         </bean>
                     </property>
 
-                    <property name="portableEnabled" value="true"/>
+                    <property name="binaryEnabled" value="true"/>
 
                     <property name="typeMetadata">
                         <list>
                             <bean class="org.apache.ignite.cache.CacheTypeMetadata">
-                                <property name="valueType" value="GridPortablePerson"/>
+                                <property name="valueType" value="GridBinaryPerson"/>
                                 <property name="ascendingFields">
                                     <map>
                                         <entry key="age" value="java.lang.Integer"/>
@@ -148,7 +148,7 @@
                                 </property>
                             </bean>
                             <bean class="org.apache.ignite.cache.CacheTypeMetadata">
-                                <property name="valueType" value="GridImplicitPortablePerson"/>
+                                <property name="valueType" value="GridImplicitBinaryPerson"/>
                                 <property name="ascendingFields">
                                     <map>
                                         <entry key="age" value="java.lang.Integer"/>
@@ -161,7 +161,7 @@
                                 </property>
                             </bean>
                             <bean class="org.apache.ignite.cache.CacheTypeMetadata">
-                                <property name="valueType" value="GridNoDefPortablePerson"/>
+                                <property name="valueType" value="GridNoDefBinaryPerson"/>
                                 <property name="ascendingFields">
                                     <map>
                                         <entry key="age" value="java.lang.Integer"/>

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index e4e975e..065082d 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -36,8 +36,8 @@
 
     <repositories>
         <repository>
-            <id>ignite-portables-test-repo</id>
-            <url>file://${basedir}/src/test/portables/repo</url>
+            <id>ignite-binaries-test-repo</id>
+            <url>file://${basedir}/src/test/binaries/repo</url>
         </repository>
     </repositories>
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java b/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java
index 2f68e7a..450cf70 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteBinary.java
@@ -32,11 +32,11 @@ import org.apache.ignite.binary.BinaryObject;
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Defines portable objects functionality. With portable objects you are able to:
+ * Defines binary objects functionality. With binary objects you are able to:
  * <ul>
  * <li>Seamlessly interoperate between Java, .NET, and C++.</li>
- * <li>Make any object portable with zero code change to your existing code.</li>
- * <li>Nest portable objects within each other.</li>
+ * <li>Make any object binary with zero code change to your existing code.</li>
+ * <li>Nest binary objects within each other.</li>
  * <li>Automatically handle {@code circular} or {@code null} references.</li>
  * <li>Automatically convert collections and maps between Java, .NET, and C++.</li>
  * <li>
@@ -45,24 +45,24 @@ import org.jetbrains.annotations.Nullable;
  * </li>
  * <li>Avoid need to have concrete class definitions on the server side.</li>
  * <li>Dynamically change structure of the classes without having to restart the cluster.</li>
- * <li>Index into portable objects for querying purposes.</li>
+ * <li>Index into binary objects for querying purposes.</li>
  * </ul>
- * <h1 class="header">Working With Portables Directly</h1>
- * Once an object is defined as portable,
- * Ignite will always store it in memory in the portable (i.e. binary) format.
- * User can choose to work either with the portable format or with the deserialized form
+ * <h1 class="header">Working With Binaries Directly</h1>
+ * Once an object is defined as binary,
+ * Ignite will always store it in memory in the binary (i.e. binary) format.
+ * User can choose to work either with the binary format or with the deserialized form
  * (assuming that class definitions are present in the classpath).
  * <p>
- * To work with the portable format directly, user should create a special cache projection
+ * To work with the binary format directly, user should create a special cache projection
  * using IgniteCache.withKeepBinary() method and then retrieve individual fields as needed:
  * <pre name=code class=java>
- * IgniteCache&lt;PortableObject, PortableObject&gt; prj = cache.withKeepBinary();
+ * IgniteCache&lt;BinaryObject, BinaryObject&gt; prj = cache.withKeepBinary();
  *
- * // Convert instance of MyKey to portable format.
- * // We could also use PortableBuilder to create the key in portable format directly.
- * PortableObject key = grid.binary().toBinary(new MyKey());
+ * // Convert instance of MyKey to binary format.
+ * // We could also use BinaryBuilder to create the key in binary format directly.
+ * BinaryObject key = grid.binary().toBinary(new MyKey());
  *
- * PortableObject val = prj.get(key);
+ * BinaryObject val = prj.get(key);
  *
  * String field = val.field("myFieldName");
  * </pre>
@@ -76,14 +76,14 @@ import org.jetbrains.annotations.Nullable;
  * // Normal java getter.
  * String fieldVal = val.getMyFieldName();
  * </pre>
- * If we used, for example, one of the automatically handled portable types for a key, like integer,
- * and still wanted to work with binary portable format for values, then we would declare cache projection
+ * If we used, for example, one of the automatically handled binary types for a key, like integer,
+ * and still wanted to work with binary binary format for values, then we would declare cache projection
  * as follows:
  * <pre name=code class=java>
- * IgniteCache&lt;Integer.class, PortableObject&gt; prj = cache.withKeepBinary();
+ * IgniteCache&lt;Integer.class, BinaryObject&gt; prj = cache.withKeepBinary();
  * </pre>
- * <h1 class="header">Automatic Portable Types</h1>
- * Note that only portable classes are converted to {@link org.apache.ignite.binary.BinaryObject} format. Following
+ * <h1 class="header">Automatic Binary Types</h1>
+ * Note that only binary classes are converted to {@link org.apache.ignite.binary.BinaryObject} format. Following
  * classes are never converted (e.g., {@link #toBinary(Object)} method will return original
  * object, and instances of these classes will be stored in cache without changes):
  * <ul>
@@ -96,74 +96,74 @@ import org.jetbrains.annotations.Nullable;
  *     <li>Enums and array of enums</li>
  *     <li>
  *         Maps, collections and array of objects (but objects inside
- *         them will still be converted if they are portable)
+ *         them will still be converted if they are binary)
  *     </li>
  * </ul>
  * <h1 class="header">Working With Maps and Collections</h1>
- * All maps and collections in the portable objects are serialized automatically. When working
+ * All maps and collections in the binary objects are serialized automatically. When working
  * with different platforms, e.g. C++ or .NET, Ignite will automatically pick the most
  * adequate collection or map in either language. For example, {@link ArrayList} in Java will become
  * {@code List} in C#, {@link LinkedList} in Java is {@link LinkedList} in C#, {@link HashMap}
  * in Java is {@code Dictionary} in C#, and {@link TreeMap} in Java becomes {@code SortedDictionary}
  * in C#, etc.
- * <h1 class="header">Building Portable Objects</h1>
- * Ignite comes with {@link org.apache.ignite.binary.BinaryObjectBuilder} which allows to build portable objects dynamically:
+ * <h1 class="header">Building Binary Objects</h1>
+ * Ignite comes with {@link org.apache.ignite.binary.BinaryObjectBuilder} which allows to build binary objects dynamically:
  * <pre name=code class=java>
- * PortableBuilder builder = Ignition.ignite().binary().builder();
+ * BinaryBuilder builder = Ignition.ignite().binary().builder();
  *
  * builder.typeId("MyObject");
  *
  * builder.stringField("fieldA", "A");
  * build.intField("fieldB", "B");
  *
- * PortableObject portableObj = builder.build();
+ * BinaryObject binaryObj = builder.build();
  * </pre>
  * For the cases when class definition is present
  * in the class path, it is also possible to populate a standard POJO and then
- * convert it to portable format, like so:
+ * convert it to binary format, like so:
  * <pre name=code class=java>
  * MyObject obj = new MyObject();
  *
  * obj.setFieldA("A");
  * obj.setFieldB(123);
  *
- * PortableObject portableObj = Ignition.ignite().binary().toBinary(obj);
+ * BinaryObject binaryObj = Ignition.ignite().binary().toBinary(obj);
  * </pre>
- * NOTE: you don't need to convert typed objects to portable format before storing
+ * NOTE: you don't need to convert typed objects to binary format before storing
  * them in cache, Ignite will do that automatically.
- * <h1 class="header">Portable Metadata</h1>
- * Even though Ignite portable protocol only works with hash codes for type and field names
- * to achieve better performance, Ignite provides metadata for all portable types which
+ * <h1 class="header">Binary Metadata</h1>
+ * Even though Ignite binary protocol only works with hash codes for type and field names
+ * to achieve better performance, Ignite provides metadata for all binary types which
  * can be queried ar runtime via any of the {@link IgniteBinary#type(Class)}
- * methods. Having metadata also allows for proper formatting of {@code PortableObject#toString()} method,
- * even when portable objects are kept in binary format only, which may be necessary for audit reasons.
+ * methods. Having metadata also allows for proper formatting of {@code BinaryObject#toString()} method,
+ * even when binary objects are kept in binary format only, which may be necessary for audit reasons.
  * <h1 class="header">Dynamic Structure Changes</h1>
- * Since objects are always cached in the portable binary format, server does not need to
+ * Since objects are always cached in the binary binary format, server does not need to
  * be aware of the class definitions. Moreover, if class definitions are not present or not
- * used on the server, then clients can continuously change the structure of the portable
+ * used on the server, then clients can continuously change the structure of the binary
  * objects without having to restart the cluster. For example, if one client stores a
  * certain class with fields A and B, and another client stores the same class with
- * fields B and C, then the server-side portable object will have the fields A, B, and C.
- * As the structure of a portable object changes, the new fields become available for SQL queries
+ * fields B and C, then the server-side binary object will have the fields A, B, and C.
+ * As the structure of a binary object changes, the new fields become available for SQL queries
  * automatically.
  * <h1 class="header">Configuration</h1>
  * By default all your objects are considered as binary and no specific configuration is needed.
  * The only requirement Ignite imposes is that your object has an empty
  * constructor. Note, that since server side does not have to know the class definition,
- * you only need to list portable objects in configuration on the client side. However, if you
- * list them on the server side as well, then you get the ability to deserialize portable objects
+ * you only need to list binary objects in configuration on the client side. However, if you
+ * list them on the server side as well, then you get the ability to deserialize binary objects
  * into concrete types on the server as well as on the client.
  * <p>
- * Here is an example of portable configuration (note that star (*) notation is supported):
+ * Here is an example of binary configuration (note that star (*) notation is supported):
  * <pre name=code class=xml>
  * ...
- * &lt;!-- Explicit portable objects configuration. --&gt;
+ * &lt;!-- Explicit binary objects configuration. --&gt;
  * &lt;property name="marshaller"&gt;
- *     &lt;bean class="org.apache.ignite.marshaller.portable.PortableMarshaller"&gt;
+ *     &lt;bean class="org.apache.ignite.marshaller.binary.BinaryMarshaller"&gt;
  *         &lt;property name="classNames"&gt;
  *             &lt;list&gt;
- *                 &lt;value&gt;my.package.for.portable.objects.*&lt;/value&gt;
- *                 &lt;value&gt;org.apache.ignite.examples.client.portable.Employee&lt;/value&gt;
+ *                 &lt;value&gt;my.package.for.binary.objects.*&lt;/value&gt;
+ *                 &lt;value&gt;org.apache.ignite.examples.client.binary.Employee&lt;/value&gt;
  *             &lt;/list&gt;
  *         &lt;/property&gt;
  *     &lt;/bean&gt;
@@ -174,7 +174,7 @@ import org.jetbrains.annotations.Nullable;
  * <pre name=code class=java>
  * IgniteConfiguration cfg = new IgniteConfiguration();
  *
- * PortableMarshaller marsh = new PortableMarshaller();
+ * BinaryMarshaller marsh = new BinaryMarshaller();
  *
  * marsh.setClassNames(Arrays.asList(
  *     Employee.class.getName(),
@@ -183,7 +183,7 @@ import org.jetbrains.annotations.Nullable;
  *
  * cfg.setMarshaller(marsh);
  * </pre>
- * You can also specify class name for a portable object via {@link org.apache.ignite.binary.BinaryTypeConfiguration}.
+ * You can also specify class name for a binary object via {@link org.apache.ignite.binary.BinaryTypeConfiguration}.
  * Do it in case if you need to override other configuration properties on per-type level, like
  * ID-mapper, or serializer.
  * <h1 class="header">Custom Affinity Keys</h1>
@@ -191,15 +191,15 @@ import org.jetbrains.annotations.Nullable;
  * storing objects in cache. For example, if you are caching {@code Employee} object with
  * {@code Organization}, and want to colocate employees with organization they work for,
  * so you can process them together, you need to specify an alternate affinity key.
- * With portable objects you would have to do it as following:
+ * With binary objects you would have to do it as following:
  * <pre name=code class=xml>
  * &lt;property name="marshaller"&gt;
- *     &lt;bean class="org.gridgain.grid.marshaller.portable.PortableMarshaller"&gt;
+ *     &lt;bean class="org.gridgain.grid.marshaller.binary.BinaryMarshaller"&gt;
  *         ...
  *         &lt;property name="typeConfigurations"&gt;
  *             &lt;list&gt;
- *                 &lt;bean class="org.apache.ignite.binary.PortableTypeConfiguration"&gt;
- *                     &lt;property name="className" value="org.apache.ignite.examples.client.portable.EmployeeKey"/&gt;
+ *                 &lt;bean class="org.apache.ignite.binary.BinaryTypeConfiguration"&gt;
+ *                     &lt;property name="className" value="org.apache.ignite.examples.client.binary.EmployeeKey"/&gt;
  *                     &lt;property name="affinityKeyFieldName" value="organizationId"/&gt;
  *                 &lt;/bean&gt;
  *             &lt;/list&gt;
@@ -212,19 +212,19 @@ import org.jetbrains.annotations.Nullable;
  * Serialization and deserialization works out-of-the-box in Ignite. However, you can provide your own custom
  * serialization logic by optionally implementing {@link org.apache.ignite.binary.Binarylizable} interface, like so:
  * <pre name=code class=java>
- * public class Address implements PortableMarshalAware {
+ * public class Address implements BinaryMarshalAware {
  *     private String street;
  *     private int zip;
  *
- *     // Empty constructor required for portable deserialization.
+ *     // Empty constructor required for binary deserialization.
  *     public Address() {}
  *
- *     &#64;Override public void writeBinary(PortableWriter writer) throws PortableException {
+ *     &#64;Override public void writeBinary(BinaryWriter writer) throws BinaryException {
  *         writer.writeString("street", street);
  *         writer.writeInt("zip", zip);
  *     }
  *
- *     &#64;Override public void readBinary(PortableReader reader) throws PortableException {
+ *     &#64;Override public void readBinary(BinaryReader reader) throws BinaryException {
  *         street = reader.readString("street");
  *         zip = reader.readInt("zip");
  *     }
@@ -255,7 +255,7 @@ import org.jetbrains.annotations.Nullable;
  * ID-mapper may be provided either globally in {@link org.apache.ignite.configuration.BinaryConfiguration},
  * or for a specific type via {@link org.apache.ignite.binary.BinaryTypeConfiguration} instance.
  * <h1 class="header">Query Indexing</h1>
- * Portable objects can be indexed for querying by specifying index fields in
+ * Binary objects can be indexed for querying by specifying index fields in
  * {@link org.apache.ignite.cache.CacheTypeMetadata} inside of specific
  * {@link org.apache.ignite.configuration.CacheConfiguration} instance,
  * like so:
@@ -273,7 +273,7 @@ import org.jetbrains.annotations.Nullable;
  *                     &lt;map&gt;
  *                     &lt;entry key="name" value="java.lang.String"/&gt;
  *
- *                         &lt;!-- Nested portable objects can also be indexed. --&gt;
+ *                         &lt;!-- Nested binary objects can also be indexed. --&gt;
  *                         &lt;entry key="address.zip" value="java.lang.Integer"/&gt;
  *                     &lt;/map&gt;
  *                 &lt;/property&gt;
@@ -302,20 +302,20 @@ public interface IgniteBinary {
     public <T> T toBinary(@Nullable Object obj) throws BinaryObjectException;
 
     /**
-     * Creates new portable builder.
+     * Creates new binary builder.
      *
      * @param typeName Type name.
-     * @return Newly portable builder.
+     * @return Newly binary builder.
      */
     public BinaryObjectBuilder builder(String typeName) throws BinaryObjectException;
 
     /**
-     * Creates portable builder initialized by existing portable object.
+     * Creates binary builder initialized by existing binary object.
      *
-     * @param portableObj Portable object to initialize builder.
-     * @return Portable builder.
+     * @param binaryObj Binary object to initialize builder.
+     * @return Binary builder.
      */
-    public BinaryObjectBuilder builder(BinaryObject portableObj) throws BinaryObjectException;
+    public BinaryObjectBuilder builder(BinaryObject binaryObj) throws BinaryObjectException;
 
     /**
      * Gets metadata for provided class.

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
index 3376abc..f98d50a 100644
--- a/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/IgniteCache.java
@@ -138,7 +138,7 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
      * so keys and values will be returned from cache API methods without changes. Therefore,
      * signature of the cache can contain only following types:
      * <ul>
-     *     <li><code>org.apache.ignite.binary.PortableObject</code> for portable classes</li>
+     *     <li><code>org.apache.ignite.binary.BinaryObject</code> for binary classes</li>
      *     <li>All primitives (byte, int, ...) and there boxed versions (Byte, Integer, ...)</li>
      *     <li>Arrays of primitives (byte[], int[], ...)</li>
      *     <li>{@link String} and array of {@link String}s</li>
@@ -148,7 +148,7 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
      *     <li>Enums and array of enums</li>
      *     <li>
      *         Maps, collections and array of objects (but objects inside
-     *         them will still be converted if they are portable)
+     *         them will still be converted if they are binary)
      *     </li>
      * </ul>
      * <p>
@@ -158,7 +158,7 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
      * <pre>
      * IgniteCache<Integer, BinaryObject> prj = cache.withKeepBinary();
      *
-     * // Value is not deserialized and returned in portable format.
+     * // Value is not deserialized and returned in binary format.
      * BinaryObject po = prj.get(1);
      * </pre>
      * <p>
@@ -166,7 +166,7 @@ public interface IgniteCache<K, V> extends javax.cache.Cache<K, V>, IgniteAsyncS
      * if default marshaller is used.
      * If not, this method is no-op and will return current cache.
      *
-     * @return New cache instance for portable objects.
+     * @return New cache instance for binary objects.
      */
     public <K1, V1> IgniteCache<K1, V1> withKeepBinary();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java
index be7a156..93a9469 100644
--- a/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java
+++ b/modules/core/src/main/java/org/apache/ignite/binary/BinaryReader.java
@@ -25,7 +25,7 @@ import java.util.Map;
 import java.util.UUID;
 
 /**
- * Reader for portable objects used in {@link Binarylizable} implementations.
+ * Reader for binary objects used in {@link Binarylizable} implementations.
  * Useful for the cases when user wants a fine-grained control over serialization.
  * <p>
  * Note that Ignite never writes full strings for field or type names. Instead,
@@ -286,4 +286,4 @@ public interface BinaryReader {
      * @return Raw reader.
      */
     public BinaryRawReader rawReader();
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java
index c879da6..fb5b039 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/affinity/AffinityNodeHashResolver.java
@@ -29,8 +29,8 @@ import org.apache.ignite.configuration.IgniteConfiguration;
  * will help to map keys to the same nodes whenever possible.
  * <p>
  * Note that on case clients exist they will query this object from the server and use it for affinity calculation.
- * Therefore you must ensure that server and clients can marshal and unmarshal this object in portable format,
- * i.e. all parties have object class(es) configured as portable.
+ * Therefore you must ensure that server and clients can marshal and unmarshal this object in binary format,
+ * i.e. all parties have object class(es) configured as binary.
  *
  * @deprecated Use {@link IgniteConfiguration#setConsistentId(Serializable)} instead.
  */
@@ -44,4 +44,4 @@ public interface AffinityNodeHashResolver extends Serializable {
      */
     @Deprecated
     public Object resolve(ClusterNode node);
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java
index 6d8f918..1151245 100644
--- a/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/configuration/BinaryConfiguration.java
@@ -44,7 +44,7 @@ public class BinaryConfiguration {
     private boolean compactFooter = DFLT_COMPACT_FOOTER;
 
     /**
-     * Sets class names of portable objects explicitly.
+     * Sets class names of binary objects explicitly.
      *
      * @param clsNames Class names.
      */
@@ -112,7 +112,7 @@ public class BinaryConfiguration {
 
     /**
      * Get whether to write footers in compact form. When enabled, Ignite will not write fields metadata
-     * when serializing objects, because internally {@code PortableMarshaller} already distribute metadata inside
+     * when serializing objects, because internally {@code BinaryMarshaller} already distribute metadata inside
      * cluster. This increases serialization performance.
      * <p>
      * <b>WARNING!</b> This mode should be disabled when already serialized data can be taken from some external

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java
index 946b686..ba04403 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteNodeAttributes.java
@@ -141,8 +141,8 @@ public final class IgniteNodeAttributes {
     /** Node consistent id. */
     public static final String ATTR_NODE_CONSISTENT_ID = ATTR_PREFIX + ".consistent.id";
 
-    /** Portable protocol version. */
-    public static final String ATTR_PORTABLE_PROTO_VER = ATTR_PREFIX + ".portable.proto.ver";
+    /** Binary protocol version. */
+    public static final String ATTR_BINARY_PROTO_VER = ATTR_PREFIX + ".binary.proto.ver";
 
     /**
      * Enforces singleton.

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
index 0c3275e..4a93bf6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
@@ -53,7 +53,7 @@ import static java.lang.reflect.Modifier.isStatic;
 import static java.lang.reflect.Modifier.isTransient;
 
 /**
- * Portable class descriptor.
+ * Binary class descriptor.
  */
 public class BinaryClassDescriptor {
     /** */
@@ -167,9 +167,9 @@ public class BinaryClassDescriptor {
             mode = BinaryWriteMode.EXCLUSION;
         else {
             if (cls == BinaryEnumObjectImpl.class)
-                mode = BinaryWriteMode.PORTABLE_ENUM;
+                mode = BinaryWriteMode.BINARY_ENUM;
             else
-                mode = serializer != null ? BinaryWriteMode.PORTABLE : BinaryUtils.mode(cls);
+                mode = serializer != null ? BinaryWriteMode.BINARY : BinaryUtils.mode(cls);
         }
 
         switch (mode) {
@@ -210,9 +210,9 @@ public class BinaryClassDescriptor {
             case OBJECT_ARR:
             case COL:
             case MAP:
-            case PORTABLE_OBJ:
+            case BINARY_OBJ:
             case ENUM:
-            case PORTABLE_ENUM:
+            case BINARY_ENUM:
             case ENUM_ARR:
             case CLASS:
             case EXCLUSION:
@@ -223,7 +223,7 @@ public class BinaryClassDescriptor {
 
                 break;
 
-            case PORTABLE:
+            case BINARY:
             case EXTERNALIZABLE:
                 ctor = constructor(cls);
                 fields = null;
@@ -284,7 +284,7 @@ public class BinaryClassDescriptor {
                 throw new BinaryObjectException("Invalid mode: " + mode);
         }
 
-        if (mode == BinaryWriteMode.PORTABLE || mode == BinaryWriteMode.EXTERNALIZABLE ||
+        if (mode == BinaryWriteMode.BINARY || mode == BinaryWriteMode.EXTERNALIZABLE ||
             mode == BinaryWriteMode.OBJECT) {
             readResolveMtd = U.findNonPublicMethod(cls, "readResolve");
             writeReplaceMtd = U.findNonPublicMethod(cls, "writeReplace");
@@ -362,14 +362,14 @@ public class BinaryClassDescriptor {
     }
 
     /**
-     * @return portableWriteReplace() method
+     * @return binaryWriteReplace() method
      */
     @Nullable Method getWriteReplaceMethod() {
         return writeReplaceMtd;
     }
 
     /**
-     * @return portableReadResolve() method
+     * @return binaryReadResolve() method
      */
     @SuppressWarnings("UnusedDeclaration")
     @Nullable Method getReadResolveMethod() {
@@ -546,8 +546,8 @@ public class BinaryClassDescriptor {
 
                 break;
 
-            case PORTABLE_ENUM:
-                writer.doWritePortableEnum((BinaryEnumObjectImpl)obj);
+            case BINARY_ENUM:
+                writer.doWriteBinaryEnum((BinaryEnumObjectImpl)obj);
 
                 break;
 
@@ -561,12 +561,12 @@ public class BinaryClassDescriptor {
 
                 break;
 
-            case PORTABLE_OBJ:
-                writer.doWritePortableObject((BinaryObjectImpl)obj);
+            case BINARY_OBJ:
+                writer.doWriteBinaryObject((BinaryObjectImpl)obj);
 
                 break;
 
-            case PORTABLE:
+            case BINARY:
                 if (preWrite(writer, obj)) {
                     try {
                         if (serializer != null)
@@ -660,7 +660,7 @@ public class BinaryClassDescriptor {
         Object res;
 
         switch (mode) {
-            case PORTABLE:
+            case BINARY:
                 res = newInstance();
 
                 reader.setHandle(res);

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
index 6293cfe..7f9bacf 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
@@ -75,7 +75,7 @@ import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 
 /**
- * Portable context.
+ * Binary context.
  */
 public class BinaryContext implements Externalizable {
     /** */
@@ -224,7 +224,7 @@ public class BinaryContext implements Externalizable {
     }
 
     /**
-     * @param marsh Portable marshaller.
+     * @param marsh Binary marshaller.
      * @param cfg Configuration.
      * @throws BinaryObjectException In case of error.
      */
@@ -279,7 +279,7 @@ public class BinaryContext implements Externalizable {
                 String clsName = typeCfg.getTypeName();
 
                 if (clsName == null)
-                    throw new BinaryObjectException("Class name is required for portable type configuration.");
+                    throw new BinaryObjectException("Class name is required for binary type configuration.");
 
                 BinaryIdMapper idMapper = globalIdMapper;
 
@@ -675,7 +675,7 @@ public class BinaryContext implements Externalizable {
     }
 
     /**
-     * @return Portable context.
+     * @return Binary context.
      * @throws ObjectStreamException In case of error.
      */
     protected Object readResolve() throws ObjectStreamException {
@@ -685,7 +685,7 @@ public class BinaryContext implements Externalizable {
             if (g == null)
                 throw new IllegalStateException("Failed to find grid for name: " + gridName);
 
-            return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).portableContext();
+            return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).binaryContext();
         }
         catch (IllegalStateException e) {
             throw U.withCause(new InvalidObjectException(e.getMessage()), e);
@@ -695,7 +695,7 @@ public class BinaryContext implements Externalizable {
     /**
      * @param cls Class.
      * @param id Type ID.
-     * @return GridPortableClassDescriptor.
+     * @return GridBinaryClassDescriptor.
      */
     public BinaryClassDescriptor registerPredefinedType(Class<?> cls, int id) {
         String typeName = typeName(cls.getName());
@@ -1047,7 +1047,7 @@ public class BinaryContext implements Externalizable {
         }
 
         /**
-         * Override portable class descriptor.
+         * Override binary class descriptor.
          *
          * @param other Other descriptor.
          * @throws BinaryObjectException If failed.

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/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 3321170..b2ee16f 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
@@ -219,7 +219,7 @@ public class BinaryEnumObjectImpl implements BinaryObjectEx, Externalizable, Cac
 
     /** {@inheritDoc} */
     @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException {
-        this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext();
+        this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java
index 8cf1a11..8050edd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java
@@ -103,8 +103,8 @@ public abstract class BinaryFieldAccessor {
             case TIMESTAMP_ARR:
             case ENUM_ARR:
             case OBJECT_ARR:
-            case PORTABLE_OBJ:
-            case PORTABLE:
+            case BINARY_OBJ:
+            case BINARY:
             case EXTERNALIZABLE:
                 return new DefaultFinalClassAccessor(field, id, mode, false);
 
@@ -608,8 +608,8 @@ public abstract class BinaryFieldAccessor {
 
                     break;
 
-                case PORTABLE_OBJ:
-                    writer.writePortableObjectField((BinaryObjectImpl)val);
+                case BINARY_OBJ:
+                    writer.writeBinaryObjectField((BinaryObjectImpl)val);
 
                     break;
 
@@ -623,7 +623,7 @@ public abstract class BinaryFieldAccessor {
 
                     break;
 
-                case PORTABLE:
+                case BINARY:
                 case EXTERNALIZABLE:
                 case OBJECT:
                     writer.writeObjectField(val);
@@ -809,8 +809,8 @@ public abstract class BinaryFieldAccessor {
 
                     break;
 
-                case PORTABLE_OBJ:
-                    val = reader.readPortableObject(id);
+                case BINARY_OBJ:
+                    val = reader.readBinaryObject(id);
 
                     break;
 
@@ -824,7 +824,7 @@ public abstract class BinaryFieldAccessor {
 
                     break;
 
-                case PORTABLE:
+                case BINARY:
                 case EXTERNALIZABLE:
                 case OBJECT:
                     val = reader.readObject(id);

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java
index 7f51631..78ed17a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java
@@ -24,7 +24,7 @@ import org.apache.ignite.binary.BinaryObject;
 import org.apache.ignite.binary.BinaryField;
 
 /**
- * Implementation of portable field descriptor.
+ * Implementation of binary field descriptor.
  */
 public class BinaryFieldImpl implements BinaryField {
     /** Type ID. */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java
index 03bf9f9..5480967 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java
@@ -81,10 +81,10 @@ public class BinaryMarshaller extends AbstractMarshaller {
     /**
      * Sets {@link BinaryContext}.
      * <p/>
-     * @param ctx Portable context.
+     * @param ctx Binary context.
      */
     @SuppressWarnings("UnusedDeclaration")
-    private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) {
+    private void setBinaryContext(BinaryContext ctx, IgniteConfiguration cfg) {
         ctx.configure(this, cfg);
 
         impl = new GridBinaryMarshaller(ctx);
@@ -116,7 +116,7 @@ public class BinaryMarshaller extends AbstractMarshaller {
     @Override public <T> T unmarshal(InputStream in, @Nullable ClassLoader clsLdr) throws IgniteCheckedException {
         ByteArrayOutputStream buf = new ByteArrayOutputStream();
 
-        // we have to fully read the InputStream because GridPortableMarshaller requires support of a method that
+        // we have to fully read the InputStream because GridBinaryMarshaller requires support of a method that
         // returns number of bytes remaining.
         try {
             byte[] arr = new byte[4096];

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java
index a8ff140..7de73b8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java
@@ -30,7 +30,7 @@ import org.apache.ignite.internal.util.typedef.internal.U;
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Portable metadata which is passed over a wire.
+ * Binary metadata which is passed over a wire.
  */
 public class BinaryMetadata implements Externalizable {
     /** */
@@ -146,7 +146,7 @@ public class BinaryMetadata implements Externalizable {
     /**
      * Wrap metadata into binary type.
      *
-     * @param ctx Portable context.
+     * @param ctx Binary context.
      * @return Binary type.
      */
     public BinaryTypeImpl wrap(BinaryContext ctx) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java
index fea2893..29ff7b3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataHandler.java
@@ -21,7 +21,7 @@ import org.apache.ignite.binary.BinaryObjectException;
 import org.apache.ignite.binary.BinaryType;
 
 /**
- * Portable meta data handler.
+ * Binary meta data handler.
  */
 public interface BinaryMetadataHandler {
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/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 252c495..404300d 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
@@ -29,7 +29,7 @@ import org.apache.ignite.binary.BinaryObject;
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Internal portable object interface.
+ * Internal binary object interface.
  */
 public abstract class BinaryObjectExImpl implements BinaryObjectEx {
     /**
@@ -245,7 +245,7 @@ public abstract class BinaryObjectExImpl implements BinaryObjectEx {
             return toString(ctx, new IdentityHashMap<BinaryObject, Integer>());
         }
         catch (BinaryObjectException e) {
-            throw new IgniteException("Failed to create string representation of portable object.", e);
+            throw new IgniteException("Failed to create string representation of binary object.", e);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/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 9fd5901..2342766 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
@@ -46,7 +46,7 @@ import org.jetbrains.annotations.Nullable;
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 /**
- * Portable object implementation.
+ * Binary object implementation.
  */
 @IgniteCodeGeneratingFail // Fields arr and start should not be generated by MessageCodeGenerator.
 public final class BinaryObjectImpl extends BinaryObjectExImpl implements Externalizable, KeyCacheObject {
@@ -142,7 +142,7 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
 
     /** {@inheritDoc} */
     @Override public void finishUnmarshal(CacheObjectContext ctx, ClassLoader ldr) throws IgniteCheckedException {
-        this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).portableContext();
+        this.ctx = ((CacheObjectBinaryProcessorImpl)ctx.processor()).binaryContext();
     }
 
     /** {@inheritDoc} */
@@ -156,7 +156,7 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
     }
 
     /**
-     * @return Detached portable object.
+     * @return Detached binary object.
      */
     public BinaryObject detach() {
         if (!detachAllowed || detached())
@@ -227,7 +227,7 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
     /** {@inheritDoc} */
     @Nullable @Override public BinaryType type() throws BinaryObjectException {
         if (ctx == null)
-            throw new BinaryObjectException("PortableContext is not set for the object.");
+            throw new BinaryObjectException("BinaryContext is not set for the object.");
 
         return ctx.metadata(typeId());
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/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 1206db7..0246a36 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
@@ -45,7 +45,7 @@ import java.util.UUID;
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 /**
- *  Portable object implementation over offheap memory
+ *  Binary object implementation over offheap memory
  */
 public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Externalizable, CacheObject {
     /** */
@@ -141,7 +141,7 @@ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Exter
     /** {@inheritDoc} */
     @Nullable @Override public BinaryType type() throws BinaryObjectException {
         if (ctx == null)
-            throw new BinaryObjectException("PortableContext is not set for the object.");
+            throw new BinaryObjectException("BinaryContext is not set for the object.");
 
         return ctx.metadata(typeId());
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
index b673e27..8f9cc92 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
@@ -69,7 +69,7 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.NULL;
 import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ;
 import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ_ARR;
 import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OPTM_MARSH;
-import static org.apache.ignite.internal.binary.GridBinaryMarshaller.PORTABLE_OBJ;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.BINARY_OBJ;
 import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT;
 import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT_ARR;
 import static org.apache.ignite.internal.binary.GridBinaryMarshaller.STRING;
@@ -81,11 +81,11 @@ import static org.apache.ignite.internal.binary.GridBinaryMarshaller.UUID;
 import static org.apache.ignite.internal.binary.GridBinaryMarshaller.UUID_ARR;
 
 /**
- * Portable reader implementation.
+ * Binary reader implementation.
  */
 @SuppressWarnings("unchecked")
 public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, BinaryReaderHandlesHolder, ObjectInput {
-    /** Portable context. */
+    /** Binary context. */
     private final BinaryContext ctx;
 
     /** Input stream. */
@@ -185,7 +185,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
 
         start = in.position();
 
-        // Perform full header parsing in case of portable object.
+        // Perform full header parsing in case of binary object.
         if (!skipHdrCheck && (in.readByte() == GridBinaryMarshaller.OBJ)) {
             // Ensure protocol is fine.
             BinaryUtils.checkProtocolVersion(in.readByte());
@@ -312,12 +312,12 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
 
     /**
      * @param fieldId Field ID.
-     * @return Portable object.
+     * @return Binary object.
      * @throws BinaryObjectException In case of error.
      */
-    @Nullable BinaryObject readPortableObject(int fieldId) throws BinaryObjectException {
+    @Nullable BinaryObject readBinaryObject(int fieldId) throws BinaryObjectException {
         if (findFieldById(fieldId)) {
-            if (checkFlag(PORTABLE_OBJ) == Flag.NULL)
+            if (checkFlag(BINARY_OBJ) == Flag.NULL)
                 return null;
 
             return new BinaryObjectImpl(ctx, BinaryUtils.doReadByteArray(in), in.readInt());
@@ -1598,12 +1598,12 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
 
                 break;
 
-            case PORTABLE_OBJ:
-                obj = BinaryUtils.doReadPortableObject(in, ctx);
+            case BINARY_OBJ:
+                obj = BinaryUtils.doReadBinaryObject(in, ctx);
 
                 ((BinaryObjectImpl)obj).context(ctx);
 
-                if (!GridBinaryMarshaller.KEEP_PORTABLES.get())
+                if (!GridBinaryMarshaller.KEEP_BINARIES.get())
                     obj = ((BinaryObject)obj).deserialize();
 
                 break;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java
index 99e642c..156ac0f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java
@@ -26,7 +26,7 @@ import java.util.Iterator;
 import java.util.List;
 
 /**
- * Schema describing portable object content. We rely on the following assumptions:
+ * Schema describing binary object content. We rely on the following assumptions:
  * - When amount of fields in the object is low, it is better to inline these values into int fields thus allowing
  * for quick comparisons performed within already fetched L1 cache line.
  * - When there are more fields, we store them inside a hash map.

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java
index 6920a34..91f29b2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java
@@ -22,7 +22,7 @@ import org.jetbrains.annotations.Nullable;
 import java.util.HashMap;
 
 /**
- * Portable schema registry. Contains all well-known object schemas.
+ * Binary schema registry. Contains all well-known object schemas.
  * <p>
  * We rely on the fact that usually object has only few different schemas. For this reason we inline several
  * of them with optional fallback to normal hash map lookup.

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java
index 23aacb2..d4fd625 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java
@@ -25,7 +25,7 @@ import java.util.Collection;
  * Binary type implementation.
  */
 public class BinaryTypeImpl implements BinaryType {
-    /** Portable context. */
+    /** Binary context. */
     private final BinaryContext ctx;
 
     /** Type metadata. */
@@ -34,7 +34,7 @@ public class BinaryTypeImpl implements BinaryType {
     /**
      * Constructor.
      *
-     * @param ctx Portable context.
+     * @param ctx Binary context.
      * @param meta Type  metadata.
      */
     public BinaryTypeImpl(BinaryContext ctx, BinaryMetadata meta) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/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 d285df5..8b5ec68 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
@@ -58,7 +58,7 @@ import java.util.concurrent.ConcurrentSkipListSet;
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 /**
- * Portable utils.
+ * Binary utils.
  */
 public class BinaryUtils {
     /** */
@@ -70,8 +70,8 @@ public class BinaryUtils {
     /** {@code true} if serialized value of this type cannot contain references to objects. */
     private static final boolean[] PLAIN_TYPE_FLAG = new boolean[102];
 
-    /** Portable classes. */
-    private static final Collection<Class<?>> PORTABLE_CLS = new HashSet<>();
+    /** Binary classes. */
+    private static final Collection<Class<?>> BINARY_CLS = new HashSet<>();
 
     /** Flag: user type. */
     public static final short FLAG_USR_TYP = 0x0001;
@@ -166,32 +166,32 @@ public class BinaryUtils {
             PLAIN_TYPE_FLAG[b] = true;
         }
 
-        PORTABLE_CLS.add(Byte.class);
-        PORTABLE_CLS.add(Short.class);
-        PORTABLE_CLS.add(Integer.class);
-        PORTABLE_CLS.add(Long.class);
-        PORTABLE_CLS.add(Float.class);
-        PORTABLE_CLS.add(Double.class);
-        PORTABLE_CLS.add(Character.class);
-        PORTABLE_CLS.add(Boolean.class);
-        PORTABLE_CLS.add(String.class);
-        PORTABLE_CLS.add(UUID.class);
-        PORTABLE_CLS.add(Date.class);
-        PORTABLE_CLS.add(Timestamp.class);
-        PORTABLE_CLS.add(BigDecimal.class);
-        PORTABLE_CLS.add(byte[].class);
-        PORTABLE_CLS.add(short[].class);
-        PORTABLE_CLS.add(int[].class);
-        PORTABLE_CLS.add(long[].class);
-        PORTABLE_CLS.add(float[].class);
-        PORTABLE_CLS.add(double[].class);
-        PORTABLE_CLS.add(char[].class);
-        PORTABLE_CLS.add(boolean[].class);
-        PORTABLE_CLS.add(String[].class);
-        PORTABLE_CLS.add(UUID[].class);
-        PORTABLE_CLS.add(Date[].class);
-        PORTABLE_CLS.add(Timestamp[].class);
-        PORTABLE_CLS.add(BigDecimal[].class);
+        BINARY_CLS.add(Byte.class);
+        BINARY_CLS.add(Short.class);
+        BINARY_CLS.add(Integer.class);
+        BINARY_CLS.add(Long.class);
+        BINARY_CLS.add(Float.class);
+        BINARY_CLS.add(Double.class);
+        BINARY_CLS.add(Character.class);
+        BINARY_CLS.add(Boolean.class);
+        BINARY_CLS.add(String.class);
+        BINARY_CLS.add(UUID.class);
+        BINARY_CLS.add(Date.class);
+        BINARY_CLS.add(Timestamp.class);
+        BINARY_CLS.add(BigDecimal.class);
+        BINARY_CLS.add(byte[].class);
+        BINARY_CLS.add(short[].class);
+        BINARY_CLS.add(int[].class);
+        BINARY_CLS.add(long[].class);
+        BINARY_CLS.add(float[].class);
+        BINARY_CLS.add(double[].class);
+        BINARY_CLS.add(char[].class);
+        BINARY_CLS.add(boolean[].class);
+        BINARY_CLS.add(String[].class);
+        BINARY_CLS.add(UUID[].class);
+        BINARY_CLS.add(Date[].class);
+        BINARY_CLS.add(Timestamp[].class);
+        BINARY_CLS.add(BigDecimal[].class);
 
         FIELD_TYPE_NAMES = new String[104];
 
@@ -210,7 +210,7 @@ public class BinaryUtils {
         FIELD_TYPE_NAMES[GridBinaryMarshaller.TIMESTAMP] = "Timestamp";
         FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM] = "Enum";
         FIELD_TYPE_NAMES[GridBinaryMarshaller.OBJ] = "Object";
-        FIELD_TYPE_NAMES[GridBinaryMarshaller.PORTABLE_OBJ] = "Object";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.BINARY_OBJ] = "Object";
         FIELD_TYPE_NAMES[GridBinaryMarshaller.COL] = "Collection";
         FIELD_TYPE_NAMES[GridBinaryMarshaller.MAP] = "Map";
         FIELD_TYPE_NAMES[GridBinaryMarshaller.CLASS] = "Class";
@@ -547,7 +547,7 @@ public class BinaryUtils {
 
     /**
      * @param cls Class.
-     * @return Portable field type.
+     * @return Binary field type.
      */
     public static byte typeByClass(Class<?> cls) {
         Byte type = PLAIN_CLASS_TO_FLAG.get(cls);
@@ -571,16 +571,16 @@ public class BinaryUtils {
     }
 
     /**
-     * Tells whether provided type is portable.
+     * Tells whether provided type is binary.
      *
      * @param cls Class to check.
-     * @return Whether type is portable.
+     * @return Whether type is binary.
      */
-    public static boolean isPortableType(Class<?> cls) {
+    public static boolean isBinaryType(Class<?> cls) {
         assert cls != null;
 
         return BinaryObject.class.isAssignableFrom(cls) ||
-            PORTABLE_CLS.contains(cls) ||
+            BINARY_CLS.contains(cls) ||
             cls.isEnum() ||
             (cls.isArray() && cls.getComponentType().isEnum());
     }
@@ -632,7 +632,7 @@ public class BinaryUtils {
     }
 
     /**
-     * Get portable object length.
+     * Get binary object length.
      *
      * @param in Input stream.
      * @param start Start position.
@@ -801,7 +801,7 @@ public class BinaryUtils {
             // Check type name.
             if (!F.eq(oldMeta.typeName(), newMeta.typeName())) {
                 throw new BinaryObjectException(
-                    "Two portable types have duplicate type ID [" + "typeId=" + oldMeta.typeId() +
+                    "Two binary types have duplicate type ID [" + "typeId=" + oldMeta.typeId() +
                         ", typeName1=" + oldMeta.typeName() + ", typeName2=" + newMeta.typeName() + ']'
                 );
             }
@@ -944,9 +944,9 @@ public class BinaryUtils {
         else if (cls.isArray())
             return cls.getComponentType().isEnum() ? BinaryWriteMode.ENUM_ARR : BinaryWriteMode.OBJECT_ARR;
         else if (cls == BinaryObjectImpl.class)
-            return BinaryWriteMode.PORTABLE_OBJ;
+            return BinaryWriteMode.BINARY_OBJ;
         else if (Binarylizable.class.isAssignableFrom(cls))
-            return BinaryWriteMode.PORTABLE;
+            return BinaryWriteMode.BINARY;
         else if (Externalizable.class.isAssignableFrom(cls))
             return BinaryWriteMode.EXTERNALIZABLE;
         else if (isSpecialCollection(cls))
@@ -1249,7 +1249,7 @@ public class BinaryUtils {
     /**
      * @return Value.
      */
-    public static BinaryObject doReadPortableObject(BinaryInputStream in, BinaryContext ctx) {
+    public static BinaryObject doReadBinaryObject(BinaryInputStream in, BinaryContext ctx) {
         if (in.offheapPointer() > 0) {
             int len = in.readInt();
 
@@ -1343,7 +1343,7 @@ public class BinaryUtils {
     /**
      * Resolve the class.
      *
-     * @param ctx Portable context.
+     * @param ctx Binary context.
      * @param typeId Type ID.
      * @param clsName Class name.
      * @param ldr Class loaded.
@@ -1374,26 +1374,26 @@ public class BinaryUtils {
     }
 
     /**
-     * Read portable enum.
+     * Read binary enum.
      *
      * @param in Input stream.
-     * @param ctx Portable context.
+     * @param ctx Binary context.
      * @param type Plain type.
      * @return Enum.
      */
-    private static BinaryEnumObjectImpl doReadPortableEnum(BinaryInputStream in, BinaryContext ctx,
+    private static BinaryEnumObjectImpl doReadBinaryEnum(BinaryInputStream in, BinaryContext ctx,
         EnumType type) {
         return new BinaryEnumObjectImpl(ctx, type.typeId, type.clsName, in.readInt());
     }
 
     /**
-     * Read portable enum array.
+     * Read binary enum array.
      *
      * @param in Input stream.
-     * @param ctx Portable context.
+     * @param ctx Binary context.
      * @return Enum array.
      */
-    private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryContext ctx) {
+    private static Object[] doReadBinaryEnumArray(BinaryInputStream in, BinaryContext ctx) {
         int len = in.readInt();
 
         Object[] arr = (Object[]) Array.newInstance(BinaryObject.class, len);
@@ -1404,7 +1404,7 @@ public class BinaryUtils {
             if (flag == GridBinaryMarshaller.NULL)
                 arr[i] = null;
             else
-                arr[i] = doReadPortableEnum(in, ctx, doReadEnumType(in));
+                arr[i] = doReadBinaryEnum(in, ctx, doReadEnumType(in));
         }
 
         return arr;
@@ -1644,16 +1644,16 @@ public class BinaryUtils {
             case GridBinaryMarshaller.MAP:
                 return doReadMap(in, ctx, ldr, handles, false, null);
 
-            case GridBinaryMarshaller.PORTABLE_OBJ:
-                return doReadPortableObject(in, ctx);
+            case GridBinaryMarshaller.BINARY_OBJ:
+                return doReadBinaryObject(in, ctx);
 
             case GridBinaryMarshaller.ENUM:
-                return doReadPortableEnum(in, ctx, doReadEnumType(in));
+                return doReadBinaryEnum(in, ctx, doReadEnumType(in));
 
             case GridBinaryMarshaller.ENUM_ARR:
                 doReadEnumType(in); // Simply skip this part as we do not need it.
 
-                return doReadPortableEnumArray(in, ctx);
+                return doReadBinaryEnumArray(in, ctx);
 
             case GridBinaryMarshaller.CLASS:
                 return doReadClass(in, ctx, ldr);

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java
index 9a37bdb..90127f4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java
@@ -133,13 +133,13 @@ public enum BinaryWriteMode {
     MAP(GridBinaryMarshaller.MAP),
 
     /** */
-    PORTABLE_OBJ(GridBinaryMarshaller.OBJ),
+    BINARY_OBJ(GridBinaryMarshaller.OBJ),
 
     /** */
     ENUM(GridBinaryMarshaller.ENUM),
 
-    /** Portable enum. */
-    PORTABLE_ENUM(GridBinaryMarshaller.ENUM),
+    /** Binary enum. */
+    BINARY_ENUM(GridBinaryMarshaller.ENUM),
 
     /** */
     ENUM_ARR(GridBinaryMarshaller.ENUM_ARR),
@@ -148,7 +148,7 @@ public enum BinaryWriteMode {
     CLASS(GridBinaryMarshaller.CLASS),
 
     /** */
-    PORTABLE(GridBinaryMarshaller.PORTABLE_OBJ),
+    BINARY(GridBinaryMarshaller.BINARY_OBJ),
 
     /** */
     EXTERNALIZABLE(GridBinaryMarshaller.OBJ),


[39/50] [abbrv] ignite git commit: ignite-1.5 Fixed test to override correct 'getConfiguration' method.

Posted by vo...@apache.org.
ignite-1.5 Fixed test to override correct 'getConfiguration' method.


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

Branch: refs/heads/ignite-2100
Commit: 47f1ced214b4176b13293386c1e2042c9cc20b32
Parents: 484a3af
Author: sboikov <sb...@gridgain.com>
Authored: Mon Dec 14 11:09:17 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Dec 14 11:09:17 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/query/IgniteSqlSplitterSelfTest.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/47f1ced2/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
index 0868fe6..865a0fd 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSplitterSelfTest.java
@@ -45,8 +45,8 @@ public class IgniteSqlSplitterSelfTest extends GridCommonAbstractTest {
     private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
 
     /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration() throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration();
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
 
         cfg.setPeerClassLoadingEnabled(false);
 


[47/50] [abbrv] ignite git commit: Merge remote-tracking branch 'origin/ignite-1.5' into ignite-1.5

Posted by vo...@apache.org.
Merge remote-tracking branch 'origin/ignite-1.5' into ignite-1.5


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

Branch: refs/heads/ignite-2100
Commit: f3cc98b189dd4c4a4ad6325e6b9a6fa6db795099
Parents: fdea7cf 345fc27
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Dec 14 12:21:38 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Dec 14 12:21:38 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    |  26 ++-
 .../resources/META-INF/classnames.properties    |  68 ++++---
 .../cache/GridCacheAbstractFullApiSelfTest.java |  25 ++-
 ...ContinuousQueryFailoverAbstractSelfTest.java | 186 ++++++++++---------
 .../tcp/TcpClientDiscoverySpiMulticastTest.java |  10 +-
 .../query/IgniteSqlSplitterSelfTest.java        |   4 +-
 .../ignite/internal/GridFactorySelfTest.java    |  16 ++
 7 files changed, 203 insertions(+), 132 deletions(-)
----------------------------------------------------------------------



[12/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary"

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableUtils.java
deleted file mode 100644
index 979b70c..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableUtils.java
+++ /dev/null
@@ -1,1909 +0,0 @@
-/*
- * 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.binary;
-
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.binary.BinaryCollectionFactory;
-import org.apache.ignite.binary.BinaryInvalidTypeException;
-import org.apache.ignite.binary.BinaryMapFactory;
-import org.apache.ignite.binary.BinaryObject;
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.Binarylizable;
-import org.apache.ignite.internal.binary.builder.PortableLazyValue;
-import org.apache.ignite.internal.binary.streams.PortableInputStream;
-import org.apache.ignite.internal.binary.builder.PortableLazyValue;
-import org.apache.ignite.internal.binary.streams.PortableInputStream;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteBiTuple;
-import org.jetbrains.annotations.Nullable;
-import org.jsr166.ConcurrentHashMap8;
-
-import java.io.ByteArrayInputStream;
-import java.io.Externalizable;
-import java.lang.reflect.Array;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentSkipListSet;
-
-import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.ARR_LIST;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BOOLEAN;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BOOLEAN_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BYTE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BYTE_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.CHAR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.CHAR_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.CLASS;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.COL;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DATE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DATE_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DECIMAL;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DECIMAL_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DOUBLE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DOUBLE_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.ENUM;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.ENUM_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.FLOAT;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.FLOAT_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.HANDLE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.HASH_MAP;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.HASH_SET;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.INT;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.INT_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.LINKED_HASH_MAP;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.LINKED_HASH_SET;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.LINKED_LIST;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.LONG;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.LONG_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.MAP;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.NULL;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.OBJ;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.OBJECT_TYPE_ID;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.OBJ_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.OPTM_MARSH;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.PORTABLE_OBJ;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.PROTO_VER;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.SHORT;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.SHORT_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.STRING;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.STRING_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.TIMESTAMP;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.TIMESTAMP_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.UNREGISTERED_TYPE_ID;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.USER_COL;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.USER_SET;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.UUID;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.UUID_ARR;
-
-/**
- * Portable utils.
- */
-public class PortableUtils {
-    /** */
-    public static final Map<Class<?>, Byte> PLAIN_CLASS_TO_FLAG = new HashMap<>();
-
-    /** */
-    public static final Map<Byte, Class<?>> FLAG_TO_CLASS = new HashMap<>();
-
-    /** {@code true} if serialized value of this type cannot contain references to objects. */
-    private static final boolean[] PLAIN_TYPE_FLAG = new boolean[102];
-
-    /** Portable classes. */
-    private static final Collection<Class<?>> PORTABLE_CLS = new HashSet<>();
-
-    /** Flag: user type. */
-    public static final short FLAG_USR_TYP = 0x0001;
-
-    /** Flag: only raw data exists. */
-    public static final short FLAG_HAS_SCHEMA = 0x0002;
-
-    /** Flag indicating that object has raw data. */
-    public static final short FLAG_HAS_RAW = 0x0004;
-
-    /** Flag: offsets take 1 byte. */
-    public static final short FLAG_OFFSET_ONE_BYTE = 0x0008;
-
-    /** Flag: offsets take 2 bytes. */
-    public static final short FLAG_OFFSET_TWO_BYTES = 0x0010;
-
-    /** Flag: compact footer, no field IDs. */
-    public static final short FLAG_COMPACT_FOOTER = 0x0020;
-
-    /** Offset which fits into 1 byte. */
-    public static final int OFFSET_1 = 1;
-
-    /** Offset which fits into 2 bytes. */
-    public static final int OFFSET_2 = 2;
-
-    /** Offset which fits into 4 bytes. */
-    public static final int OFFSET_4 = 4;
-
-    /** Field ID length. */
-    public static final int FIELD_ID_LEN = 4;
-
-    /** Field type names. */
-    private static final String[] FIELD_TYPE_NAMES;
-
-    /** FNV1 hash offset basis. */
-    private static final int FNV1_OFFSET_BASIS = 0x811C9DC5;
-
-    /** FNV1 hash prime. */
-    private static final int FNV1_PRIME = 0x01000193;
-
-    /**
-     * Static class initializer.
-     */
-    static {
-        PLAIN_CLASS_TO_FLAG.put(Byte.class, GridPortableMarshaller.BYTE);
-        PLAIN_CLASS_TO_FLAG.put(Short.class, GridPortableMarshaller.SHORT);
-        PLAIN_CLASS_TO_FLAG.put(Integer.class, GridPortableMarshaller.INT);
-        PLAIN_CLASS_TO_FLAG.put(Long.class, GridPortableMarshaller.LONG);
-        PLAIN_CLASS_TO_FLAG.put(Float.class, GridPortableMarshaller.FLOAT);
-        PLAIN_CLASS_TO_FLAG.put(Double.class, GridPortableMarshaller.DOUBLE);
-        PLAIN_CLASS_TO_FLAG.put(Character.class, GridPortableMarshaller.CHAR);
-        PLAIN_CLASS_TO_FLAG.put(Boolean.class, GridPortableMarshaller.BOOLEAN);
-        PLAIN_CLASS_TO_FLAG.put(BigDecimal.class, GridPortableMarshaller.DECIMAL);
-        PLAIN_CLASS_TO_FLAG.put(String.class, GridPortableMarshaller.STRING);
-        PLAIN_CLASS_TO_FLAG.put(UUID.class, GridPortableMarshaller.UUID);
-        PLAIN_CLASS_TO_FLAG.put(Date.class, GridPortableMarshaller.DATE);
-        PLAIN_CLASS_TO_FLAG.put(Timestamp.class, GridPortableMarshaller.TIMESTAMP);
-
-        PLAIN_CLASS_TO_FLAG.put(byte[].class, GridPortableMarshaller.BYTE_ARR);
-        PLAIN_CLASS_TO_FLAG.put(short[].class, GridPortableMarshaller.SHORT_ARR);
-        PLAIN_CLASS_TO_FLAG.put(int[].class, GridPortableMarshaller.INT_ARR);
-        PLAIN_CLASS_TO_FLAG.put(long[].class, GridPortableMarshaller.LONG_ARR);
-        PLAIN_CLASS_TO_FLAG.put(float[].class, GridPortableMarshaller.FLOAT_ARR);
-        PLAIN_CLASS_TO_FLAG.put(double[].class, GridPortableMarshaller.DOUBLE_ARR);
-        PLAIN_CLASS_TO_FLAG.put(char[].class, GridPortableMarshaller.CHAR_ARR);
-        PLAIN_CLASS_TO_FLAG.put(boolean[].class, GridPortableMarshaller.BOOLEAN_ARR);
-        PLAIN_CLASS_TO_FLAG.put(BigDecimal[].class, GridPortableMarshaller.DECIMAL_ARR);
-        PLAIN_CLASS_TO_FLAG.put(String[].class, GridPortableMarshaller.STRING_ARR);
-        PLAIN_CLASS_TO_FLAG.put(UUID[].class, GridPortableMarshaller.UUID_ARR);
-        PLAIN_CLASS_TO_FLAG.put(Date[].class, GridPortableMarshaller.DATE_ARR);
-        PLAIN_CLASS_TO_FLAG.put(Timestamp[].class, GridPortableMarshaller.TIMESTAMP_ARR);
-
-        for (Map.Entry<Class<?>, Byte> entry : PLAIN_CLASS_TO_FLAG.entrySet())
-            FLAG_TO_CLASS.put(entry.getValue(), entry.getKey());
-
-        PLAIN_CLASS_TO_FLAG.put(byte.class, GridPortableMarshaller.BYTE);
-        PLAIN_CLASS_TO_FLAG.put(short.class, GridPortableMarshaller.SHORT);
-        PLAIN_CLASS_TO_FLAG.put(int.class, GridPortableMarshaller.INT);
-        PLAIN_CLASS_TO_FLAG.put(long.class, GridPortableMarshaller.LONG);
-        PLAIN_CLASS_TO_FLAG.put(float.class, GridPortableMarshaller.FLOAT);
-        PLAIN_CLASS_TO_FLAG.put(double.class, GridPortableMarshaller.DOUBLE);
-        PLAIN_CLASS_TO_FLAG.put(char.class, GridPortableMarshaller.CHAR);
-        PLAIN_CLASS_TO_FLAG.put(boolean.class, GridPortableMarshaller.BOOLEAN);
-
-        for (byte b : new byte[] {
-            GridPortableMarshaller.BYTE, GridPortableMarshaller.SHORT, GridPortableMarshaller.INT, GridPortableMarshaller.LONG, GridPortableMarshaller.FLOAT, GridPortableMarshaller.DOUBLE,
-            GridPortableMarshaller.CHAR, GridPortableMarshaller.BOOLEAN, GridPortableMarshaller.DECIMAL, GridPortableMarshaller.STRING, GridPortableMarshaller.UUID, GridPortableMarshaller.DATE, GridPortableMarshaller.TIMESTAMP,
-            GridPortableMarshaller.BYTE_ARR, GridPortableMarshaller.SHORT_ARR, GridPortableMarshaller.INT_ARR, GridPortableMarshaller.LONG_ARR, GridPortableMarshaller.FLOAT_ARR, GridPortableMarshaller.DOUBLE_ARR,
-            GridPortableMarshaller.CHAR_ARR, GridPortableMarshaller.BOOLEAN_ARR, GridPortableMarshaller.DECIMAL_ARR, GridPortableMarshaller.STRING_ARR, GridPortableMarshaller.UUID_ARR, GridPortableMarshaller.DATE_ARR, GridPortableMarshaller.TIMESTAMP_ARR,
-            GridPortableMarshaller.ENUM, GridPortableMarshaller.ENUM_ARR, GridPortableMarshaller.NULL}) {
-
-            PLAIN_TYPE_FLAG[b] = true;
-        }
-
-        PORTABLE_CLS.add(Byte.class);
-        PORTABLE_CLS.add(Short.class);
-        PORTABLE_CLS.add(Integer.class);
-        PORTABLE_CLS.add(Long.class);
-        PORTABLE_CLS.add(Float.class);
-        PORTABLE_CLS.add(Double.class);
-        PORTABLE_CLS.add(Character.class);
-        PORTABLE_CLS.add(Boolean.class);
-        PORTABLE_CLS.add(String.class);
-        PORTABLE_CLS.add(UUID.class);
-        PORTABLE_CLS.add(Date.class);
-        PORTABLE_CLS.add(Timestamp.class);
-        PORTABLE_CLS.add(BigDecimal.class);
-        PORTABLE_CLS.add(byte[].class);
-        PORTABLE_CLS.add(short[].class);
-        PORTABLE_CLS.add(int[].class);
-        PORTABLE_CLS.add(long[].class);
-        PORTABLE_CLS.add(float[].class);
-        PORTABLE_CLS.add(double[].class);
-        PORTABLE_CLS.add(char[].class);
-        PORTABLE_CLS.add(boolean[].class);
-        PORTABLE_CLS.add(String[].class);
-        PORTABLE_CLS.add(UUID[].class);
-        PORTABLE_CLS.add(Date[].class);
-        PORTABLE_CLS.add(Timestamp[].class);
-        PORTABLE_CLS.add(BigDecimal[].class);
-
-        FIELD_TYPE_NAMES = new String[104];
-
-        FIELD_TYPE_NAMES[GridPortableMarshaller.BYTE] = "byte";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.SHORT] = "short";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.INT] = "int";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.LONG] = "long";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.BOOLEAN] = "boolean";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.FLOAT] = "float";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.DOUBLE] = "double";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.CHAR] = "char";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.UUID] = "UUID";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.DECIMAL] = "decimal";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.STRING] = "String";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.DATE] = "Date";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.TIMESTAMP] = "Timestamp";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.ENUM] = "Enum";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.OBJ] = "Object";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.PORTABLE_OBJ] = "Object";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.COL] = "Collection";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.MAP] = "Map";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.CLASS] = "Class";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.BYTE_ARR] = "byte[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.SHORT_ARR] = "short[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.INT_ARR] = "int[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.LONG_ARR] = "long[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.BOOLEAN_ARR] = "boolean[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.FLOAT_ARR] = "float[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.DOUBLE_ARR] = "double[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.CHAR_ARR] = "char[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.UUID_ARR] = "UUID[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.DECIMAL_ARR] = "decimal[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.STRING_ARR] = "String[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.DATE_ARR] = "Date[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.TIMESTAMP_ARR] = "Timestamp[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.OBJ_ARR] = "Object[]";
-        FIELD_TYPE_NAMES[GridPortableMarshaller.ENUM_ARR] = "Enum[]";
-    }
-
-    /**
-     * Check if user type flag is set.
-     *
-     * @param flags Flags.
-     * @return {@code True} if set.
-     */
-    public static boolean isUserType(short flags) {
-        return isFlagSet(flags, FLAG_USR_TYP);
-    }
-
-    /**
-     * Check if raw-only flag is set.
-     *
-     * @param flags Flags.
-     * @return {@code True} if set.
-     */
-    public static boolean hasSchema(short flags) {
-        return isFlagSet(flags, FLAG_HAS_SCHEMA);
-    }
-
-    /**
-     * Check if raw-only flag is set.
-     *
-     * @param flags Flags.
-     * @return {@code True} if set.
-     */
-    public static boolean hasRaw(short flags) {
-        return isFlagSet(flags, FLAG_HAS_RAW);
-    }
-
-    /**
-     * Check if "no-field-ids" flag is set.
-     *
-     * @param flags Flags.
-     * @return {@code True} if set.
-     */
-    public static boolean isCompactFooter(short flags) {
-        return isFlagSet(flags, FLAG_COMPACT_FOOTER);
-    }
-
-    /**
-     * Check whether particular flag is set.
-     *
-     * @param flags Flags.
-     * @param flag Flag.
-     * @return {@code True} if flag is set in flags.
-     */
-    private static boolean isFlagSet(short flags, short flag) {
-        return (flags & flag) == flag;
-    }
-
-    /**
-     * Schema initial ID.
-     *
-     * @return ID.
-     */
-    public static int schemaInitialId() {
-        return FNV1_OFFSET_BASIS;
-    }
-
-    /**
-     * Update schema ID when new field is added.
-     *
-     * @param schemaId Current schema ID.
-     * @param fieldId Field ID.
-     * @return New schema ID.
-     */
-    public static int updateSchemaId(int schemaId, int fieldId) {
-        schemaId = schemaId ^ (fieldId & 0xFF);
-        schemaId = schemaId * FNV1_PRIME;
-        schemaId = schemaId ^ ((fieldId >> 8) & 0xFF);
-        schemaId = schemaId * FNV1_PRIME;
-        schemaId = schemaId ^ ((fieldId >> 16) & 0xFF);
-        schemaId = schemaId * FNV1_PRIME;
-        schemaId = schemaId ^ ((fieldId >> 24) & 0xFF);
-        schemaId = schemaId * FNV1_PRIME;
-
-        return schemaId;
-    }
-
-    /**
-     * @param typeName Field type name.
-     * @return Field type ID;
-     */
-    @SuppressWarnings("StringEquality")
-    public static int fieldTypeId(String typeName) {
-        for (int i = 0; i < FIELD_TYPE_NAMES.length; i++) {
-            String typeName0 = FIELD_TYPE_NAMES[i];
-
-            if (typeName.equals(typeName0))
-                return i;
-        }
-
-        throw new IllegalArgumentException("Invalid metadata type name: " + typeName);
-    }
-
-    /**
-     * @param typeId Field type ID.
-     * @return Field type name.
-     */
-    public static String fieldTypeName(int typeId) {
-        assert typeId >= 0 && typeId < FIELD_TYPE_NAMES.length : typeId;
-
-        String typeName = FIELD_TYPE_NAMES[typeId];
-
-        assert typeName != null : typeId;
-
-        return typeName;
-    }
-
-    /**
-     * Write value with flag. e.g. writePlainObject(writer, (byte)77) will write two byte: {BYTE, 77}.
-     *
-     * @param writer W
-     * @param val Value.
-     */
-    public static void writePlainObject(BinaryWriterExImpl writer, Object val) {
-        Byte flag = PLAIN_CLASS_TO_FLAG.get(val.getClass());
-
-        if (flag == null)
-            throw new IllegalArgumentException("Can't write object with type: " + val.getClass());
-
-        switch (flag) {
-            case GridPortableMarshaller.BYTE:
-                writer.writeByte(flag);
-                writer.writeByte((Byte)val);
-
-                break;
-
-            case GridPortableMarshaller.SHORT:
-                writer.writeByte(flag);
-                writer.writeShort((Short)val);
-
-                break;
-
-            case GridPortableMarshaller.INT:
-                writer.writeByte(flag);
-                writer.writeInt((Integer)val);
-
-                break;
-
-            case GridPortableMarshaller.LONG:
-                writer.writeByte(flag);
-                writer.writeLong((Long)val);
-
-                break;
-
-            case GridPortableMarshaller.FLOAT:
-                writer.writeByte(flag);
-                writer.writeFloat((Float)val);
-
-                break;
-
-            case GridPortableMarshaller.DOUBLE:
-                writer.writeByte(flag);
-                writer.writeDouble((Double)val);
-
-                break;
-
-            case GridPortableMarshaller.CHAR:
-                writer.writeByte(flag);
-                writer.writeChar((Character)val);
-
-                break;
-
-            case GridPortableMarshaller.BOOLEAN:
-                writer.writeByte(flag);
-                writer.writeBoolean((Boolean)val);
-
-                break;
-
-            case GridPortableMarshaller.DECIMAL:
-                writer.doWriteDecimal((BigDecimal)val);
-
-                break;
-
-            case GridPortableMarshaller.STRING:
-                writer.doWriteString((String)val);
-
-                break;
-
-            case GridPortableMarshaller.UUID:
-                writer.doWriteUuid((UUID)val);
-
-                break;
-
-            case GridPortableMarshaller.DATE:
-                writer.doWriteDate((Date)val);
-
-                break;
-
-            case GridPortableMarshaller.TIMESTAMP:
-                writer.doWriteTimestamp((Timestamp) val);
-
-                break;
-
-            case GridPortableMarshaller.BYTE_ARR:
-                writer.doWriteByteArray((byte[])val);
-
-                break;
-
-            case GridPortableMarshaller.SHORT_ARR:
-                writer.doWriteShortArray((short[])val);
-
-                break;
-
-            case GridPortableMarshaller.INT_ARR:
-                writer.doWriteIntArray((int[])val);
-
-                break;
-
-            case GridPortableMarshaller.LONG_ARR:
-                writer.doWriteLongArray((long[])val);
-
-                break;
-
-            case GridPortableMarshaller.FLOAT_ARR:
-                writer.doWriteFloatArray((float[])val);
-
-                break;
-
-            case GridPortableMarshaller.DOUBLE_ARR:
-                writer.doWriteDoubleArray((double[])val);
-
-                break;
-
-            case GridPortableMarshaller.CHAR_ARR:
-                writer.doWriteCharArray((char[])val);
-
-                break;
-
-            case GridPortableMarshaller.BOOLEAN_ARR:
-                writer.doWriteBooleanArray((boolean[])val);
-
-                break;
-
-            case GridPortableMarshaller.DECIMAL_ARR:
-                writer.doWriteDecimalArray((BigDecimal[])val);
-
-                break;
-
-            case GridPortableMarshaller.STRING_ARR:
-                writer.doWriteStringArray((String[])val);
-
-                break;
-
-            case GridPortableMarshaller.UUID_ARR:
-                writer.doWriteUuidArray((UUID[])val);
-
-                break;
-
-            case GridPortableMarshaller.DATE_ARR:
-                writer.doWriteDateArray((Date[])val);
-
-                break;
-
-            case GridPortableMarshaller.TIMESTAMP_ARR:
-                writer.doWriteTimestampArray((Timestamp[])val);
-
-                break;
-
-            default:
-                throw new IllegalArgumentException("Can't write object with type: " + val.getClass());
-        }
-    }
-
-    /**
-     * @param obj Value to unwrap.
-     * @return Unwrapped value.
-     */
-    public static Object unwrapLazy(@Nullable Object obj) {
-        if (obj instanceof PortableLazyValue)
-            return ((PortableLazyValue)obj).value();
-
-        return obj;
-    }
-
-    /**
-     * @param delegate Iterator to delegate.
-     * @return New iterator.
-     */
-    public static Iterator<Object> unwrapLazyIterator(final Iterator<Object> delegate) {
-        return new Iterator<Object>() {
-            @Override public boolean hasNext() {
-                return delegate.hasNext();
-            }
-
-            @Override public Object next() {
-                return unwrapLazy(delegate.next());
-            }
-
-            @Override public void remove() {
-                delegate.remove();
-            }
-        };
-    }
-
-    /**
-     * @return {@code true} if content of serialized value cannot contain references to other object.
-     */
-    public static boolean isPlainType(int type) {
-        return type > 0 && type < PLAIN_TYPE_FLAG.length && PLAIN_TYPE_FLAG[type];
-    }
-
-    /**
-     * Checks whether an array type values can or can not contain references to other object.
-     *
-     * @param type Array type.
-     * @return {@code true} if content of serialized array value cannot contain references to other object.
-     */
-    public static boolean isPlainArrayType(int type) {
-        return (type >= GridPortableMarshaller.BYTE_ARR && type <= GridPortableMarshaller.DATE_ARR) || type == GridPortableMarshaller.TIMESTAMP_ARR;
-    }
-
-    /**
-     * @param cls Class.
-     * @return Portable field type.
-     */
-    public static byte typeByClass(Class<?> cls) {
-        Byte type = PLAIN_CLASS_TO_FLAG.get(cls);
-
-        if (type != null)
-            return type;
-
-        if (cls.isEnum())
-            return GridPortableMarshaller.ENUM;
-
-        if (cls.isArray())
-            return cls.getComponentType().isEnum() || cls.getComponentType() == Enum.class ? GridPortableMarshaller.ENUM_ARR : GridPortableMarshaller.OBJ_ARR;
-
-        if (isSpecialCollection(cls))
-            return GridPortableMarshaller.COL;
-
-        if (isSpecialMap(cls))
-            return GridPortableMarshaller.MAP;
-
-        return GridPortableMarshaller.OBJ;
-    }
-
-    /**
-     * Tells whether provided type is portable.
-     *
-     * @param cls Class to check.
-     * @return Whether type is portable.
-     */
-    public static boolean isPortableType(Class<?> cls) {
-        assert cls != null;
-
-        return BinaryObject.class.isAssignableFrom(cls) ||
-            PORTABLE_CLS.contains(cls) ||
-            cls.isEnum() ||
-            (cls.isArray() && cls.getComponentType().isEnum());
-    }
-
-    /**
-     * Attempts to create a new map of the same type as {@code map} has. Otherwise returns new {@code HashMap} instance.
-     *
-     * @param map Original map.
-     * @return New map.
-     */
-    public static <K, V> Map<K, V> newMap(Map<K, V> map) {
-        if (map instanceof LinkedHashMap)
-            return U.newLinkedHashMap(map.size());
-        else if (map instanceof TreeMap)
-            return new TreeMap<>(((TreeMap<Object, Object>)map).comparator());
-        else if (map instanceof ConcurrentHashMap8)
-            return new ConcurrentHashMap8<>(U.capacity(map.size()));
-        else if (map instanceof ConcurrentHashMap)
-            return new ConcurrentHashMap<>(U.capacity(map.size()));
-
-        return U.newHashMap(map.size());
-    }
-
-    /**
-     * Attempts to create a new set of the same type as {@code set} has. Otherwise returns new {@code HashSet} instance.
-     *
-     * @param set Original set.
-     * @return New set.
-     */
-    public static <V> Set<V> newSet(Set<V> set) {
-        if (set instanceof LinkedHashSet)
-            return U.newLinkedHashSet(set.size());
-        else if (set instanceof TreeSet)
-            return new TreeSet<>(((TreeSet<Object>)set).comparator());
-        else if (set instanceof ConcurrentSkipListSet)
-            return new ConcurrentSkipListSet<>(((ConcurrentSkipListSet<Object>)set).comparator());
-
-        return U.newHashSet(set.size());
-    }
-
-    /**
-     * Check protocol version.
-     *
-     * @param protoVer Protocol version.
-     */
-    public static void checkProtocolVersion(byte protoVer) {
-        if (GridPortableMarshaller.PROTO_VER != protoVer)
-            throw new BinaryObjectException("Unsupported protocol version: " + protoVer);
-    }
-
-    /**
-     * Get portable object length.
-     *
-     * @param in Input stream.
-     * @param start Start position.
-     * @return Length.
-     */
-    public static int length(PortablePositionReadable in, int start) {
-        return in.readIntPositioned(start + GridPortableMarshaller.TOTAL_LEN_POS);
-    }
-
-    /**
-     * Get footer start of the object.
-     *
-     * @param in Input stream.
-     * @param start Object start position inside the stream.
-     * @return Footer start.
-     */
-    public static int footerStartRelative(PortablePositionReadable in, int start) {
-        short flags = in.readShortPositioned(start + GridPortableMarshaller.FLAGS_POS);
-
-        if (hasSchema(flags))
-            // Schema exists, use offset.
-            return in.readIntPositioned(start + GridPortableMarshaller.SCHEMA_OR_RAW_OFF_POS);
-        else
-            // No schema, footer start equals to object end.
-            return length(in, start);
-    }
-
-    /**
-     * Get object's footer.
-     *
-     * @param in Input stream.
-     * @param start Start position.
-     * @return Footer start.
-     */
-    public static int footerStartAbsolute(PortablePositionReadable in, int start) {
-        return footerStartRelative(in, start) + start;
-    }
-
-    /**
-     * Get object's footer.
-     *
-     * @param in Input stream.
-     * @param start Start position.
-     * @return Footer.
-     */
-    public static IgniteBiTuple<Integer, Integer> footerAbsolute(PortablePositionReadable in, int start) {
-        short flags = in.readShortPositioned(start + GridPortableMarshaller.FLAGS_POS);
-
-        int footerEnd = length(in, start);
-
-        if (hasSchema(flags)) {
-            // Schema exists.
-            int footerStart = in.readIntPositioned(start + GridPortableMarshaller.SCHEMA_OR_RAW_OFF_POS);
-
-            if (hasRaw(flags))
-                footerEnd -= 4;
-
-            assert footerStart <= footerEnd;
-
-            return F.t(start + footerStart, start + footerEnd);
-        }
-        else
-            // No schema.
-            return F.t(start + footerEnd, start + footerEnd);
-    }
-
-    /**
-     * Get relative raw offset of the object.
-     *
-     * @param in Input stream.
-     * @param start Object start position inside the stream.
-     * @return Raw offset.
-     */
-    public static int rawOffsetRelative(PortablePositionReadable in, int start) {
-        short flags = in.readShortPositioned(start + GridPortableMarshaller.FLAGS_POS);
-
-        int len = length(in, start);
-
-        if (hasSchema(flags)){
-            // Schema exists.
-            if (hasRaw(flags))
-                // Raw offset is set, it is at the very end of the object.
-                return in.readIntPositioned(start + len - 4);
-            else
-                // Raw offset is not set, so just return schema offset.
-                return in.readIntPositioned(start + GridPortableMarshaller.SCHEMA_OR_RAW_OFF_POS);
-        }
-        else
-            // No schema, raw offset is located on schema offset position.
-            return in.readIntPositioned(start + GridPortableMarshaller.SCHEMA_OR_RAW_OFF_POS);
-    }
-
-    /**
-     * Get absolute raw offset of the object.
-     *
-     * @param in Input stream.
-     * @param start Object start position inside the stream.
-     * @return Raw offset.
-     */
-    public static int rawOffsetAbsolute(PortablePositionReadable in, int start) {
-        return start + rawOffsetRelative(in, start);
-    }
-
-    /**
-     * Get offset length for the given flags.
-     *
-     * @param flags Flags.
-     * @return Offset size.
-     */
-    public static int fieldOffsetLength(short flags) {
-        if ((flags & FLAG_OFFSET_ONE_BYTE) == FLAG_OFFSET_ONE_BYTE)
-            return OFFSET_1;
-        else if ((flags & FLAG_OFFSET_TWO_BYTES) == FLAG_OFFSET_TWO_BYTES)
-            return OFFSET_2;
-        else
-            return OFFSET_4;
-    }
-
-    /**
-     * Get field ID length.
-     *
-     * @param flags Flags.
-     * @return Field ID length.
-     */
-    public static int fieldIdLength(short flags) {
-        return isCompactFooter(flags) ? 0 : FIELD_ID_LEN;
-    }
-
-    /**
-     * Get relative field offset.
-     *
-     * @param stream Stream.
-     * @param pos Position.
-     * @param fieldOffsetSize Field offset size.
-     * @return Relative field offset.
-     */
-    public static int fieldOffsetRelative(PortablePositionReadable stream, int pos, int fieldOffsetSize) {
-        int res;
-
-        if (fieldOffsetSize == OFFSET_1)
-            res = (int)stream.readBytePositioned(pos) & 0xFF;
-        else if (fieldOffsetSize == OFFSET_2)
-            res = (int)stream.readShortPositioned(pos) & 0xFFFF;
-        else
-            res = stream.readIntPositioned(pos);
-
-        return res;
-    }
-
-    /**
-     * Merge old and new metas.
-     *
-     * @param oldMeta Old meta.
-     * @param newMeta New meta.
-     * @return New meta if old meta was null, old meta if no changes detected, merged meta otherwise.
-     * @throws BinaryObjectException If merge failed due to metadata conflict.
-     */
-    public static BinaryMetadata mergeMetadata(@Nullable BinaryMetadata oldMeta, BinaryMetadata newMeta) {
-        assert newMeta != null;
-
-        if (oldMeta == null)
-            return newMeta;
-        else {
-            assert oldMeta.typeId() == newMeta.typeId();
-
-            // Check type name.
-            if (!F.eq(oldMeta.typeName(), newMeta.typeName())) {
-                throw new BinaryObjectException(
-                    "Two portable types have duplicate type ID [" + "typeId=" + oldMeta.typeId() +
-                        ", typeName1=" + oldMeta.typeName() + ", typeName2=" + newMeta.typeName() + ']'
-                );
-            }
-
-            // Check affinity field names.
-            if (!F.eq(oldMeta.affinityKeyFieldName(), newMeta.affinityKeyFieldName())) {
-                throw new BinaryObjectException(
-                    "Binary type has different affinity key fields [" + "typeName=" + newMeta.typeName() +
-                        ", affKeyFieldName1=" + oldMeta.affinityKeyFieldName() +
-                        ", affKeyFieldName2=" + newMeta.affinityKeyFieldName() + ']'
-                );
-            }
-
-            // Check enum flag.
-            if (oldMeta.isEnum() != newMeta.isEnum()) {
-                if (oldMeta.isEnum())
-                    throw new BinaryObjectException("Binary type already registered as enum: " +
-                        newMeta.typeName());
-                else
-                    throw new BinaryObjectException("Binary type already registered as non-enum: " +
-                        newMeta.typeName());
-            }
-
-            // Check and merge fields.
-            boolean changed = false;
-
-            Map<String, Integer> mergedFields = new HashMap<>(oldMeta.fieldsMap());
-            Map<String, Integer> newFields = newMeta.fieldsMap();
-
-            for (Map.Entry<String, Integer> newField : newFields.entrySet()) {
-                Integer oldFieldType = mergedFields.put(newField.getKey(), newField.getValue());
-
-                if (oldFieldType == null)
-                    changed = true;
-                else if (!F.eq(oldFieldType, newField.getValue())) {
-                    throw new BinaryObjectException(
-                        "Binary type has different field types [" + "typeName=" + oldMeta.typeName() +
-                            ", fieldName=" + newField.getKey() +
-                            ", fieldTypeName1=" + fieldTypeName(oldFieldType) +
-                            ", fieldTypeName2=" + fieldTypeName(newField.getValue()) + ']'
-                    );
-                }
-            }
-
-            // Check and merge schemas.
-            Collection<PortableSchema> mergedSchemas = new HashSet<>(oldMeta.schemas());
-
-            for (PortableSchema newSchema : newMeta.schemas()) {
-                if (mergedSchemas.add(newSchema))
-                    changed = true;
-            }
-
-            // Return either old meta if no changes detected, or new merged meta.
-            return changed ? new BinaryMetadata(oldMeta.typeId(), oldMeta.typeName(), mergedFields,
-                oldMeta.affinityKeyFieldName(), mergedSchemas, oldMeta.isEnum()) : oldMeta;
-        }
-    }
-
-    /**
-     * @param cls Class.
-     * @return Mode.
-     */
-    @SuppressWarnings("IfMayBeConditional")
-    public static BinaryWriteMode mode(Class<?> cls) {
-        assert cls != null;
-
-        /** Primitives. */
-        if (cls == byte.class)
-            return BinaryWriteMode.P_BYTE;
-        else if (cls == boolean.class)
-            return BinaryWriteMode.P_BOOLEAN;
-        else if (cls == short.class)
-            return BinaryWriteMode.P_SHORT;
-        else if (cls == char.class)
-            return BinaryWriteMode.P_CHAR;
-        else if (cls == int.class)
-            return BinaryWriteMode.P_INT;
-        else if (cls == long.class)
-            return BinaryWriteMode.P_LONG;
-        else if (cls == float.class)
-            return BinaryWriteMode.P_FLOAT;
-        else if (cls == double.class)
-            return BinaryWriteMode.P_DOUBLE;
-
-        /** Boxed primitives. */
-        else if (cls == Byte.class)
-            return BinaryWriteMode.BYTE;
-        else if (cls == Boolean.class)
-            return BinaryWriteMode.BOOLEAN;
-        else if (cls == Short.class)
-            return BinaryWriteMode.SHORT;
-        else if (cls == Character.class)
-            return BinaryWriteMode.CHAR;
-        else if (cls == Integer.class)
-            return BinaryWriteMode.INT;
-        else if (cls == Long.class)
-            return BinaryWriteMode.LONG;
-        else if (cls == Float.class)
-            return BinaryWriteMode.FLOAT;
-        else if (cls == Double.class)
-            return BinaryWriteMode.DOUBLE;
-
-        /** The rest types. */
-        else if (cls == BigDecimal.class)
-            return BinaryWriteMode.DECIMAL;
-        else if (cls == String.class)
-            return BinaryWriteMode.STRING;
-        else if (cls == UUID.class)
-            return BinaryWriteMode.UUID;
-        else if (cls == Date.class)
-            return BinaryWriteMode.DATE;
-        else if (cls == Timestamp.class)
-            return BinaryWriteMode.TIMESTAMP;
-        else if (cls == byte[].class)
-            return BinaryWriteMode.BYTE_ARR;
-        else if (cls == short[].class)
-            return BinaryWriteMode.SHORT_ARR;
-        else if (cls == int[].class)
-            return BinaryWriteMode.INT_ARR;
-        else if (cls == long[].class)
-            return BinaryWriteMode.LONG_ARR;
-        else if (cls == float[].class)
-            return BinaryWriteMode.FLOAT_ARR;
-        else if (cls == double[].class)
-            return BinaryWriteMode.DOUBLE_ARR;
-        else if (cls == char[].class)
-            return BinaryWriteMode.CHAR_ARR;
-        else if (cls == boolean[].class)
-            return BinaryWriteMode.BOOLEAN_ARR;
-        else if (cls == BigDecimal[].class)
-            return BinaryWriteMode.DECIMAL_ARR;
-        else if (cls == String[].class)
-            return BinaryWriteMode.STRING_ARR;
-        else if (cls == UUID[].class)
-            return BinaryWriteMode.UUID_ARR;
-        else if (cls == Date[].class)
-            return BinaryWriteMode.DATE_ARR;
-        else if (cls == Timestamp[].class)
-            return BinaryWriteMode.TIMESTAMP_ARR;
-        else if (cls.isArray())
-            return cls.getComponentType().isEnum() ? BinaryWriteMode.ENUM_ARR : BinaryWriteMode.OBJECT_ARR;
-        else if (cls == BinaryObjectImpl.class)
-            return BinaryWriteMode.PORTABLE_OBJ;
-        else if (Binarylizable.class.isAssignableFrom(cls))
-            return BinaryWriteMode.PORTABLE;
-        else if (Externalizable.class.isAssignableFrom(cls))
-            return BinaryWriteMode.EXTERNALIZABLE;
-        else if (isSpecialCollection(cls))
-            return BinaryWriteMode.COL;
-        else if (isSpecialMap(cls))
-            return BinaryWriteMode.MAP;
-        else if (cls.isEnum())
-            return BinaryWriteMode.ENUM;
-        else if (cls == Class.class)
-            return BinaryWriteMode.CLASS;
-        else
-            return BinaryWriteMode.OBJECT;
-    }
-
-    /**
-     * Check if class represents a collection which must be treated specially.
-     *
-     * @param cls Class.
-     * @return {@code True} if this is a special collection class.
-     */
-    private static boolean isSpecialCollection(Class cls) {
-        return ArrayList.class.equals(cls) || LinkedList.class.equals(cls) ||
-            HashSet.class.equals(cls) || LinkedHashSet.class.equals(cls);
-    }
-
-    /**
-     * Check if class represents a map which must be treated specially.
-     *
-     * @param cls Class.
-     * @return {@code True} if this is a special map class.
-     */
-    private static boolean isSpecialMap(Class cls) {
-        return HashMap.class.equals(cls) || LinkedHashMap.class.equals(cls);
-    }
-
-    /**
-     * @return Value.
-     */
-    public static byte[] doReadByteArray(PortableInputStream in) {
-        int len = in.readInt();
-
-        return in.readByteArray(len);
-    }
-
-    /**
-     * @return Value.
-     */
-    public static boolean[] doReadBooleanArray(PortableInputStream in) {
-        int len = in.readInt();
-
-        return in.readBooleanArray(len);
-    }
-
-    /**
-     * @return Value.
-     */
-    public static short[] doReadShortArray(PortableInputStream in) {
-        int len = in.readInt();
-
-        return in.readShortArray(len);
-    }
-
-    /**
-     * @return Value.
-     */
-    public static char[] doReadCharArray(PortableInputStream in) {
-        int len = in.readInt();
-
-        return in.readCharArray(len);
-    }
-
-    /**
-     * @return Value.
-     */
-    public static int[] doReadIntArray(PortableInputStream in) {
-        int len = in.readInt();
-
-        return in.readIntArray(len);
-    }
-
-    /**
-     * @return Value.
-     */
-    public static long[] doReadLongArray(PortableInputStream in) {
-        int len = in.readInt();
-
-        return in.readLongArray(len);
-    }
-
-    /**
-     * @return Value.
-     */
-    public static float[] doReadFloatArray(PortableInputStream in) {
-        int len = in.readInt();
-
-        return in.readFloatArray(len);
-    }
-
-    /**
-     * @return Value.
-     */
-    public static double[] doReadDoubleArray(PortableInputStream in) {
-        int len = in.readInt();
-
-        return in.readDoubleArray(len);
-    }
-
-    /**
-     * @return Value.
-     */
-    public static BigDecimal doReadDecimal(PortableInputStream in) {
-        int scale = in.readInt();
-        byte[] mag = doReadByteArray(in);
-
-        BigInteger intVal = new BigInteger(mag);
-
-        if (scale < 0) {
-            scale &= 0x7FFFFFFF;
-
-            intVal = intVal.negate();
-        }
-
-        return new BigDecimal(intVal, scale);
-    }
-
-    /**
-     * @return Value.
-     */
-    public static String doReadString(PortableInputStream in) {
-        if (!in.hasArray())
-            return new String(doReadByteArray(in), UTF_8);
-
-        int strLen = in.readInt();
-
-        int pos = in.position();
-
-        // String will copy necessary array part for us.
-        String res = new String(in.array(), pos, strLen, UTF_8);
-
-        in.position(pos + strLen);
-
-        return res;
-    }
-
-    /**
-     * @return Value.
-     */
-    public static UUID doReadUuid(PortableInputStream in) {
-        return new UUID(in.readLong(), in.readLong());
-    }
-
-    /**
-     * @return Value.
-     */
-    public static Date doReadDate(PortableInputStream in) {
-        long time = in.readLong();
-
-        return new Date(time);
-    }
-
-    /**
-     * @return Value.
-     */
-    public static Timestamp doReadTimestamp(PortableInputStream in) {
-        long time = in.readLong();
-        int nanos = in.readInt();
-
-        Timestamp ts = new Timestamp(time);
-
-        ts.setNanos(ts.getNanos() + nanos);
-
-        return ts;
-    }
-
-    /**
-     * @return Value.
-     * @throws BinaryObjectException In case of error.
-     */
-    public static BigDecimal[] doReadDecimalArray(PortableInputStream in) throws BinaryObjectException {
-        int len = in.readInt();
-
-        BigDecimal[] arr = new BigDecimal[len];
-
-        for (int i = 0; i < len; i++) {
-            byte flag = in.readByte();
-
-            if (flag == GridPortableMarshaller.NULL)
-                arr[i] = null;
-            else {
-                if (flag != GridPortableMarshaller.DECIMAL)
-                    throw new BinaryObjectException("Invalid flag value: " + flag);
-
-                arr[i] = doReadDecimal(in);
-            }
-        }
-
-        return arr;
-    }
-
-    /**
-     * @return Value.
-     * @throws BinaryObjectException In case of error.
-     */
-    public static String[] doReadStringArray(PortableInputStream in) throws BinaryObjectException {
-        int len = in.readInt();
-
-        String[] arr = new String[len];
-
-        for (int i = 0; i < len; i++) {
-            byte flag = in.readByte();
-
-            if (flag == GridPortableMarshaller.NULL)
-                arr[i] = null;
-            else {
-                if (flag != GridPortableMarshaller.STRING)
-                    throw new BinaryObjectException("Invalid flag value: " + flag);
-
-                arr[i] = doReadString(in);
-            }
-        }
-
-        return arr;
-    }
-
-    /**
-     * @return Value.
-     * @throws BinaryObjectException In case of error.
-     */
-    public static UUID[] doReadUuidArray(PortableInputStream in) throws BinaryObjectException {
-        int len = in.readInt();
-
-        UUID[] arr = new UUID[len];
-
-        for (int i = 0; i < len; i++) {
-            byte flag = in.readByte();
-
-            if (flag == GridPortableMarshaller.NULL)
-                arr[i] = null;
-            else {
-                if (flag != GridPortableMarshaller.UUID)
-                    throw new BinaryObjectException("Invalid flag value: " + flag);
-
-                arr[i] = doReadUuid(in);
-            }
-        }
-
-        return arr;
-    }
-
-    /**
-     * @return Value.
-     * @throws BinaryObjectException In case of error.
-     */
-    public static Date[] doReadDateArray(PortableInputStream in) throws BinaryObjectException {
-        int len = in.readInt();
-
-        Date[] arr = new Date[len];
-
-        for (int i = 0; i < len; i++) {
-            byte flag = in.readByte();
-
-            if (flag == GridPortableMarshaller.NULL)
-                arr[i] = null;
-            else {
-                if (flag != GridPortableMarshaller.DATE)
-                    throw new BinaryObjectException("Invalid flag value: " + flag);
-
-                arr[i] = doReadDate(in);
-            }
-        }
-
-        return arr;
-    }
-
-    /**
-     * @return Value.
-     * @throws BinaryObjectException In case of error.
-     */
-    public static Timestamp[] doReadTimestampArray(PortableInputStream in) throws BinaryObjectException {
-        int len = in.readInt();
-
-        Timestamp[] arr = new Timestamp[len];
-
-        for (int i = 0; i < len; i++) {
-            byte flag = in.readByte();
-
-            if (flag == GridPortableMarshaller.NULL)
-                arr[i] = null;
-            else {
-                if (flag != GridPortableMarshaller.TIMESTAMP)
-                    throw new BinaryObjectException("Invalid flag value: " + flag);
-
-                arr[i] = doReadTimestamp(in);
-            }
-        }
-
-        return arr;
-    }
-
-    /**
-     * @return Value.
-     */
-    public static BinaryObject doReadPortableObject(PortableInputStream in, PortableContext ctx) {
-        if (in.offheapPointer() > 0) {
-            int len = in.readInt();
-
-            int pos = in.position();
-
-            in.position(in.position() + len);
-
-            int start = in.readInt();
-
-            return new BinaryObjectOffheapImpl(ctx, in.offheapPointer() + pos, start, len);
-        }
-        else {
-            byte[] arr = doReadByteArray(in);
-            int start = in.readInt();
-
-            return new BinaryObjectImpl(ctx, arr, start);
-        }
-    }
-
-    /**
-     * @return Value.
-     */
-    public static Class doReadClass(PortableInputStream in, PortableContext ctx, ClassLoader ldr)
-        throws BinaryObjectException {
-        int typeId = in.readInt();
-
-        return doReadClass(in, ctx, ldr, typeId);
-    }
-
-    /**
-     * Read plain type.
-     *
-     * @param in Input stream.
-     * @return Plain type.
-     */
-    private static EnumType doReadEnumType(PortableInputStream in) {
-        int typeId = in.readInt();
-
-        if (typeId != GridPortableMarshaller.UNREGISTERED_TYPE_ID)
-            return new EnumType(typeId, null);
-        else {
-            String clsName = doReadClassName(in);
-
-            return new EnumType(GridPortableMarshaller.UNREGISTERED_TYPE_ID, clsName);
-        }
-    }
-
-    /**
-     * @param in Input stream.
-     * @return Class name.
-     */
-    private static String doReadClassName(PortableInputStream in) {
-        byte flag = in.readByte();
-
-        if (flag != GridPortableMarshaller.STRING)
-            throw new BinaryObjectException("Failed to read class name [position=" + (in.position() - 1) + ']');
-
-        return doReadString(in);
-    }
-
-    /**
-     * @param typeId Type id.
-     * @return Value.
-     */
-    public static Class doReadClass(PortableInputStream in, PortableContext ctx, ClassLoader ldr, int typeId)
-        throws BinaryObjectException {
-        Class cls;
-
-        if (typeId == GridPortableMarshaller.OBJECT_TYPE_ID)
-            return Object.class;
-
-        if (typeId != GridPortableMarshaller.UNREGISTERED_TYPE_ID)
-            cls = ctx.descriptorForTypeId(true, typeId, ldr, false).describedClass();
-        else {
-            String clsName = doReadClassName(in);
-
-            try {
-                cls = U.forName(clsName, ldr);
-            }
-            catch (ClassNotFoundException e) {
-                throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e);
-            }
-
-            // forces registering of class by type id, at least locally
-            ctx.descriptorForClass(cls, true);
-        }
-
-        return cls;
-    }
-
-    /**
-     * Resolve the class.
-     *
-     * @param ctx Portable context.
-     * @param typeId Type ID.
-     * @param clsName Class name.
-     * @param ldr Class loaded.
-     * @return Resovled class.
-     */
-    public static Class resolveClass(PortableContext ctx, int typeId, @Nullable String clsName,
-        @Nullable ClassLoader ldr, boolean deserialize) {
-        Class cls;
-
-        if (typeId == GridPortableMarshaller.OBJECT_TYPE_ID)
-            return Object.class;
-
-        if (typeId != GridPortableMarshaller.UNREGISTERED_TYPE_ID)
-            cls = ctx.descriptorForTypeId(true, typeId, ldr, deserialize).describedClass();
-        else {
-            try {
-                cls = U.forName(clsName, ldr);
-            }
-            catch (ClassNotFoundException e) {
-                throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e);
-            }
-
-            // forces registering of class by type id, at least locally
-            ctx.descriptorForClass(cls, true);
-        }
-
-        return cls;
-    }
-
-    /**
-     * Read portable enum.
-     *
-     * @param in Input stream.
-     * @param ctx Portable context.
-     * @param type Plain type.
-     * @return Enum.
-     */
-    private static BinaryEnumObjectImpl doReadPortableEnum(PortableInputStream in, PortableContext ctx,
-        EnumType type) {
-        return new BinaryEnumObjectImpl(ctx, type.typeId, type.clsName, in.readInt());
-    }
-
-    /**
-     * Read portable enum array.
-     *
-     * @param in Input stream.
-     * @param ctx Portable context.
-     * @return Enum array.
-     */
-    private static Object[] doReadPortableEnumArray(PortableInputStream in, PortableContext ctx) {
-        int len = in.readInt();
-
-        Object[] arr = (Object[]) Array.newInstance(BinaryObject.class, len);
-
-        for (int i = 0; i < len; i++) {
-            byte flag = in.readByte();
-
-            if (flag == GridPortableMarshaller.NULL)
-                arr[i] = null;
-            else
-                arr[i] = doReadPortableEnum(in, ctx, doReadEnumType(in));
-        }
-
-        return arr;
-    }
-
-    /**
-     * Having target class in place we simply read ordinal and create final representation.
-     *
-     * @param cls Enum class.
-     * @return Value.
-     */
-    public static Enum<?> doReadEnum(PortableInputStream in, Class<?> cls) throws BinaryObjectException {
-        assert cls != null;
-
-        if (!cls.isEnum())
-            throw new BinaryObjectException("Class does not represent enum type: " + cls.getName());
-
-        int ord = in.readInt();
-
-        return BinaryEnumCache.get(cls, ord);
-    }
-
-    /**
-     * @param cls Enum class.
-     * @return Value.
-     */
-    public static Object[] doReadEnumArray(PortableInputStream in, PortableContext ctx, ClassLoader ldr, Class<?> cls)
-        throws BinaryObjectException {
-        int len = in.readInt();
-
-        Object[] arr = (Object[]) Array.newInstance(cls, len);
-
-        for (int i = 0; i < len; i++) {
-            byte flag = in.readByte();
-
-            if (flag == GridPortableMarshaller.NULL)
-                arr[i] = null;
-            else
-                arr[i] = doReadEnum(in, doReadClass(in, ctx, ldr));
-        }
-
-        return arr;
-    }
-
-    /**
-     * Read object serialized using optimized marshaller.
-     *
-     * @return Result.
-     */
-    public static Object doReadOptimized(PortableInputStream in, PortableContext ctx, @Nullable ClassLoader clsLdr) {
-        int len = in.readInt();
-
-        ByteArrayInputStream input = new ByteArrayInputStream(in.array(), in.position(), len);
-
-        try {
-            return ctx.optimizedMarsh().unmarshal(input, clsLdr);
-        }
-        catch (IgniteCheckedException e) {
-            throw new BinaryObjectException("Failed to unmarshal object with optimized marshaller", e);
-        }
-        finally {
-            in.position(in.position() + len);
-        }
-    }
-
-    /**
-     * @return Object.
-     * @throws BinaryObjectException In case of error.
-     */
-    @Nullable public static Object doReadObject(PortableInputStream in, PortableContext ctx, ClassLoader ldr,
-        BinaryReaderHandlesHolder handles) throws BinaryObjectException {
-        return new BinaryReaderExImpl(ctx, in, ldr, handles.handles()).deserialize();
-    }
-
-    /**
-     * @return Unmarshalled value.
-     * @throws BinaryObjectException In case of error.
-     */
-    @Nullable public static Object unmarshal(PortableInputStream in, PortableContext ctx, ClassLoader ldr)
-        throws BinaryObjectException {
-        return unmarshal(in, ctx, ldr, new BinaryReaderHandlesHolderImpl());
-    }
-
-    /**
-     * @return Unmarshalled value.
-     * @throws BinaryObjectException In case of error.
-     */
-    @Nullable public static Object unmarshal(PortableInputStream in, PortableContext ctx, ClassLoader ldr,
-        BinaryReaderHandlesHolder handles) throws BinaryObjectException {
-        return unmarshal(in, ctx, ldr, handles, false);
-    }
-
-    /**
-     * @return Unmarshalled value.
-     * @throws BinaryObjectException In case of error.
-     */
-    @Nullable public static Object unmarshal(PortableInputStream in, PortableContext ctx, ClassLoader ldr,
-        BinaryReaderHandlesHolder handles, boolean detach) throws BinaryObjectException {
-        int start = in.position();
-
-        byte flag = in.readByte();
-
-        switch (flag) {
-            case GridPortableMarshaller.NULL:
-                return null;
-
-            case GridPortableMarshaller.HANDLE: {
-                int handlePos = start - in.readInt();
-
-                Object obj = handles.getHandle(handlePos);
-
-                if (obj == null) {
-                    int retPos = in.position();
-
-                    in.position(handlePos);
-
-                    obj = unmarshal(in, ctx, ldr, handles);
-
-                    in.position(retPos);
-                }
-
-                return obj;
-            }
-
-            case GridPortableMarshaller.OBJ: {
-                checkProtocolVersion(in.readByte());
-
-                int len = length(in, start);
-
-                BinaryObjectExImpl po;
-
-                if (detach) {
-                    // In detach mode we simply copy object's content.
-                    in.position(start);
-
-                    po = new BinaryObjectImpl(ctx, in.readByteArray(len), 0);
-                }
-                else {
-                    if (in.offheapPointer() == 0)
-                        po = new BinaryObjectImpl(ctx, in.array(), start);
-                    else
-                        po = new BinaryObjectOffheapImpl(ctx, in.offheapPointer(), start,
-                            in.remaining() + in.position());
-
-                    in.position(start + po.length());
-                }
-
-                handles.setHandle(po, start);
-
-                return po;
-            }
-
-            case GridPortableMarshaller.BYTE:
-                return in.readByte();
-
-            case GridPortableMarshaller.SHORT:
-                return in.readShort();
-
-            case GridPortableMarshaller.INT:
-                return in.readInt();
-
-            case GridPortableMarshaller.LONG:
-                return in.readLong();
-
-            case GridPortableMarshaller.FLOAT:
-                return in.readFloat();
-
-            case GridPortableMarshaller.DOUBLE:
-                return in.readDouble();
-
-            case GridPortableMarshaller.CHAR:
-                return in.readChar();
-
-            case GridPortableMarshaller.BOOLEAN:
-                return in.readBoolean();
-
-            case GridPortableMarshaller.DECIMAL:
-                return doReadDecimal(in);
-
-            case GridPortableMarshaller.STRING:
-                return doReadString(in);
-
-            case GridPortableMarshaller.UUID:
-                return doReadUuid(in);
-
-            case GridPortableMarshaller.DATE:
-                return doReadDate(in);
-
-            case GridPortableMarshaller.TIMESTAMP:
-                return doReadTimestamp(in);
-
-            case GridPortableMarshaller.BYTE_ARR:
-                return doReadByteArray(in);
-
-            case GridPortableMarshaller.SHORT_ARR:
-                return doReadShortArray(in);
-
-            case GridPortableMarshaller.INT_ARR:
-                return doReadIntArray(in);
-
-            case GridPortableMarshaller.LONG_ARR:
-                return doReadLongArray(in);
-
-            case GridPortableMarshaller.FLOAT_ARR:
-                return doReadFloatArray(in);
-
-            case GridPortableMarshaller.DOUBLE_ARR:
-                return doReadDoubleArray(in);
-
-            case GridPortableMarshaller.CHAR_ARR:
-                return doReadCharArray(in);
-
-            case GridPortableMarshaller.BOOLEAN_ARR:
-                return doReadBooleanArray(in);
-
-            case GridPortableMarshaller.DECIMAL_ARR:
-                return doReadDecimalArray(in);
-
-            case GridPortableMarshaller.STRING_ARR:
-                return doReadStringArray(in);
-
-            case GridPortableMarshaller.UUID_ARR:
-                return doReadUuidArray(in);
-
-            case GridPortableMarshaller.DATE_ARR:
-                return doReadDateArray(in);
-
-            case GridPortableMarshaller.TIMESTAMP_ARR:
-                return doReadTimestampArray(in);
-
-            case GridPortableMarshaller.OBJ_ARR:
-                return doReadObjectArray(in, ctx, ldr, handles, false);
-
-            case GridPortableMarshaller.COL:
-                return doReadCollection(in, ctx, ldr, handles, false, null);
-
-            case GridPortableMarshaller.MAP:
-                return doReadMap(in, ctx, ldr, handles, false, null);
-
-            case GridPortableMarshaller.PORTABLE_OBJ:
-                return doReadPortableObject(in, ctx);
-
-            case GridPortableMarshaller.ENUM:
-                return doReadPortableEnum(in, ctx, doReadEnumType(in));
-
-            case GridPortableMarshaller.ENUM_ARR:
-                doReadEnumType(in); // Simply skip this part as we do not need it.
-
-                return doReadPortableEnumArray(in, ctx);
-
-            case GridPortableMarshaller.CLASS:
-                return doReadClass(in, ctx, ldr);
-
-            case GridPortableMarshaller.OPTM_MARSH:
-                return doReadOptimized(in, ctx, ldr);
-
-            default:
-                throw new BinaryObjectException("Invalid flag value: " + flag);
-        }
-    }
-
-    /**
-     * @param deserialize Deep flag.
-     * @return Value.
-     * @throws BinaryObjectException In case of error.
-     */
-    public static Object[] doReadObjectArray(PortableInputStream in, PortableContext ctx, ClassLoader ldr,
-        BinaryReaderHandlesHolder handles, boolean deserialize) throws BinaryObjectException {
-        int hPos = positionForHandle(in);
-
-        Class compType = doReadClass(in, ctx, ldr);
-
-        int len = in.readInt();
-
-        Object[] arr = deserialize ? (Object[])Array.newInstance(compType, len) : new Object[len];
-
-        handles.setHandle(arr, hPos);
-
-        for (int i = 0; i < len; i++)
-            arr[i] = deserializeOrUnmarshal(in, ctx, ldr, handles, deserialize);
-
-        return arr;
-    }
-
-    /**
-     * @param deserialize Deep flag.
-     * @param factory Collection factory.
-     * @return Value.
-     * @throws BinaryObjectException In case of error.
-     */
-    @SuppressWarnings("unchecked")
-    public static Collection<?> doReadCollection(PortableInputStream in, PortableContext ctx, ClassLoader ldr,
-        BinaryReaderHandlesHolder handles, boolean deserialize, BinaryCollectionFactory factory)
-        throws BinaryObjectException {
-        int hPos = positionForHandle(in);
-
-        int size = in.readInt();
-
-        assert size >= 0;
-
-        byte colType = in.readByte();
-
-        Collection<Object> col;
-
-        if (factory != null)
-            col = factory.create(size);
-        else {
-            switch (colType) {
-                case GridPortableMarshaller.ARR_LIST:
-                    col = new ArrayList<>(size);
-
-                    break;
-
-                case GridPortableMarshaller.LINKED_LIST:
-                    col = new LinkedList<>();
-
-                    break;
-
-                case GridPortableMarshaller.HASH_SET:
-                    col = U.newHashSet(size);
-
-                    break;
-
-                case GridPortableMarshaller.LINKED_HASH_SET:
-                    col = U.newLinkedHashSet(size);
-
-                    break;
-
-                case GridPortableMarshaller.USER_SET:
-                    col = U.newHashSet(size);
-
-                    break;
-
-                case GridPortableMarshaller.USER_COL:
-                    col = new ArrayList<>(size);
-
-                    break;
-
-                default:
-                    throw new BinaryObjectException("Invalid collection type: " + colType);
-            }
-        }
-
-        handles.setHandle(col, hPos);
-
-        for (int i = 0; i < size; i++)
-            col.add(deserializeOrUnmarshal(in, ctx, ldr, handles, deserialize));
-
-        return col;
-    }
-
-    /**
-     * @param deserialize Deep flag.
-     * @param factory Map factory.
-     * @return Value.
-     * @throws BinaryObjectException In case of error.
-     */
-    @SuppressWarnings("unchecked")
-    public static Map<?, ?> doReadMap(PortableInputStream in, PortableContext ctx, ClassLoader ldr,
-        BinaryReaderHandlesHolder handles, boolean deserialize, BinaryMapFactory factory)
-        throws BinaryObjectException {
-        int hPos = positionForHandle(in);
-
-        int size = in.readInt();
-
-        assert size >= 0;
-
-        byte mapType = in.readByte();
-
-        Map<Object, Object> map;
-
-        if (factory != null)
-            map = factory.create(size);
-        else {
-            switch (mapType) {
-                case GridPortableMarshaller.HASH_MAP:
-                    map = U.newHashMap(size);
-
-                    break;
-
-                case GridPortableMarshaller.LINKED_HASH_MAP:
-                    map = U.newLinkedHashMap(size);
-
-                    break;
-
-                case GridPortableMarshaller.USER_COL:
-                    map = U.newHashMap(size);
-
-                    break;
-
-                default:
-                    throw new BinaryObjectException("Invalid map type: " + mapType);
-            }
-        }
-
-        handles.setHandle(map, hPos);
-
-        for (int i = 0; i < size; i++) {
-            Object key = deserializeOrUnmarshal(in, ctx, ldr, handles, deserialize);
-            Object val = deserializeOrUnmarshal(in, ctx, ldr, handles, deserialize);
-
-            map.put(key, val);
-        }
-
-        return map;
-    }
-
-    /**
-     * Deserialize or unmarshal the object.
-     *
-     * @param deserialize Deserialize.
-     * @return Result.
-     */
-    private static Object deserializeOrUnmarshal(PortableInputStream in, PortableContext ctx, ClassLoader ldr,
-        BinaryReaderHandlesHolder handles, boolean deserialize) {
-        return deserialize ? doReadObject(in, ctx, ldr, handles) : unmarshal(in, ctx, ldr, handles);
-    }
-
-    /**
-     * Get position to be used for handle. We assume here that the hdr byte was read, hence subtract -1.
-     *
-     * @return Position for handle.
-     */
-    public static int positionForHandle(PortableInputStream in) {
-        return in.position() - 1;
-    }
-
-    /**
-     * Enum type.
-     */
-    private static class EnumType {
-        /** Type ID. */
-        private final int typeId;
-
-        /** Class name. */
-        private final String clsName;
-
-        /**
-         * Constructor.
-         *
-         * @param typeId Type ID.
-         * @param clsName Class name.
-         */
-        public EnumType(int typeId, @Nullable String clsName) {
-            assert typeId != GridPortableMarshaller.UNREGISTERED_TYPE_ID && clsName == null ||
-                typeId == GridPortableMarshaller.UNREGISTERED_TYPE_ID && clsName != null;
-
-            this.typeId = typeId;
-            this.clsName = clsName;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryAbstractLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryAbstractLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryAbstractLazyValue.java
new file mode 100644
index 0000000..9c79f36
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryAbstractLazyValue.java
@@ -0,0 +1,57 @@
+/*
+ * 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.binary.builder;
+
+/**
+ *
+ */
+abstract class BinaryAbstractLazyValue implements BinaryLazyValue {
+    /** */
+    protected Object val;
+
+    /** */
+    protected final BinaryBuilderReader reader;
+
+    /** */
+    protected final int valOff;
+
+    /**
+     * @param reader Reader.
+     * @param valOff Value.
+     */
+    protected BinaryAbstractLazyValue(BinaryBuilderReader reader, int valOff) {
+        this.reader = reader;
+        this.valOff = valOff;
+    }
+
+    /**
+     * @return Value.
+     */
+    protected abstract Object init();
+
+    /** {@inheritDoc} */
+    @Override public Object value() {
+        if (val == null) {
+            val = init();
+
+            assert val != null;
+        }
+
+        return val;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java
new file mode 100644
index 0000000..d8dd00b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderEnum.java
@@ -0,0 +1,115 @@
+/*
+ * 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.binary.builder;
+
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.binary.BinaryInvalidTypeException;
+
+/**
+ *
+ */
+public class BinaryBuilderEnum implements BinaryBuilderSerializationAware {
+    /** */
+    private final int ordinal;
+
+    /** */
+    private final int typeId;
+
+    /** */
+    private final String clsName;
+
+    /**
+     * @param typeId Type ID.
+     * @param anEnum Enum instance.
+     */
+    public BinaryBuilderEnum(int typeId, Enum anEnum) {
+        ordinal = anEnum.ordinal();
+        this.typeId = typeId;
+        clsName = null;
+    }
+
+    /**
+     * @param reader PortableBuilderReader.
+     */
+    public BinaryBuilderEnum(BinaryBuilderReader reader) {
+        int typeId = reader.readInt();
+
+        if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) {
+            clsName = reader.readString();
+
+            Class cls;
+
+            try {
+                cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader());
+            }
+            catch (ClassNotFoundException e) {
+                throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e);
+            }
+
+            this.typeId = reader.portableContext().descriptorForClass(cls, false).typeId();
+        }
+        else {
+            this.typeId = typeId;
+            this.clsName = null;
+        }
+
+        ordinal = reader.readInt();
+    }
+
+    /**
+     * @return Ordinal.
+     */
+    public int getOrdinal() {
+        return ordinal;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) {
+        writer.writeByte(GridBinaryMarshaller.ENUM);
+
+        if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) {
+            writer.writeInt(GridBinaryMarshaller.UNREGISTERED_TYPE_ID);
+            writer.writeString(clsName);
+        }
+        else
+            writer.writeInt(typeId);
+
+        writer.writeInt(ordinal);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object o) {
+        if (o == null || getClass() != o.getClass())
+            return false;
+
+        BinaryBuilderEnum that = (BinaryBuilderEnum)o;
+
+        return ordinal == that.ordinal && typeId == that.typeId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int hashCode() {
+        int result = ordinal;
+
+        result = 31 * result + typeId;
+
+        return result;
+    }
+}


[26/50] [abbrv] ignite git commit: ignite-2065: portable -> binary renaming (methods, javadoc and etc.)

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index d5e849e..481317a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -321,7 +321,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
         final boolean skipTx,
         @Nullable UUID subjId,
         final String taskName,
-        final boolean deserializePortable,
+        final boolean deserializeBinary,
         final boolean skipVals,
         final boolean canRemap) {
         ctx.checkSecurity(SecurityPermission.CACHE_READ);
@@ -345,7 +345,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                     forcePrimary,
                     subjId0,
                     taskName,
-                    deserializePortable,
+                    deserializeBinary,
                     expiryPlc,
                     skipVals,
                     skipStore,
@@ -361,7 +361,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
         boolean skipTx,
         @Nullable UUID subjId,
         final String taskName,
-        final boolean deserializePortable,
+        final boolean deserializeBinary,
         final boolean skipVals,
         final boolean canRemap
     ) {
@@ -389,7 +389,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                     forcePrimary,
                     subjId0,
                     taskName,
-                    deserializePortable,
+                    deserializeBinary,
                     expiryPlc,
                     skipVals,
                     skipStore,
@@ -779,7 +779,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                         CacheInvokeResult invokeRes = (CacheInvokeResult)res;
 
                         if (invokeRes.result() != null)
-                            res = CacheInvokeResult.fromResult((T)ctx.unwrapPortableIfNeeded(invokeRes.result(),
+                            res = CacheInvokeResult.fromResult((T)ctx.unwrapBinaryIfNeeded(invokeRes.result(),
                                 keepBinary, false));
                     }
 
@@ -1004,7 +1004,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      * @param forcePrimary Force primary flag.
      * @param subjId Subject ID.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param expiryPlc Expiry policy.
      * @param skipVals Skip values flag.
      * @param skipStore Skip store flag.
@@ -1015,7 +1015,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
         boolean forcePrimary,
         UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         @Nullable ExpiryPolicy expiryPlc,
         boolean skipVals,
         boolean skipStore,
@@ -1033,7 +1033,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
             forcePrimary,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             expiry,
             skipVals,
             canRemap,
@@ -1052,7 +1052,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
      * @param forcePrimary Force primary flag.
      * @param subjId Subject ID.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param expiryPlc Expiry policy.
      * @param skipVals Skip values flag.
      * @param skipStore Skip store flag.
@@ -1062,7 +1062,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
         boolean forcePrimary,
         UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         @Nullable ExpiryPolicy expiryPlc,
         boolean skipVals,
         boolean skipStore,
@@ -1103,7 +1103,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                                 null,
                                 taskName,
                                 expiry,
-                                !deserializePortable);
+                                !deserializeBinary);
 
                             // Entry was not in memory or in swap, so we remove it from cache.
                             if (v == null) {
@@ -1115,7 +1115,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
                                 success = false;
                             }
                             else
-                                ctx.addResult(locVals, key, v, skipVals, false, deserializePortable, true);
+                                ctx.addResult(locVals, key, v, skipVals, false, deserializeBinary, true);
                         }
                         else
                             success = false;
@@ -1163,7 +1163,7 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K, V> {
             forcePrimary,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             expiry,
             skipVals,
             canRemap,

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
index 4f15fa1..1f4cb6a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridDhtAtomicUpdateRequest.java
@@ -157,7 +157,7 @@ public class GridDhtAtomicUpdateRequest extends GridCacheMessage implements Grid
     @GridDirectTransient
     private List<CacheObject> localPrevVals;
 
-    /** Keep portable flag. */
+    /** Keep binary flag. */
     private boolean keepBinary;
 
     /**
@@ -486,7 +486,7 @@ public class GridDhtAtomicUpdateRequest extends GridCacheMessage implements Grid
     }
 
     /**
-     * @return Keep portable flag.
+     * @return Keep binary flag.
      */
     public boolean keepBinary() {
         return keepBinary;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
index 513e6e8..ba3d546 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateFuture.java
@@ -325,7 +325,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
 
         Object retval =
             res == null ? null : rawRetval ? ret : (this.retval || op == TRANSFORM) ?
-                cctx.unwrapPortableIfNeeded(ret.value(), keepBinary) : ret.success();
+                cctx.unwrapBinaryIfNeeded(ret.value(), keepBinary) : ret.success();
 
         if (op == TRANSFORM && retval == null)
             retval = Collections.emptyMap();
@@ -1191,7 +1191,7 @@ public class GridNearAtomicUpdateFuture extends GridFutureAdapter<Object>
             Collection<Object> keys = new ArrayList<>(failedKeys.size());
 
             for (KeyCacheObject key : failedKeys)
-                keys.add(cctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepBinary, false));
+                keys.add(cctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false));
 
             err0.add(keys, err, topVer);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
index b7100dd..c24ad34 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridNearAtomicUpdateRequest.java
@@ -151,7 +151,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
     /** */
     private boolean clientReq;
 
-    /** Keep portable flag. */
+    /** Keep binary flag. */
     private boolean keepBinary;
 
     /**
@@ -341,7 +341,7 @@ public class GridNearAtomicUpdateRequest extends GridCacheMessage implements Gri
     }
 
     /**
-     * @return Keep portable flag.
+     * @return Keep binary flag.
      */
     public boolean keepBinary() {
         return keepBinary;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
index 19fefdb..073043d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/colocated/GridDhtColocatedCache.java
@@ -198,7 +198,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
         boolean skipTx,
         @Nullable UUID subjId,
         String taskName,
-        final boolean deserializePortable,
+        final boolean deserializeBinary,
         final boolean skipVals,
         boolean canRemap) {
         ctx.checkSecurity(SecurityPermission.CACHE_READ);
@@ -215,7 +215,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
                 @Override public IgniteInternalFuture<V> op(IgniteTxLocalAdapter tx) {
                     IgniteInternalFuture<Map<Object, Object>>  fut = tx.getAllAsync(ctx,
                         Collections.singleton(ctx.toCacheKeyObject(key)),
-                        deserializePortable,
+                        deserializeBinary,
                         skipVals,
                         false,
                         opCtx != null && opCtx.skipStore());
@@ -254,7 +254,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
             forcePrimary,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null),
             skipVals,
             canRemap,
@@ -273,7 +273,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
         boolean skipTx,
         @Nullable UUID subjId,
         String taskName,
-        final boolean deserializePortable,
+        final boolean deserializeBinary,
         final boolean skipVals,
         boolean canRemap
     ) {
@@ -294,7 +294,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
                 @Override public IgniteInternalFuture<Map<K, V>> op(IgniteTxLocalAdapter tx) {
                     return tx.getAllAsync(ctx,
                         ctx.cacheKeysView(keys),
-                        deserializePortable,
+                        deserializeBinary,
                         skipVals,
                         false,
                         opCtx != null && opCtx.skipStore());
@@ -315,7 +315,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
             topVer,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             skipVals ? null : expiryPolicy(opCtx != null ? opCtx.expiry() : null),
             skipVals,
             canRemap);
@@ -341,7 +341,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
      * @param topVer Topology version.
      * @param subjId Subject ID.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param expiryPlc Expiry policy.
      * @param skipVals Skip values flag.
      * @param canRemap Can remap flag.
@@ -354,7 +354,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
         AffinityTopologyVersion topVer,
         @Nullable UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         @Nullable IgniteCacheExpiryPolicy expiryPlc,
         boolean skipVals,
         boolean canRemap) {
@@ -363,7 +363,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
             forcePrimary,
             topVer, subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             expiryPlc,
             skipVals,
             canRemap,
@@ -378,7 +378,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
      * @param topVer Topology version.
      * @param subjId Subject ID.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param expiryPlc Expiry policy.
      * @param skipVals Skip values flag.
      * @param canRemap Flag indicating whether future can be remapped on a newer topology version.
@@ -393,7 +393,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
         AffinityTopologyVersion topVer,
         @Nullable UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         @Nullable IgniteCacheExpiryPolicy expiryPlc,
         boolean skipVals,
         boolean canRemap,
@@ -407,7 +407,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
             forcePrimary,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             expiryPlc,
             skipVals,
             canRemap,
@@ -426,7 +426,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
      * @param topVer Topology version.
      * @param subjId Subject ID.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param expiryPlc Expiry policy.
      * @param skipVals Skip values flag.
      * @param canRemap Flag indicating whether future can be remapped on a newer topology version.
@@ -441,7 +441,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
         AffinityTopologyVersion topVer,
         @Nullable UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         @Nullable IgniteCacheExpiryPolicy expiryPlc,
         boolean skipVals,
         boolean canRemap,
@@ -486,7 +486,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
                                     null,
                                     taskName,
                                     expiryPlc,
-                                    !deserializePortable);
+                                    !deserializeBinary);
 
                                 if (res != null) {
                                     v = res.get1();
@@ -506,7 +506,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
                                     null,
                                     taskName,
                                     expiryPlc,
-                                    !deserializePortable);
+                                    !deserializeBinary);
                             }
 
                             // Entry was not in memory or in swap, so we remove it from cache.
@@ -530,7 +530,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
                                         v,
                                         skipVals,
                                         keepCacheObj,
-                                        deserializePortable,
+                                        deserializeBinary,
                                         true);
                                 }
                             }
@@ -582,7 +582,7 @@ public class GridDhtColocatedCache<K, V> extends GridDhtTransactionalCacheAdapte
             forcePrimary,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             expiryPlc,
             skipVals,
             canRemap,

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
index 49a267a..06898cd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearAtomicCache.java
@@ -225,7 +225,7 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
         @Nullable byte[] valBytes,
         long ttl,
         long expireTime,
-        boolean keepPortable,
+        boolean keepBinary,
         UUID nodeId,
         UUID subjId,
         String taskName
@@ -251,7 +251,7 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
                         /*write-through*/false,
                         /*read-through*/false,
                         /*retval*/false,
-                        keepPortable,
+                        keepBinary,
                         /*expiry policy*/null,
                         /*event*/true,
                         /*metrics*/true,
@@ -395,7 +395,7 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
         boolean skipTx,
         @Nullable UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         boolean skipVals,
         boolean canRemap
     ) {
@@ -416,7 +416,7 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
             forcePrimary,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             skipVals ? null : opCtx != null ? opCtx.expiry() : null,
             skipVals,
             opCtx != null && opCtx.skipStore(),
@@ -690,4 +690,4 @@ public class GridNearAtomicCache<K, V> extends GridNearCacheAdapter<K, V> {
             Thread.currentThread().interrupt();
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
index 27ef996..5bf18d9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
@@ -225,7 +225,7 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
      * @param forcePrimary Force primary flag.
      * @param subjId Subject ID.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param expiryPlc Expiry policy.
      * @param skipVal Skip value flag.
      * @param skipStore Skip store flag.
@@ -237,7 +237,7 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
         boolean forcePrimary,
         @Nullable UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         @Nullable ExpiryPolicy expiryPlc,
         boolean skipVal,
         boolean skipStore,
@@ -257,7 +257,7 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
             txx,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             expiry,
             skipVal,
             canRemap,
@@ -445,9 +445,9 @@ public abstract class GridNearCacheAdapter<K, V> extends GridDistributedCacheAda
     }
 
     /** {@inheritDoc} */
-    @Override public V promote(K key, boolean deserializePortable) throws IgniteCheckedException {
+    @Override public V promote(K key, boolean deserializeBinary) throws IgniteCheckedException {
         // Unswap only from dht(). Near cache does not have swap storage.
-        return dht().promote(key, deserializePortable);
+        return dht().promote(key, deserializeBinary);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
index 9705569..cb866e3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearGetFuture.java
@@ -91,7 +91,7 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
      * @param tx Transaction.
      * @param subjId Subject ID.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param expiryPlc Expiry policy.
      * @param skipVals Skip values flag.
      * @param canRemap Flag indicating whether future can be remapped on a newer topology version.
@@ -106,7 +106,7 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
         @Nullable IgniteTxLocalEx tx,
         @Nullable UUID subjId,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         @Nullable IgniteCacheExpiryPolicy expiryPlc,
         boolean skipVals,
         boolean canRemap,
@@ -119,7 +119,7 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
             forcePrimary,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             expiryPlc,
             skipVals,
             canRemap,
@@ -423,7 +423,7 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
                             null,
                             taskName,
                             expiryPlc,
-                            !deserializePortable);
+                            !deserializeBinary);
 
                         if (res != null) {
                             v = res.get1();
@@ -443,7 +443,7 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
                             null,
                             taskName,
                             expiryPlc,
-                            !deserializePortable);
+                            !deserializeBinary);
                     }
                 }
 
@@ -472,7 +472,7 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
                                     null,
                                     taskName,
                                     expiryPlc,
-                                    !deserializePortable);
+                                    !deserializeBinary);
 
                                 if (res != null) {
                                     v = res.get1();
@@ -492,7 +492,7 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
                                     null,
                                     taskName,
                                     expiryPlc,
-                                    !deserializePortable);
+                                    !deserializeBinary);
                             }
 
                             // Entry was not in memory or in swap, so we remove it from cache.
@@ -544,9 +544,9 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
                             add(new GridFinishedFuture<>(Collections.singletonMap(key0, val0)));
                         }
                         else {
-                            K key0 = (K)cctx.unwrapPortableIfNeeded(key, !deserializePortable, false);
+                            K key0 = (K)cctx.unwrapBinaryIfNeeded(key, !deserializeBinary, false);
                             V val0 = !skipVals ?
-                                (V)cctx.unwrapPortableIfNeeded(v, !deserializePortable, false) :
+                                (V)cctx.unwrapBinaryIfNeeded(v, !deserializeBinary, false) :
                                 (V)Boolean.TRUE;
 
                             add(new GridFinishedFuture<>(Collections.singletonMap(key0, val0)));
@@ -681,7 +681,7 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
                             info.ttl(),
                             info.expireTime(),
                             true,
-                            !deserializePortable,
+                            !deserializeBinary,
                             topVer,
                             subjId);
                     }
@@ -699,7 +699,7 @@ public final class GridNearGetFuture<K, V> extends CacheDistributedGetFutureAdap
                             val,
                             skipVals,
                             keepCacheObjects,
-                            deserializePortable,
+                            deserializeBinary,
                             false);
                 }
                 catch (GridCacheEntryRemovedException ignore) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
index 3441eee..a09dec0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTransactionalCache.java
@@ -120,7 +120,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
         boolean skipTx,
         @Nullable UUID subjId,
         String taskName,
-        final boolean deserializePortable,
+        final boolean deserializeBinary,
         final boolean skipVals,
         boolean canRemap
     ) {
@@ -143,7 +143,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
                 @Override public IgniteInternalFuture<Map<K, V>> op(IgniteTxLocalAdapter tx) {
                     return tx.getAllAsync(ctx,
                         ctx.cacheKeysView(keys),
-                        deserializePortable,
+                        deserializeBinary,
                         skipVals,
                         false,
                         skipStore);
@@ -158,7 +158,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
             forcePrimary,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             skipVals ? null : opCtx != null ? opCtx.expiry() : null,
             skipVals,
             skipStore,
@@ -169,7 +169,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
      * @param tx Transaction.
      * @param keys Keys to load.
      * @param readThrough Read through flag.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param expiryPlc Expiry policy.
      * @param skipVals Skip values flag.
      * @param needVer If {@code true} returns values as tuples containing value and version.
@@ -178,7 +178,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
     IgniteInternalFuture<Map<K, V>> txLoadAsync(GridNearTxLocal tx,
         @Nullable Collection<KeyCacheObject> keys,
         boolean readThrough,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         @Nullable IgniteCacheExpiryPolicy expiryPlc,
         boolean skipVals,
         boolean needVer) {
@@ -191,7 +191,7 @@ public class GridNearTransactionalCache<K, V> extends GridNearCacheAdapter<K, V>
             tx,
             CU.subjectId(tx, ctx.shared()),
             tx.resolveTaskName(),
-            deserializePortable,
+            deserializeBinary,
             expiryPlc,
             skipVals,
             /*can remap*/true,

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
index 2eb4c68..ae4972e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxLocal.java
@@ -341,7 +341,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
             return cacheCtx.nearTx().txLoadAsync(this,
                 keys,
                 readThrough,
-                /*deserializePortable*/false,
+                /*deserializeBinary*/false,
                 accessPolicy(cacheCtx, keys),
                 skipVals,
                 needVer).chain(new C1<IgniteInternalFuture<Map<Object, Object>>, Void>() {
@@ -372,7 +372,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
                     topologyVersion(),
                     CU.subjectId(this, cctx),
                     resolveTaskName(),
-                    /*deserializePortable*/false,
+                    /*deserializeBinary*/false,
                     accessPolicy(cacheCtx, keys),
                     skipVals,
                     /*can remap*/true,
@@ -403,7 +403,7 @@ public class GridNearTxLocal extends GridDhtTxLocalAdapter {
                     topologyVersion(),
                     CU.subjectId(this, cctx),
                     resolveTaskName(),
-                    /*deserializePortable*/false,
+                    /*deserializeBinary*/false,
                     accessPolicy(cacheCtx, keys),
                     skipVals,
                     /*can remap*/true,

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
index dda5ed2..6130ead 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java
@@ -477,14 +477,14 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
     /** {@inheritDoc} */
 
     @SuppressWarnings("unchecked")
-    @Override @Nullable public V get(K key, boolean deserializePortable) throws IgniteCheckedException {
+    @Override @Nullable public V get(K key, boolean deserializeBinary) throws IgniteCheckedException {
         String taskName = ctx.kernalContext().job().currentTaskName();
 
         Map<K, V> m = getAllInternal(Collections.singleton(key),
             ctx.isSwapOrOffheapEnabled(),
             ctx.readThrough(),
             taskName,
-            deserializePortable,
+            deserializeBinary,
             false);
 
         assert m.isEmpty() || m.size() == 1 : m.size();
@@ -494,7 +494,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
 
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
-    @Override public final Map<K, V> getAll(Collection<? extends K> keys, boolean deserializePortable)
+    @Override public final Map<K, V> getAll(Collection<? extends K> keys, boolean deserializeBinary)
         throws IgniteCheckedException {
         A.notNull(keys, "keys");
 
@@ -504,7 +504,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
             ctx.isSwapOrOffheapEnabled(),
             ctx.readThrough(),
             taskName,
-            deserializePortable,
+            deserializeBinary,
             false);
     }
 
@@ -517,7 +517,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
         boolean skipTx,
         @Nullable UUID subjId,
         final String taskName,
-        final boolean deserializePortable,
+        final boolean deserializeBinary,
         final boolean skipVals,
         boolean canRemap
     ) {
@@ -528,7 +528,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
 
         return asyncOp(new Callable<Map<K, V>>() {
             @Override public Map<K, V> call() throws Exception {
-                return getAllInternal(keys, swapOrOffheap, storeEnabled, taskName, deserializePortable, skipVals);
+                return getAllInternal(keys, swapOrOffheap, storeEnabled, taskName, deserializeBinary, skipVals);
             }
         });
     }
@@ -540,7 +540,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
      * @param swapOrOffheap {@code True} if swap of off-heap storage are enabled.
      * @param storeEnabled Store enabled flag.
      * @param taskName Task name.
-     * @param deserializePortable Deserialize portable .
+     * @param deserializeBinary Deserialize binary .
      * @param skipVals Skip value flag.
      * @return Key-value map.
      * @throws IgniteCheckedException If failed.
@@ -550,7 +550,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
         boolean swapOrOffheap,
         boolean storeEnabled,
         String taskName,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         boolean skipVals
     ) throws IgniteCheckedException {
         ctx.checkSecurity(SecurityPermission.CACHE_READ);
@@ -596,10 +596,10 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                             null,
                             taskName,
                             expiry,
-                            !deserializePortable);
+                            !deserializeBinary);
 
                         if (v != null)
-                            ctx.addResult(vals, cacheKey, v, skipVals, false, deserializePortable, true);
+                            ctx.addResult(vals, cacheKey, v, skipVals, false, deserializeBinary, true);
                         else
                             success = false;
                     }
@@ -634,7 +634,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
             false,
             subjId,
             taskName,
-            deserializePortable,
+            deserializeBinary,
             /*force primary*/false,
             expiry,
             skipVals,
@@ -667,7 +667,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
 
         CacheOperationContext opCtx = ctx.operationContextPerCall();
 
-        final boolean keepPortable = opCtx != null && opCtx.isKeepBinary();
+        final boolean keepBinary = opCtx != null && opCtx.isKeepBinary();
 
         return (Map<K, EntryProcessorResult<T>>)updateAllInternal(TRANSFORM,
             invokeMap.keySet(),
@@ -679,7 +679,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
             null,
             ctx.writeThrough(),
             ctx.readThrough(),
-            keepPortable);
+            keepBinary);
     }
 
     /** {@inheritDoc} */
@@ -820,7 +820,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
 
         final ExpiryPolicy expiry = expiryPerCall();
 
-        final boolean keepPortable = opCtx != null && opCtx.isKeepBinary();
+        final boolean keepBinary = opCtx != null && opCtx.isKeepBinary();
 
         IgniteInternalFuture fut = asyncOp(new Callable<Object>() {
             @Override public Object call() throws Exception {
@@ -834,7 +834,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                     filter,
                     writeThrough,
                     readThrough,
-                    keepPortable);
+                    keepBinary);
             }
         });
 
@@ -871,7 +871,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
 
         CacheOperationContext opCtx = ctx.operationContextPerCall();
 
-        final boolean keepPortable = opCtx != null && opCtx.isKeepBinary();
+        final boolean keepBinary = opCtx != null && opCtx.isKeepBinary();
 
         IgniteInternalFuture fut = asyncOp(new Callable<Object>() {
             @Override public Object call() throws Exception {
@@ -885,7 +885,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                     filter,
                     writeThrough,
                     readThrough,
-                    keepPortable);
+                    keepBinary);
             }
         });
 
@@ -922,7 +922,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
         CacheEntryPredicate[] filter,
         boolean writeThrough,
         boolean readThrough,
-        boolean keepPortable
+        boolean keepBinary
     ) throws IgniteCheckedException {
         if (keyCheck)
             validateCacheKeys(keys);
@@ -946,7 +946,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                 expiryPlc,
                 ver,
                 filter,
-                keepPortable,
+                keepBinary,
                 subjId,
                 taskName);
         }
@@ -987,7 +987,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                         writeThrough,
                         readThrough,
                         retval,
-                        keepPortable,
+                        keepBinary,
                         expiryPlc,
                         true,
                         true,
@@ -1042,7 +1042,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
         if (err != null)
             throw err;
 
-        Object ret = res == null ? null : rawRetval ? new GridCacheReturn(ctx,  true, keepPortable, res.get2(), res.get1()) :
+        Object ret = res == null ? null : rawRetval ? new GridCacheReturn(ctx,  true, keepBinary, res.get2(), res.get1()) :
             (retval || op == TRANSFORM) ? res.get2() : res.get1();
 
         if (op == TRANSFORM && ret == null)
@@ -1075,7 +1075,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
         @Nullable ExpiryPolicy expiryPlc,
         GridCacheVersion ver,
         @Nullable CacheEntryPredicate[] filter,
-        boolean keepPortable,
+        boolean keepBinary,
         UUID subjId,
         String taskName
     ) throws IgniteCheckedException {
@@ -1144,12 +1144,12 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                             entryProcessor,
                             taskName,
                             null,
-                            keepPortable);
+                            keepBinary);
 
                         Object oldVal = null;
 
                         CacheInvokeEntry<Object, Object> invokeEntry = new CacheInvokeEntry<>(ctx, entry.key(), old,
-                            entry.version(), keepPortable);
+                            entry.version(), keepBinary);
 
                         CacheObject updated;
                         Object updatedVal = null;
@@ -1178,7 +1178,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                             if (intercept) {
                                 IgniteBiTuple<Boolean, ?> interceptorRes = ctx.config().getInterceptor()
                                     .onBeforeRemove(new CacheLazyEntry(ctx, entry.key(), invokeEntry.key(),
-                                        old, oldVal, keepPortable));
+                                        old, oldVal, keepBinary));
 
                                 if (ctx.cancelRemove(interceptorRes))
                                     continue;
@@ -1193,7 +1193,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                                     putMap,
                                     null,
                                     expiryPlc,
-                                    keepPortable,
+                                    keepBinary,
                                     err,
                                     subjId,
                                     taskName);
@@ -1214,7 +1214,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                             if (intercept) {
                                 Object interceptorVal = ctx.config().getInterceptor()
                                     .onBeforePut(new CacheLazyEntry(ctx, entry.key(), invokeEntry.getKey(),
-                                        old, oldVal, keepPortable), updatedVal);
+                                        old, oldVal, keepBinary), updatedVal);
 
                                 if (interceptorVal == null)
                                     continue;
@@ -1231,7 +1231,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                                     null,
                                     rmvKeys,
                                     expiryPlc,
-                                    keepPortable,
+                                    keepBinary,
                                     err,
                                     subjId,
                                     taskName);
@@ -1266,10 +1266,10 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                                 null,
                                 taskName,
                                 null,
-                                keepPortable);
+                                keepBinary);
 
                             Object interceptorVal = ctx.config().getInterceptor().onBeforePut(new CacheLazyEntry(
-                                ctx, entry.key(), old, keepPortable), val);
+                                ctx, entry.key(), old, keepBinary), val);
 
                             if (interceptorVal == null)
                                 continue;
@@ -1301,10 +1301,10 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                                 null,
                                 taskName,
                                 null,
-                                keepPortable);
+                                keepBinary);
 
                             IgniteBiTuple<Boolean, ?> interceptorRes = ctx.config().getInterceptor()
-                                .onBeforeRemove(new CacheLazyEntry(ctx, entry.key(), old, keepPortable));
+                                .onBeforeRemove(new CacheLazyEntry(ctx, entry.key(), old, keepBinary));
 
                             if (ctx.cancelRemove(interceptorRes))
                                 continue;
@@ -1338,7 +1338,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                     putMap,
                     rmvKeys,
                     expiryPlc,
-                    keepPortable,
+                    keepBinary,
                     err,
                     subjId,
                     taskName);
@@ -1376,7 +1376,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
         @Nullable Map<Object, Object> putMap,
         @Nullable Collection<Object> rmvKeys,
         @Nullable ExpiryPolicy expiryPlc,
-        boolean keepPortable,
+        boolean keepBinary,
         @Nullable CachePartialUpdateCheckedException err,
         UUID subjId,
         String taskName
@@ -1446,7 +1446,7 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
                     false,
                     false,
                     false,
-                    keepPortable,
+                    keepBinary,
                     expiryPlc,
                     true,
                     true,
@@ -1457,9 +1457,9 @@ public class GridLocalAtomicCache<K, V> extends GridCacheAdapter<K, V> {
 
                 if (intercept) {
                     if (op == UPDATE)
-                        ctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(ctx, entry.key(), writeVal, keepPortable));
+                        ctx.config().getInterceptor().onAfterPut(new CacheLazyEntry(ctx, entry.key(), writeVal, keepBinary));
                     else
-                        ctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(ctx, entry.key(), t.get2(), keepPortable));
+                        ctx.config().getInterceptor().onAfterRemove(new CacheLazyEntry(ctx, entry.key(), t.get2(), keepBinary));
                 }
             }
             catch (GridCacheEntryRemovedException ignore) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
index 578f6de..7f63b4c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
@@ -273,7 +273,7 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
                 req.className(),
                 req.clause(),
                 req.includeMetaData(),
-                req.keepPortable(),
+                req.keepBinary(),
                 req.subjectId(),
                 req.taskHash()
             );
@@ -566,7 +566,7 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
                 qry.query().includeBackups(),
                 qry.arguments(),
                 false,
-                qry.query().keepPortable(),
+                qry.query().keepBinary(),
                 qry.query().subjectId(),
                 qry.query().taskHash(),
                 queryTopologyVersion(),
@@ -612,7 +612,7 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
                 qry.includeBackups(),
                 fut.fields(),
                 all,
-                qry.keepPortable(),
+                qry.keepBinary(),
                 qry.subjectId(),
                 qry.taskHash(),
                 queryTopologyVersion(),
@@ -679,7 +679,7 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
                 qry.query().includeBackups(),
                 qry.arguments(),
                 qry.query().includeMetadata(),
-                qry.query().keepPortable(),
+                qry.query().keepBinary(),
                 qry.query().subjectId(),
                 qry.query().taskHash(),
                 queryTopologyVersion(),

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
index 855e239..b948dc5 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryAdapter.java
@@ -73,7 +73,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
     /** */
     private final IgniteLogger log;
 
-    /** Class name in case of portable query. */
+    /** Class name in case of binary query. */
     private final String clsName;
 
     /** */
@@ -110,7 +110,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
     private volatile ClusterGroup prj;
 
     /** */
-    private boolean keepPortable;
+    private boolean keepBinary;
 
     /** */
     private UUID subjId;
@@ -126,7 +126,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
      * @param filter Scan filter.
      * @param part Partition.
      * @param incMeta Include metadata flag.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      */
     public GridCacheQueryAdapter(GridCacheContext<?, ?> cctx,
         GridCacheQueryType type,
@@ -135,7 +135,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
         @Nullable IgniteBiPredicate<Object, Object> filter,
         @Nullable Integer part,
         boolean incMeta,
-        boolean keepPortable) {
+        boolean keepBinary) {
         assert cctx != null;
         assert type != null;
         assert part == null || part >= 0;
@@ -147,7 +147,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
         this.filter = filter;
         this.part = part;
         this.incMeta = incMeta;
-        this.keepPortable = keepPortable;
+        this.keepBinary = keepBinary;
 
         log = cctx.logger(getClass());
 
@@ -169,7 +169,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
      * @param clsName Class name.
      * @param clause Clause.
      * @param incMeta Include metadata flag.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @param subjId Security subject ID.
      * @param taskHash Task hash.
      */
@@ -187,7 +187,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
         @Nullable String clsName,
         String clause,
         boolean incMeta,
-        boolean keepPortable,
+        boolean keepBinary,
         UUID subjId,
         int taskHash) {
         this.cctx = cctx;
@@ -204,7 +204,7 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
         this.clsName = clsName;
         this.clause = clause;
         this.incMeta = incMeta;
-        this.keepPortable = keepPortable;
+        this.keepBinary = keepBinary;
         this.subjId = subjId;
         this.taskHash = taskHash;
     }
@@ -238,19 +238,19 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
     }
 
     /**
-     * @return {@code True} if portable should not be deserialized.
+     * @return {@code True} if binary should not be deserialized.
      */
-    public boolean keepPortable() {
-        return keepPortable;
+    public boolean keepBinary() {
+        return keepBinary;
     }
 
     /**
-     * Forces query to keep portable object representation even if query was created on plain projection.
+     * Forces query to keep binary object representation even if query was created on plain projection.
      *
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      */
-    public void keepPortable(boolean keepPortable) {
-        this.keepPortable = keepPortable;
+    public void keepBinary(boolean keepBinary) {
+        this.keepBinary = keepBinary;
     }
 
     /**
@@ -721,4 +721,4 @@ public class GridCacheQueryAdapter<T> implements CacheQuery<T> {
             }
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
index 2a4fbda..e3e5d98 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
@@ -402,7 +402,7 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
 
                 data = dedupIfRequired((Collection<Object>)data);
 
-                data = cctx.unwrapPortablesIfNeeded((Collection<Object>)data, qry.query().keepPortable());
+                data = cctx.unwrapBinariesIfNeeded((Collection<Object>)data, qry.query().keepBinary());
 
                 synchronized (mux) {
                     enqueue(data);
@@ -583,4 +583,4 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
         X.println(">>>  keysSize: " + keys.size());
         X.println(">>>  cnt: " + cnt);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 4681e47..15502a0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -807,8 +807,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
         throws IgniteCheckedException {
         IgniteInternalCache<K, V> prj0 = cctx.cache();
 
-        if (qry.keepPortable())
-            prj0 = prj0.keepPortable();
+        if (qry.keepBinary())
+            prj0 = prj0.keepBinary();
 
         final IgniteInternalCache<K, V> prj = prj0;
 
@@ -907,7 +907,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                                     entry != null ? entry.peek(true, false, false, topVer, expiryPlc) : null;
 
                                 // TODO 950 nocopy
-                                val = (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(cacheVal, qry.keepPortable());
+                                val = (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(cacheVal, qry.keepBinary());
                             }
                             catch (GridCacheEntryRemovedException e) {
                                 val = null;
@@ -960,7 +960,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
 
                     private boolean checkPredicate(Map.Entry<K, V> e) {
                         if (keyValFilter != null) {
-                            Map.Entry<K, V> e0 = (Map.Entry<K, V>)cctx.unwrapPortableIfNeeded(e, qry.keepPortable());
+                            Map.Entry<K, V> e0 = (Map.Entry<K, V>)cctx.unwrapBinaryIfNeeded(e, qry.keepBinary());
 
                             return keyValFilter.apply(e0.getKey(), e0.getValue());
                         }
@@ -1043,7 +1043,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
         Iterator<Map.Entry<byte[], byte[]>> it = part == null ? cctx.swap().rawSwapIterator(true, backups) :
             cctx.swap().rawSwapIterator(part);
 
-        return scanIterator(it, filter, qry.keepPortable());
+        return scanIterator(it, filter, qry.keepBinary());
     }
 
     /**
@@ -1055,27 +1055,27 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
         IgniteBiPredicate<K, V> filter = qry.scanFilter();
 
         if (cctx.offheapTiered() && filter != null) {
-            OffheapIteratorClosure c = new OffheapIteratorClosure(filter, qry.keepPortable());
+            OffheapIteratorClosure c = new OffheapIteratorClosure(filter, qry.keepBinary());
 
             return cctx.swap().rawOffHeapIterator(c, qry.partition(), true, backups);
         }
         else {
             Iterator<Map.Entry<byte[], byte[]>> it = cctx.swap().rawOffHeapIterator(qry.partition(), true, backups);
 
-            return scanIterator(it, filter, qry.keepPortable());
+            return scanIterator(it, filter, qry.keepBinary());
         }
     }
 
     /**
      * @param it Lazy swap or offheap iterator.
      * @param filter Scan filter.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @return Iterator.
      */
     private GridIteratorAdapter<IgniteBiTuple<K, V>> scanIterator(
         @Nullable final Iterator<Map.Entry<byte[], byte[]>> it,
         @Nullable final IgniteBiPredicate<K, V> filter,
-        final boolean keepPortable) {
+        final boolean keepBinary) {
         if (it == null)
             return new GridEmptyCloseableIterator<>();
 
@@ -1109,11 +1109,11 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                 next = null;
 
                 while (it.hasNext()) {
-                    final LazySwapEntry e = new LazySwapEntry(it.next(), keepPortable);
+                    final LazySwapEntry e = new LazySwapEntry(it.next(), keepBinary);
 
                     if (filter != null) {
-                        K key = (K)cctx.unwrapPortableIfNeeded(e.key(), keepPortable);
-                        V val = (V)cctx.unwrapPortableIfNeeded(e.value(), keepPortable);
+                        K key = (K)cctx.unwrapBinaryIfNeeded(e.key(), keepBinary);
+                        V val = (V)cctx.unwrapBinaryIfNeeded(e.value(), keepBinary);
 
                         if (!filter.apply(key, val))
                             continue;
@@ -1536,7 +1536,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
 
                     // Unwrap entry for reducer or transformer only.
                     if (rdc != null || trans != null)
-                        entry = (Map.Entry<K, V>)cctx.unwrapPortableIfNeeded(entry, qry.keepPortable());
+                        entry = (Map.Entry<K, V>)cctx.unwrapBinaryIfNeeded(entry, qry.keepBinary());
 
                     // Reduce.
                     if (rdc != null) {
@@ -2549,7 +2549,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
 
             CacheObject obj = cctx.cacheObjects().toCacheObject(cctx.cacheObjectContext(), t.get2(), t.get1());
 
-            return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(obj, keepBinary);
+            return (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(obj, keepBinary);
         }
 
         /** {@inheritDoc} */
@@ -2636,19 +2636,19 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
         private IgniteBiPredicate<K, V> filter;
 
         /** */
-        private boolean keepPortable;
+        private boolean keepBinary;
 
         /**
          * @param filter Filter.
-         * @param keepPortable Keep portable flag.
+         * @param keepBinary Keep binary flag.
          */
         private OffheapIteratorClosure(
             @Nullable IgniteBiPredicate<K, V> filter,
-            boolean keepPortable) {
+            boolean keepBinary) {
             assert filter != null;
 
             this.filter = filter;
-            this.keepPortable = keepPortable;
+            this.keepBinary = keepBinary;
         }
 
         /** {@inheritDoc} */
@@ -2657,8 +2657,8 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
             throws IgniteCheckedException {
             LazyOffheapEntry e = new LazyOffheapEntry(keyPtr, valPtr);
 
-            K key = (K)cctx.unwrapPortableIfNeeded(e.key(), keepPortable);
-            V val = (V)cctx.unwrapPortableIfNeeded(e.value(), keepPortable);
+            K key = (K)cctx.unwrapBinaryIfNeeded(e.key(), keepBinary);
+            V val = (V)cctx.unwrapBinaryIfNeeded(e.value(), keepBinary);
 
             if (!filter.apply(key, val))
                 return null;
@@ -3042,10 +3042,10 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
     /**
      * Query for {@link IndexingSpi}.
      *
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @return Query.
      */
-    public <R> CacheQuery<R> createSpiQuery(boolean keepPortable) {
+    public <R> CacheQuery<R> createSpiQuery(boolean keepBinary) {
         return new GridCacheQueryAdapter<>(cctx,
             SPI,
             null,
@@ -3053,7 +3053,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
             null,
             null,
             false,
-            keepPortable);
+            keepBinary);
     }
 
     /**
@@ -3061,11 +3061,11 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
      *
      * @param filter Scan filter.
      * @param part Partition.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @return Created query.
      */
     public CacheQuery<Map.Entry<K, V>> createScanQuery(@Nullable IgniteBiPredicate<K, V> filter,
-        @Nullable Integer part, boolean keepPortable) {
+        @Nullable Integer part, boolean keepBinary) {
 
         return new GridCacheQueryAdapter<>(cctx,
             SCAN,
@@ -3074,7 +3074,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
             (IgniteBiPredicate<Object, Object>)filter,
             part,
             false,
-            keepPortable);
+            keepBinary);
     }
 
     /**
@@ -3083,11 +3083,11 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
      *
      * @param clsName Query class name.
      * @param search Search clause.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @return Created query.
      */
     public CacheQuery<Map.Entry<K, V>> createFullTextQuery(String clsName,
-        String search, boolean keepPortable) {
+        String search, boolean keepBinary) {
         A.notNull("clsName", clsName);
         A.notNull("search", search);
 
@@ -3098,7 +3098,7 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
             null,
             null,
             false,
-            keepPortable);
+            keepBinary);
     }
 
     /**
@@ -3106,10 +3106,10 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
      * documentation.
      *
      * @param qry Query.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @return Created query.
      */
-    public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean keepPortable) {
+    public CacheQuery<List<?>> createSqlFieldsQuery(String qry, boolean keepBinary) {
         A.notNull(qry, "qry");
 
         return new GridCacheQueryAdapter<>(cctx,
@@ -3119,6 +3119,6 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
             null,
             null,
             false,
-            keepPortable);
+            keepBinary);
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
index fa2d6b1..9fae5e1 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryRequest.java
@@ -111,7 +111,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
     private boolean all;
 
     /** */
-    private boolean keepPortable;
+    private boolean keepBinary;
 
     /** */
     private UUID subjId;
@@ -165,7 +165,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
      * @param incBackups {@code true} if need to include backups.
      * @param fields Fields query flag.
      * @param all Whether to load all pages.
-     * @param keepPortable Whether to keep binary.
+     * @param keepBinary Whether to keep binary.
      * @param subjId Subject ID.
      * @param taskHash Task name hash code.
      * @param topVer Topology version.
@@ -179,7 +179,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
         boolean incBackups,
         boolean fields,
         boolean all,
-        boolean keepPortable,
+        boolean keepBinary,
         UUID subjId,
         int taskHash,
         AffinityTopologyVersion topVer,
@@ -192,7 +192,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
         this.incBackups = incBackups;
         this.fields = fields;
         this.all = all;
-        this.keepPortable = keepPortable;
+        this.keepBinary = keepBinary;
         this.subjId = subjId;
         this.taskHash = taskHash;
         this.topVer = topVer;
@@ -215,7 +215,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
      * @param incBackups {@code true} if need to include backups.
      * @param args Query arguments.
      * @param incMeta Include meta data or not.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @param subjId Subject ID.
      * @param taskHash Task name hash code.
      * @param topVer Topology version.
@@ -237,7 +237,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
         boolean incBackups,
         Object[] args,
         boolean incMeta,
-        boolean keepPortable,
+        boolean keepBinary,
         UUID subjId,
         int taskHash,
         AffinityTopologyVersion topVer,
@@ -262,7 +262,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
         this.incBackups = incBackups;
         this.args = args;
         this.incMeta = incMeta;
-        this.keepPortable = keepPortable;
+        this.keepBinary = keepBinary;
         this.subjId = subjId;
         this.taskHash = taskHash;
         this.topVer = topVer;
@@ -454,8 +454,8 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
     /**
      * @return Whether to keep binary.
      */
-    public boolean keepPortable() {
-        return keepPortable;
+    public boolean keepBinary() {
+        return keepBinary;
     }
 
     /**
@@ -555,7 +555,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
                 writer.incrementState();
 
             case 13:
-                if (!writer.writeBoolean("keepPortable", keepPortable))
+                if (!writer.writeBoolean("keepBinary", keepBinary))
                     return false;
 
                 writer.incrementState();
@@ -711,7 +711,7 @@ public class GridCacheQueryRequest extends GridCacheMessage implements GridCache
                 reader.incrementState();
 
             case 13:
-                keepPortable = reader.readBoolean("keepPortable");
+                keepBinary = reader.readBoolean("keepBinary");
 
                 if (!reader.isLastRead())
                     return false;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java
index f665339..d26e666 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryEvent.java
@@ -59,18 +59,18 @@ class CacheContinuousQueryEvent<K, V> extends CacheEntryEvent<K, V> {
     /** {@inheritDoc} */
     @Override
     public K getKey() {
-        return (K)cctx.cacheObjectContext().unwrapPortableIfNeeded(e.key(), e.isKeepBinary(), false);
+        return (K)cctx.cacheObjectContext().unwrapBinaryIfNeeded(e.key(), e.isKeepBinary(), false);
     }
 
     /** {@inheritDoc} */
     @Override public V getValue() {
-        return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(e.value(), e.isKeepBinary(), false);
+        return (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(e.value(), e.isKeepBinary(), false);
     }
 
     /** {@inheritDoc} */
     @Override
     public V getOldValue() {
-        return (V)cctx.cacheObjectContext().unwrapPortableIfNeeded(e.oldValue(), e.isKeepBinary(), false);
+        return (V)cctx.cacheObjectContext().unwrapBinaryIfNeeded(e.oldValue(), e.isKeepBinary(), false);
     }
 
     /** {@inheritDoc} */
@@ -94,4 +94,4 @@ class CacheContinuousQueryEvent<K, V> extends CacheEntryEvent<K, V> {
             "newVal", getValue(),
             "oldVal", getOldValue());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java
index d001c76..e89483a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheOsStoreManager.java
@@ -57,7 +57,7 @@ public class CacheOsStoreManager extends GridCacheStoreManagerAdapter {
             if (store instanceof PlatformCacheStore) {
                 PlatformProcessor proc = ctx.platform();
 
-                proc.registerStore((PlatformCacheStore)store, configuredConvertPortable());
+                proc.registerStore((PlatformCacheStore)store, configuredConvertBinary());
             }
         }
 
@@ -76,12 +76,12 @@ public class CacheOsStoreManager extends GridCacheStoreManagerAdapter {
     }
 
     /** {@inheritDoc} */
-    @Override public boolean convertPortable() {
-        return configuredConvertPortable() && !(cfgStore instanceof PlatformCacheStore);
+    @Override public boolean convertBinary() {
+        return configuredConvertBinary() && !(cfgStore instanceof PlatformCacheStore);
     }
 
     /** {@inheritDoc} */
-    @Override public boolean configuredConvertPortable() {
+    @Override public boolean configuredConvertBinary() {
         return !(ctx.config().getMarshaller() instanceof BinaryMarshaller && cfg.isKeepBinaryInStore());
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheStoreManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheStoreManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheStoreManager.java
index 509c806..67c9334 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheStoreManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/CacheStoreManager.java
@@ -188,12 +188,12 @@ public interface CacheStoreManager<K, V> extends GridCacheManager<K, V> {
     public void forceFlush() throws IgniteCheckedException;
 
     /**
-     * @return Convert-portable flag.
+     * @return Convert-binary flag.
      */
-    public boolean convertPortable();
+    public boolean convertBinary();
 
     /**
-     * @return Configured convert portable flag.
+     * @return Configured convert binary flag.
      */
-    public boolean configuredConvertPortable();
-}
\ No newline at end of file
+    public boolean configuredConvertBinary();
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
index af3a77b..7ffebbd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/store/GridCacheStoreManagerAdapter.java
@@ -283,7 +283,7 @@ public abstract class GridCacheStoreManagerAdapter extends GridCacheManagerAdapt
                 // Never load internal keys from store as they are never persisted.
                 return null;
 
-            Object storeKey = cctx.unwrapPortableIfNeeded(key, !convertPortable());
+            Object storeKey = cctx.unwrapBinaryIfNeeded(key, !convertBinary());
 
             if (log.isDebugEnabled())
                 log.debug("Loading value from store for key: " + storeKey);
@@ -410,7 +410,7 @@ public abstract class GridCacheStoreManagerAdapter extends GridCacheManagerAdapt
             Collection<Object> keys0 = F.viewReadOnly(keys,
                 new C1<KeyCacheObject, Object>() {
                     @Override public Object apply(KeyCacheObject key) {
-                        return cctx.unwrapPortableIfNeeded(key, !convertPortable());
+                        return cctx.unwrapBinaryIfNeeded(key, !convertBinary());
                     }
                 });
 
@@ -533,8 +533,8 @@ public abstract class GridCacheStoreManagerAdapter extends GridCacheManagerAdapt
             if (key instanceof GridCacheInternal)
                 return true;
 
-            key = cctx.unwrapPortableIfNeeded(key, !convertPortable());
-            val = cctx.unwrapPortableIfNeeded(val, !convertPortable());
+            key = cctx.unwrapBinaryIfNeeded(key, !convertBinary());
+            val = cctx.unwrapBinaryIfNeeded(val, !convertBinary());
 
             if (log.isDebugEnabled())
                 log.debug("Storing value in cache store [key=" + key + ", val=" + val + ']');
@@ -636,7 +636,7 @@ public abstract class GridCacheStoreManagerAdapter extends GridCacheManagerAdapt
             if (key instanceof GridCacheInternal)
                 return false;
 
-            key = cctx.unwrapPortableIfNeeded(key, !convertPortable());
+            key = cctx.unwrapBinaryIfNeeded(key, !convertBinary());
 
             if (log.isDebugEnabled())
                 log.debug("Removing value from cache store [key=" + key + ']');
@@ -684,7 +684,7 @@ public abstract class GridCacheStoreManagerAdapter extends GridCacheManagerAdapt
         }
 
         if (store != null) {
-            Collection<Object> keys0 = cctx.unwrapPortablesIfNeeded(keys, !convertPortable());
+            Collection<Object> keys0 = cctx.unwrapBinariesIfNeeded(keys, !convertBinary());
 
             if (log.isDebugEnabled())
                 log.debug("Removing values from cache store [keys=" + keys0 + ']');
@@ -771,7 +771,7 @@ public abstract class GridCacheStoreManagerAdapter extends GridCacheManagerAdapt
         assert e != null;
 
         if (e.getMessage() != null) {
-            throw new IgniteCheckedException("Cache store must work with portable objects if binary are " +
+            throw new IgniteCheckedException("Cache store must work with binary objects if binary are " +
                 "enabled for cache [cacheName=" + cctx.namex() + ']', e);
         }
         else
@@ -1093,8 +1093,8 @@ public abstract class GridCacheStoreManagerAdapter extends GridCacheManagerAdapt
 
                         Object v = locStore ? e.getValue() : e.getValue().get1();
 
-                        k = cctx.unwrapPortableIfNeeded(k, !convertPortable());
-                        v = cctx.unwrapPortableIfNeeded(v, !convertPortable());
+                        k = cctx.unwrapBinaryIfNeeded(k, !convertBinary());
+                        v = cctx.unwrapBinaryIfNeeded(v, !convertBinary());
 
                         if (rmvd != null && rmvd.contains(k))
                             continue;


[10/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary"

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainLazyValue.java
new file mode 100644
index 0000000..84e96d3
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainLazyValue.java
@@ -0,0 +1,49 @@
+/*
+ * 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.binary.builder;
+
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+
+/**
+ *
+ */
+class BinaryPlainLazyValue extends BinaryAbstractLazyValue {
+    /** */
+    protected final int len;
+
+    /**
+     * @param reader Reader
+     * @param valOff Offset
+     * @param len Length.
+     */
+    protected BinaryPlainLazyValue(BinaryBuilderReader reader, int valOff, int len) {
+        super(reader, valOff);
+
+        this.len = len;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected Object init() {
+        return reader.reader().unmarshal(valOff);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) {
+        writer.write(reader.array(), valOff, len);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryValueWithType.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryValueWithType.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryValueWithType.java
new file mode 100644
index 0000000..9f43bdb
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryValueWithType.java
@@ -0,0 +1,76 @@
+/*
+ * 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.binary.builder;
+
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ *
+ */
+class BinaryValueWithType implements BinaryLazyValue {
+    /** */
+    private byte type;
+
+    /** */
+    private Object val;
+
+    /**
+     * @param type Type
+     * @param val Value.
+     */
+    BinaryValueWithType(byte type, Object val) {
+        this.type = type;
+        this.val = val;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) {
+        if (val instanceof BinaryBuilderSerializationAware)
+            ((BinaryBuilderSerializationAware)val).writeTo(writer, ctx);
+        else
+            ctx.writeValue(writer, val);
+    }
+
+    /**
+     * @return Type ID.
+     */
+    public int typeId() {
+        return type;
+    }
+
+    /** {@inheritDoc} */
+    @Override public Object value() {
+        if (val instanceof BinaryLazyValue)
+            return ((BinaryLazyValue)val).value();
+
+        return val;
+    }
+
+    /**
+     * @param val New value.
+     */
+    public void value(Object val) {
+        this.val = val;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(BinaryValueWithType.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableAbstractLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableAbstractLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableAbstractLazyValue.java
deleted file mode 100644
index 0b6cc0a..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableAbstractLazyValue.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.binary.builder;
-
-/**
- *
- */
-abstract class PortableAbstractLazyValue implements PortableLazyValue {
-    /** */
-    protected Object val;
-
-    /** */
-    protected final PortableBuilderReader reader;
-
-    /** */
-    protected final int valOff;
-
-    /**
-     * @param reader Reader.
-     * @param valOff Value.
-     */
-    protected PortableAbstractLazyValue(PortableBuilderReader reader, int valOff) {
-        this.reader = reader;
-        this.valOff = valOff;
-    }
-
-    /**
-     * @return Value.
-     */
-    protected abstract Object init();
-
-    /** {@inheritDoc} */
-    @Override public Object value() {
-        if (val == null) {
-            val = init();
-
-            assert val != null;
-        }
-
-        return val;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderEnum.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderEnum.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderEnum.java
deleted file mode 100644
index 779c514..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderEnum.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.binary.builder;
-
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.binary.BinaryInvalidTypeException;
-
-/**
- *
- */
-public class PortableBuilderEnum implements PortableBuilderSerializationAware {
-    /** */
-    private final int ordinal;
-
-    /** */
-    private final int typeId;
-
-    /** */
-    private final String clsName;
-
-    /**
-     * @param typeId Type ID.
-     * @param anEnum Enum instance.
-     */
-    public PortableBuilderEnum(int typeId, Enum anEnum) {
-        ordinal = anEnum.ordinal();
-        this.typeId = typeId;
-        clsName = null;
-    }
-
-    /**
-     * @param reader PortableBuilderReader.
-     */
-    public PortableBuilderEnum(PortableBuilderReader reader) {
-        int typeId = reader.readInt();
-
-        if (typeId == GridPortableMarshaller.UNREGISTERED_TYPE_ID) {
-            clsName = reader.readString();
-
-            Class cls;
-
-            try {
-                cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader());
-            }
-            catch (ClassNotFoundException e) {
-                throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e);
-            }
-
-            this.typeId = reader.portableContext().descriptorForClass(cls, false).typeId();
-        }
-        else {
-            this.typeId = typeId;
-            this.clsName = null;
-        }
-
-        ordinal = reader.readInt();
-    }
-
-    /**
-     * @return Ordinal.
-     */
-    public int getOrdinal() {
-        return ordinal;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeTo(BinaryWriterExImpl writer, PortableBuilderSerializer ctx) {
-        writer.writeByte(GridPortableMarshaller.ENUM);
-
-        if (typeId == GridPortableMarshaller.UNREGISTERED_TYPE_ID) {
-            writer.writeInt(GridPortableMarshaller.UNREGISTERED_TYPE_ID);
-            writer.writeString(clsName);
-        }
-        else
-            writer.writeInt(typeId);
-
-        writer.writeInt(ordinal);
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean equals(Object o) {
-        if (o == null || getClass() != o.getClass())
-            return false;
-
-        PortableBuilderEnum that = (PortableBuilderEnum)o;
-
-        return ordinal == that.ordinal && typeId == that.typeId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int hashCode() {
-        int result = ordinal;
-
-        result = 31 * result + typeId;
-
-        return result;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderReader.java
deleted file mode 100644
index c86fb95..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderReader.java
+++ /dev/null
@@ -1,857 +0,0 @@
-/*
- * 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.binary.builder;
-
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.internal.binary.BinaryObjectImpl;
-import org.apache.ignite.internal.binary.BinaryReaderExImpl;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.PortableContext;
-import org.apache.ignite.internal.binary.PortablePositionReadable;
-import org.apache.ignite.internal.binary.PortablePrimitives;
-import org.apache.ignite.internal.binary.PortableSchema;
-import org.apache.ignite.internal.binary.streams.PortableHeapInputStream;
-import org.apache.ignite.internal.binary.BinaryObjectImpl;
-import org.apache.ignite.internal.binary.BinaryReaderExImpl;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.PortableContext;
-import org.apache.ignite.internal.binary.PortablePositionReadable;
-import org.apache.ignite.internal.binary.PortablePrimitives;
-import org.apache.ignite.internal.binary.PortableSchema;
-import org.apache.ignite.internal.binary.PortableUtils;
-import org.apache.ignite.internal.binary.streams.PortableHeapInputStream;
-
-import java.sql.Timestamp;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.NULL;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.STRING;
-
-/**
- *
- */
-public class PortableBuilderReader implements PortablePositionReadable {
-    /** */
-    private final PortableContext ctx;
-
-    /** */
-    private final byte[] arr;
-
-    /** */
-    private final BinaryReaderExImpl reader;
-
-    /** */
-    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();
-
-        reader = new BinaryReaderExImpl(ctx,
-            PortableHeapInputStream.create(arr, pos),
-            ctx.configuration().getClassLoader());
-
-        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.pos = start;
-
-        reader = new BinaryReaderExImpl(ctx, PortableHeapInputStream.create(arr, start), null, other.reader.handles());
-
-        this.objMap = other.objMap;
-    }
-
-    /**
-     * @return Portable context.
-     */
-    public PortableContext portableContext() {
-        return ctx;
-    }
-
-    /**
-     * @param obj Mutable portable object.
-     */
-    public void registerObject(BinaryObjectBuilderImpl obj) {
-        objMap.put(obj.start(), obj);
-    }
-
-    /**
-     * Get schema of the object, starting at the given position.
-     *
-     * @return Object's schema.
-     */
-    public PortableSchema schema() {
-        return reader.getOrCreateSchema();
-    }
-
-    /**
-     * @return Read int value.
-     */
-    public int readInt() {
-        int res = readInt(0);
-
-        pos += 4;
-
-        return res;
-    }
-
-    /**
-     * @return Read int value.
-     */
-    public byte readByte() {
-        return arr[pos++];
-    }
-
-    /**
-     * @return Read boolean value.
-     */
-    public boolean readBoolean() {
-        return readByte() == 1;
-    }
-
-    /**
-     * @return Read int value.
-     */
-    public byte readByte(int off) {
-        return arr[pos + off];
-    }
-
-    /**
-     * @param off Offset related to {@link #pos}
-     * @return Read int value.
-     */
-    public int readInt(int off) {
-        return PortablePrimitives.readInt(arr, pos + off);
-    }
-
-    /**
-     * @param pos Position in the source array.
-     * @return Read byte value.
-     */
-    public byte readBytePositioned(int pos) {
-        return PortablePrimitives.readByte(arr, pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public short readShortPositioned(int pos) {
-        return PortablePrimitives.readShort(arr, pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public int readIntPositioned(int pos) {
-        return PortablePrimitives.readInt(arr, pos);
-    }
-
-    /**
-     * @return Read length of array.
-     */
-    public int readLength() {
-        return PortablePrimitives.readInt(arr, pos);
-    }
-
-    /**
-     * Read string length.
-     *
-     * @return String length.
-     */
-    public int readStringLength() {
-        return PortablePrimitives.readInt(arr, pos);
-    }
-
-    /**
-     * Reads string.
-     *
-     * @return String.
-     */
-    public String readString() {
-        byte flag = readByte();
-
-        if (flag == GridPortableMarshaller.NULL)
-            return null;
-
-        if (flag != GridPortableMarshaller.STRING)
-            throw new BinaryObjectException("Failed to deserialize String.");
-
-        int len = readInt();
-
-        String str = new String(arr, pos, len, UTF_8);
-
-        pos += len;
-
-        return str;
-    }
-
-    /**
-     *
-     */
-    public void skipValue() {
-        byte type = arr[pos++];
-
-        int len;
-
-        switch (type) {
-            case GridPortableMarshaller.NULL:
-                return;
-
-            case GridPortableMarshaller.OBJ:
-                pos += readInt(GridPortableMarshaller.TOTAL_LEN_POS - 1) - 1;
-
-                return;
-
-            case GridPortableMarshaller.BOOLEAN:
-            case GridPortableMarshaller.BYTE:
-                len = 1;
-                break;
-
-            case GridPortableMarshaller.CHAR:
-            case GridPortableMarshaller.SHORT:
-                len = 2;
-
-                break;
-
-            case GridPortableMarshaller.HANDLE:
-            case GridPortableMarshaller.FLOAT:
-            case GridPortableMarshaller.INT:
-                len = 4;
-
-                break;
-
-            case GridPortableMarshaller.ENUM:
-                //skipping type id and ordinal value
-                len = 8;
-
-                break;
-
-            case GridPortableMarshaller.LONG:
-            case GridPortableMarshaller.DOUBLE:
-                len = 8;
-
-                break;
-
-            case GridPortableMarshaller.BYTE_ARR:
-            case GridPortableMarshaller.BOOLEAN_ARR:
-                len = 4 + readLength();
-
-                break;
-
-            case GridPortableMarshaller.STRING:
-                len = 4 + readStringLength();
-
-                break;
-
-            case GridPortableMarshaller.DECIMAL:
-                len = /** scale */ 4  + /** mag len */ 4  + /** mag bytes count */ readInt(4);
-
-                break;
-
-            case GridPortableMarshaller.UUID:
-                len = 8 + 8;
-
-                break;
-
-            case GridPortableMarshaller.DATE:
-                len = 8;
-
-                break;
-
-            case GridPortableMarshaller.TIMESTAMP:
-                len = 8 + 4;
-
-                break;
-
-            case GridPortableMarshaller.CHAR_ARR:
-            case GridPortableMarshaller.SHORT_ARR:
-                len = 4 + readLength() * 2;
-
-                break;
-
-            case GridPortableMarshaller.INT_ARR:
-            case GridPortableMarshaller.FLOAT_ARR:
-                len = 4 + readLength() * 4;
-
-                break;
-
-            case GridPortableMarshaller.LONG_ARR:
-            case GridPortableMarshaller.DOUBLE_ARR:
-                len = 4 + readLength() * 8;
-
-                break;
-
-            case GridPortableMarshaller.DECIMAL_ARR:
-            case GridPortableMarshaller.DATE_ARR:
-            case GridPortableMarshaller.TIMESTAMP_ARR:
-            case GridPortableMarshaller.OBJ_ARR:
-            case GridPortableMarshaller.ENUM_ARR:
-            case GridPortableMarshaller.UUID_ARR:
-            case GridPortableMarshaller.STRING_ARR: {
-                int size = readInt();
-
-                for (int i = 0; i < size; i++)
-                    skipValue();
-
-                return;
-            }
-
-            case GridPortableMarshaller.COL: {
-                int size = readInt();
-
-                pos++; // skip collection type
-
-                for (int i = 0; i < size; i++)
-                    skipValue();
-
-                return;
-            }
-
-            case GridPortableMarshaller.MAP: {
-                int size = readInt();
-
-                pos++; // skip collection type
-
-                for (int i = 0; i < size; i++) {
-                    skipValue(); // skip key.
-                    skipValue(); // skip value.
-                }
-
-                return;
-            }
-
-            case GridPortableMarshaller.PORTABLE_OBJ:
-                len = readInt() + 4;
-
-                break;
-
-            default:
-                throw new BinaryObjectException("Invalid flag value: " + type);
-        }
-
-        pos += len;
-    }
-
-    /**
-     * @param pos Position.
-     * @param len Length.
-     * @return Object.
-     */
-    public Object getValueQuickly(int pos, int len) {
-        byte type = arr[pos];
-
-        switch (type) {
-            case GridPortableMarshaller.NULL:
-                return null;
-
-            case GridPortableMarshaller.HANDLE: {
-                int objStart = pos - readIntPositioned(pos + 1);
-
-                BinaryObjectBuilderImpl res = objMap.get(objStart);
-
-                if (res == null) {
-                    res = new BinaryObjectBuilderImpl(new PortableBuilderReader(this, objStart), objStart);
-
-                    objMap.put(objStart, res);
-                }
-
-                return res;
-            }
-
-            case GridPortableMarshaller.OBJ: {
-                BinaryObjectBuilderImpl res = objMap.get(pos);
-
-                if (res == null) {
-                    res = new BinaryObjectBuilderImpl(new PortableBuilderReader(this, pos), pos);
-
-                    objMap.put(pos, res);
-                }
-
-                return res;
-            }
-
-            case GridPortableMarshaller.BYTE:
-                return arr[pos + 1];
-
-            case GridPortableMarshaller.SHORT:
-                return PortablePrimitives.readShort(arr, pos + 1);
-
-            case GridPortableMarshaller.INT:
-                return PortablePrimitives.readInt(arr, pos + 1);
-
-            case GridPortableMarshaller.LONG:
-                return PortablePrimitives.readLong(arr, pos + 1);
-
-            case GridPortableMarshaller.FLOAT:
-                return PortablePrimitives.readFloat(arr, pos + 1);
-
-            case GridPortableMarshaller.DOUBLE:
-                return PortablePrimitives.readDouble(arr, pos + 1);
-
-            case GridPortableMarshaller.CHAR:
-                return PortablePrimitives.readChar(arr, pos + 1);
-
-            case GridPortableMarshaller.BOOLEAN:
-                return arr[pos + 1] != 0;
-
-            case GridPortableMarshaller.DECIMAL:
-            case GridPortableMarshaller.STRING:
-            case GridPortableMarshaller.UUID:
-            case GridPortableMarshaller.DATE:
-            case GridPortableMarshaller.TIMESTAMP:
-                return new PortablePlainLazyValue(this, pos, len);
-
-            case GridPortableMarshaller.BYTE_ARR:
-            case GridPortableMarshaller.SHORT_ARR:
-            case GridPortableMarshaller.INT_ARR:
-            case GridPortableMarshaller.LONG_ARR:
-            case GridPortableMarshaller.FLOAT_ARR:
-            case GridPortableMarshaller.DOUBLE_ARR:
-            case GridPortableMarshaller.CHAR_ARR:
-            case GridPortableMarshaller.BOOLEAN_ARR:
-            case GridPortableMarshaller.DECIMAL_ARR:
-            case GridPortableMarshaller.DATE_ARR:
-            case GridPortableMarshaller.TIMESTAMP_ARR:
-            case GridPortableMarshaller.UUID_ARR:
-            case GridPortableMarshaller.STRING_ARR:
-            case GridPortableMarshaller.ENUM_ARR:
-            case GridPortableMarshaller.OBJ_ARR:
-            case GridPortableMarshaller.COL:
-            case GridPortableMarshaller.MAP:
-                return new LazyCollection(pos);
-
-            case GridPortableMarshaller.ENUM: {
-                if (len == 1) {
-                    assert readByte(pos) == GridPortableMarshaller.NULL;
-
-                    return null;
-                }
-
-                int mark = position();
-                position(pos + 1);
-
-                PortableBuilderEnum builderEnum = new PortableBuilderEnum(this);
-
-                position(mark);
-
-                return builderEnum;
-            }
-
-            case GridPortableMarshaller.PORTABLE_OBJ: {
-                int size = readIntPositioned(pos + 1);
-
-                int start = readIntPositioned(pos + 4 + size);
-
-                BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start);
-
-                return new PortablePlainPortableObject(portableObj);
-            }
-
-            default:
-                throw new BinaryObjectException("Invalid flag value: " + type);
-        }
-    }
-
-    /**
-     * @return Parsed value.
-     */
-    public Object parseValue() {
-        int valPos = pos;
-
-        byte type = arr[pos++];
-
-        int plainLazyValLen;
-
-        boolean modifiableLazyVal = false;
-
-        switch (type) {
-            case GridPortableMarshaller.NULL:
-                return null;
-
-            case GridPortableMarshaller.HANDLE: {
-                int objStart = pos - 1 - readInt();
-
-                BinaryObjectBuilderImpl res = objMap.get(objStart);
-
-                if (res == null) {
-                    res = new BinaryObjectBuilderImpl(new PortableBuilderReader(this, objStart), objStart);
-
-                    objMap.put(objStart, res);
-                }
-
-                return res;
-            }
-
-            case GridPortableMarshaller.OBJ: {
-                pos--;
-
-                BinaryObjectBuilderImpl res = objMap.get(pos);
-
-                if (res == null) {
-                    res = new BinaryObjectBuilderImpl(new PortableBuilderReader(this, pos), pos);
-
-                    objMap.put(pos, res);
-                }
-
-                pos += readInt(GridPortableMarshaller.TOTAL_LEN_POS);
-
-                return res;
-            }
-
-            case GridPortableMarshaller.BYTE:
-                return arr[pos++];
-
-            case GridPortableMarshaller.SHORT: {
-                Object res = PortablePrimitives.readShort(arr, pos);
-                pos += 2;
-                return res;
-            }
-
-            case GridPortableMarshaller.INT:
-                return readInt();
-
-            case GridPortableMarshaller.LONG:
-                plainLazyValLen = 8;
-
-                break;
-
-            case GridPortableMarshaller.FLOAT:
-                plainLazyValLen = 4;
-
-                break;
-
-            case GridPortableMarshaller.DOUBLE:
-                plainLazyValLen = 8;
-
-                break;
-
-            case GridPortableMarshaller.CHAR:
-                plainLazyValLen = 2;
-
-                break;
-
-            case GridPortableMarshaller.BOOLEAN:
-                return arr[pos++] != 0;
-
-            case GridPortableMarshaller.DECIMAL:
-                plainLazyValLen = /** scale */ 4  + /** mag len */ 4  + /** mag bytes count */ readInt(4);
-
-                break;
-
-            case GridPortableMarshaller.STRING:
-                plainLazyValLen = 4 + readStringLength();
-
-                break;
-
-            case GridPortableMarshaller.UUID:
-                plainLazyValLen = 8 + 8;
-
-                break;
-
-            case GridPortableMarshaller.DATE:
-                plainLazyValLen = 8;
-
-                break;
-
-            case GridPortableMarshaller.TIMESTAMP:
-                plainLazyValLen = 8 + 4;
-
-                break;
-
-            case GridPortableMarshaller.BYTE_ARR:
-                plainLazyValLen = 4 + readLength();
-                modifiableLazyVal = true;
-
-                break;
-
-            case GridPortableMarshaller.SHORT_ARR:
-                plainLazyValLen = 4 + readLength() * 2;
-                modifiableLazyVal = true;
-
-                break;
-
-            case GridPortableMarshaller.INT_ARR:
-                plainLazyValLen = 4 + readLength() * 4;
-                modifiableLazyVal = true;
-
-                break;
-
-            case GridPortableMarshaller.LONG_ARR:
-                plainLazyValLen = 4 + readLength() * 8;
-                modifiableLazyVal = true;
-
-                break;
-
-            case GridPortableMarshaller.FLOAT_ARR:
-                plainLazyValLen = 4 + readLength() * 4;
-                modifiableLazyVal = true;
-
-                break;
-
-            case GridPortableMarshaller.DOUBLE_ARR:
-                plainLazyValLen = 4 + readLength() * 8;
-                modifiableLazyVal = true;
-
-                break;
-
-            case GridPortableMarshaller.CHAR_ARR:
-                plainLazyValLen = 4 + readLength() * 2;
-                modifiableLazyVal = true;
-
-                break;
-
-            case GridPortableMarshaller.BOOLEAN_ARR:
-                plainLazyValLen = 4 + readLength();
-                modifiableLazyVal = true;
-
-                break;
-
-            case GridPortableMarshaller.OBJ_ARR:
-                return new PortableObjectArrayLazyValue(this);
-
-            case GridPortableMarshaller.DATE_ARR: {
-                int size = readInt();
-
-                Date[] res = new Date[size];
-
-                for (int i = 0; i < res.length; i++) {
-                    byte flag = arr[pos++];
-
-                    if (flag == GridPortableMarshaller.NULL) continue;
-
-                    if (flag != GridPortableMarshaller.DATE)
-                        throw new BinaryObjectException("Invalid flag value: " + flag);
-
-                    long time = PortablePrimitives.readLong(arr, pos);
-
-                    pos += 8;
-
-                    res[i] = new Date(time);
-                }
-
-                return res;
-            }
-
-            case GridPortableMarshaller.TIMESTAMP_ARR: {
-                int size = readInt();
-
-                Timestamp[] res = new Timestamp[size];
-
-                for (int i = 0; i < res.length; i++) {
-                    byte flag = arr[pos++];
-
-                    if (flag == GridPortableMarshaller.NULL)
-                        continue;
-
-                    if (flag != GridPortableMarshaller.TIMESTAMP)
-                        throw new BinaryObjectException("Invalid flag value: " + flag);
-
-                    long time = PortablePrimitives.readLong(arr, pos);
-
-                    pos += 8;
-
-                    int nano = PortablePrimitives.readInt(arr, pos);
-
-                    pos += 4;
-
-                    Timestamp ts = new Timestamp(time);
-
-                    ts.setNanos(ts.getNanos() + nano);
-
-                    res[i] = ts;
-                }
-
-                return res;
-            }
-
-            case GridPortableMarshaller.UUID_ARR:
-            case GridPortableMarshaller.STRING_ARR:
-            case GridPortableMarshaller.DECIMAL_ARR: {
-                int size = readInt();
-
-                for (int i = 0; i < size; i++) {
-                    byte flag = arr[pos++];
-
-                    if (flag == GridPortableMarshaller.UUID)
-                        pos += 8 + 8;
-                    else if (flag == GridPortableMarshaller.STRING)
-                        pos += 4 + readStringLength();
-                    else if (flag == GridPortableMarshaller.DECIMAL) {
-                        pos += 4; // scale value
-                        pos += 4 + readLength();
-                    }
-                    else
-                        assert flag == GridPortableMarshaller.NULL;
-                }
-
-                return new PortableModifiableLazyValue(this, valPos, pos - valPos);
-            }
-
-            case GridPortableMarshaller.COL: {
-                int size = readInt();
-                byte colType = arr[pos++];
-
-                switch (colType) {
-                    case GridPortableMarshaller.USER_COL:
-                    case GridPortableMarshaller.ARR_LIST:
-                        return new PortableLazyArrayList(this, size);
-
-                    case GridPortableMarshaller.LINKED_LIST:
-                        return new PortableLazyLinkedList(this, size);
-
-                    case GridPortableMarshaller.HASH_SET:
-                    case GridPortableMarshaller.LINKED_HASH_SET:
-                        return new PortableLazySet(this, size);
-                }
-
-                throw new BinaryObjectException("Unknown collection type: " + colType);
-            }
-
-            case GridPortableMarshaller.MAP:
-                return PortableLazyMap.parseMap(this);
-
-            case GridPortableMarshaller.ENUM:
-                return new PortableBuilderEnum(this);
-
-            case GridPortableMarshaller.ENUM_ARR:
-                return new PortableEnumArrayLazyValue(this);
-
-            case GridPortableMarshaller.PORTABLE_OBJ: {
-                int size = readInt();
-
-                pos += size;
-
-                int start = readInt();
-
-                BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr,
-                    pos - 4 - size + start);
-
-                return new PortablePlainPortableObject(portableObj);
-            }
-
-            default:
-                throw new BinaryObjectException("Invalid flag value: " + type);
-        }
-
-        PortableAbstractLazyValue res;
-
-        if (modifiableLazyVal)
-            res = new PortableModifiableLazyValue(this, valPos, 1 + plainLazyValLen);
-        else
-            res = new PortablePlainLazyValue(this, valPos, 1 + plainLazyValLen);
-
-        pos += plainLazyValLen;
-
-        return res;
-    }
-
-    /**
-     * @return Array.
-     */
-    public byte[] array() {
-        return arr;
-    }
-
-    /**
-     * @return Position of reader.
-     */
-    public int position() {
-        return pos;
-    }
-
-    /**
-     * @param pos New pos.
-     */
-    public void position(int pos) {
-        this.pos = pos;
-    }
-
-    /**
-     * @param n Number of bytes to skip.
-     */
-    public void skip(int n) {
-        pos += n;
-    }
-
-    /**
-     * @return Reader.
-     */
-    BinaryReaderExImpl reader() {
-        return reader;
-    }
-
-    /**
-     *
-     */
-    private class LazyCollection implements PortableLazyValue {
-        /** */
-        private final int valOff;
-
-        /** */
-        private Object col;
-
-        /**
-         * @param valOff Value.
-         */
-        protected LazyCollection(int valOff) {
-            this.valOff = valOff;
-        }
-
-        /**
-         * @return Object.
-         */
-        private Object wrappedCollection() {
-            if (col == null) {
-                position(valOff);
-
-                col = parseValue();
-            }
-
-            return col;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeTo(BinaryWriterExImpl writer, PortableBuilderSerializer ctx) {
-            ctx.writeValue(writer, wrappedCollection());
-        }
-
-        /** {@inheritDoc} */
-        @Override public Object value() {
-            return PortableUtils.unwrapLazy(wrappedCollection());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderSerializationAware.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderSerializationAware.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderSerializationAware.java
deleted file mode 100644
index 03d5720..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderSerializationAware.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.binary.builder;
-
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-
-/**
- *
- */
-interface PortableBuilderSerializationAware {
-    /**
-     * @param writer Writer.
-     * @param ctx Context.
-     */
-    public void writeTo(BinaryWriterExImpl writer, PortableBuilderSerializer ctx);
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderSerializer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderSerializer.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderSerializer.java
deleted file mode 100644
index 06c51fb..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableBuilderSerializer.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * 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.binary.builder;
-
-import org.apache.ignite.binary.BinaryObject;
-import org.apache.ignite.internal.binary.BinaryMetadata;
-import org.apache.ignite.internal.binary.BinaryObjectExImpl;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.PortableContext;
-import org.apache.ignite.internal.binary.PortableUtils;
-
-import java.util.Collection;
-import java.util.IdentityHashMap;
-import java.util.Map;
-
-/**
- *
- */
-class PortableBuilderSerializer {
-    /** */
-    private final Map<BinaryObjectBuilderImpl, Integer> objToPos = new IdentityHashMap<>();
-
-    /** */
-    private Map<BinaryObject, BinaryObjectBuilderImpl> portableObjToWrapper;
-
-    /**
-     * @param obj Mutable object.
-     * @param posInResArr Object position in the array.
-     */
-    public void registerObjectWriting(BinaryObjectBuilderImpl obj, int posInResArr) {
-        objToPos.put(obj, posInResArr);
-    }
-
-    /**
-     * @param writer Writer.
-     * @param val Value.
-     */
-    public void writeValue(BinaryWriterExImpl writer, Object val) {
-        if (val == null) {
-            writer.writeByte(GridPortableMarshaller.NULL);
-
-            return;
-        }
-
-        if (val instanceof PortableBuilderSerializationAware) {
-            ((PortableBuilderSerializationAware)val).writeTo(writer, this);
-
-            return;
-        }
-
-        if (val instanceof BinaryObjectExImpl) {
-            if (portableObjToWrapper == null)
-                portableObjToWrapper = new IdentityHashMap<>();
-
-            BinaryObjectBuilderImpl wrapper = portableObjToWrapper.get(val);
-
-            if (wrapper == null) {
-                wrapper = BinaryObjectBuilderImpl.wrap((BinaryObject)val);
-
-                portableObjToWrapper.put((BinaryObject)val, wrapper);
-            }
-
-            val = wrapper;
-        }
-
-        if (val instanceof BinaryObjectBuilderImpl) {
-            BinaryObjectBuilderImpl obj = (BinaryObjectBuilderImpl)val;
-
-            Integer posInResArr = objToPos.get(obj);
-
-            if (posInResArr == null) {
-                objToPos.put(obj, writer.out().position());
-
-                obj.serializeTo(writer.newWriter(obj.typeId()), this);
-            }
-            else {
-                int handle = writer.out().position() - posInResArr;
-
-                writer.writeByte(GridPortableMarshaller.HANDLE);
-                writer.writeInt(handle);
-            }
-
-            return;
-        }
-
-        if (val.getClass().isEnum()) {
-            String typeName = PortableContext.typeName(val.getClass().getName());
-            int typeId = writer.context().typeId(typeName);
-
-            BinaryMetadata meta = new BinaryMetadata(typeId, typeName, null, null, null, true);
-            writer.context().updateMetadata(typeId, meta);
-
-            writer.writeByte(GridPortableMarshaller.ENUM);
-            writer.writeInt(typeId);
-            writer.writeInt(((Enum)val).ordinal());
-
-            return;
-        }
-
-        if (val instanceof Collection) {
-            Collection<?> c = (Collection<?>)val;
-
-            writer.writeByte(GridPortableMarshaller.COL);
-            writer.writeInt(c.size());
-
-            byte colType = writer.context().collectionType(c.getClass());
-
-            writer.writeByte(colType);
-
-            for (Object obj : c)
-                writeValue(writer, obj);
-
-            return;
-        }
-
-        if (val instanceof Map) {
-            Map<?, ?> map = (Map<?, ?>)val;
-
-            writer.writeByte(GridPortableMarshaller.MAP);
-            writer.writeInt(map.size());
-
-            writer.writeByte(writer.context().mapType(map.getClass()));
-
-            for (Map.Entry<?, ?> entry : map.entrySet()) {
-                writeValue(writer, entry.getKey());
-                writeValue(writer, entry.getValue());
-            }
-
-            return;
-        }
-
-        Byte flag = PortableUtils.PLAIN_CLASS_TO_FLAG.get(val.getClass());
-
-        if (flag != null) {
-            PortableUtils.writePlainObject(writer, val);
-
-            return;
-        }
-
-        if (val instanceof Object[]) {
-            int compTypeId = writer.context().typeId(((Object[])val).getClass().getComponentType().getName());
-
-            if (val instanceof PortableBuilderEnum[]) {
-                writeArray(writer, GridPortableMarshaller.ENUM_ARR, (Object[])val, compTypeId);
-
-                return;
-            }
-
-            if (((Object[])val).getClass().getComponentType().isEnum()) {
-                Enum[] enumArr = (Enum[])val;
-
-                writer.writeByte(GridPortableMarshaller.ENUM_ARR);
-                writer.writeInt(compTypeId);
-                writer.writeInt(enumArr.length);
-
-                for (Enum anEnum : enumArr)
-                    writeValue(writer, anEnum);
-
-                return;
-            }
-
-            writeArray(writer, GridPortableMarshaller.OBJ_ARR, (Object[])val, compTypeId);
-
-            return;
-        }
-
-        writer.doWriteObject(val);
-    }
-
-    /**
-     * @param writer Writer.
-     * @param elementType Element type.
-     * @param arr The array.
-     * @param compTypeId Component type ID.
-     */
-    public void writeArray(BinaryWriterExImpl writer, byte elementType, Object[] arr, int compTypeId) {
-        writer.writeByte(elementType);
-        writer.writeInt(compTypeId);
-        writer.writeInt(arr.length);
-
-        for (Object obj : arr)
-            writeValue(writer, obj);
-    }
-
-    /**
-     * @param writer Writer.
-     * @param elementType Element type.
-     * @param arr The array.
-     * @param clsName Component class name.
-     */
-    public void writeArray(BinaryWriterExImpl writer, byte elementType, Object[] arr, String clsName) {
-        writer.writeByte(elementType);
-        writer.writeInt(GridPortableMarshaller.UNREGISTERED_TYPE_ID);
-        writer.writeString(clsName);
-        writer.writeInt(arr.length);
-
-        for (Object obj : arr)
-            writeValue(writer, obj);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableEnumArrayLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableEnumArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableEnumArrayLazyValue.java
deleted file mode 100644
index fa83d7e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableEnumArrayLazyValue.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.binary.builder;
-
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.BinaryInvalidTypeException;
-
-/**
- *
- */
-class PortableEnumArrayLazyValue extends PortableAbstractLazyValue {
-    /** */
-    private final int len;
-
-    /** */
-    private final int compTypeId;
-
-    /** */
-    private final String clsName;
-
-    /**
-     * @param reader Reader.
-     */
-    protected PortableEnumArrayLazyValue(PortableBuilderReader reader) {
-        super(reader, reader.position() - 1);
-
-        int typeId = reader.readInt();
-
-        if (typeId == GridPortableMarshaller.UNREGISTERED_TYPE_ID) {
-            clsName = reader.readString();
-
-            Class cls;
-
-            try {
-                cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader());
-            }
-            catch (ClassNotFoundException e) {
-                throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e);
-            }
-
-            compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId();
-        }
-        else {
-            compTypeId = typeId;
-            clsName = null;
-        }
-
-        int size = reader.readInt();
-
-        for (int i = 0; i < size; i++)
-            reader.skipValue();
-
-        len = reader.position() - valOff;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected Object init() {
-        reader.position(valOff + 1);
-
-        //skipping component type id
-        reader.readInt();
-
-        int size = reader.readInt();
-
-        PortableBuilderEnum[] res = new PortableBuilderEnum[size];
-
-        for (int i = 0; i < size; i++) {
-            byte flag = reader.readByte();
-
-            if (flag == GridPortableMarshaller.NULL)
-                continue;
-
-            if (flag != GridPortableMarshaller.ENUM)
-                throw new BinaryObjectException("Invalid flag value: " + flag);
-
-            res[i] = new PortableBuilderEnum(reader);
-        }
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeTo(BinaryWriterExImpl writer, PortableBuilderSerializer ctx) {
-        if (val != null) {
-            if (clsName != null)
-                ctx.writeArray(writer, GridPortableMarshaller.ENUM_ARR, (Object[])val, clsName);
-            else
-                ctx.writeArray(writer, GridPortableMarshaller.ENUM_ARR, (Object[])val, compTypeId);
-
-            return;
-        }
-
-        writer.write(reader.array(), valOff, len);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyArrayList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyArrayList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyArrayList.java
deleted file mode 100644
index 846ac82..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyArrayList.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * 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.binary.builder;
-
-import java.util.AbstractList;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.PortableUtils;
-
-/**
- *
- */
-class PortableLazyArrayList extends AbstractList<Object> implements PortableBuilderSerializationAware {
-    /** */
-    private final PortableBuilderReader reader;
-
-    /** */
-    private final int off;
-
-    /** */
-    private List<Object> delegate;
-
-    /**
-     * @param reader Reader.
-     * @param size Size,
-     */
-    PortableLazyArrayList(PortableBuilderReader reader, int size) {
-        this.reader = reader;
-        off = reader.position() - 1/* flag */ - 4/* size */ - 1/* col type */;
-
-        assert size >= 0;
-
-        for (int i = 0; i < size; i++)
-            reader.skipValue();
-    }
-
-    /**
-     *
-     */
-    private void ensureDelegateInit() {
-        if (delegate == null) {
-            int size = reader.readIntPositioned(off + 1);
-
-            reader.position(off + 1/* flag */ + 4/* size */ + 1/* col type */);
-
-            delegate = new ArrayList<>(size);
-
-            for (int i = 0; i < size; i++)
-                delegate.add(reader.parseValue());
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object get(int idx) {
-        ensureDelegateInit();
-
-        return PortableUtils.unwrapLazy(delegate.get(idx));
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean add(Object o) {
-        ensureDelegateInit();
-
-        return delegate.add(o);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void add(int idx, Object element) {
-        ensureDelegateInit();
-
-        delegate.add(idx, element);
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object set(int idx, Object element) {
-        ensureDelegateInit();
-
-        return PortableUtils.unwrapLazy(delegate.set(idx, element));
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object remove(int idx) {
-        ensureDelegateInit();
-
-        return PortableUtils.unwrapLazy(delegate.remove(idx));
-    }
-
-    /** {@inheritDoc} */
-    @Override public void clear() {
-        if (delegate == null)
-            delegate = new ArrayList<>();
-        else
-            delegate.clear();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean addAll(int idx, Collection<?> c) {
-        return delegate.addAll(idx, c);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void removeRange(int fromIdx, int toIdx) {
-        ensureDelegateInit();
-
-        delegate.subList(fromIdx, toIdx).clear();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int size() {
-        if (delegate == null)
-            return reader.readIntPositioned(off + 1);
-
-        return delegate.size();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeTo(BinaryWriterExImpl writer, PortableBuilderSerializer ctx) {
-        if (delegate == null) {
-            int size = reader.readIntPositioned(off + 1);
-
-            int hdrSize = 1 /* flag */ + 4 /* size */ + 1 /* col type */;
-
-            writer.write(reader.array(), off, hdrSize);
-
-            reader.position(off + hdrSize);
-
-            for (int i = 0; i < size; i++) {
-                Object o = reader.parseValue();
-
-                ctx.writeValue(writer, o);
-            }
-        }
-        else {
-            writer.writeByte(GridPortableMarshaller.COL);
-            writer.writeInt(delegate.size());
-
-            byte colType = reader.array()[off + 1 /* flag */ + 4 /* size */];
-            writer.writeByte(colType);
-
-            int oldPos = reader.position();
-
-            for (Object o : delegate)
-                ctx.writeValue(writer, o);
-
-            // PortableBuilderImpl might have been written. It could override reader's position.
-            reader.position(oldPos);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyLinkedList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyLinkedList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyLinkedList.java
deleted file mode 100644
index 11ed765..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyLinkedList.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * 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.binary.builder;
-
-import java.util.AbstractList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.PortableUtils;
-
-/**
- *
- */
-class PortableLazyLinkedList extends AbstractList<Object> implements PortableBuilderSerializationAware {
-    /** */
-    private final PortableBuilderReader reader;
-
-    /** */
-    private final int off;
-
-    /** */
-    private List<Object> delegate;
-
-    /**
-     * @param reader Reader.
-     * @param size Size,
-     */
-    PortableLazyLinkedList(PortableBuilderReader reader, int size) {
-        this.reader = reader;
-        off = reader.position() - 1/* flag */ - 4/* size */ - 1/* col type */;
-
-        assert size >= 0;
-
-        for (int i = 0; i < size; i++)
-            reader.skipValue();
-    }
-
-    /**
-     *
-     */
-    private void ensureDelegateInit() {
-        if (delegate == null) {
-            int size = reader.readIntPositioned(off + 1);
-
-            reader.position(off + 1/* flag */ + 4/* size */ + 1/* col type */);
-
-            delegate = new LinkedList<>();
-
-            for (int i = 0; i < size; i++)
-                delegate.add(reader.parseValue());
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object get(int idx) {
-        ensureDelegateInit();
-
-        return PortableUtils.unwrapLazy(delegate.get(idx));
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean add(Object o) {
-        ensureDelegateInit();
-
-        return delegate.add(o);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void add(int idx, Object element) {
-        ensureDelegateInit();
-
-        delegate.add(idx, element);
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object set(int idx, Object element) {
-        ensureDelegateInit();
-
-        return PortableUtils.unwrapLazy(delegate.set(idx, element));
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object remove(int idx) {
-        ensureDelegateInit();
-
-        return PortableUtils.unwrapLazy(delegate.remove(idx));
-    }
-
-    /** {@inheritDoc} */
-    @Override public void clear() {
-        if (delegate == null)
-            delegate = new LinkedList<>();
-        else
-            delegate.clear();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean addAll(int idx, Collection<?> c) {
-        ensureDelegateInit();
-
-        return delegate.addAll(idx, c);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void removeRange(int fromIdx, int toIdx) {
-        ensureDelegateInit();
-
-        delegate.subList(fromIdx, toIdx).clear();
-    }
-
-    /** {@inheritDoc} */
-    @Override public int size() {
-        if (delegate == null)
-            return reader.readIntPositioned(off + 1);
-
-        return delegate.size();
-    }
-
-    /** {@inheritDoc} */
-    @Override public ListIterator<Object> listIterator(final int idx) {
-        ensureDelegateInit();
-
-        return new ListIterator<Object>() {
-            /** */
-            private final ListIterator<Object> delegate = PortableLazyLinkedList.super.listIterator(idx);
-
-            @Override public boolean hasNext() {
-                return delegate.hasNext();
-            }
-
-            @Override public Object next() {
-                return PortableUtils.unwrapLazy(delegate.next());
-            }
-
-            @Override public boolean hasPrevious() {
-                return delegate.hasPrevious();
-            }
-
-            @Override public Object previous() {
-                return PortableUtils.unwrapLazy(delegate.previous());
-            }
-
-            @Override public int nextIndex() {
-                return delegate.nextIndex();
-            }
-
-            @Override public int previousIndex() {
-                return delegate.previousIndex();
-            }
-
-            @Override public void remove() {
-                delegate.remove();
-            }
-
-            @Override public void set(Object o) {
-                delegate.set(o);
-            }
-
-            @Override public void add(Object o) {
-                delegate.add(o);
-            }
-        };
-    }
-
-    /** {@inheritDoc} */
-    @Override public Iterator<Object> iterator() {
-        ensureDelegateInit();
-
-        return PortableUtils.unwrapLazyIterator(super.iterator());
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeTo(BinaryWriterExImpl writer, PortableBuilderSerializer ctx) {
-        if (delegate == null) {
-            int size = reader.readIntPositioned(off + 1);
-
-            int hdrSize = 1 /* flag */ + 4 /* size */ + 1 /* col type */;
-            writer.write(reader.array(), off, hdrSize);
-
-            reader.position(off + hdrSize);
-
-            for (int i = 0; i < size; i++) {
-                Object o = reader.parseValue();
-
-                ctx.writeValue(writer, o);
-            }
-        }
-        else {
-            writer.writeByte(GridPortableMarshaller.COL);
-            writer.writeInt(delegate.size());
-
-            byte colType = reader.array()[off + 1 /* flag */ + 4 /* size */];
-            writer.writeByte(colType);
-
-            for (Object o : delegate)
-                ctx.writeValue(writer, o);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyMap.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyMap.java
deleted file mode 100644
index 4bc7622..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyMap.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * 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.binary.builder;
-
-import java.util.AbstractMap;
-import java.util.AbstractSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.PortableUtils;
-import org.jetbrains.annotations.Nullable;
-
-/**
- *
- */
-class PortableLazyMap extends AbstractMap<Object, Object> implements PortableBuilderSerializationAware {
-    /** */
-    private final PortableBuilderReader reader;
-
-    /** */
-    private final int off;
-
-    /** */
-    private Map<Object, Object> delegate;
-
-    /**
-     * @param reader Reader.
-     * @param off Offset.
-     */
-    private PortableLazyMap(PortableBuilderReader reader, int off) {
-        this.reader = reader;
-        this.off = off;
-    }
-
-    /**
-     * @param reader Reader.
-     * @return PortableLazyMap.
-     */
-    @Nullable public static PortableLazyMap parseMap(PortableBuilderReader reader) {
-        int off = reader.position() - 1;
-
-        int size = reader.readInt();
-
-        reader.skip(1); // map type.
-
-        for (int i = 0; i < size; i++) {
-            reader.skipValue(); // skip key
-            reader.skipValue(); // skip value
-        }
-
-        return new PortableLazyMap(reader, off);
-    }
-
-    /**
-     *
-     */
-    private void ensureDelegateInit() {
-        if (delegate == null) {
-            int size = reader.readIntPositioned(off + 1);
-
-            reader.position(off + 1/* flag */ + 4/* size */ + 1/* col type */);
-
-            delegate = new LinkedHashMap<>();
-
-            for (int i = 0; i < size; i++)
-                delegate.put(PortableUtils.unwrapLazy(reader.parseValue()), reader.parseValue());
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeTo(BinaryWriterExImpl writer, PortableBuilderSerializer ctx) {
-        if (delegate == null) {
-            int size = reader.readIntPositioned(off + 1);
-
-            int hdrSize = 1 /* flag */ + 4 /* size */ + 1 /* col type */;
-            writer.write(reader.array(), off, hdrSize);
-
-            reader.position(off + hdrSize);
-
-            for (int i = 0; i < size; i++) {
-                ctx.writeValue(writer, reader.parseValue()); // key
-                ctx.writeValue(writer, reader.parseValue()); // value
-            }
-        }
-        else {
-            writer.writeByte(GridPortableMarshaller.MAP);
-            writer.writeInt(delegate.size());
-
-            byte colType = reader.array()[off + 1 /* flag */ + 4 /* size */];
-
-            writer.writeByte(colType);
-
-            for (Entry<Object, Object> entry : delegate.entrySet()) {
-                ctx.writeValue(writer, entry.getKey());
-                ctx.writeValue(writer, entry.getValue());
-            }
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public int size() {
-        if (delegate == null)
-            return reader.readIntPositioned(off + 1);
-
-        return delegate.size();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean containsKey(Object key) {
-        ensureDelegateInit();
-
-        return delegate.containsKey(key);
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean containsValue(Object val) {
-        return values().contains(val);
-    }
-
-    /** {@inheritDoc} */
-    @Override public Set<Object> keySet() {
-        ensureDelegateInit();
-
-        return delegate.keySet();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void clear() {
-        if (delegate == null)
-            delegate = new LinkedHashMap<>();
-        else
-            delegate.clear();
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object get(Object key) {
-        ensureDelegateInit();
-
-        return PortableUtils.unwrapLazy(delegate.get(key));
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object put(Object key, Object val) {
-        ensureDelegateInit();
-
-        return PortableUtils.unwrapLazy(delegate.put(key, val));
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object remove(Object key) {
-        ensureDelegateInit();
-
-        return PortableUtils.unwrapLazy(delegate.remove(key));
-    }
-
-    /** {@inheritDoc} */
-    @Override public Set<Entry<Object, Object>> entrySet() {
-        ensureDelegateInit();
-
-        return new AbstractSet<Entry<Object, Object>>() {
-            @Override public boolean contains(Object o) {
-                throw new UnsupportedOperationException();
-            }
-
-            @Override public Iterator<Entry<Object, Object>> iterator() {
-                return new Iterator<Entry<Object, Object>>() {
-                    /** */
-                    private final Iterator<Entry<Object, Object>> itr = delegate.entrySet().iterator();
-
-                    @Override public boolean hasNext() {
-                        return itr.hasNext();
-                    }
-
-                    @Override public Entry<Object, Object> next() {
-                        Entry<Object, Object> res = itr.next();
-
-                        final Object val = res.getValue();
-
-                        if (val instanceof PortableLazyValue) {
-                            return new SimpleEntry<Object, Object>(res.getKey(), val) {
-                                private static final long serialVersionUID = 0L;
-
-                                @Override public Object getValue() {
-                                    return ((PortableLazyValue)val).value();
-                                }
-                            };
-                        }
-
-                        return res;
-                    }
-
-                    @Override public void remove() {
-                        itr.remove();
-                    }
-                };
-            }
-
-            @Override public int size() {
-                return delegate.size();
-            }
-        };
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazySet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazySet.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazySet.java
deleted file mode 100644
index 3548f1f..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazySet.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.binary.builder;
-
-import java.util.Collection;
-import java.util.Set;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.PortableUtils;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.util.typedef.internal.U;
-
-/**
- *
- */
-class PortableLazySet extends PortableAbstractLazyValue {
-    /** */
-    private final int off;
-
-    /**
-     * @param reader Reader.
-     * @param size Size.
-     */
-    PortableLazySet(PortableBuilderReader reader, int size) {
-        super(reader, reader.position() - 1);
-
-        off = reader.position() - 1/* flag */ - 4/* size */ - 1/* col type */;
-
-        assert size >= 0;
-
-        for (int i = 0; i < size; i++)
-            reader.skipValue();
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeTo(BinaryWriterExImpl writer, PortableBuilderSerializer ctx) {
-        if (val == null) {
-            int size = reader.readIntPositioned(off + 1);
-
-            int hdrSize = 1 /* flag */ + 4 /* size */ + 1 /* col type */;
-            writer.write(reader.array(), off, hdrSize);
-
-            reader.position(off + hdrSize);
-
-            for (int i = 0; i < size; i++) {
-                Object o = reader.parseValue();
-
-                ctx.writeValue(writer, o);
-            }
-        }
-        else {
-            Collection<Object> c = (Collection<Object>)val;
-
-            writer.writeByte(GridPortableMarshaller.COL);
-            writer.writeInt(c.size());
-
-            byte colType = reader.array()[off + 1 /* flag */ + 4 /* size */];
-            writer.writeByte(colType);
-
-            for (Object o : c)
-                ctx.writeValue(writer, o);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override protected Object init() {
-        int size = reader.readIntPositioned(off + 1);
-
-        reader.position(off + 1/* flag */ + 4/* size */ + 1/* col type */);
-
-        Set<Object> res = U.newLinkedHashSet(size);
-
-        for (int i = 0; i < size; i++)
-            res.add(PortableUtils.unwrapLazy(reader.parseValue()));
-
-        return res;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyValue.java
deleted file mode 100644
index 51c6d7e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableLazyValue.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.binary.builder;
-
-/**
- *
- */
-public interface PortableLazyValue extends PortableBuilderSerializationAware {
-    /**
-     * @return Value.
-     */
-    public Object value();
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableModifiableLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableModifiableLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableModifiableLazyValue.java
deleted file mode 100644
index b00157e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableModifiableLazyValue.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.binary.builder;
-
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-
-/**
- *
- */
-public class PortableModifiableLazyValue extends PortableAbstractLazyValue {
-    /** */
-    protected final int len;
-
-    /**
-     * @param reader
-     * @param valOff
-     * @param len
-     */
-    public PortableModifiableLazyValue(PortableBuilderReader reader, int valOff, int len) {
-        super(reader, valOff);
-
-        this.len = len;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected Object init() {
-        return reader.reader().unmarshal(valOff);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeTo(BinaryWriterExImpl writer, PortableBuilderSerializer ctx) {
-        if (val == null)
-            writer.write(reader.array(), valOff, len);
-        else
-            writer.writeObject(val);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableObjectArrayLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableObjectArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableObjectArrayLazyValue.java
deleted file mode 100644
index 7f77b0d..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableObjectArrayLazyValue.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.binary.builder;
-
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.binary.BinaryInvalidTypeException;
-
-/**
- *
- */
-class PortableObjectArrayLazyValue extends PortableAbstractLazyValue {
-    /** */
-    private Object[] lazyValsArr;
-
-    /** */
-    private int compTypeId;
-
-    /** */
-    private String clsName;
-
-    /**
-     * @param reader Reader.
-     */
-    protected PortableObjectArrayLazyValue(PortableBuilderReader reader) {
-        super(reader, reader.position() - 1);
-
-        int typeId = reader.readInt();
-
-        if (typeId == GridPortableMarshaller.UNREGISTERED_TYPE_ID) {
-            clsName = reader.readString();
-
-            Class cls;
-
-            try {
-                cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader());
-            }
-            catch (ClassNotFoundException e) {
-                throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e);
-            }
-
-            compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId();
-        }
-        else {
-            compTypeId = typeId;
-            clsName = null;
-        }
-
-        int size = reader.readInt();
-
-        lazyValsArr = new Object[size];
-
-        for (int i = 0; i < size; i++)
-            lazyValsArr[i] = reader.parseValue();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected Object init() {
-        for (int i = 0; i < lazyValsArr.length; i++) {
-            if (lazyValsArr[i] instanceof PortableLazyValue)
-                lazyValsArr[i] = ((PortableLazyValue)lazyValsArr[i]).value();
-        }
-
-        return lazyValsArr;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeTo(BinaryWriterExImpl writer, PortableBuilderSerializer ctx) {
-        if (clsName == null)
-            ctx.writeArray(writer, GridPortableMarshaller.OBJ_ARR, lazyValsArr, compTypeId);
-        else
-            ctx.writeArray(writer, GridPortableMarshaller.OBJ_ARR, lazyValsArr, clsName);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortablePlainLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortablePlainLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortablePlainLazyValue.java
deleted file mode 100644
index f572415..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortablePlainLazyValue.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.binary.builder;
-
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-
-/**
- *
- */
-class PortablePlainLazyValue extends PortableAbstractLazyValue {
-    /** */
-    protected final int len;
-
-    /**
-     * @param reader Reader
-     * @param valOff Offset
-     * @param len Length.
-     */
-    protected PortablePlainLazyValue(PortableBuilderReader reader, int valOff, int len) {
-        super(reader, valOff);
-
-        this.len = len;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected Object init() {
-        return reader.reader().unmarshal(valOff);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeTo(BinaryWriterExImpl writer, PortableBuilderSerializer ctx) {
-        writer.write(reader.array(), valOff, len);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortablePlainPortableObject.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortablePlainPortableObject.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortablePlainPortableObject.java
deleted file mode 100644
index 3b77a52..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortablePlainPortableObject.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.binary.builder;
-
-import org.apache.ignite.internal.binary.BinaryObjectImpl;
-import org.apache.ignite.internal.binary.BinaryObjectOffheapImpl;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.binary.BinaryObjectImpl;
-import org.apache.ignite.internal.binary.BinaryObjectOffheapImpl;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.binary.BinaryObject;
-
-/**
- *
- */
-public class PortablePlainPortableObject implements PortableLazyValue {
-    /** */
-    private final BinaryObject portableObj;
-
-    /**
-     * @param portableObj Portable object.
-     */
-    public PortablePlainPortableObject(BinaryObject portableObj) {
-        this.portableObj = portableObj;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object value() {
-        return portableObj;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeTo(BinaryWriterExImpl writer, PortableBuilderSerializer ctx) {
-        BinaryObject val = portableObj;
-
-        if (val instanceof BinaryObjectOffheapImpl)
-            val = ((BinaryObjectOffheapImpl)val).heapCopy();
-
-        writer.doWritePortableObject((BinaryObjectImpl)val);
-    }
-}


[48/50] [abbrv] ignite git commit: IGNITE-2152: .NET: Intro text is added.

Posted by vo...@apache.org.
IGNITE-2152: .NET: Intro text is added.


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

Branch: refs/heads/ignite-2100
Commit: f87b80f7bf6e38b3ebd21088d4e8aa11a505ed59
Parents: f3cc98b
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Dec 14 12:40:22 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Dec 14 12:40:22 2015 +0300

----------------------------------------------------------------------
 .../cpp/core/include/ignite/ignition.h          | 41 ++------------------
 .../dotnet/Apache.Ignite.Core/Impl/Ignite.cs    |  8 ++++
 2 files changed, 12 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f87b80f7/modules/platforms/cpp/core/include/ignite/ignition.h
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/core/include/ignite/ignition.h b/modules/platforms/cpp/core/include/ignite/ignition.h
index 67edb73..93ce166 100644
--- a/modules/platforms/cpp/core/include/ignite/ignition.h
+++ b/modules/platforms/cpp/core/include/ignite/ignition.h
@@ -16,44 +16,11 @@
  */
 
 /**
- * \mainpage Apache Ignite C++ Library
+ * \mainpage Apache Ignite C++
  *
- * The Apache Ignite is a proven software solution, which delivers unprecedented speed
- * and unlimited scale to accelerate your business and time to insights. It enables high-performance transactions,
- * real-time streaming and fast analytics in a single, comprehensive data access and processing layer. The In-Memory
- * Data Fabric is designed to easily power both existing and new applications in a distributed, massively
- * parallel architecture on affordable, industry-standard hardware.
- * <p>
- * The Apache Ignite provides a unified API that spans all key types of applications
- * (Java, .NET, C++) and connects them with multiple data stores containing structured, semi-structured and
- * unstructured data (SQL, NoSQL, Hadoop). It offers a secure, highly available and manageable data environment
- * that allows companies to process full ACID transactions and generate valuable insights from real-time,
- * interactive and batch queries.
- * <p>
- * The In-Memory Data Fabric offers a strategic approach to in-memory computing that delivers performance,
- * scale and comprehensive capabilities far above and beyond what traditional in-memory databases,
- * data grids or other in-memory-based point solutions can offer by themselves.
- *
- * \section ultimate_speed_and_scale Ultimate Speed and Scale
- *
- * The Apache Ignite accesses and processes data from distributed enterprise and
- * cloud-based data stores orders of magnitudes faster, and shares them with today's most demanding transactional,
- * analytical and hybrid applications. The In-Memory Data Fabric delivers unprecedented throughput
- * and low latency performance in a virtually unlimited, global scale-out architecture for both new and
- * existing applications.
- *
- * \section comprehensive_and_proven Comprehensive and Proven
- *
- * The Apache Ignite is the product of seven years of meticulous research and development,
- * built from the ground up (i.e. no bolt-on's), and run successfully by hundreds of organizations worldwide.
- * It is a comprehensive in-memory solution that includes a clustering and compute grid, a database-agnostic data grid,
- * a real-time streaming engine as well as plug-and-play Hadoop acceleration. The In-Memory Data Fabric
- * connects multiple data sources (relational, NoSQL, Hadoop) with Java, .NET and C++ applications, and offers
- * a secure and highly available architecture; it also provides a fully-featured, graphical management interface.
- * <p>
- * The Apache Ignite is used today by Fortune 500 companies, top government agencies as well as
- * innovative mobile and web companies in a broad range of business scenarios, such as automated trading systems,
- * fraud detection, big data analytics, social networks, online gaming, and bioinformatics.
+ * Apache Ignite In-Memory Data Fabric is a high-performance, integrated and distributed in-memory platform for
+ * computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with
+ * traditional disk-based or flash-based technologies.
  */
 
 #ifndef _IGNITE_IGNITION

http://git-wip-us.apache.org/repos/asf/ignite/blob/f87b80f7/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
index 2fcada3..5b952b1 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
@@ -15,6 +15,14 @@
  * limitations under the License.
  */
 
+/**
+ * \mainpage Apache Ignite.NET
+ *
+ * Apache Ignite In-Memory Data Fabric is a high-performance, integrated and distributed in-memory platform for 
+ * computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with 
+ * traditional disk-based or flash-based technologies.
+ */
+
 namespace Apache.Ignite.Core.Impl
 {
     using System;


[46/50] [abbrv] ignite git commit: IGNITE-2150: Fixed invalid test scenario.

Posted by vo...@apache.org.
IGNITE-2150: Fixed invalid test scenario.


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

Branch: refs/heads/ignite-2100
Commit: fdea7cfaf6ea26834d2694cbfc9634de8d24209b
Parents: 3db1448
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Dec 14 12:21:17 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Dec 14 12:21:17 2015 +0300

----------------------------------------------------------------------
 .../binary/BinaryMarshallerSelfTest.java        | 42 --------------------
 1 file changed, 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/fdea7cfa/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
index 4ecad09..b83bbad 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
@@ -2299,41 +2299,6 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testCyclicReferencesMarshalling() throws Exception {
-        BinaryMarshaller marsh = binaryMarshaller();
-
-        SimpleObject obj = simpleObject();
-
-        obj.bArr = obj.inner.bArr;
-        obj.cArr = obj.inner.cArr;
-        obj.boolArr = obj.inner.boolArr;
-        obj.sArr = obj.inner.sArr;
-        obj.strArr = obj.inner.strArr;
-        obj.iArr = obj.inner.iArr;
-        obj.lArr = obj.inner.lArr;
-        obj.fArr = obj.inner.fArr;
-        obj.dArr = obj.inner.dArr;
-        obj.dateArr = obj.inner.dateArr;
-        obj.uuidArr = obj.inner.uuidArr;
-        obj.objArr = obj.inner.objArr;
-        obj.bdArr = obj.inner.bdArr;
-        obj.map = obj.inner.map;
-        obj.col = obj.inner.col;
-        obj.mEntry = obj.inner.mEntry;
-
-        SimpleObject res = (SimpleObject)marshalUnmarshal(obj, marsh);
-
-        assertEquals(obj, res);
-
-        assertTrue(res.objArr == res.inner.objArr);
-        assertTrue(res.map == res.inner.map);
-        assertTrue(res.col == res.inner.col);
-        assertTrue(res.mEntry == res.inner.mEntry);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
     public void testProxy() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller();
 
@@ -2799,8 +2764,6 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
         inner.map.put(2, "str2");
         inner.map.put(3, "str3");
 
-        inner.mEntry = inner.map.entrySet().iterator().next();
-
         SimpleObject outer = new SimpleObject();
 
         outer.b = 2;
@@ -2843,8 +2806,6 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
         outer.map.put(5, "str5");
         outer.map.put(6, "str6");
 
-        outer.mEntry = outer.map.entrySet().iterator().next();
-
         return outer;
     }
 
@@ -3144,9 +3105,6 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
         private TestEnum[] enumArr;
 
         /** */
-        private Map.Entry<Integer, String> mEntry;
-
-        /** */
         private SimpleObject inner;
 
         /** {@inheritDoc} */


[05/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary"

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortablesPartitionedOnlyByteArrayValuesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortablesPartitionedOnlyByteArrayValuesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortablesPartitionedOnlyByteArrayValuesSelfTest.java
deleted file mode 100644
index 95630f6..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortablesPartitionedOnlyByteArrayValuesSelfTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.processors.cache.distributed.dht.GridCacheAbstractPartitionedOnlyByteArrayValuesSelfTest;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-
-/**
- *
- */
-public class GridCachePortablesPartitionedOnlyByteArrayValuesSelfTest
-    extends GridCacheAbstractPartitionedOnlyByteArrayValuesSelfTest {
-    /** {@inheritDoc} */
-    @Override protected boolean peerClassLoading() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        cfg.setMarshaller(new BinaryMarshaller());
-
-        return cfg;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/session/GridSessionCheckpointSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/session/GridSessionCheckpointSelfTest.java b/modules/core/src/test/java/org/apache/ignite/session/GridSessionCheckpointSelfTest.java
index ded30cb..f3374c4 100644
--- a/modules/core/src/test/java/org/apache/ignite/session/GridSessionCheckpointSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/session/GridSessionCheckpointSelfTest.java
@@ -21,7 +21,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.binary.BinaryCachingMetadataHandler;
 import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.internal.binary.PortableContext;
+import org.apache.ignite.internal.binary.BinaryContext;
 import org.apache.ignite.internal.util.IgniteUtils;
 import org.apache.ignite.marshaller.Marshaller;
 import org.apache.ignite.marshaller.MarshallerContextTestImpl;
@@ -96,7 +96,7 @@ public class GridSessionCheckpointSelfTest extends GridSessionCheckpointAbstract
         cfg.setCheckpointSpi(spi);
 
         if (cfg.getMarshaller() instanceof BinaryMarshaller) {
-            PortableContext ctx = new PortableContext(BinaryCachingMetadataHandler.create(), cfg);
+            BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), cfg);
 
             Marshaller marsh = cfg.getMarshaller();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
index 8c8b831..2367688 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteMock.java
@@ -51,7 +51,7 @@ import org.apache.ignite.configuration.CollectionConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.configuration.NearCacheConfiguration;
 import org.apache.ignite.internal.binary.BinaryCachingMetadataHandler;
-import org.apache.ignite.internal.binary.PortableContext;
+import org.apache.ignite.internal.binary.BinaryContext;
 import org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl;
 import org.apache.ignite.internal.processors.cacheobject.NoOpBinary;
 import org.apache.ignite.lang.IgniteProductVersion;
@@ -89,7 +89,7 @@ public class IgniteMock implements Ignite {
     private IgniteBinary binaryMock;
 
     /** */
-    private PortableContext ctx;
+    private BinaryContext ctx;
 
     /**
      * Mock values
@@ -295,7 +295,7 @@ public class IgniteMock implements Ignite {
 
         if (ctx == null) {
             /** {@inheritDoc} */
-            ctx = new PortableContext(BinaryCachingMetadataHandler.create(), configuration()) {
+            ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), configuration()) {
                 @Override public int typeId(String typeName) {
                     return typeName.hashCode();
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
index 69ecb4f..67a4f20 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
@@ -29,7 +29,7 @@ import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.binary.BinaryCachingMetadataHandler;
 import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.internal.binary.PortableContext;
+import org.apache.ignite.internal.binary.BinaryContext;
 import org.apache.ignite.internal.processors.resource.GridResourceProcessor;
 import org.apache.ignite.internal.util.IgniteUtils;
 import org.apache.ignite.internal.util.typedef.internal.U;
@@ -264,7 +264,7 @@ public class IgniteTestResources {
         marsh.setContext(new MarshallerContextTestImpl());
 
         if (marsh instanceof BinaryMarshaller) {
-            PortableContext ctx = new PortableContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration());
+            BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration());
 
             IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", ctx, new IgniteConfiguration());
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheTestSuite.java
index f569718..f5745d8 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheTestSuite.java
@@ -28,21 +28,21 @@ import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredEvictio
 import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredEvictionSelfTest;
 import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredSelfTest;
 import org.apache.ignite.internal.processors.cache.expiry.IgniteCacheAtomicLocalExpiryPolicyTest;
-import org.apache.ignite.internal.processors.cache.binary.GridPortableCacheEntryMemorySizeSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.datastreaming.DataStreamProcessorPortableSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.GridBinaryCacheEntryMemorySizeSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.datastreaming.DataStreamProcessorBinarySelfTest;
 import org.apache.ignite.internal.processors.cache.binary.datastreaming.GridDataStreamerImplSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAffinityRoutingPortableSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyPortableDataStreamerMultiNodeSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyPortableDataStreamerMultithreadedSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyPortableMultiNodeSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyPortableMultithreadedSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheMemoryModePortableSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredAtomicPortableSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredEvictionAtomicPortableSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredEvictionPortableSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredPortableSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAffinityRoutingBinarySelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultiNodeSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultithreadedSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyBinaryMultiNodeSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyBinaryMultithreadedSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheMemoryModeBinarySelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredAtomicBinarySelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredEvictionAtomicBinarySelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredEvictionBinarySelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredBinarySelfTest;
 import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCachePortablesNearPartitionedByteArrayValuesSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCachePortablesPartitionedOnlyByteArrayValuesSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinariesPartitionedOnlyByteArrayValuesSelfTest;
 import org.apache.ignite.internal.processors.datastreamer.DataStreamProcessorSelfTest;
 import org.apache.ignite.testframework.config.GridTestProperties;
 
@@ -76,25 +76,25 @@ public class IgnitePortableCacheTestSuite extends TestSuite {
 
         suite.addTest(IgniteCacheTestSuite.suite(ignoredTests));
 
-        suite.addTestSuite(GridCacheMemoryModePortableSelfTest.class);
-        suite.addTestSuite(GridCacheOffHeapTieredEvictionAtomicPortableSelfTest.class);
-        suite.addTestSuite(GridCacheOffHeapTieredEvictionPortableSelfTest.class);
+        suite.addTestSuite(GridCacheMemoryModeBinarySelfTest.class);
+        suite.addTestSuite(GridCacheOffHeapTieredEvictionAtomicBinarySelfTest.class);
+        suite.addTestSuite(GridCacheOffHeapTieredEvictionBinarySelfTest.class);
 
-        suite.addTestSuite(GridCachePortablesPartitionedOnlyByteArrayValuesSelfTest.class);
+        suite.addTestSuite(GridCacheBinariesPartitionedOnlyByteArrayValuesSelfTest.class);
         suite.addTestSuite(GridCachePortablesNearPartitionedByteArrayValuesSelfTest.class);
-        suite.addTestSuite(GridCacheOffHeapTieredPortableSelfTest.class);
-        suite.addTestSuite(GridCacheOffHeapTieredAtomicPortableSelfTest.class);
+        suite.addTestSuite(GridCacheOffHeapTieredBinarySelfTest.class);
+        suite.addTestSuite(GridCacheOffHeapTieredAtomicBinarySelfTest.class);
 
         suite.addTestSuite(GridDataStreamerImplSelfTest.class);
-        suite.addTestSuite(DataStreamProcessorPortableSelfTest.class);
-        suite.addTestSuite(GridCacheAtomicPartitionedOnlyPortableDataStreamerMultiNodeSelfTest.class);
-        suite.addTestSuite(GridCacheAtomicPartitionedOnlyPortableDataStreamerMultithreadedSelfTest.class);
+        suite.addTestSuite(DataStreamProcessorBinarySelfTest.class);
+        suite.addTestSuite(GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultiNodeSelfTest.class);
+        suite.addTestSuite(GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultithreadedSelfTest.class);
 
-        suite.addTestSuite(GridCacheAtomicPartitionedOnlyPortableMultiNodeSelfTest.class);
-        suite.addTestSuite(GridCacheAtomicPartitionedOnlyPortableMultithreadedSelfTest.class);
+        suite.addTestSuite(GridCacheAtomicPartitionedOnlyBinaryMultiNodeSelfTest.class);
+        suite.addTestSuite(GridCacheAtomicPartitionedOnlyBinaryMultithreadedSelfTest.class);
 
-        suite.addTestSuite(GridCacheAffinityRoutingPortableSelfTest.class);
-        suite.addTestSuite(GridPortableCacheEntryMemorySizeSelfTest.class);
+        suite.addTestSuite(GridCacheAffinityRoutingBinarySelfTest.class);
+        suite.addTestSuite(GridBinaryCacheEntryMemorySizeSelfTest.class);
 
         return suite;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableObjectsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableObjectsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableObjectsTestSuite.java
index 4329225..942a5fa 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableObjectsTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableObjectsTestSuite.java
@@ -19,10 +19,10 @@ package org.apache.ignite.testsuites;
 
 import junit.framework.TestSuite;
 import org.apache.ignite.internal.binary.BinaryEnumsSelfTest;
-import org.apache.ignite.internal.binary.GridPortableAffinityKeySelfTest;
+import org.apache.ignite.internal.binary.GridBinaryAffinityKeySelfTest;
 import org.apache.ignite.internal.binary.BinaryObjectBuilderAdditionalSelfTest;
 import org.apache.ignite.internal.binary.BinaryObjectBuilderSelfTest;
-import org.apache.ignite.internal.binary.GridPortableMarshallerCtxDisabledSelfTest;
+import org.apache.ignite.internal.binary.GridBinaryMarshallerCtxDisabledSelfTest;
 import org.apache.ignite.internal.binary.BinaryMarshallerSelfTest;
 import org.apache.ignite.internal.binary.GridPortableMetaDataSelfTest;
 import org.apache.ignite.internal.binary.GridPortableWildcardsSelfTest;
@@ -40,8 +40,8 @@ import org.apache.ignite.internal.binary.noncompact.BinaryObjectBuilderNonCompac
 import org.apache.ignite.internal.processors.cache.distributed.IgniteBinaryMetadataUpdateChangingTopologySelfTest;
 import org.apache.ignite.internal.processors.cache.binary.GridCacheClientNodeBinaryObjectMetadataMultinodeTest;
 import org.apache.ignite.internal.processors.cache.binary.GridCacheClientNodeBinaryObjectMetadataTest;
-import org.apache.ignite.internal.processors.cache.binary.GridCachePortableStoreObjectsSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.GridCachePortableStorePortablesSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryStoreObjectsSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryStorePortablesSelfTest;
 import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsAtomicNearDisabledOffheapTieredSelfTest;
 import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsAtomicNearDisabledSelfTest;
 import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsAtomicOffheapTieredSelfTest;
@@ -67,7 +67,7 @@ public class IgnitePortableObjectsTestSuite extends TestSuite {
         TestSuite suite = new TestSuite("Ignite Binary Objects Test Suite");
 
         suite.addTestSuite(BinaryMarshallerSelfTest.class);
-        suite.addTestSuite(GridPortableMarshallerCtxDisabledSelfTest.class);
+        suite.addTestSuite(GridBinaryMarshallerCtxDisabledSelfTest.class);
         suite.addTestSuite(BinaryObjectBuilderSelfTest.class);
         suite.addTestSuite(BinaryObjectBuilderAdditionalSelfTest.class);
         suite.addTestSuite(BinaryFieldsHeapSelfTest.class);
@@ -76,7 +76,7 @@ public class IgnitePortableObjectsTestSuite extends TestSuite {
         suite.addTestSuite(BinaryFooterOffsetsOffheapSelfTest.class);
         suite.addTestSuite(BinaryEnumsSelfTest.class);
         suite.addTestSuite(GridPortableMetaDataSelfTest.class);
-        suite.addTestSuite(GridPortableAffinityKeySelfTest.class);
+        suite.addTestSuite(GridBinaryAffinityKeySelfTest.class);
         suite.addTestSuite(GridPortableWildcardsSelfTest.class);
 
         // Tests for objects with non-compact footers.
@@ -102,8 +102,8 @@ public class IgnitePortableObjectsTestSuite extends TestSuite {
         suite.addTestSuite(GridCacheBinaryObjectsPartitionedOffheapTieredSelfTest.class);
         suite.addTestSuite(GridCacheBinaryObjectsPartitionedNearDisabledOffheapTieredSelfTest.class);
 
-        suite.addTestSuite(GridCachePortableStoreObjectsSelfTest.class);
-        suite.addTestSuite(GridCachePortableStorePortablesSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryStoreObjectsSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryStorePortablesSelfTest.class);
 
         suite.addTestSuite(GridCacheClientNodeBinaryObjectMetadataTest.class);
         suite.addTestSuite(GridCacheClientNodeBinaryObjectMetadataMultinodeTest.class);

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentBinaryEntryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentBinaryEntryProcessor.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentBinaryEntryProcessor.java
new file mode 100644
index 0000000..7b94613
--- /dev/null
+++ b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentBinaryEntryProcessor.java
@@ -0,0 +1,35 @@
+/*
+ * 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.tests.p2p;
+
+import javax.cache.processor.EntryProcessorException;
+import javax.cache.processor.MutableEntry;
+import org.apache.ignite.cache.CacheEntryProcessor;
+
+/**
+ * Entry processor used by {@code GridCacheEntryProcessorDeploymentSelfTest}.
+ */
+public class CacheDeploymentBinaryEntryProcessor implements CacheEntryProcessor<String, String, Boolean> {
+    /** {@inheritDoc} */
+    @Override public Boolean process(MutableEntry<String, String> entry, Object... arguments)
+        throws EntryProcessorException {
+        String val = entry.getKey();
+
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentPortableEntryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentPortableEntryProcessor.java b/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentPortableEntryProcessor.java
deleted file mode 100644
index 03d3efc..0000000
--- a/modules/extdata/p2p/src/main/java/org/apache/ignite/tests/p2p/CacheDeploymentPortableEntryProcessor.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.tests.p2p;
-
-import javax.cache.processor.EntryProcessorException;
-import javax.cache.processor.MutableEntry;
-import org.apache.ignite.cache.CacheEntryProcessor;
-
-/**
- * Entry processor used by {@code GridCacheEntryProcessorDeploymentSelfTest}.
- */
-public class CacheDeploymentPortableEntryProcessor implements CacheEntryProcessor<String, String, Boolean> {
-    /** {@inheritDoc} */
-    @Override public Boolean process(MutableEntry<String, String> entry, Object... arguments)
-        throws EntryProcessorException {
-        String val = entry.getKey();
-
-        return true;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java
index 3773f8c..2df9026 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java
@@ -35,8 +35,8 @@ import org.apache.ignite.internal.processors.cache.IgniteCachePartitionedQueryMu
 import org.apache.ignite.internal.processors.cache.IgniteCacheQueryEvictsMultiThreadedSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheQueryMultiThreadedSelfTest;
 import org.apache.ignite.internal.processors.cache.IgniteCacheQueryOffheapMultiThreadedSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCachePortableDuplicateIndexObjectPartitionedAtomicSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCachePortableDuplicateIndexObjectPartitionedTransactionalSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicNearEnabledSelfTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicP2PDisabledSelfTest;
 import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicSelfTest;
@@ -111,8 +111,8 @@ public class IgnitePortableCacheQueryTestSuite extends TestSuite {
         //Unmarshallig query test.
         suite.addTestSuite(IgniteCacheP2pUnmarshallingQueryErrorTest.class);
 
-        suite.addTestSuite(GridCachePortableDuplicateIndexObjectPartitionedAtomicSelfTest.class);
-        suite.addTestSuite(GridCachePortableDuplicateIndexObjectPartitionedTransactionalSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.class);
 
         return suite;
     }


[18/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary" (in tests)

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinariesNearPartitionedByteArrayValuesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinariesNearPartitionedByteArrayValuesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinariesNearPartitionedByteArrayValuesSelfTest.java
new file mode 100644
index 0000000..13b374c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinariesNearPartitionedByteArrayValuesSelfTest.java
@@ -0,0 +1,41 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheAbstractNearPartitionedByteArrayValuesSelfTest;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+
+/**
+ *
+ */
+public class GridCacheBinariesNearPartitionedByteArrayValuesSelfTest
+    extends GridCacheAbstractNearPartitionedByteArrayValuesSelfTest {
+    /** {@inheritDoc} */
+    @Override protected boolean peerClassLoading() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        cfg.setMarshaller(new BinaryMarshaller());
+
+        return cfg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortablesNearPartitionedByteArrayValuesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortablesNearPartitionedByteArrayValuesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortablesNearPartitionedByteArrayValuesSelfTest.java
deleted file mode 100644
index 9c1572e..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortablesNearPartitionedByteArrayValuesSelfTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.processors.cache.distributed.near.GridCacheAbstractNearPartitionedByteArrayValuesSelfTest;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-
-/**
- *
- */
-public class GridCachePortablesNearPartitionedByteArrayValuesSelfTest
-    extends GridCacheAbstractNearPartitionedByteArrayValuesSelfTest {
-    /** {@inheritDoc} */
-    @Override protected boolean peerClassLoading() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        cfg.setMarshaller(new BinaryMarshaller());
-
-        return cfg;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheFullApiTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheFullApiTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheFullApiTestSuite.java
new file mode 100644
index 0000000..3dc78cc
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheFullApiTestSuite.java
@@ -0,0 +1,37 @@
+/*
+ * 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.testsuites;
+
+import junit.framework.TestSuite;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.testframework.config.GridTestProperties;
+
+/**
+ * Cache full API suite with portable marshaller.
+ */
+public class IgniteBinaryCacheFullApiTestSuite extends TestSuite {
+    /**
+     * @return Suite.
+     * @throws Exception In case of error.
+     */
+    public static TestSuite suite() throws Exception {
+        GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
+
+        return IgniteCacheFullApiSelfTestSuite.suite();
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheTestSuite.java
new file mode 100644
index 0000000..729bebe
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheTestSuite.java
@@ -0,0 +1,101 @@
+/*
+ * 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.testsuites;
+
+import java.util.HashSet;
+import junit.framework.TestSuite;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.internal.processors.cache.GridCacheAffinityRoutingSelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheEntryMemorySizeSelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheMvccSelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredAtomicSelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredEvictionAtomicSelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredEvictionSelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredSelfTest;
+import org.apache.ignite.internal.processors.cache.expiry.IgniteCacheAtomicLocalExpiryPolicyTest;
+import org.apache.ignite.internal.processors.cache.binary.GridBinaryCacheEntryMemorySizeSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.datastreaming.DataStreamProcessorBinarySelfTest;
+import org.apache.ignite.internal.processors.cache.binary.datastreaming.GridDataStreamerImplSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAffinityRoutingBinarySelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultiNodeSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultithreadedSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyBinaryMultiNodeSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyBinaryMultithreadedSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheMemoryModeBinarySelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredAtomicBinarySelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredEvictionAtomicBinarySelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredEvictionBinarySelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredBinarySelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinariesNearPartitionedByteArrayValuesSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinariesPartitionedOnlyByteArrayValuesSelfTest;
+import org.apache.ignite.internal.processors.datastreamer.DataStreamProcessorSelfTest;
+import org.apache.ignite.testframework.config.GridTestProperties;
+
+/**
+ * Cache suite with portable marshaller.
+ */
+public class IgniteBinaryCacheTestSuite extends TestSuite {
+    /**
+     * @return Suite.
+     * @throws Exception In case of error.
+     */
+    public static TestSuite suite() throws Exception {
+        GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
+
+        TestSuite suite = new TestSuite("Portable Cache Test Suite");
+
+        HashSet<Class> ignoredTests = new HashSet<>();
+
+        // Tests below have a special version for Portable Marshaller
+        ignoredTests.add(DataStreamProcessorSelfTest.class);
+        ignoredTests.add(GridCacheOffHeapTieredEvictionAtomicSelfTest.class);
+        ignoredTests.add(GridCacheOffHeapTieredEvictionSelfTest.class);
+        ignoredTests.add(GridCacheOffHeapTieredSelfTest.class);
+        ignoredTests.add(GridCacheOffHeapTieredAtomicSelfTest.class);
+        ignoredTests.add(GridCacheAffinityRoutingSelfTest.class);
+        ignoredTests.add(IgniteCacheAtomicLocalExpiryPolicyTest.class);
+        ignoredTests.add(GridCacheEntryMemorySizeSelfTest.class);
+
+        // Tests that are not ready to be used with PortableMarshaller
+        ignoredTests.add(GridCacheMvccSelfTest.class);
+
+        suite.addTest(IgniteCacheTestSuite.suite(ignoredTests));
+
+        suite.addTestSuite(GridCacheMemoryModeBinarySelfTest.class);
+        suite.addTestSuite(GridCacheOffHeapTieredEvictionAtomicBinarySelfTest.class);
+        suite.addTestSuite(GridCacheOffHeapTieredEvictionBinarySelfTest.class);
+
+        suite.addTestSuite(GridCacheBinariesPartitionedOnlyByteArrayValuesSelfTest.class);
+        suite.addTestSuite(GridCacheBinariesNearPartitionedByteArrayValuesSelfTest.class);
+        suite.addTestSuite(GridCacheOffHeapTieredBinarySelfTest.class);
+        suite.addTestSuite(GridCacheOffHeapTieredAtomicBinarySelfTest.class);
+
+        suite.addTestSuite(GridDataStreamerImplSelfTest.class);
+        suite.addTestSuite(DataStreamProcessorBinarySelfTest.class);
+        suite.addTestSuite(GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultiNodeSelfTest.class);
+        suite.addTestSuite(GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultithreadedSelfTest.class);
+
+        suite.addTestSuite(GridCacheAtomicPartitionedOnlyBinaryMultiNodeSelfTest.class);
+        suite.addTestSuite(GridCacheAtomicPartitionedOnlyBinaryMultithreadedSelfTest.class);
+
+        suite.addTestSuite(GridCacheAffinityRoutingBinarySelfTest.class);
+        suite.addTestSuite(GridBinaryCacheEntryMemorySizeSelfTest.class);
+
+        return suite;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java
new file mode 100644
index 0000000..271ff33
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java
@@ -0,0 +1,114 @@
+/*
+ * 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.testsuites;
+
+import junit.framework.TestSuite;
+import org.apache.ignite.internal.binary.BinaryEnumsSelfTest;
+import org.apache.ignite.internal.binary.GridBinaryAffinityKeySelfTest;
+import org.apache.ignite.internal.binary.BinaryObjectBuilderAdditionalSelfTest;
+import org.apache.ignite.internal.binary.BinaryObjectBuilderSelfTest;
+import org.apache.ignite.internal.binary.GridBinaryMarshallerCtxDisabledSelfTest;
+import org.apache.ignite.internal.binary.BinaryMarshallerSelfTest;
+import org.apache.ignite.internal.binary.GridBinaryMetaDataSelfTest;
+import org.apache.ignite.internal.binary.GridBinaryWildcardsSelfTest;
+import org.apache.ignite.internal.binary.BinaryFooterOffsetsHeapSelfTest;
+import org.apache.ignite.internal.binary.BinaryFooterOffsetsOffheapSelfTest;
+import org.apache.ignite.internal.binary.BinaryFieldsHeapSelfTest;
+import org.apache.ignite.internal.binary.BinaryFieldsOffheapSelfTest;
+import org.apache.ignite.internal.binary.noncompact.BinaryFieldsHeapNonCompactSelfTest;
+import org.apache.ignite.internal.binary.noncompact.BinaryFieldsOffheapNonCompactSelfTest;
+import org.apache.ignite.internal.binary.noncompact.BinaryFooterOffsetsHeapNonCompactSelfTest;
+import org.apache.ignite.internal.binary.noncompact.BinaryFooterOffsetsOffheapNonCompactSelfTest;
+import org.apache.ignite.internal.binary.noncompact.BinaryMarshallerNonCompactSelfTest;
+import org.apache.ignite.internal.binary.noncompact.BinaryObjectBuilderAdditionalNonCompactSelfTest;
+import org.apache.ignite.internal.binary.noncompact.BinaryObjectBuilderNonCompactSelfTest;
+import org.apache.ignite.internal.processors.cache.distributed.IgniteBinaryMetadataUpdateChangingTopologySelfTest;
+import org.apache.ignite.internal.processors.cache.binary.GridCacheClientNodeBinaryObjectMetadataMultinodeTest;
+import org.apache.ignite.internal.processors.cache.binary.GridCacheClientNodeBinaryObjectMetadataTest;
+import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryStoreObjectsSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryStoreBinariesSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsAtomicNearDisabledOffheapTieredSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsAtomicNearDisabledSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsAtomicOffheapTieredSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsAtomicSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsPartitionedNearDisabledOffheapTieredSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsPartitionedNearDisabledSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsPartitionedOffheapTieredSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsPartitionedSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.replicated.GridCacheBinaryObjectsReplicatedSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.local.GridCacheBinaryObjectsAtomicLocalSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.local.GridCacheBinaryObjectsLocalOffheapTieredSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.local.GridCacheBinaryObjectsLocalSelfTest;
+
+/**
+ * Test for portable objects stored in cache.
+ */
+public class IgniteBinaryObjectsTestSuite extends TestSuite {
+    /**
+     * @return Suite.
+     * @throws Exception If failed.
+     */
+    public static TestSuite suite() throws Exception {
+        TestSuite suite = new TestSuite("Ignite Binary Objects Test Suite");
+
+        suite.addTestSuite(BinaryMarshallerSelfTest.class);
+        suite.addTestSuite(GridBinaryMarshallerCtxDisabledSelfTest.class);
+        suite.addTestSuite(BinaryObjectBuilderSelfTest.class);
+        suite.addTestSuite(BinaryObjectBuilderAdditionalSelfTest.class);
+        suite.addTestSuite(BinaryFieldsHeapSelfTest.class);
+        suite.addTestSuite(BinaryFieldsOffheapSelfTest.class);
+        suite.addTestSuite(BinaryFooterOffsetsHeapSelfTest.class);
+        suite.addTestSuite(BinaryFooterOffsetsOffheapSelfTest.class);
+        suite.addTestSuite(BinaryEnumsSelfTest.class);
+        suite.addTestSuite(GridBinaryMetaDataSelfTest.class);
+        suite.addTestSuite(GridBinaryAffinityKeySelfTest.class);
+        suite.addTestSuite(GridBinaryWildcardsSelfTest.class);
+
+        // Tests for objects with non-compact footers.
+        suite.addTestSuite(BinaryMarshallerNonCompactSelfTest.class);
+        suite.addTestSuite(BinaryObjectBuilderNonCompactSelfTest.class);
+        suite.addTestSuite(BinaryObjectBuilderAdditionalNonCompactSelfTest.class);
+        suite.addTestSuite(BinaryFieldsHeapNonCompactSelfTest.class);
+        suite.addTestSuite(BinaryFieldsOffheapNonCompactSelfTest.class);
+        suite.addTestSuite(BinaryFooterOffsetsHeapNonCompactSelfTest.class);
+        suite.addTestSuite(BinaryFooterOffsetsOffheapNonCompactSelfTest.class);
+
+        suite.addTestSuite(GridCacheBinaryObjectsLocalSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryObjectsAtomicLocalSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryObjectsReplicatedSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryObjectsPartitionedSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryObjectsPartitionedNearDisabledSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryObjectsAtomicSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryObjectsAtomicNearDisabledSelfTest.class);
+
+        suite.addTestSuite(GridCacheBinaryObjectsLocalOffheapTieredSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryObjectsAtomicOffheapTieredSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryObjectsAtomicNearDisabledOffheapTieredSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryObjectsPartitionedOffheapTieredSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryObjectsPartitionedNearDisabledOffheapTieredSelfTest.class);
+
+        suite.addTestSuite(GridCacheBinaryStoreObjectsSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryStoreBinariesSelfTest.class);
+
+        suite.addTestSuite(GridCacheClientNodeBinaryObjectMetadataTest.class);
+        suite.addTestSuite(GridCacheClientNodeBinaryObjectMetadataMultinodeTest.class);
+        suite.addTestSuite(IgniteBinaryMetadataUpdateChangingTopologySelfTest.class);
+
+        return suite;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheFullApiTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheFullApiTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheFullApiTestSuite.java
deleted file mode 100644
index 3ba5b45..0000000
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheFullApiTestSuite.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.testsuites;
-
-import junit.framework.TestSuite;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.testframework.config.GridTestProperties;
-
-/**
- * Cache full API suite with portable marshaller.
- */
-public class IgnitePortableCacheFullApiTestSuite extends TestSuite {
-    /**
-     * @return Suite.
-     * @throws Exception In case of error.
-     */
-    public static TestSuite suite() throws Exception {
-        GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
-
-        return IgniteCacheFullApiSelfTestSuite.suite();
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheTestSuite.java
deleted file mode 100644
index f5745d8..0000000
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheTestSuite.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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.testsuites;
-
-import java.util.HashSet;
-import junit.framework.TestSuite;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.internal.processors.cache.GridCacheAffinityRoutingSelfTest;
-import org.apache.ignite.internal.processors.cache.GridCacheEntryMemorySizeSelfTest;
-import org.apache.ignite.internal.processors.cache.GridCacheMvccSelfTest;
-import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredAtomicSelfTest;
-import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredEvictionAtomicSelfTest;
-import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredEvictionSelfTest;
-import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredSelfTest;
-import org.apache.ignite.internal.processors.cache.expiry.IgniteCacheAtomicLocalExpiryPolicyTest;
-import org.apache.ignite.internal.processors.cache.binary.GridBinaryCacheEntryMemorySizeSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.datastreaming.DataStreamProcessorBinarySelfTest;
-import org.apache.ignite.internal.processors.cache.binary.datastreaming.GridDataStreamerImplSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAffinityRoutingBinarySelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultiNodeSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultithreadedSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyBinaryMultiNodeSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheAtomicPartitionedOnlyBinaryMultithreadedSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheMemoryModeBinarySelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredAtomicBinarySelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredEvictionAtomicBinarySelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredEvictionBinarySelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheOffHeapTieredBinarySelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCachePortablesNearPartitionedByteArrayValuesSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinariesPartitionedOnlyByteArrayValuesSelfTest;
-import org.apache.ignite.internal.processors.datastreamer.DataStreamProcessorSelfTest;
-import org.apache.ignite.testframework.config.GridTestProperties;
-
-/**
- * Cache suite with portable marshaller.
- */
-public class IgnitePortableCacheTestSuite extends TestSuite {
-    /**
-     * @return Suite.
-     * @throws Exception In case of error.
-     */
-    public static TestSuite suite() throws Exception {
-        GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
-
-        TestSuite suite = new TestSuite("Portable Cache Test Suite");
-
-        HashSet<Class> ignoredTests = new HashSet<>();
-
-        // Tests below have a special version for Portable Marshaller
-        ignoredTests.add(DataStreamProcessorSelfTest.class);
-        ignoredTests.add(GridCacheOffHeapTieredEvictionAtomicSelfTest.class);
-        ignoredTests.add(GridCacheOffHeapTieredEvictionSelfTest.class);
-        ignoredTests.add(GridCacheOffHeapTieredSelfTest.class);
-        ignoredTests.add(GridCacheOffHeapTieredAtomicSelfTest.class);
-        ignoredTests.add(GridCacheAffinityRoutingSelfTest.class);
-        ignoredTests.add(IgniteCacheAtomicLocalExpiryPolicyTest.class);
-        ignoredTests.add(GridCacheEntryMemorySizeSelfTest.class);
-
-        // Tests that are not ready to be used with PortableMarshaller
-        ignoredTests.add(GridCacheMvccSelfTest.class);
-
-        suite.addTest(IgniteCacheTestSuite.suite(ignoredTests));
-
-        suite.addTestSuite(GridCacheMemoryModeBinarySelfTest.class);
-        suite.addTestSuite(GridCacheOffHeapTieredEvictionAtomicBinarySelfTest.class);
-        suite.addTestSuite(GridCacheOffHeapTieredEvictionBinarySelfTest.class);
-
-        suite.addTestSuite(GridCacheBinariesPartitionedOnlyByteArrayValuesSelfTest.class);
-        suite.addTestSuite(GridCachePortablesNearPartitionedByteArrayValuesSelfTest.class);
-        suite.addTestSuite(GridCacheOffHeapTieredBinarySelfTest.class);
-        suite.addTestSuite(GridCacheOffHeapTieredAtomicBinarySelfTest.class);
-
-        suite.addTestSuite(GridDataStreamerImplSelfTest.class);
-        suite.addTestSuite(DataStreamProcessorBinarySelfTest.class);
-        suite.addTestSuite(GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultiNodeSelfTest.class);
-        suite.addTestSuite(GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultithreadedSelfTest.class);
-
-        suite.addTestSuite(GridCacheAtomicPartitionedOnlyBinaryMultiNodeSelfTest.class);
-        suite.addTestSuite(GridCacheAtomicPartitionedOnlyBinaryMultithreadedSelfTest.class);
-
-        suite.addTestSuite(GridCacheAffinityRoutingBinarySelfTest.class);
-        suite.addTestSuite(GridBinaryCacheEntryMemorySizeSelfTest.class);
-
-        return suite;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableObjectsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableObjectsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableObjectsTestSuite.java
deleted file mode 100644
index 942a5fa..0000000
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgnitePortableObjectsTestSuite.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * 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.testsuites;
-
-import junit.framework.TestSuite;
-import org.apache.ignite.internal.binary.BinaryEnumsSelfTest;
-import org.apache.ignite.internal.binary.GridBinaryAffinityKeySelfTest;
-import org.apache.ignite.internal.binary.BinaryObjectBuilderAdditionalSelfTest;
-import org.apache.ignite.internal.binary.BinaryObjectBuilderSelfTest;
-import org.apache.ignite.internal.binary.GridBinaryMarshallerCtxDisabledSelfTest;
-import org.apache.ignite.internal.binary.BinaryMarshallerSelfTest;
-import org.apache.ignite.internal.binary.GridPortableMetaDataSelfTest;
-import org.apache.ignite.internal.binary.GridPortableWildcardsSelfTest;
-import org.apache.ignite.internal.binary.BinaryFooterOffsetsHeapSelfTest;
-import org.apache.ignite.internal.binary.BinaryFooterOffsetsOffheapSelfTest;
-import org.apache.ignite.internal.binary.BinaryFieldsHeapSelfTest;
-import org.apache.ignite.internal.binary.BinaryFieldsOffheapSelfTest;
-import org.apache.ignite.internal.binary.noncompact.BinaryFieldsHeapNonCompactSelfTest;
-import org.apache.ignite.internal.binary.noncompact.BinaryFieldsOffheapNonCompactSelfTest;
-import org.apache.ignite.internal.binary.noncompact.BinaryFooterOffsetsHeapNonCompactSelfTest;
-import org.apache.ignite.internal.binary.noncompact.BinaryFooterOffsetsOffheapNonCompactSelfTest;
-import org.apache.ignite.internal.binary.noncompact.BinaryMarshallerNonCompactSelfTest;
-import org.apache.ignite.internal.binary.noncompact.BinaryObjectBuilderAdditionalNonCompactSelfTest;
-import org.apache.ignite.internal.binary.noncompact.BinaryObjectBuilderNonCompactSelfTest;
-import org.apache.ignite.internal.processors.cache.distributed.IgniteBinaryMetadataUpdateChangingTopologySelfTest;
-import org.apache.ignite.internal.processors.cache.binary.GridCacheClientNodeBinaryObjectMetadataMultinodeTest;
-import org.apache.ignite.internal.processors.cache.binary.GridCacheClientNodeBinaryObjectMetadataTest;
-import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryStoreObjectsSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryStorePortablesSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsAtomicNearDisabledOffheapTieredSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsAtomicNearDisabledSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsAtomicOffheapTieredSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsAtomicSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsPartitionedNearDisabledOffheapTieredSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsPartitionedNearDisabledSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsPartitionedOffheapTieredSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryObjectsPartitionedSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.replicated.GridCacheBinaryObjectsReplicatedSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.local.GridCacheBinaryObjectsAtomicLocalSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.local.GridCacheBinaryObjectsLocalOffheapTieredSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.local.GridCacheBinaryObjectsLocalSelfTest;
-
-/**
- * Test for portable objects stored in cache.
- */
-public class IgnitePortableObjectsTestSuite extends TestSuite {
-    /**
-     * @return Suite.
-     * @throws Exception If failed.
-     */
-    public static TestSuite suite() throws Exception {
-        TestSuite suite = new TestSuite("Ignite Binary Objects Test Suite");
-
-        suite.addTestSuite(BinaryMarshallerSelfTest.class);
-        suite.addTestSuite(GridBinaryMarshallerCtxDisabledSelfTest.class);
-        suite.addTestSuite(BinaryObjectBuilderSelfTest.class);
-        suite.addTestSuite(BinaryObjectBuilderAdditionalSelfTest.class);
-        suite.addTestSuite(BinaryFieldsHeapSelfTest.class);
-        suite.addTestSuite(BinaryFieldsOffheapSelfTest.class);
-        suite.addTestSuite(BinaryFooterOffsetsHeapSelfTest.class);
-        suite.addTestSuite(BinaryFooterOffsetsOffheapSelfTest.class);
-        suite.addTestSuite(BinaryEnumsSelfTest.class);
-        suite.addTestSuite(GridPortableMetaDataSelfTest.class);
-        suite.addTestSuite(GridBinaryAffinityKeySelfTest.class);
-        suite.addTestSuite(GridPortableWildcardsSelfTest.class);
-
-        // Tests for objects with non-compact footers.
-        suite.addTestSuite(BinaryMarshallerNonCompactSelfTest.class);
-        suite.addTestSuite(BinaryObjectBuilderNonCompactSelfTest.class);
-        suite.addTestSuite(BinaryObjectBuilderAdditionalNonCompactSelfTest.class);
-        suite.addTestSuite(BinaryFieldsHeapNonCompactSelfTest.class);
-        suite.addTestSuite(BinaryFieldsOffheapNonCompactSelfTest.class);
-        suite.addTestSuite(BinaryFooterOffsetsHeapNonCompactSelfTest.class);
-        suite.addTestSuite(BinaryFooterOffsetsOffheapNonCompactSelfTest.class);
-
-        suite.addTestSuite(GridCacheBinaryObjectsLocalSelfTest.class);
-        suite.addTestSuite(GridCacheBinaryObjectsAtomicLocalSelfTest.class);
-        suite.addTestSuite(GridCacheBinaryObjectsReplicatedSelfTest.class);
-        suite.addTestSuite(GridCacheBinaryObjectsPartitionedSelfTest.class);
-        suite.addTestSuite(GridCacheBinaryObjectsPartitionedNearDisabledSelfTest.class);
-        suite.addTestSuite(GridCacheBinaryObjectsAtomicSelfTest.class);
-        suite.addTestSuite(GridCacheBinaryObjectsAtomicNearDisabledSelfTest.class);
-
-        suite.addTestSuite(GridCacheBinaryObjectsLocalOffheapTieredSelfTest.class);
-        suite.addTestSuite(GridCacheBinaryObjectsAtomicOffheapTieredSelfTest.class);
-        suite.addTestSuite(GridCacheBinaryObjectsAtomicNearDisabledOffheapTieredSelfTest.class);
-        suite.addTestSuite(GridCacheBinaryObjectsPartitionedOffheapTieredSelfTest.class);
-        suite.addTestSuite(GridCacheBinaryObjectsPartitionedNearDisabledOffheapTieredSelfTest.class);
-
-        suite.addTestSuite(GridCacheBinaryStoreObjectsSelfTest.class);
-        suite.addTestSuite(GridCacheBinaryStorePortablesSelfTest.class);
-
-        suite.addTestSuite(GridCacheClientNodeBinaryObjectMetadataTest.class);
-        suite.addTestSuite(GridCacheClientNodeBinaryObjectMetadataMultinodeTest.class);
-        suite.addTestSuite(IgniteBinaryMetadataUpdateChangingTopologySelfTest.class);
-
-        return suite;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
new file mode 100644
index 0000000..daf9c45
--- /dev/null
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
@@ -0,0 +1,119 @@
+/*
+ * 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.testsuites;
+
+import junit.framework.TestSuite;
+import org.apache.ignite.internal.processors.cache.CacheLocalQueryMetricsSelfTest;
+import org.apache.ignite.internal.processors.cache.CachePartitionedQueryMetricsDistributedSelfTest;
+import org.apache.ignite.internal.processors.cache.CachePartitionedQueryMetricsLocalSelfTest;
+import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsDistributedSelfTest;
+import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsLocalSelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheQueryIndexDisabledSelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheQueryIndexingDisabledSelfTest;
+import org.apache.ignite.internal.processors.cache.GridCacheReduceQueryMultithreadedSelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteBinaryObjectFieldsQuerySelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheFieldsQueryNoDataSelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheLargeResultSelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheOffheapTieredMultithreadedSelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheP2pUnmarshallingQueryErrorTest;
+import org.apache.ignite.internal.processors.cache.IgniteCachePartitionedQueryMultiThreadedSelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheQueryEvictsMultiThreadedSelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheQueryMultiThreadedSelfTest;
+import org.apache.ignite.internal.processors.cache.IgniteCacheQueryOffheapMultiThreadedSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest;
+import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicNearEnabledSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicP2PDisabledSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryLocalAtomicSelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionedOnlySelfTest;
+import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedAtomicSelfTest;
+import org.apache.ignite.internal.processors.query.h2.sql.BaseH2CompareQueryTest;
+import org.apache.ignite.internal.processors.query.h2.sql.GridQueryParsingTest;
+import org.apache.ignite.internal.processors.query.h2.sql.H2CompareBigQueryTest;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.spi.communication.tcp.GridOrderedMessageCancelSelfTest;
+import org.apache.ignite.testframework.config.GridTestProperties;
+
+/**
+ * Cache query suite with portable marshaller.
+ */
+public class IgniteBinaryCacheQueryTestSuite extends TestSuite {
+    /**
+     * @return Suite.
+     * @throws Exception In case of error.
+     */
+    public static TestSuite suite() throws Exception {
+        GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
+
+        TestSuite suite = new TestSuite("Grid Cache Query Test Suite using PortableMarshaller");
+
+        // Parsing
+        suite.addTestSuite(GridQueryParsingTest.class);
+
+        // Queries tests.
+        suite.addTestSuite(GridCacheQueryIndexDisabledSelfTest.class);
+        suite.addTestSuite(IgniteCachePartitionedQueryMultiThreadedSelfTest.class);
+        suite.addTestSuite(IgniteCacheLargeResultSelfTest.class);
+        suite.addTestSuite(IgniteCacheQueryMultiThreadedSelfTest.class);
+        suite.addTestSuite(IgniteCacheQueryEvictsMultiThreadedSelfTest.class);
+        suite.addTestSuite(IgniteCacheQueryOffheapMultiThreadedSelfTest.class);
+
+        suite.addTestSuite(IgniteCacheOffheapTieredMultithreadedSelfTest.class);
+        suite.addTestSuite(GridCacheReduceQueryMultithreadedSelfTest.class);
+
+
+        // Fields queries.
+        suite.addTestSuite(IgniteCacheFieldsQueryNoDataSelfTest.class);
+        suite.addTestSuite(IgniteBinaryObjectFieldsQuerySelfTest.class);
+
+        // Continuous queries.
+        suite.addTestSuite(GridCacheContinuousQueryLocalAtomicSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryReplicatedAtomicSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryPartitionedOnlySelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryAtomicSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryAtomicNearEnabledSelfTest.class);
+        suite.addTestSuite(GridCacheContinuousQueryAtomicP2PDisabledSelfTest.class);
+
+        suite.addTestSuite(GridCacheQueryIndexingDisabledSelfTest.class);
+
+        //Should be adjusted. Not ready to be used with PortableMarshaller.
+        //suite.addTestSuite(GridCachePortableSwapScanQuerySelfTest.class);
+
+        suite.addTestSuite(GridOrderedMessageCancelSelfTest.class);
+
+        // Ignite cache and H2 comparison.
+        suite.addTestSuite(BaseH2CompareQueryTest.class);
+        suite.addTestSuite(H2CompareBigQueryTest.class);
+
+        // Metrics tests
+        suite.addTestSuite(CacheLocalQueryMetricsSelfTest.class);
+        suite.addTestSuite(CachePartitionedQueryMetricsDistributedSelfTest.class);
+        suite.addTestSuite(CachePartitionedQueryMetricsLocalSelfTest.class);
+        suite.addTestSuite(CacheReplicatedQueryMetricsDistributedSelfTest.class);
+        suite.addTestSuite(CacheReplicatedQueryMetricsLocalSelfTest.class);
+
+        //Unmarshallig query test.
+        suite.addTestSuite(IgniteCacheP2pUnmarshallingQueryErrorTest.class);
+
+        suite.addTestSuite(GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.class);
+        suite.addTestSuite(GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.class);
+
+        return suite;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java
deleted file mode 100644
index 2df9026..0000000
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgnitePortableCacheQueryTestSuite.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * 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.testsuites;
-
-import junit.framework.TestSuite;
-import org.apache.ignite.internal.processors.cache.CacheLocalQueryMetricsSelfTest;
-import org.apache.ignite.internal.processors.cache.CachePartitionedQueryMetricsDistributedSelfTest;
-import org.apache.ignite.internal.processors.cache.CachePartitionedQueryMetricsLocalSelfTest;
-import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsDistributedSelfTest;
-import org.apache.ignite.internal.processors.cache.CacheReplicatedQueryMetricsLocalSelfTest;
-import org.apache.ignite.internal.processors.cache.GridCacheQueryIndexDisabledSelfTest;
-import org.apache.ignite.internal.processors.cache.GridCacheQueryIndexingDisabledSelfTest;
-import org.apache.ignite.internal.processors.cache.GridCacheReduceQueryMultithreadedSelfTest;
-import org.apache.ignite.internal.processors.cache.IgniteBinaryObjectFieldsQuerySelfTest;
-import org.apache.ignite.internal.processors.cache.IgniteCacheFieldsQueryNoDataSelfTest;
-import org.apache.ignite.internal.processors.cache.IgniteCacheLargeResultSelfTest;
-import org.apache.ignite.internal.processors.cache.IgniteCacheOffheapTieredMultithreadedSelfTest;
-import org.apache.ignite.internal.processors.cache.IgniteCacheP2pUnmarshallingQueryErrorTest;
-import org.apache.ignite.internal.processors.cache.IgniteCachePartitionedQueryMultiThreadedSelfTest;
-import org.apache.ignite.internal.processors.cache.IgniteCacheQueryEvictsMultiThreadedSelfTest;
-import org.apache.ignite.internal.processors.cache.IgniteCacheQueryMultiThreadedSelfTest;
-import org.apache.ignite.internal.processors.cache.IgniteCacheQueryOffheapMultiThreadedSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest;
-import org.apache.ignite.internal.processors.cache.binary.distributed.dht.GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicNearEnabledSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicP2PDisabledSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryAtomicSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryLocalAtomicSelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryPartitionedOnlySelfTest;
-import org.apache.ignite.internal.processors.cache.query.continuous.GridCacheContinuousQueryReplicatedAtomicSelfTest;
-import org.apache.ignite.internal.processors.query.h2.sql.BaseH2CompareQueryTest;
-import org.apache.ignite.internal.processors.query.h2.sql.GridQueryParsingTest;
-import org.apache.ignite.internal.processors.query.h2.sql.H2CompareBigQueryTest;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.spi.communication.tcp.GridOrderedMessageCancelSelfTest;
-import org.apache.ignite.testframework.config.GridTestProperties;
-
-/**
- * Cache query suite with portable marshaller.
- */
-public class IgnitePortableCacheQueryTestSuite extends TestSuite {
-    /**
-     * @return Suite.
-     * @throws Exception In case of error.
-     */
-    public static TestSuite suite() throws Exception {
-        GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
-
-        TestSuite suite = new TestSuite("Grid Cache Query Test Suite using PortableMarshaller");
-
-        // Parsing
-        suite.addTestSuite(GridQueryParsingTest.class);
-
-        // Queries tests.
-        suite.addTestSuite(GridCacheQueryIndexDisabledSelfTest.class);
-        suite.addTestSuite(IgniteCachePartitionedQueryMultiThreadedSelfTest.class);
-        suite.addTestSuite(IgniteCacheLargeResultSelfTest.class);
-        suite.addTestSuite(IgniteCacheQueryMultiThreadedSelfTest.class);
-        suite.addTestSuite(IgniteCacheQueryEvictsMultiThreadedSelfTest.class);
-        suite.addTestSuite(IgniteCacheQueryOffheapMultiThreadedSelfTest.class);
-
-        suite.addTestSuite(IgniteCacheOffheapTieredMultithreadedSelfTest.class);
-        suite.addTestSuite(GridCacheReduceQueryMultithreadedSelfTest.class);
-
-
-        // Fields queries.
-        suite.addTestSuite(IgniteCacheFieldsQueryNoDataSelfTest.class);
-        suite.addTestSuite(IgniteBinaryObjectFieldsQuerySelfTest.class);
-
-        // Continuous queries.
-        suite.addTestSuite(GridCacheContinuousQueryLocalAtomicSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryReplicatedAtomicSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryPartitionedOnlySelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryAtomicSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryAtomicNearEnabledSelfTest.class);
-        suite.addTestSuite(GridCacheContinuousQueryAtomicP2PDisabledSelfTest.class);
-
-        suite.addTestSuite(GridCacheQueryIndexingDisabledSelfTest.class);
-
-        //Should be adjusted. Not ready to be used with PortableMarshaller.
-        //suite.addTestSuite(GridCachePortableSwapScanQuerySelfTest.class);
-
-        suite.addTestSuite(GridOrderedMessageCancelSelfTest.class);
-
-        // Ignite cache and H2 comparison.
-        suite.addTestSuite(BaseH2CompareQueryTest.class);
-        suite.addTestSuite(H2CompareBigQueryTest.class);
-
-        // Metrics tests
-        suite.addTestSuite(CacheLocalQueryMetricsSelfTest.class);
-        suite.addTestSuite(CachePartitionedQueryMetricsDistributedSelfTest.class);
-        suite.addTestSuite(CachePartitionedQueryMetricsLocalSelfTest.class);
-        suite.addTestSuite(CacheReplicatedQueryMetricsDistributedSelfTest.class);
-        suite.addTestSuite(CacheReplicatedQueryMetricsLocalSelfTest.class);
-
-        //Unmarshallig query test.
-        suite.addTestSuite(IgniteCacheP2pUnmarshallingQueryErrorTest.class);
-
-        suite.addTestSuite(GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.class);
-        suite.addTestSuite(GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.class);
-
-        return suite;
-    }
-}


[36/50] [abbrv] ignite git commit: ignite-1.5 Fixed NPE in IgniteKernal.dumpDebugInfo.

Posted by vo...@apache.org.
ignite-1.5 Fixed NPE in IgniteKernal.dumpDebugInfo.


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

Branch: refs/heads/ignite-2100
Commit: acb57c5eb95d11ebde5557618226d80f25ac610c
Parents: 717dab2
Author: sboikov <sb...@gridgain.com>
Authored: Mon Dec 14 10:40:57 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Dec 14 10:40:57 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    | 26 ++++++++++++--------
 1 file changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/acb57c5e/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 4fb5d4a..0f781d6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -3244,20 +3244,26 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
 
     /** {@inheritDoc} */
     public void dumpDebugInfo() {
-        boolean client = ctx.clientNode();
+        GridKernalContextImpl ctx = this.ctx;
 
-        ClusterNode locNode = ctx.discovery().localNode();
+        if (ctx != null) {
+            boolean client = ctx.clientNode();
 
-        UUID routerId = locNode instanceof TcpDiscoveryNode ? ((TcpDiscoveryNode)locNode).clientRouterNodeId() : null;
+            ClusterNode locNode = ctx.discovery().localNode();
 
-        U.warn(log, "Dumping debug info for node [id=" + locNode.id() +
-            ", name=" + ctx.gridName() +
-            ", order=" + locNode.order() +
-            ", topVer=" + ctx.discovery().topologyVersion() +
-            ", client=" + client +
-            (client && routerId != null ? ", routerId=" + routerId : "") + ']');
+            UUID routerId = locNode instanceof TcpDiscoveryNode ? ((TcpDiscoveryNode)locNode).clientRouterNodeId() : null;
 
-        ctx.cache().context().exchange().dumpDebugInfo();
+            U.warn(log, "Dumping debug info for node [id=" + locNode.id() +
+                ", name=" + ctx.gridName() +
+                ", order=" + locNode.order() +
+                ", topVer=" + ctx.discovery().topologyVersion() +
+                ", client=" + client +
+                (client && routerId != null ? ", routerId=" + routerId : "") + ']');
+
+            ctx.cache().context().exchange().dumpDebugInfo();
+        }
+        else
+            U.warn(log, "Dumping debug info for node, context is not initialized [name=" + gridName + ']');
     }
 
     /** {@inheritDoc} */


[06/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary"

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCachePortableStorePortablesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCachePortableStorePortablesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCachePortableStorePortablesSelfTest.java
deleted file mode 100644
index 40fc9c6..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCachePortableStorePortablesSelfTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.processors.cache.binary;
-
-import java.util.Map;
-import org.apache.ignite.binary.BinaryObject;
-
-/**
- * Tests for cache store with binary.
- */
-public class GridCachePortableStorePortablesSelfTest extends GridCachePortableStoreAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected boolean keepPortableInStore() {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void populateMap(Map<Object, Object> map, int... idxs) {
-        assert map != null;
-        assert idxs != null;
-
-        for (int idx : idxs)
-            map.put(portable(new Key(idx)), portable(new Value(idx)));
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void checkMap(Map<Object, Object> map, int... idxs) {
-        assert map != null;
-        assert idxs != null;
-
-        assertEquals(idxs.length, map.size());
-
-        for (int idx : idxs) {
-            Object val = map.get(portable(new Key(idx)));
-
-            assertTrue(String.valueOf(val), val instanceof BinaryObject);
-
-            BinaryObject po = (BinaryObject)val;
-
-            assertEquals("Value", po.type().typeName());
-            assertEquals(new Integer(idx), po.field("idx"));
-        }
-    }
-
-    /**
-     * @param obj Object.
-     * @return Portable object.
-     */
-    private Object portable(Object obj) {
-        return grid().binary().toBinary(obj);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridPortableCacheEntryMemorySizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridPortableCacheEntryMemorySizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridPortableCacheEntryMemorySizeSelfTest.java
deleted file mode 100644
index f2c75c9..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridPortableCacheEntryMemorySizeSelfTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.processors.cache.binary;
-
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.binary.BinaryNoopMetadataHandler;
-import org.apache.ignite.internal.binary.PortableContext;
-import org.apache.ignite.internal.processors.cache.GridCacheEntryMemorySizeSelfTest;
-import org.apache.ignite.internal.util.IgniteUtils;
-import org.apache.ignite.marshaller.Marshaller;
-import org.apache.ignite.marshaller.MarshallerContextTestImpl;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-
-/**
- *
- */
-public class GridPortableCacheEntryMemorySizeSelfTest extends GridCacheEntryMemorySizeSelfTest {
-    /** {@inheritDoc} */
-    @Override protected Marshaller createMarshaller() throws IgniteCheckedException {
-        BinaryMarshaller marsh = new BinaryMarshaller();
-
-        marsh.setContext(new MarshallerContextTestImpl(null));
-
-        IgniteConfiguration iCfg = new IgniteConfiguration();
-
-        PortableContext pCtx = new PortableContext(BinaryNoopMetadataHandler.instance(), iCfg);
-
-        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", pCtx, iCfg);
-
-        return marsh;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridPortableDuplicateIndexObjectsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridPortableDuplicateIndexObjectsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridPortableDuplicateIndexObjectsAbstractSelfTest.java
deleted file mode 100644
index 6ef8749..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridPortableDuplicateIndexObjectsAbstractSelfTest.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * 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.processors.cache.binary;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.cache.CacheTypeMetadata;
-import org.apache.ignite.cache.query.SqlFieldsQuery;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.binary.BinaryObject;
-
-/**
- * Tests that portable object is the same in cache entry and in index.
- */
-public abstract class GridPortableDuplicateIndexObjectsAbstractSelfTest extends GridCacheAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 1;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        BinaryConfiguration bCfg = new BinaryConfiguration();
-
-        bCfg.setClassNames(Collections.singletonList(TestPortable.class.getName()));
-
-        cfg.setBinaryConfiguration(bCfg);
-
-        cfg.setMarshaller(new BinaryMarshaller());
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
-        CacheConfiguration ccfg = super.cacheConfiguration(gridName);
-
-        ccfg.setCopyOnRead(false);
-
-        CacheTypeMetadata meta = new CacheTypeMetadata();
-
-        meta.setKeyType(Integer.class);
-        meta.setValueType(TestPortable.class.getName());
-
-        Map<String, Class<?>> idx = new HashMap<>();
-
-        idx.put("fieldOne", String.class);
-        idx.put("fieldTwo", Integer.class);
-
-        meta.setAscendingFields(idx);
-
-        ccfg.setTypeMetadata(Collections.singletonList(meta));
-
-        return ccfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override public abstract CacheAtomicityMode atomicityMode();
-
-    /** {@inheritDoc} */
-    @Override public abstract CacheMode cacheMode();
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testIndexReferences() throws Exception {
-        IgniteCache<Integer, TestPortable> cache = grid(0).cache(null);
-
-        String fieldOneVal = "123";
-        int fieldTwoVal = 123;
-        int key = 0;
-
-        cache.put(key, new TestPortable(fieldOneVal, fieldTwoVal));
-
-        IgniteCache<Integer, BinaryObject> prj = grid(0).cache(null).withKeepBinary();
-
-        BinaryObject cacheVal = prj.get(key);
-
-        assertEquals(fieldOneVal, cacheVal.field("fieldOne"));
-        assertEquals(new Integer(fieldTwoVal), cacheVal.field("fieldTwo"));
-
-        List<?> row = F.first(prj.query(new SqlFieldsQuery("select _val from " +
-            "TestPortable where _key = ?").setArgs(key)).getAll());
-
-        assertEquals(1, row.size());
-
-        BinaryObject qryVal = (BinaryObject)row.get(0);
-
-        assertEquals(fieldOneVal, qryVal.field("fieldOne"));
-        assertEquals(new Integer(fieldTwoVal), qryVal.field("fieldTwo"));
-        assertSame(cacheVal, qryVal);
-    }
-
-    /**
-     * Test portable object.
-     */
-    private static class TestPortable {
-        /** */
-        private String fieldOne;
-
-        /** */
-        private int fieldTwo;
-
-        /**
-         *
-         */
-        private TestPortable() {
-            // No-op.
-        }
-
-        /**
-         * @param fieldOne Field one.
-         * @param fieldTwo Field two.
-         */
-        private TestPortable(String fieldOne, int fieldTwo) {
-            this.fieldOne = fieldOne;
-            this.fieldTwo = fieldTwo;
-        }
-
-        /**
-         * @return Field one.
-         */
-        public String fieldOne() {
-            return fieldOne;
-        }
-
-        /**
-         * @return Field two.
-         */
-        public int fieldTwo() {
-            return fieldTwo;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/DataStreamProcessorBinarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/DataStreamProcessorBinarySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/DataStreamProcessorBinarySelfTest.java
new file mode 100644
index 0000000..bb53123
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/DataStreamProcessorBinarySelfTest.java
@@ -0,0 +1,71 @@
+/*
+ * 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.processors.cache.binary.datastreaming;
+
+import java.util.Collection;
+import java.util.Map;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.processors.datastreamer.DataStreamProcessorSelfTest;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.stream.StreamReceiver;
+
+/**
+ *
+ */
+public class DataStreamProcessorBinarySelfTest extends DataStreamProcessorSelfTest {
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        BinaryMarshaller marsh = new BinaryMarshaller();
+
+        cfg.setMarshaller(marsh);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected StreamReceiver<String, TestObject> getStreamReceiver() {
+        return new TestDataReceiver();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected boolean customKeepBinary() {
+        return true;
+    }
+
+    /**
+     *
+     */
+    private static class TestDataReceiver implements StreamReceiver<String, TestObject> {
+        /** {@inheritDoc} */
+        @Override public void receive(IgniteCache<String, TestObject> cache,
+            Collection<Map.Entry<String, TestObject>> entries) {
+            for (Map.Entry<String, TestObject> e : entries) {
+                assertTrue(e.getKey() instanceof String);
+                assertTrue(String.valueOf(e.getValue()), e.getValue() instanceof BinaryObject);
+
+                TestObject obj = ((BinaryObject)e.getValue()).deserialize();
+
+                cache.put(e.getKey(), new TestObject(obj.val + 1));
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/DataStreamProcessorPortableSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/DataStreamProcessorPortableSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/DataStreamProcessorPortableSelfTest.java
deleted file mode 100644
index 0538b9e..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/DataStreamProcessorPortableSelfTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.processors.cache.binary.datastreaming;
-
-import java.util.Collection;
-import java.util.Map;
-import org.apache.ignite.IgniteCache;
-import org.apache.ignite.binary.BinaryObject;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.processors.datastreamer.DataStreamProcessorSelfTest;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.stream.StreamReceiver;
-
-/**
- *
- */
-public class DataStreamProcessorPortableSelfTest extends DataStreamProcessorSelfTest {
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        BinaryMarshaller marsh = new BinaryMarshaller();
-
-        cfg.setMarshaller(marsh);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected StreamReceiver<String, TestObject> getStreamReceiver() {
-        return new TestDataReceiver();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected boolean customKeepBinary() {
-        return true;
-    }
-
-    /**
-     *
-     */
-    private static class TestDataReceiver implements StreamReceiver<String, TestObject> {
-        /** {@inheritDoc} */
-        @Override public void receive(IgniteCache<String, TestObject> cache,
-            Collection<Map.Entry<String, TestObject>> entries) {
-            for (Map.Entry<String, TestObject> e : entries) {
-                assertTrue(e.getKey() instanceof String);
-                assertTrue(String.valueOf(e.getValue()), e.getValue() instanceof BinaryObject);
-
-                TestObject obj = ((BinaryObject)e.getValue()).deserialize();
-
-                cache.put(e.getKey(), new TestObject(obj.val + 1));
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAffinityRoutingBinarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAffinityRoutingBinarySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAffinityRoutingBinarySelfTest.java
new file mode 100644
index 0000000..5b21c99
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAffinityRoutingBinarySelfTest.java
@@ -0,0 +1,54 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+import java.util.Collections;
+import org.apache.ignite.cache.CacheKeyConfiguration;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.processors.cache.GridCacheAffinityRoutingSelfTest;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.binary.BinaryTypeConfiguration;
+
+/**
+ *
+ */
+public class GridCacheAffinityRoutingBinarySelfTest extends GridCacheAffinityRoutingSelfTest {
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();
+
+        typeCfg.setTypeName(AffinityTestKey.class.getName());
+
+        CacheKeyConfiguration keyCfg = new CacheKeyConfiguration(AffinityTestKey.class.getName(), "affKey");
+
+        cfg.setCacheKeyConfiguration(keyCfg);
+
+        BinaryConfiguration bCfg = new BinaryConfiguration();
+
+        bCfg.setTypeConfigurations(Collections.singleton(typeCfg));
+
+        cfg.setBinaryConfiguration(bCfg);
+
+        cfg.setMarshaller(new BinaryMarshaller());
+
+        return cfg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAffinityRoutingPortableSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAffinityRoutingPortableSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAffinityRoutingPortableSelfTest.java
deleted file mode 100644
index 9f564dd..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAffinityRoutingPortableSelfTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-import java.util.Collections;
-import org.apache.ignite.cache.CacheKeyConfiguration;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.processors.cache.GridCacheAffinityRoutingSelfTest;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.binary.BinaryTypeConfiguration;
-
-/**
- *
- */
-public class GridCacheAffinityRoutingPortableSelfTest extends GridCacheAffinityRoutingSelfTest {
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();
-
-        typeCfg.setTypeName(AffinityTestKey.class.getName());
-
-        CacheKeyConfiguration keyCfg = new CacheKeyConfiguration(AffinityTestKey.class.getName(), "affKey");
-
-        cfg.setCacheKeyConfiguration(keyCfg);
-
-        BinaryConfiguration bCfg = new BinaryConfiguration();
-
-        bCfg.setTypeConfigurations(Collections.singleton(typeCfg));
-
-        cfg.setBinaryConfiguration(bCfg);
-
-        cfg.setMarshaller(new BinaryMarshaller());
-
-        return cfg;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultiNodeSelfTest.java
new file mode 100644
index 0000000..10effbd
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultiNodeSelfTest.java
@@ -0,0 +1,29 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+/**
+ *
+ */
+public class GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultiNodeSelfTest extends
+    GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultithreadedSelfTest {
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 4;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultithreadedSelfTest.java
new file mode 100644
index 0000000..c48f2a5
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultithreadedSelfTest.java
@@ -0,0 +1,47 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.configuration.NearCacheConfiguration;
+import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryObjectsAbstractDataStreamerSelfTest;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+
+/**
+ *
+ */
+public class GridCacheAtomicPartitionedOnlyBinaryDataStreamerMultithreadedSelfTest extends
+    GridCacheBinaryObjectsAbstractDataStreamerSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return PARTITIONED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return ATOMIC;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected NearCacheConfiguration nearConfiguration() {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryMultiNodeSelfTest.java
new file mode 100644
index 0000000..064f0c5
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryMultiNodeSelfTest.java
@@ -0,0 +1,28 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+/**
+ *
+ */
+public class GridCacheAtomicPartitionedOnlyBinaryMultiNodeSelfTest extends
+    GridCacheAtomicPartitionedOnlyBinaryMultithreadedSelfTest {
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 4;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryMultithreadedSelfTest.java
new file mode 100644
index 0000000..1836f3a
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyBinaryMultithreadedSelfTest.java
@@ -0,0 +1,47 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.configuration.NearCacheConfiguration;
+import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryObjectsAbstractMultiThreadedSelfTest;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+
+/**
+ *
+ */
+public class GridCacheAtomicPartitionedOnlyBinaryMultithreadedSelfTest extends
+    GridCacheBinaryObjectsAbstractMultiThreadedSelfTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return PARTITIONED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return ATOMIC;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected NearCacheConfiguration nearConfiguration() {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableDataStreamerMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableDataStreamerMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableDataStreamerMultiNodeSelfTest.java
deleted file mode 100644
index 82ad26f..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableDataStreamerMultiNodeSelfTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-/**
- *
- */
-public class GridCacheAtomicPartitionedOnlyPortableDataStreamerMultiNodeSelfTest extends
-    GridCacheAtomicPartitionedOnlyPortableDataStreamerMultithreadedSelfTest {
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 4;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableDataStreamerMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableDataStreamerMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableDataStreamerMultithreadedSelfTest.java
deleted file mode 100644
index 3e37a18..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableDataStreamerMultithreadedSelfTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.configuration.NearCacheConfiguration;
-import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryObjectsAbstractDataStreamerSelfTest;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
-import static org.apache.ignite.cache.CacheMode.PARTITIONED;
-
-/**
- *
- */
-public class GridCacheAtomicPartitionedOnlyPortableDataStreamerMultithreadedSelfTest extends
-    GridCacheBinaryObjectsAbstractDataStreamerSelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheMode cacheMode() {
-        return PARTITIONED;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheAtomicityMode atomicityMode() {
-        return ATOMIC;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected NearCacheConfiguration nearConfiguration() {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableMultiNodeSelfTest.java
deleted file mode 100644
index d704dcf..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableMultiNodeSelfTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-/**
- *
- */
-public class GridCacheAtomicPartitionedOnlyPortableMultiNodeSelfTest extends
-    GridCacheAtomicPartitionedOnlyPortableMultithreadedSelfTest {
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 4;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableMultithreadedSelfTest.java
deleted file mode 100644
index 4391b2b..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheAtomicPartitionedOnlyPortableMultithreadedSelfTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.configuration.NearCacheConfiguration;
-import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryObjectsAbstractMultiThreadedSelfTest;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
-import static org.apache.ignite.cache.CacheMode.PARTITIONED;
-
-/**
- *
- */
-public class GridCacheAtomicPartitionedOnlyPortableMultithreadedSelfTest extends
-    GridCacheBinaryObjectsAbstractMultiThreadedSelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheMode cacheMode() {
-        return PARTITIONED;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheAtomicityMode atomicityMode() {
-        return ATOMIC;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected NearCacheConfiguration nearConfiguration() {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinariesPartitionedOnlyByteArrayValuesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinariesPartitionedOnlyByteArrayValuesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinariesPartitionedOnlyByteArrayValuesSelfTest.java
new file mode 100644
index 0000000..8e21dac
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinariesPartitionedOnlyByteArrayValuesSelfTest.java
@@ -0,0 +1,42 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.processors.cache.distributed.dht.GridCacheAbstractPartitionedOnlyByteArrayValuesSelfTest;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+
+/**
+ *
+ */
+public class GridCacheBinariesPartitionedOnlyByteArrayValuesSelfTest
+    extends GridCacheAbstractPartitionedOnlyByteArrayValuesSelfTest {
+    /** {@inheritDoc} */
+    @Override protected boolean peerClassLoading() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        cfg.setMarshaller(new BinaryMarshaller());
+
+        return cfg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.java
new file mode 100644
index 0000000..459d0ee
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest.java
@@ -0,0 +1,38 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.internal.processors.cache.binary.GridBinaryDuplicateIndexObjectsAbstractSelfTest;
+
+/**
+ * Test PARTITIONED ATOMIC.
+ */
+public class GridCacheBinaryDuplicateIndexObjectPartitionedAtomicSelfTest extends
+    GridBinaryDuplicateIndexObjectsAbstractSelfTest {
+    /** {@inheritDoc} */
+    @Override public CacheAtomicityMode atomicityMode() {
+        return CacheAtomicityMode.ATOMIC;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheMode cacheMode() {
+        return CacheMode.PARTITIONED;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.java
new file mode 100644
index 0000000..e319fe4
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest.java
@@ -0,0 +1,41 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.internal.processors.cache.binary.GridBinaryDuplicateIndexObjectsAbstractSelfTest;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+
+/**
+ * Test PARTITIONED and TRANSACTIONAL.
+ */
+public class GridCacheBinaryDuplicateIndexObjectPartitionedTransactionalSelfTest extends
+    GridBinaryDuplicateIndexObjectsAbstractSelfTest {
+    /** {@inheritDoc} */
+    @Override public CacheAtomicityMode atomicityMode() {
+        return TRANSACTIONAL;
+    }
+
+    /** {@inheritDoc} */
+    @Override public CacheMode cacheMode() {
+        return PARTITIONED;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheMemoryModeBinarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheMemoryModeBinarySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheMemoryModeBinarySelfTest.java
new file mode 100644
index 0000000..119ba03
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheMemoryModeBinarySelfTest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.processors.cache.GridCacheMemoryModeSelfTest;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+
+/**
+ * Memory models test.
+ */
+public class GridCacheMemoryModeBinarySelfTest extends GridCacheMemoryModeSelfTest {
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        cfg.setMarshaller(new BinaryMarshaller());
+
+        return cfg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheMemoryModePortableSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheMemoryModePortableSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheMemoryModePortableSelfTest.java
deleted file mode 100644
index 7836c17..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheMemoryModePortableSelfTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.processors.cache.GridCacheMemoryModeSelfTest;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-
-/**
- * Memory models test.
- */
-public class GridCacheMemoryModePortableSelfTest extends GridCacheMemoryModeSelfTest {
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        cfg.setMarshaller(new BinaryMarshaller());
-
-        return cfg;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredAtomicBinarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredAtomicBinarySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredAtomicBinarySelfTest.java
new file mode 100644
index 0000000..3494b5c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredAtomicBinarySelfTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+import java.util.Arrays;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredAtomicSelfTest;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+
+/**
+ *
+ */
+public class GridCacheOffHeapTieredAtomicBinarySelfTest extends GridCacheOffHeapTieredAtomicSelfTest {
+    /** {@inheritDoc} */
+    @Override protected boolean portableEnabled() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        // Enable binary.
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        BinaryConfiguration bCfg = new BinaryConfiguration();
+
+        bCfg.setClassNames(Arrays.asList(TestValue.class.getName()));
+
+        cfg.setMarshaller(new BinaryMarshaller());
+
+        return cfg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredAtomicPortableSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredAtomicPortableSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredAtomicPortableSelfTest.java
deleted file mode 100644
index 0d9b1ec..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredAtomicPortableSelfTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-import java.util.Arrays;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredAtomicSelfTest;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-
-/**
- *
- */
-public class GridCacheOffHeapTieredAtomicPortableSelfTest extends GridCacheOffHeapTieredAtomicSelfTest {
-    /** {@inheritDoc} */
-    @Override protected boolean portableEnabled() {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        // Enable binary.
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        BinaryConfiguration bCfg = new BinaryConfiguration();
-
-        bCfg.setClassNames(Arrays.asList(TestValue.class.getName()));
-
-        cfg.setMarshaller(new BinaryMarshaller());
-
-        return cfg;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredBinarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredBinarySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredBinarySelfTest.java
new file mode 100644
index 0000000..7cde9e7
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredBinarySelfTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+import java.util.Arrays;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredSelfTest;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+
+/**
+ *
+ */
+public class GridCacheOffHeapTieredBinarySelfTest extends GridCacheOffHeapTieredSelfTest {
+    /** {@inheritDoc} */
+    @Override protected boolean portableEnabled() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        // Enable binary.
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        BinaryConfiguration bCfg = new BinaryConfiguration();
+
+        bCfg.setClassNames(Arrays.asList(TestValue.class.getName()));
+
+        cfg.setMarshaller(new BinaryMarshaller());
+
+        return cfg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionAtomicBinarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionAtomicBinarySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionAtomicBinarySelfTest.java
new file mode 100644
index 0000000..79fe8d3
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionAtomicBinarySelfTest.java
@@ -0,0 +1,96 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+import java.util.Arrays;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredEvictionAtomicSelfTest;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.binary.BinaryObject;
+
+/**
+ *
+ */
+public class GridCacheOffHeapTieredEvictionAtomicBinarySelfTest extends GridCacheOffHeapTieredEvictionAtomicSelfTest {
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        // Enable binary.
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        BinaryConfiguration bCfg = new BinaryConfiguration();
+
+        bCfg.setClassNames(Arrays.asList(TestValue.class.getName()));
+
+        cfg.setMarshaller(new BinaryMarshaller());
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected TestPredicate testPredicate(String expVal, boolean acceptNull) {
+        return new PortableValuePredicate(expVal, acceptNull);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected TestProcessor testClosure(String expVal, boolean acceptNull) {
+        return new PortableValueClosure(expVal, acceptNull);
+    }
+
+    /**
+     *
+     */
+    @SuppressWarnings("PackageVisibleInnerClass")
+    static class PortableValuePredicate extends TestPredicate {
+        /**
+         * @param expVal Expected value.
+         * @param acceptNull If {@code true} value can be null;
+         */
+        PortableValuePredicate(String expVal, boolean acceptNull) {
+            super(expVal, acceptNull);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void checkValue(Object val) {
+            BinaryObject obj = (BinaryObject)val;
+
+            assertEquals(expVal, obj.field("val"));
+        }
+    }
+
+    /**
+     *
+     */
+    @SuppressWarnings("PackageVisibleInnerClass")
+    static class PortableValueClosure extends TestProcessor {
+        /**
+         * @param expVal Expected value.
+         * @param acceptNull If {@code true} value can be null;
+         */
+        PortableValueClosure(String expVal, boolean acceptNull) {
+            super(expVal, acceptNull);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void checkValue(Object val) {
+            BinaryObject obj = (BinaryObject)val;
+
+            assertEquals(expVal, obj.field("val"));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionAtomicPortableSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionAtomicPortableSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionAtomicPortableSelfTest.java
deleted file mode 100644
index addee05..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionAtomicPortableSelfTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-import java.util.Arrays;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredEvictionAtomicSelfTest;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.binary.BinaryObject;
-
-/**
- *
- */
-public class GridCacheOffHeapTieredEvictionAtomicPortableSelfTest extends GridCacheOffHeapTieredEvictionAtomicSelfTest {
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        // Enable binary.
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        BinaryConfiguration bCfg = new BinaryConfiguration();
-
-        bCfg.setClassNames(Arrays.asList(TestValue.class.getName()));
-
-        cfg.setMarshaller(new BinaryMarshaller());
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected TestPredicate testPredicate(String expVal, boolean acceptNull) {
-        return new PortableValuePredicate(expVal, acceptNull);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected TestProcessor testClosure(String expVal, boolean acceptNull) {
-        return new PortableValueClosure(expVal, acceptNull);
-    }
-
-    /**
-     *
-     */
-    @SuppressWarnings("PackageVisibleInnerClass")
-    static class PortableValuePredicate extends TestPredicate {
-        /**
-         * @param expVal Expected value.
-         * @param acceptNull If {@code true} value can be null;
-         */
-        PortableValuePredicate(String expVal, boolean acceptNull) {
-            super(expVal, acceptNull);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void checkValue(Object val) {
-            BinaryObject obj = (BinaryObject)val;
-
-            assertEquals(expVal, obj.field("val"));
-        }
-    }
-
-    /**
-     *
-     */
-    @SuppressWarnings("PackageVisibleInnerClass")
-    static class PortableValueClosure extends TestProcessor {
-        /**
-         * @param expVal Expected value.
-         * @param acceptNull If {@code true} value can be null;
-         */
-        PortableValueClosure(String expVal, boolean acceptNull) {
-            super(expVal, acceptNull);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void checkValue(Object val) {
-            BinaryObject obj = (BinaryObject)val;
-
-            assertEquals(expVal, obj.field("val"));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionBinarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionBinarySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionBinarySelfTest.java
new file mode 100644
index 0000000..9a47e4f
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionBinarySelfTest.java
@@ -0,0 +1,96 @@
+/*
+ * 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.processors.cache.binary.distributed.dht;
+
+import java.util.Arrays;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredEvictionSelfTest;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.binary.BinaryObject;
+
+/**
+ *
+ */
+public class GridCacheOffHeapTieredEvictionBinarySelfTest extends GridCacheOffHeapTieredEvictionSelfTest {
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        // Enable binary.
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        BinaryConfiguration bCfg = new BinaryConfiguration();
+
+        bCfg.setClassNames(Arrays.asList(TestValue.class.getName()));
+
+        cfg.setMarshaller(new BinaryMarshaller());
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected TestPredicate testPredicate(String expVal, boolean acceptNull) {
+        return new PortableValuePredicate(expVal, acceptNull);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected TestProcessor testClosure(String expVal, boolean acceptNull) {
+        return new PortableValueClosure(expVal, acceptNull);
+    }
+
+    /**
+     *
+     */
+    @SuppressWarnings("PackageVisibleInnerClass")
+    static class PortableValuePredicate extends TestPredicate {
+        /**
+         * @param expVal Expected value.
+         * @param acceptNull If {@code true} value can be null;
+         */
+        PortableValuePredicate(String expVal, boolean acceptNull) {
+            super(expVal, acceptNull);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void checkValue(Object val) {
+            BinaryObject obj = (BinaryObject)val;
+
+            assertEquals(expVal, obj.field("val"));
+        }
+    }
+
+    /**
+     *
+     */
+    @SuppressWarnings("PackageVisibleInnerClass")
+    static class PortableValueClosure extends TestProcessor {
+        /**
+         * @param expVal Expected value.
+         * @param acceptNull If {@code true} value can be null;
+         */
+        PortableValueClosure(String expVal, boolean acceptNull) {
+            super(expVal, acceptNull);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void checkValue(Object val) {
+            BinaryObject obj = (BinaryObject)val;
+
+            assertEquals(expVal, obj.field("val"));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionPortableSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionPortableSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionPortableSelfTest.java
deleted file mode 100644
index 3e5d7e0..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionPortableSelfTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-import java.util.Arrays;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredEvictionSelfTest;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.binary.BinaryObject;
-
-/**
- *
- */
-public class GridCacheOffHeapTieredEvictionPortableSelfTest extends GridCacheOffHeapTieredEvictionSelfTest {
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        // Enable binary.
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        BinaryConfiguration bCfg = new BinaryConfiguration();
-
-        bCfg.setClassNames(Arrays.asList(TestValue.class.getName()));
-
-        cfg.setMarshaller(new BinaryMarshaller());
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected TestPredicate testPredicate(String expVal, boolean acceptNull) {
-        return new PortableValuePredicate(expVal, acceptNull);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected TestProcessor testClosure(String expVal, boolean acceptNull) {
-        return new PortableValueClosure(expVal, acceptNull);
-    }
-
-    /**
-     *
-     */
-    @SuppressWarnings("PackageVisibleInnerClass")
-    static class PortableValuePredicate extends TestPredicate {
-        /**
-         * @param expVal Expected value.
-         * @param acceptNull If {@code true} value can be null;
-         */
-        PortableValuePredicate(String expVal, boolean acceptNull) {
-            super(expVal, acceptNull);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void checkValue(Object val) {
-            BinaryObject obj = (BinaryObject)val;
-
-            assertEquals(expVal, obj.field("val"));
-        }
-    }
-
-    /**
-     *
-     */
-    @SuppressWarnings("PackageVisibleInnerClass")
-    static class PortableValueClosure extends TestProcessor {
-        /**
-         * @param expVal Expected value.
-         * @param acceptNull If {@code true} value can be null;
-         */
-        PortableValueClosure(String expVal, boolean acceptNull) {
-            super(expVal, acceptNull);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void checkValue(Object val) {
-            BinaryObject obj = (BinaryObject)val;
-
-            assertEquals(expVal, obj.field("val"));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredPortableSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredPortableSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredPortableSelfTest.java
deleted file mode 100644
index 12298c6..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredPortableSelfTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-import java.util.Arrays;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.processors.cache.GridCacheOffHeapTieredSelfTest;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-
-/**
- *
- */
-public class GridCacheOffHeapTieredPortableSelfTest extends GridCacheOffHeapTieredSelfTest {
-    /** {@inheritDoc} */
-    @Override protected boolean portableEnabled() {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        // Enable binary.
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        BinaryConfiguration bCfg = new BinaryConfiguration();
-
-        bCfg.setClassNames(Arrays.asList(TestValue.class.getName()));
-
-        cfg.setMarshaller(new BinaryMarshaller());
-
-        return cfg;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortableDuplicateIndexObjectPartitionedAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortableDuplicateIndexObjectPartitionedAtomicSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortableDuplicateIndexObjectPartitionedAtomicSelfTest.java
deleted file mode 100644
index f01914c..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortableDuplicateIndexObjectPartitionedAtomicSelfTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.internal.processors.cache.binary.GridPortableDuplicateIndexObjectsAbstractSelfTest;
-
-/**
- * Test PARTITIONED ATOMIC.
- */
-public class GridCachePortableDuplicateIndexObjectPartitionedAtomicSelfTest extends
-    GridPortableDuplicateIndexObjectsAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override public CacheAtomicityMode atomicityMode() {
-        return CacheAtomicityMode.ATOMIC;
-    }
-
-    /** {@inheritDoc} */
-    @Override public CacheMode cacheMode() {
-        return CacheMode.PARTITIONED;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortableDuplicateIndexObjectPartitionedTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortableDuplicateIndexObjectPartitionedTransactionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortableDuplicateIndexObjectPartitionedTransactionalSelfTest.java
deleted file mode 100644
index 68305f3..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCachePortableDuplicateIndexObjectPartitionedTransactionalSelfTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.processors.cache.binary.distributed.dht;
-
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.internal.processors.cache.binary.GridPortableDuplicateIndexObjectsAbstractSelfTest;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.cache.CacheMode.PARTITIONED;
-
-/**
- * Test PARTITIONED and TRANSACTIONAL.
- */
-public class GridCachePortableDuplicateIndexObjectPartitionedTransactionalSelfTest extends
-    GridPortableDuplicateIndexObjectsAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override public CacheAtomicityMode atomicityMode() {
-        return TRANSACTIONAL;
-    }
-
-    /** {@inheritDoc} */
-    @Override public CacheMode cacheMode() {
-        return PARTITIONED;
-    }
-}


[33/50] [abbrv] ignite git commit: Fixed failure in BinaryObjectBuilderSelfTest.testCopyFromInnerObject.

Posted by vo...@apache.org.
Fixed failure in BinaryObjectBuilderSelfTest.testCopyFromInnerObject.


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

Branch: refs/heads/ignite-2100
Commit: 4ae6292cface325f21237db5d18ce77dee380072
Parents: 6d96bb6
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Dec 14 10:08:29 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Dec 14 10:08:29 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/binary/BinaryUtils.java      | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4ae6292c/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 8b5ec68..9e5260b 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
@@ -836,13 +836,18 @@ public class BinaryUtils {
 
                 if (oldFieldType == null)
                     changed = true;
-                else if (!F.eq(oldFieldType, newField.getValue())) {
-                    throw new BinaryObjectException(
-                        "Binary type has different field types [" + "typeName=" + oldMeta.typeName() +
-                            ", fieldName=" + newField.getKey() +
-                            ", fieldTypeName1=" + fieldTypeName(oldFieldType) +
-                            ", fieldTypeName2=" + fieldTypeName(newField.getValue()) + ']'
-                    );
+                else {
+                    String oldFieldTypeName = fieldTypeName(oldFieldType);
+                    String newFieldTypeName = fieldTypeName(newField.getValue());
+
+                    if (!F.eq(oldFieldTypeName, newFieldTypeName)) {
+                        throw new BinaryObjectException(
+                            "Binary type has different field types [" + "typeName=" + oldMeta.typeName() +
+                                ", fieldName=" + newField.getKey() +
+                                ", fieldTypeName1=" + oldFieldTypeName +
+                                ", fieldTypeName2=" + newFieldTypeName + ']'
+                        );
+                    }
                 }
             }
 


[50/50] [abbrv] ignite git commit: IGNITE-2100:: Propagate flag form configuration to BinaryClassDescriptor.

Posted by vo...@apache.org.
IGNITE-2100:: Propagate flag form configuration to BinaryClassDescriptor.


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

Branch: refs/heads/ignite-2100
Commit: 74e478d40ec68147bec15ca646036d46c6af86db
Parents: c482298
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Dec 14 15:03:08 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Dec 14 15:03:08 2015 +0300

----------------------------------------------------------------------
 .../internal/binary/BinaryClassDescriptor.java  |  4 +-
 .../ignite/internal/binary/BinaryContext.java   | 41 +++++++++++++++-----
 2 files changed, 35 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/74e478d4/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
index 4a93bf6..1c28ab8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
@@ -128,6 +128,7 @@ public class BinaryClassDescriptor {
      * @param metaDataEnabled Metadata enabled flag.
      * @param registered Whether typeId has been successfully registered by MarshallerContext or not.
      * @param predefined Whether the class is predefined or not.
+     * @param useDfltSerialization Whether to use default configuration.
      * @throws BinaryObjectException In case of error.
      */
     BinaryClassDescriptor(
@@ -141,7 +142,8 @@ public class BinaryClassDescriptor {
         @Nullable BinarySerializer serializer,
         boolean metaDataEnabled,
         boolean registered,
-        boolean predefined
+        boolean predefined,
+        boolean useDfltSerialization
     ) throws BinaryObjectException {
         assert ctx != null;
         assert cls != null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/74e478d4/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
index 7f9bacf..32e64a2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
@@ -70,6 +70,7 @@ import java.util.LinkedList;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
@@ -111,6 +112,10 @@ public class BinaryContext implements Externalizable {
     /** */
     private final Map<String, BinaryIdMapper> typeMappers = new ConcurrentHashMap8<>(0);
 
+    /** Default serialization flags. */
+    private final Set<Integer> dfltSerializationFlags =
+        Collections.newSetFromMap(new ConcurrentHashMap<Integer, Boolean>());
+
     /** */
     private BinaryMetadataHandler metaHnd;
 
@@ -298,16 +303,17 @@ public class BinaryContext implements Externalizable {
 
                     for (String clsName0 : classesInPackage(pkgName))
                         descs.add(clsName0, idMapper, serializer, affFields.get(clsName0),
-                            typeCfg.isEnum(), true);
+                            typeCfg.isEnum(), typeCfg.isUseDefaultSerialization(), true);
                 }
                 else
                     descs.add(clsName, idMapper, serializer, affFields.get(clsName),
-                        typeCfg.isEnum(), false);
+                        typeCfg.isEnum(), typeCfg.isUseDefaultSerialization(), false);
             }
         }
 
         for (TypeDescriptor desc : descs.descriptors())
-            registerUserType(desc.clsName, desc.idMapper, desc.serializer, desc.affKeyFieldName, desc.isEnum);
+            registerUserType(desc.clsName, desc.idMapper, desc.serializer, desc.affKeyFieldName, desc.isEnum,
+                desc.useDfltSerialization);
 
         BinaryInternalIdMapper dfltMapper = BinaryInternalIdMapper.create(globalIdMapper);
 
@@ -505,7 +511,8 @@ public class BinaryContext implements Externalizable {
                 null,
                 false,
                 true, /* registered */
-                false /* predefined */
+                false, /* predefined */
+                true /* prefer default serialization */
             );
 
             BinaryClassDescriptor old = descByCls.putIfAbsent(cls, desc);
@@ -553,7 +560,8 @@ public class BinaryContext implements Externalizable {
             null,
             true,
             registered,
-            false /* predefined */
+            false /* predefined */,
+            dfltSerializationFlags.contains(typeId)
         );
 
         if (!deserialize) {
@@ -711,7 +719,8 @@ public class BinaryContext implements Externalizable {
             null,
             false,
             true, /* registered */
-            true /* predefined */
+            true, /* predefined */
+            false /* default serialization */
         );
 
         predefinedTypeNames.put(typeName, id);
@@ -728,6 +737,7 @@ public class BinaryContext implements Externalizable {
      * @param serializer Serializer.
      * @param affKeyFieldName Affinity key field name.
      * @param isEnum If enum.
+     * @param useDfltSerialization Use default serialization flag.
      * @throws BinaryObjectException In case of error.
      */
     @SuppressWarnings("ErrorNotRethrown")
@@ -735,7 +745,8 @@ public class BinaryContext implements Externalizable {
         BinaryIdMapper idMapper,
         @Nullable BinarySerializer serializer,
         @Nullable String affKeyFieldName,
-        boolean isEnum)
+        boolean isEnum,
+        boolean useDfltSerialization)
         throws BinaryObjectException {
         assert idMapper != null;
 
@@ -766,6 +777,9 @@ public class BinaryContext implements Externalizable {
 
         typeMappers.put(typeName, idMapper);
 
+        if (useDfltSerialization)
+            dfltSerializationFlags.add(id);
+
         Map<String, Integer> fieldsMeta = null;
         Collection<BinarySchema> schemas = null;
 
@@ -781,7 +795,8 @@ public class BinaryContext implements Externalizable {
                 serializer,
                 true,
                 true, /* registered */
-                false /* predefined */
+                false, /* predefined */
+                useDfltSerialization
             );
 
             fieldsMeta = desc.fieldsMeta();
@@ -969,6 +984,7 @@ public class BinaryContext implements Externalizable {
          * @param serializer Serializer.
          * @param affKeyFieldName Affinity key field name.
          * @param isEnum Enum flag.
+         * @param useDfltSerialziation Use default serialization flag.
          * @param canOverride Whether this descriptor can be override.
          * @throws BinaryObjectException If failed.
          */
@@ -977,6 +993,7 @@ public class BinaryContext implements Externalizable {
             BinarySerializer serializer,
             String affKeyFieldName,
             boolean isEnum,
+            boolean useDfltSerialziation,
             boolean canOverride)
             throws BinaryObjectException {
             TypeDescriptor desc = new TypeDescriptor(clsName,
@@ -984,6 +1001,7 @@ public class BinaryContext implements Externalizable {
                 serializer,
                 affKeyFieldName,
                 isEnum,
+                useDfltSerialziation,
                 canOverride);
 
             TypeDescriptor oldDesc = descs.get(clsName);
@@ -1023,6 +1041,9 @@ public class BinaryContext implements Externalizable {
         /** Enum flag. */
         private boolean isEnum;
 
+        /** Use default serialization flag. */
+        private boolean useDfltSerialization;
+
         /** Whether this descriptor can be override. */
         private boolean canOverride;
 
@@ -1034,15 +1055,17 @@ public class BinaryContext implements Externalizable {
          * @param serializer Serializer.
          * @param affKeyFieldName Affinity key field name.
          * @param isEnum Enum type.
+         * @param useDfltSerialization Use default serialization flag.
          * @param canOverride Whether this descriptor can be override.
          */
         private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer serializer,
-            String affKeyFieldName, boolean isEnum, boolean canOverride) {
+            String affKeyFieldName, boolean isEnum, boolean useDfltSerialization, boolean canOverride) {
             this.clsName = clsName;
             this.idMapper = idMapper;
             this.serializer = serializer;
             this.affKeyFieldName = affKeyFieldName;
             this.isEnum = isEnum;
+            this.useDfltSerialization = useDfltSerialization;
             this.canOverride = canOverride;
         }
 


[24/50] [abbrv] ignite git commit: ignite-2065: portable -> binary renaming (methods, javadoc and etc.)

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientBinaryMetaData.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientBinaryMetaData.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientBinaryMetaData.java
index daa056b..f1fd99c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientBinaryMetaData.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientBinaryMetaData.java
@@ -21,7 +21,7 @@ import java.util.Map;
 import org.apache.ignite.internal.util.typedef.internal.S;
 
 /**
- * Portable meta data sent from client.
+ * Binary meta data sent from client.
  */
 public class GridClientBinaryMetaData {
     /** */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientTaskRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientTaskRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientTaskRequest.java
index 3ac16f2..4977430 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientTaskRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientTaskRequest.java
@@ -36,7 +36,7 @@ public class GridClientTaskRequest extends GridClientAbstractMessage {
     private Object arg;
 
     /** Keep binary flag. */
-    private boolean keepPortables;
+    private boolean keepBinaries;
 
     /**
      * @return Task name.
@@ -69,15 +69,15 @@ public class GridClientTaskRequest extends GridClientAbstractMessage {
     /**
      * @return Keep binary flag.
      */
-    public boolean keepPortables() {
-        return keepPortables;
+    public boolean keepBinaries() {
+        return keepBinaries;
     }
 
     /**
-     * @param keepPortables Keep binary flag.
+     * @param keepBinaries Keep binary flag.
      */
-    public void keepPortables(boolean keepPortables) {
-        this.keepPortables = keepPortables;
+    public void keepBinaries(boolean keepBinaries) {
+        this.keepBinaries = keepBinaries;
     }
 
     /** {@inheritDoc} */
@@ -122,4 +122,4 @@ public class GridClientTaskRequest extends GridClientAbstractMessage {
     @Override public String toString() {
         return getClass().getSimpleName() + " [taskName=" + taskName + ", arg=" + arg + "]";
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorMimeTypes.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorMimeTypes.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorMimeTypes.java
index 1792e04..1c27ecb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorMimeTypes.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/util/VisorMimeTypes.java
@@ -276,7 +276,7 @@ public class VisorMimeTypes {
         mimeTypes.put("htm", "text/html");
         mimeTypes.put("docm", "application/vnd.ms-word.document.macroenabled.12");
         mimeTypes.put("xdssc", "application/dssc+xml");
-        mimeTypes.put("pbm", "image/x-portable-bitmap");
+        mimeTypes.put("pbm", "image/x-binary-bitmap");
         mimeTypes.put("fdf", "application/vnd.fdf");
         mimeTypes.put("ggt", "application/vnd.geogebra.tool");
         mimeTypes.put("cii", "application/vnd.anser-web-certificate-issue-initiation");
@@ -760,7 +760,7 @@ public class VisorMimeTypes {
         mimeTypes.put("otf", "application/x-font-otf");
         mimeTypes.put("clkx", "application/vnd.crick.clicker");
         mimeTypes.put("xbd", "application/vnd.fujixerox.docuworks.binder");
-        mimeTypes.put("ppm", "image/x-portable-pixmap");
+        mimeTypes.put("ppm", "image/x-binary-pixmap");
         mimeTypes.put("wav", "audio/x-wav");
         mimeTypes.put("ssml", "application/ssml+xml");
         mimeTypes.put("p7b", "application/x-pkcs7-certificates");
@@ -808,7 +808,7 @@ public class VisorMimeTypes {
         mimeTypes.put("xenc", "application/xenc+xml");
         mimeTypes.put("wpl", "application/vnd.ms-wpl");
         mimeTypes.put("dxf", "image/vnd.dxf");
-        mimeTypes.put("pgm", "image/x-portable-graymap");
+        mimeTypes.put("pgm", "image/x-binary-graymap");
         mimeTypes.put("spot", "text/vnd.in3d.spot");
         mimeTypes.put("odt", "application/vnd.oasis.opendocument.text");
         mimeTypes.put("azs", "application/vnd.airzip.filesecure.azs");
@@ -817,7 +817,7 @@ public class VisorMimeTypes {
         mimeTypes.put("dd2", "application/vnd.oma.dd2+xml");
         mimeTypes.put("semf", "application/vnd.semf");
         mimeTypes.put("semd", "application/vnd.semd");
-        mimeTypes.put("pnm", "image/x-portable-anymap");
+        mimeTypes.put("pnm", "image/x-binary-anymap");
         mimeTypes.put("sema", "application/vnd.sema");
         mimeTypes.put("wma", "audio/x-ms-wma");
         mimeTypes.put("cww", "application/prs.cww");
@@ -1017,4 +1017,4 @@ public class VisorMimeTypes {
 
         return null;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/marshaller/portable/package-info.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/portable/package-info.java b/modules/core/src/main/java/org/apache/ignite/marshaller/portable/package-info.java
deleted file mode 100644
index 90cc5e6..0000000
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/portable/package-info.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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 description. -->
- * Contains portable marshaller API classes.
- */
-package org.apache.ignite.marshaller.portable;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetBinaryConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetBinaryConfiguration.java b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetBinaryConfiguration.java
index 3914c32..7c5da2f 100644
--- a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetBinaryConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetBinaryConfiguration.java
@@ -41,7 +41,7 @@ public class PlatformDotNetBinaryConfiguration {
     /** Default serializer. */
     private String dfltSerializer;
 
-    /** Whether to cache deserialized value in IGridPortableObject */
+    /** Whether to cache deserialized value in IGridBinaryObject */
     private boolean dfltKeepDeserialized = true;
 
     /**
@@ -145,7 +145,7 @@ public class PlatformDotNetBinaryConfiguration {
     /**
      * Gets default keep deserialized flag. See {@link #setDefaultKeepDeserialized(boolean)} for more information.
      *
-     * @return  Flag indicates whether to cache deserialized value in IGridPortableObject.
+     * @return  Flag indicates whether to cache deserialized value in IGridBinaryObject.
      */
     public boolean isDefaultKeepDeserialized() {
         return dfltKeepDeserialized;
@@ -167,4 +167,4 @@ public class PlatformDotNetBinaryConfiguration {
     @Override public String toString() {
         return S.toString(PlatformDotNetBinaryConfiguration.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetConfiguration.java b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetConfiguration.java
index f323085..d31ab95 100644
--- a/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetConfiguration.java
+++ b/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetConfiguration.java
@@ -61,10 +61,10 @@ public class PlatformDotNetConfiguration implements PlatformConfiguration {
     }
 
     /**
-     * @param portableCfg Configuration.
+     * @param binaryCfg Configuration.
      */
-    public void setBinaryConfiguration(PlatformDotNetBinaryConfiguration portableCfg) {
-        this.binaryCfg = portableCfg;
+    public void setBinaryConfiguration(PlatformDotNetBinaryConfiguration binaryCfg) {
+        this.binaryCfg = binaryCfg;
     }
 
     /**
@@ -94,4 +94,4 @@ public class PlatformDotNetConfiguration implements PlatformConfiguration {
     @Override public String toString() {
         return S.toString(PlatformDotNetConfiguration.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index 2aa0f09..d801109 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -3228,7 +3228,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                 boolean rmtMarshCompactFooterBool = rmtMarshCompactFooter != null ? rmtMarshCompactFooter : false;
 
                 if (locMarshCompactFooterBool != rmtMarshCompactFooterBool) {
-                    String errMsg = "Local node's portable marshaller \"compactFooter\" property differs from " +
+                    String errMsg = "Local node's binary marshaller \"compactFooter\" property differs from " +
                         "the same property on remote node (make sure all nodes in topology have the same value " +
                         "of \"compactFooter\" property) [locMarshallerCompactFooter=" + locMarshCompactFooterBool +
                         ", rmtMarshallerCompactFooter=" + rmtMarshCompactFooterBool +
@@ -3243,7 +3243,7 @@ class ServerImpl extends TcpDiscoveryImpl {
                         log.debug(errMsg);
 
                     try {
-                        String sndMsg = "Local node's portable marshaller \"compactFooter\" property differs from " +
+                        String sndMsg = "Local node's binary marshaller \"compactFooter\" property differs from " +
                             "the same property on remote node (make sure all nodes in topology have the same value " +
                             "of \"compactFooter\" property) [locMarshallerCompactFooter=" + rmtMarshCompactFooterBool +
                             ", rmtMarshallerCompactFooter=" + locMarshCompactFooterBool +

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java b/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
index b3747d7..df6afcc 100644
--- a/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
+++ b/modules/core/src/main/java/org/jsr166/ConcurrentHashMap8.java
@@ -3263,7 +3263,7 @@ public class ConcurrentHashMap8<K, V>
     }
 
     /**
-     * Returns exportable snapshot entry for the given key and value
+     * Returns exbinary snapshot entry for the given key and value
      * when write-through can't or shouldn't be used.
      */
     static <K,V> AbstractMap.SimpleEntry<K,V> entryFor(K k, V v) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index c1bac44..913320b 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -300,10 +300,10 @@ org.apache.ignite.internal.binary.BinaryObjectImpl
 org.apache.ignite.internal.binary.BinaryObjectOffheapImpl
 org.apache.ignite.internal.binary.BinaryReaderExImpl$Flag
 org.apache.ignite.internal.binary.BinaryWriteMode
-org.apache.ignite.internal.binary.PortableContext
-org.apache.ignite.internal.binary.PortableSchema
-org.apache.ignite.internal.binary.PortableSchema$Confirmation
-org.apache.ignite.internal.binary.builder.PortableLazyMap$1$1$1
+org.apache.ignite.internal.binary.BinaryContext
+org.apache.ignite.internal.binary.BinarySchema
+org.apache.ignite.internal.binary.BinarySchema$Confirmation
+org.apache.ignite.internal.binary.builder.BinaryLazyMap$1$1$1
 org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion
 org.apache.ignite.internal.processors.affinity.GridAffinityAssignment
 org.apache.ignite.internal.processors.affinity.GridAffinityMessage
@@ -745,14 +745,14 @@ org.apache.ignite.internal.processors.cache.local.atomic.GridLocalAtomicCache$4
 org.apache.ignite.internal.processors.cache.local.atomic.GridLocalAtomicCache$5
 org.apache.ignite.internal.processors.cache.local.atomic.GridLocalAtomicCache$6
 org.apache.ignite.internal.processors.cache.local.atomic.GridLocalAtomicCache$9
-org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheDefaultPortableAffinityKeyMapper
+org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheDefaultBinaryAffinityKeyMapper
 org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$1
 org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$4
 org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$5
 org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$MetaDataEntryFilter
 org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$MetaDataPredicate
 org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$MetadataProcessor
-org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.PortableMetadataKey
+org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.BinaryMetadataKey
 org.apache.ignite.internal.processors.cache.query.CacheQueryType
 org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryFuture$1
 org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryFuture$3

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.jar
----------------------------------------------------------------------
diff --git a/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.jar b/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.jar
new file mode 100644
index 0000000..863350d
Binary files /dev/null and b/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.jar differ

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.pom
----------------------------------------------------------------------
diff --git a/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.pom b/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.pom
new file mode 100644
index 0000000..533a3c9
--- /dev/null
+++ b/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.ignite.binary</groupId>
+  <artifactId>test1</artifactId>
+  <version>1.1</version>
+  <description>POM was created from install:install-file</description>
+</project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test1/maven-metadata-local.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test1/maven-metadata-local.xml b/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test1/maven-metadata-local.xml
new file mode 100644
index 0000000..4ca5d44
--- /dev/null
+++ b/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test1/maven-metadata-local.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+  <groupId>org.apache.ignite.binary</groupId>
+  <artifactId>test1</artifactId>
+  <versioning>
+    <release>1.1</release>
+    <versions>
+      <version>1.1</version>
+    </versions>
+    <lastUpdated>20140806090184</lastUpdated>
+  </versioning>
+</metadata>

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.jar
----------------------------------------------------------------------
diff --git a/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.jar b/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.jar
new file mode 100644
index 0000000..ccf4ea2
Binary files /dev/null and b/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.jar differ

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.pom
----------------------------------------------------------------------
diff --git a/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.pom b/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.pom
new file mode 100644
index 0000000..2eaaeff
--- /dev/null
+++ b/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.pom
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.ignite.binary</groupId>
+  <artifactId>test2</artifactId>
+  <version>1.1</version>
+  <description>POM was created from install:install-file</description>
+</project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test2/maven-metadata-local.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test2/maven-metadata-local.xml b/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test2/maven-metadata-local.xml
new file mode 100644
index 0000000..c45c88f
--- /dev/null
+++ b/modules/core/src/test/binaries/repo/org/apache/ignite/binary/test2/maven-metadata-local.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+  <groupId>org.apache.ignite.binary</groupId>
+  <artifactId>test2</artifactId>
+  <versioning>
+    <release>1.1</release>
+    <versions>
+      <version>1.1</version>
+    </versions>
+    <lastUpdated>20140806090410</lastUpdated>
+  </versioning>
+</metadata>

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsAbstractSelfTest.java
index 7d53705..943c5aa 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsAbstractSelfTest.java
@@ -34,7 +34,7 @@ import java.util.Date;
 import java.util.UUID;
 
 /**
- * Contains tests for portable object fields.
+ * Contains tests for binary object fields.
  */
 public abstract class BinaryFieldsAbstractSelfTest extends GridCommonAbstractTest {
     /** Marshaller. */
@@ -43,7 +43,7 @@ public abstract class BinaryFieldsAbstractSelfTest extends GridCommonAbstractTes
     /**
      * Create marshaller.
      *
-     * @return Portable marshaller.
+     * @return Binary marshaller.
      * @throws Exception If failed.
      */
     protected BinaryMarshaller createMarshaller() throws Exception {
@@ -67,7 +67,7 @@ public abstract class BinaryFieldsAbstractSelfTest extends GridCommonAbstractTes
 
         marsh.setContext(new MarshallerContextTestImpl(null));
 
-        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", ctx, iCfg);
+        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);
 
         return marsh;
     }
@@ -80,12 +80,12 @@ public abstract class BinaryFieldsAbstractSelfTest extends GridCommonAbstractTes
     }
 
     /**
-     * Get portable context for the current marshaller.
+     * Get binary context for the current marshaller.
      *
      * @param marsh Marshaller.
-     * @return Portable context.
+     * @return Binary context.
      */
-    protected static BinaryContext portableContext(BinaryMarshaller marsh) {
+    protected static BinaryContext binaryContext(BinaryMarshaller marsh) {
         GridBinaryMarshaller impl = U.field(marsh, "impl");
 
         return impl.context();
@@ -478,7 +478,7 @@ public abstract class BinaryFieldsAbstractSelfTest extends GridCommonAbstractTes
     /**
      * Get test context.
      *
-     * @param marsh Portable marshaller.
+     * @param marsh Binary marshaller.
      * @param fieldName Field name.
      * @return Test context.
      * @throws Exception If failed.
@@ -486,7 +486,7 @@ public abstract class BinaryFieldsAbstractSelfTest extends GridCommonAbstractTes
     private TestContext context(BinaryMarshaller marsh, String fieldName) throws Exception {
         TestObject obj = createObject();
 
-        BinaryObjectExImpl portObj = toPortable(marsh, obj);
+        BinaryObjectExImpl portObj = toBinary(marsh, obj);
 
         BinaryField field = portObj.type().field(fieldName);
 
@@ -496,7 +496,7 @@ public abstract class BinaryFieldsAbstractSelfTest extends GridCommonAbstractTes
     /**
      * Get test context with nested test object.
      *
-     * @param marsh Portable marshaller.
+     * @param marsh Binary marshaller.
      * @param fieldName Field name.
      * @return Test context.
      * @throws Exception If failed.
@@ -506,7 +506,7 @@ public abstract class BinaryFieldsAbstractSelfTest extends GridCommonAbstractTes
         TestObject obj = createObject();
         TestOuterObject outObj = new TestOuterObject(obj);
 
-        BinaryObjectExImpl portOutObj = toPortable(marsh, outObj);
+        BinaryObjectExImpl portOutObj = toBinary(marsh, outObj);
         BinaryObjectExImpl portObj = portOutObj.field("fInner");
 
         assert portObj != null;
@@ -526,14 +526,14 @@ public abstract class BinaryFieldsAbstractSelfTest extends GridCommonAbstractTes
     }
 
     /**
-     * Convert object to portable object.
+     * Convert object to binary object.
      *
      * @param marsh Marshaller.
      * @param obj Object.
-     * @return Portable object.
+     * @return Binary object.
      * @throws Exception If failed.
      */
-    protected abstract BinaryObjectExImpl toPortable(BinaryMarshaller marsh, Object obj) throws Exception;
+    protected abstract BinaryObjectExImpl toBinary(BinaryMarshaller marsh, Object obj) throws Exception;
 
     /**
      * Outer test object.
@@ -696,7 +696,7 @@ public abstract class BinaryFieldsAbstractSelfTest extends GridCommonAbstractTes
         /** Object. */
         public final TestObject obj;
 
-        /** Portable object. */
+        /** Binary object. */
         public final BinaryObjectExImpl portObj;
 
         /** Field. */
@@ -706,7 +706,7 @@ public abstract class BinaryFieldsAbstractSelfTest extends GridCommonAbstractTes
          * Constructor.
          *
          * @param obj Object.
-         * @param portObj Portable object.
+         * @param portObj Binary object.
          * @param field Field.
          */
         public TestContext(TestObject obj, BinaryObjectExImpl portObj, BinaryField field) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsHeapSelfTest.java
index 0e92bf4..fceffa0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsHeapSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsHeapSelfTest.java
@@ -18,13 +18,13 @@
 package org.apache.ignite.internal.binary;
 
 /**
- * Field tests for heap-based portables.
+ * Field tests for heap-based binaries.
  */
 public class BinaryFieldsHeapSelfTest extends BinaryFieldsAbstractSelfTest {
     /** {@inheritDoc} */
-    @Override protected BinaryObjectExImpl toPortable(BinaryMarshaller marsh, Object obj) throws Exception {
+    @Override protected BinaryObjectExImpl toBinary(BinaryMarshaller marsh, Object obj) throws Exception {
         byte[] bytes = marsh.marshal(obj);
 
-        return new BinaryObjectImpl(portableContext(marsh), bytes, 0);
+        return new BinaryObjectImpl(binaryContext(marsh), bytes, 0);
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsOffheapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsOffheapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsOffheapSelfTest.java
index d24d898..87cc527 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsOffheapSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsOffheapSelfTest.java
@@ -22,7 +22,7 @@ import org.eclipse.jetty.util.ConcurrentHashSet;
 import sun.misc.Unsafe;
 
 /**
- * Field tests for heap-based portables.
+ * Field tests for heap-based binaries.
  */
 public class BinaryFieldsOffheapSelfTest extends BinaryFieldsAbstractSelfTest {
     /** Unsafe instance. */
@@ -46,7 +46,7 @@ public class BinaryFieldsOffheapSelfTest extends BinaryFieldsAbstractSelfTest {
     }
 
     /** {@inheritDoc} */
-    @Override protected BinaryObjectExImpl toPortable(BinaryMarshaller marsh, Object obj) throws Exception {
+    @Override protected BinaryObjectExImpl toBinary(BinaryMarshaller marsh, Object obj) throws Exception {
         byte[] arr = marsh.marshal(obj);
 
         long ptr = UNSAFE.allocateMemory(arr.length);
@@ -55,6 +55,6 @@ public class BinaryFieldsOffheapSelfTest extends BinaryFieldsAbstractSelfTest {
 
         UNSAFE.copyMemory(arr, BYTE_ARR_OFF, null, ptr, arr.length);
 
-        return new BinaryObjectOffheapImpl(portableContext(marsh), ptr, 0, arr.length);
+        return new BinaryObjectOffheapImpl(binaryContext(marsh), ptr, 0, arr.length);
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsAbstractSelfTest.java
index 43609b8..0e3749c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsAbstractSelfTest.java
@@ -39,7 +39,7 @@ public abstract class BinaryFooterOffsetsAbstractSelfTest extends GridCommonAbst
     /** Marshaller. */
     protected BinaryMarshaller marsh;
 
-    /** Portable context. */
+    /** Binary context. */
     protected BinaryContext ctx;
 
     /** {@inheritDoc} */
@@ -62,7 +62,7 @@ public abstract class BinaryFooterOffsetsAbstractSelfTest extends GridCommonAbst
 
         marsh.setContext(new MarshallerContextTestImpl(null));
 
-        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", ctx, iCfg);
+        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);
     }
 
     /**
@@ -127,9 +127,9 @@ public abstract class BinaryFooterOffsetsAbstractSelfTest extends GridCommonAbst
     private void check(int len) throws Exception {
         TestObject obj = new TestObject(len);
 
-        BinaryObjectExImpl portObj = toPortable(marsh, obj);
+        BinaryObjectExImpl portObj = toBinary(marsh, obj);
 
-        // 1. Test portable object content.
+        // 1. Test binary object content.
         assert portObj.hasField("field1");
         assert portObj.hasField("field2");
 
@@ -162,14 +162,14 @@ public abstract class BinaryFooterOffsetsAbstractSelfTest extends GridCommonAbst
     }
 
     /**
-     * Convert object to portable object.
+     * Convert object to binary object.
      *
      * @param marsh Marshaller.
      * @param obj Object.
-     * @return Portable object.
+     * @return Binary object.
      * @throws Exception If failed.
      */
-    protected abstract BinaryObjectExImpl toPortable(BinaryMarshaller marsh, Object obj) throws Exception;
+    protected abstract BinaryObjectExImpl toBinary(BinaryMarshaller marsh, Object obj) throws Exception;
 
     /**
      * Test object.

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsHeapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsHeapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsHeapSelfTest.java
index 68e897e..7b3a754 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsHeapSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsHeapSelfTest.java
@@ -18,11 +18,11 @@
 package org.apache.ignite.internal.binary;
 
 /**
- * Compact offsets tests for heap portable objects.
+ * Compact offsets tests for heap binary objects.
  */
 public class BinaryFooterOffsetsHeapSelfTest extends BinaryFooterOffsetsAbstractSelfTest {
     /** {@inheritDoc} */
-    @Override protected BinaryObjectExImpl toPortable(BinaryMarshaller marsh, Object obj) throws Exception {
+    @Override protected BinaryObjectExImpl toBinary(BinaryMarshaller marsh, Object obj) throws Exception {
         byte[] bytes = marsh.marshal(obj);
 
         return new BinaryObjectImpl(ctx, bytes, 0);

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsOffheapSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsOffheapSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsOffheapSelfTest.java
index f0f0396..fe9ba17 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsOffheapSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsOffheapSelfTest.java
@@ -22,7 +22,7 @@ import org.eclipse.jetty.util.ConcurrentHashSet;
 import sun.misc.Unsafe;
 
 /**
- * Compact offsets tests for offheap portable objects.
+ * Compact offsets tests for offheap binary objects.
  */
 public class BinaryFooterOffsetsOffheapSelfTest extends BinaryFooterOffsetsAbstractSelfTest {
     /** Unsafe instance. */
@@ -46,7 +46,7 @@ public class BinaryFooterOffsetsOffheapSelfTest extends BinaryFooterOffsetsAbstr
     }
 
     /** {@inheritDoc} */
-    @Override protected BinaryObjectExImpl toPortable(BinaryMarshaller marsh, Object obj) throws Exception {
+    @Override protected BinaryObjectExImpl toBinary(BinaryMarshaller marsh, Object obj) throws Exception {
         byte[] arr = marsh.marshal(obj);
 
         long ptr = UNSAFE.allocateMemory(arr.length);

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
index 52fecbf..4ecad09 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
@@ -89,7 +89,7 @@ import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertNotEquals;
 
 /**
- * Portable marshaller tests.
+ * Binary marshaller tests.
  */
 @SuppressWarnings({"OverlyStrongTypeCast", "ArrayHashCode", "ConstantConditions"})
 public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
@@ -632,7 +632,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortable() throws Exception {
+    public void testBinary() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName()),
             new BinaryTypeConfiguration(TestBinary.class.getName())
@@ -711,45 +711,45 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
             new Integer(((BinaryObject)simplePo.field("enumVal")).enumOrdinal()));
         assertArrayEquals(ordinals(obj.simple.enumArr), ordinals((BinaryObject[])simplePo.field("enumArr")));
         assertNull(simplePo.field("simple"));
-        assertNull(simplePo.field("portable"));
+        assertNull(simplePo.field("binary"));
         assertNull(simplePo.field("unknown"));
 
-        BinaryObject portablePo = po.field("_portable");
-
-        assertEquals(obj.portable, portablePo.deserialize());
-
-        assertEquals(obj.portable.b, (byte)portablePo.field("_b"));
-        assertEquals(obj.portable.s, (short)portablePo.field("_s"));
-        assertEquals(obj.portable.i, (int)portablePo.field("_i"));
-        assertEquals(obj.portable.l, (long)portablePo.field("_l"));
-        assertEquals(obj.portable.f, (float)portablePo.field("_f"), 0);
-        assertEquals(obj.portable.d, (double)portablePo.field("_d"), 0);
-        assertEquals(obj.portable.c, (char)portablePo.field("_c"));
-        assertEquals(obj.portable.bool, (boolean)portablePo.field("_bool"));
-        assertEquals(obj.portable.str, portablePo.field("_str"));
-        assertEquals(obj.portable.uuid, portablePo.field("_uuid"));
-        assertEquals(obj.portable.date, portablePo.field("_date"));
-        assertEquals(obj.portable.ts, portablePo.field("_ts"));
-        assertArrayEquals(obj.portable.bArr, (byte[])portablePo.field("_bArr"));
-        assertArrayEquals(obj.portable.sArr, (short[])portablePo.field("_sArr"));
-        assertArrayEquals(obj.portable.iArr, (int[])portablePo.field("_iArr"));
-        assertArrayEquals(obj.portable.lArr, (long[])portablePo.field("_lArr"));
-        assertArrayEquals(obj.portable.fArr, (float[])portablePo.field("_fArr"), 0);
-        assertArrayEquals(obj.portable.dArr, (double[])portablePo.field("_dArr"), 0);
-        assertArrayEquals(obj.portable.cArr, (char[])portablePo.field("_cArr"));
-        assertBooleanArrayEquals(obj.portable.boolArr, (boolean[])portablePo.field("_boolArr"));
-        assertArrayEquals(obj.portable.strArr, (String[])portablePo.field("_strArr"));
-        assertArrayEquals(obj.portable.uuidArr, (UUID[])portablePo.field("_uuidArr"));
-        assertArrayEquals(obj.portable.dateArr, (Date[])portablePo.field("_dateArr"));
-        assertArrayEquals(obj.portable.objArr, (Object[])portablePo.field("_objArr"));
-        assertEquals(obj.portable.col, portablePo.field("_col"));
-        assertEquals(obj.portable.map, portablePo.field("_map"));
-        assertEquals(new Integer(obj.portable.enumVal.ordinal()),
-            new Integer(((BinaryObject)portablePo.field("_enumVal")).enumOrdinal()));
-        assertArrayEquals(ordinals(obj.portable.enumArr), ordinals((BinaryObject[])portablePo.field("_enumArr")));
-        assertNull(portablePo.field("_simple"));
-        assertNull(portablePo.field("_portable"));
-        assertNull(portablePo.field("unknown"));
+        BinaryObject binaryPo = po.field("_binary");
+
+        assertEquals(obj.binary, binaryPo.deserialize());
+
+        assertEquals(obj.binary.b, (byte)binaryPo.field("_b"));
+        assertEquals(obj.binary.s, (short)binaryPo.field("_s"));
+        assertEquals(obj.binary.i, (int)binaryPo.field("_i"));
+        assertEquals(obj.binary.l, (long)binaryPo.field("_l"));
+        assertEquals(obj.binary.f, (float)binaryPo.field("_f"), 0);
+        assertEquals(obj.binary.d, (double)binaryPo.field("_d"), 0);
+        assertEquals(obj.binary.c, (char)binaryPo.field("_c"));
+        assertEquals(obj.binary.bool, (boolean)binaryPo.field("_bool"));
+        assertEquals(obj.binary.str, binaryPo.field("_str"));
+        assertEquals(obj.binary.uuid, binaryPo.field("_uuid"));
+        assertEquals(obj.binary.date, binaryPo.field("_date"));
+        assertEquals(obj.binary.ts, binaryPo.field("_ts"));
+        assertArrayEquals(obj.binary.bArr, (byte[])binaryPo.field("_bArr"));
+        assertArrayEquals(obj.binary.sArr, (short[])binaryPo.field("_sArr"));
+        assertArrayEquals(obj.binary.iArr, (int[])binaryPo.field("_iArr"));
+        assertArrayEquals(obj.binary.lArr, (long[])binaryPo.field("_lArr"));
+        assertArrayEquals(obj.binary.fArr, (float[])binaryPo.field("_fArr"), 0);
+        assertArrayEquals(obj.binary.dArr, (double[])binaryPo.field("_dArr"), 0);
+        assertArrayEquals(obj.binary.cArr, (char[])binaryPo.field("_cArr"));
+        assertBooleanArrayEquals(obj.binary.boolArr, (boolean[])binaryPo.field("_boolArr"));
+        assertArrayEquals(obj.binary.strArr, (String[])binaryPo.field("_strArr"));
+        assertArrayEquals(obj.binary.uuidArr, (UUID[])binaryPo.field("_uuidArr"));
+        assertArrayEquals(obj.binary.dateArr, (Date[])binaryPo.field("_dateArr"));
+        assertArrayEquals(obj.binary.objArr, (Object[])binaryPo.field("_objArr"));
+        assertEquals(obj.binary.col, binaryPo.field("_col"));
+        assertEquals(obj.binary.map, binaryPo.field("_map"));
+        assertEquals(new Integer(obj.binary.enumVal.ordinal()),
+            new Integer(((BinaryObject)binaryPo.field("_enumVal")).enumOrdinal()));
+        assertArrayEquals(ordinals(obj.binary.enumArr), ordinals((BinaryObject[])binaryPo.field("_enumArr")));
+        assertNull(binaryPo.field("_simple"));
+        assertNull(binaryPo.field("_binary"));
+        assertNull(binaryPo.field("unknown"));
     }
 
     /**
@@ -859,7 +859,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
 
     /**
      * @param obj Simple object.
-     * @param po Portable object.
+     * @param po Binary object.
      */
     private void checkSimpleObjectData(SimpleObject obj, BinaryObject po) {
         assertEquals(obj.b, (byte)po.field("b"));
@@ -1343,7 +1343,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
             customType4
         ));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         assertEquals("notconfiguredclass".hashCode(), ctx.typeId("NotConfiguredClass"));
         assertEquals("key".hashCode(), ctx.typeId("Key"));
@@ -1406,7 +1406,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
             customType1,
             customType2));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         assertEquals("val".hashCode(), ctx.fieldId("key".hashCode(), "val"));
         assertEquals("val".hashCode(), ctx.fieldId("nonexistentclass2".hashCode(), "val"));
@@ -1463,7 +1463,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopy() throws Exception {
+    public void testBinaryCopy() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName())
         ));
@@ -1578,7 +1578,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
 //                    return null;
 //                }
 //            },
-//            PortableException.class,
+//            BinaryException.class,
 //            "Invalid value type for field: i"
 //        );
     }
@@ -1586,7 +1586,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopyString() throws Exception {
+    public void testBinaryCopyString() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName())
         ));
@@ -1607,7 +1607,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopyUuid() throws Exception {
+    public void testBinaryCopyUuid() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName())
         ));
@@ -1630,7 +1630,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopyByteArray() throws Exception {
+    public void testBinaryCopyByteArray() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName())
         ));
@@ -1649,7 +1649,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     }
 
     /**
-     * @param po Portable object.
+     * @param po Binary object.
      * @param fields Fields.
      * @return Copy.
      */
@@ -1667,7 +1667,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopyShortArray() throws Exception {
+    public void testBinaryCopyShortArray() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName())
         ));
@@ -1688,7 +1688,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopyIntArray() throws Exception {
+    public void testBinaryCopyIntArray() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName())
         ));
@@ -1709,7 +1709,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopyLongArray() throws Exception {
+    public void testBinaryCopyLongArray() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName())
         ));
@@ -1730,7 +1730,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopyFloatArray() throws Exception {
+    public void testBinaryCopyFloatArray() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName())
         ));
@@ -1751,7 +1751,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopyDoubleArray() throws Exception {
+    public void testBinaryCopyDoubleArray() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName())
         ));
@@ -1772,7 +1772,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopyCharArray() throws Exception {
+    public void testBinaryCopyCharArray() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName())
         ));
@@ -1793,7 +1793,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopyStringArray() throws Exception {
+    public void testBinaryCopyStringArray() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName())
         ));
@@ -1814,7 +1814,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopyObject() throws Exception {
+    public void testBinaryCopyObject() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName())
         ));
@@ -1841,7 +1841,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopyNonPrimitives() throws Exception {
+    public void testBinaryCopyNonPrimitives() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration(SimpleObject.class.getName())
         ));
@@ -1878,7 +1878,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableCopyMixed() throws Exception {
+    public void testBinaryCopyMixed() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(new BinaryTypeConfiguration(SimpleObject.class.getName())));
 
         SimpleObject obj = simpleObject();
@@ -1939,10 +1939,10 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testOffheapPortable() throws Exception {
+    public void testOffheapBinary() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(new BinaryTypeConfiguration(SimpleObject.class.getName())));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         SimpleObject simpleObj = simpleObject();
 
@@ -2038,11 +2038,11 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration(MySingleton.class.getName()),
             new BinaryTypeConfiguration(SingletonMarker.class.getName())));
 
-        BinaryObjectImpl portableObj = marshal(MySingleton.INSTANCE, marsh);
+        BinaryObjectImpl binaryObj = marshal(MySingleton.INSTANCE, marsh);
 
-        assertTrue(portableObj.array().length <= 1024); // Check that big string was not serialized.
+        assertTrue(binaryObj.array().length <= 1024); // Check that big string was not serialized.
 
-        MySingleton singleton = portableObj.deserialize();
+        MySingleton singleton = binaryObj.deserialize();
 
         assertSame(MySingleton.INSTANCE, singleton);
     }
@@ -2050,13 +2050,13 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      *
      */
-    public void testReadResolveOnPortableAware() throws Exception {
+    public void testReadResolveOnBinaryAware() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Collections.singletonList(
             new BinaryTypeConfiguration(MyTestClass.class.getName())));
 
-        BinaryObjectImpl portableObj = marshal(new MyTestClass(), marsh);
+        BinaryObjectImpl binaryObj = marshal(new MyTestClass(), marsh);
 
-        MyTestClass obj = portableObj.deserialize();
+        MyTestClass obj = binaryObj.deserialize();
 
         assertEquals("readResolve", obj.s);
     }
@@ -2065,11 +2065,11 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
      * @throws Exception If ecxeption thrown.
      */
     public void testDeclareReadResolveInParent() throws Exception {
-        BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(new BinaryTypeConfiguration(ChildPortable.class.getName())));
+        BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(new BinaryTypeConfiguration(ChildBinary.class.getName())));
 
-        BinaryObjectImpl portableObj = marshal(new ChildPortable(), marsh);
+        BinaryObjectImpl binaryObj = marshal(new ChildBinary(), marsh);
 
-        ChildPortable singleton = portableObj.deserialize();
+        ChildBinary singleton = binaryObj.deserialize();
 
         assertNotNull(singleton.s);
     }
@@ -2140,7 +2140,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
 
         BinaryMarshaller marsh = binaryMarshaller();
 
-        try (BinaryWriterExImpl writer = new BinaryWriterExImpl(portableContext(marsh))) {
+        try (BinaryWriterExImpl writer = new BinaryWriterExImpl(binaryContext(marsh))) {
             assertEquals(true, INSTANCE.isAcquired());
 
             writer.writeString("Thread local test");
@@ -2150,7 +2150,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
             assertEquals(true, INSTANCE.isAcquired());
         }
 
-        // Checking the portable marshaller.
+        // Checking the binary marshaller.
         assertEquals(false, INSTANCE.isAcquired());
 
         marsh = binaryMarshaller();
@@ -2162,12 +2162,12 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
         marsh = binaryMarshaller();
 
         // Checking the builder.
-        BinaryObjectBuilder builder = new BinaryObjectBuilderImpl(portableContext(marsh),
+        BinaryObjectBuilder builder = new BinaryObjectBuilderImpl(binaryContext(marsh),
             "org.gridgain.foo.bar.TestClass");
 
         builder.setField("a", "1");
 
-        BinaryObject portableObj = builder.build();
+        BinaryObject binaryObj = builder.build();
 
         assertEquals(false, INSTANCE.isAcquired());
     }
@@ -2273,7 +2273,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     public void testPredefinedTypeIds() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller();
 
-        BinaryContext pCtx = portableContext(marsh);
+        BinaryContext pCtx = binaryContext(marsh);
 
         Field field = pCtx.getClass().getDeclaredField("predefinedTypeNames");
 
@@ -2615,11 +2615,11 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     }
 
     /**
-     * @param po Portable object.
+     * @param po Binary object.
      * @param off Offset.
      * @return Value.
      */
-    private int intFromPortable(BinaryObject po, int off) {
+    private int intFromBinary(BinaryObject po, int off) {
         byte[] arr = U.field(po, "arr");
 
         return Integer.reverseBytes(U.bytesToInt(arr, off));
@@ -2647,7 +2647,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      * @param obj Object.
      * @param marsh Marshaller.
-     * @return Portable object.
+     * @return Binary object.
      */
     private <T> BinaryObjectImpl marshal(T obj, BinaryMarshaller marsh) throws IgniteCheckedException {
         byte[] bytes = marsh.marshal(obj);
@@ -2665,9 +2665,9 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
 
     /**
      * @param marsh Marshaller.
-     * @return Portable context.
+     * @return Binary context.
      */
-    protected BinaryContext portableContext(BinaryMarshaller marsh) {
+    protected BinaryContext binaryContext(BinaryMarshaller marsh) {
         GridBinaryMarshaller impl = U.field(marsh, "impl");
 
         return impl.context();
@@ -2731,7 +2731,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
 
         marsh.setContext(new MarshallerContextTestImpl(null));
 
-        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", ctx, iCfg);
+        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);
 
         return marsh;
     }
@@ -2849,7 +2849,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     }
 
     /**
-     * @return Portable object.
+     * @return Binary object.
      */
     private TestBinary binaryObject() {
         SimpleObject innerSimple = new SimpleObject();
@@ -2891,80 +2891,80 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
         innerSimple.map.put(2, "str2");
         innerSimple.map.put(3, "str3");
 
-        TestBinary innerPortable = new TestBinary();
-
-        innerPortable.b = 2;
-        innerPortable.s = 2;
-        innerPortable.i = 2;
-        innerPortable.l = 2;
-        innerPortable.f = 2.2f;
-        innerPortable.d = 2.2d;
-        innerPortable.c = 2;
-        innerPortable.bool = true;
-        innerPortable.str = "str2";
-        innerPortable.uuid = UUID.randomUUID();
-        innerPortable.date = new Date();
-        innerPortable.ts = new Timestamp(System.currentTimeMillis());
-        innerPortable.bArr = new byte[] {10, 20, 30};
-        innerPortable.sArr = new short[] {10, 20, 30};
-        innerPortable.iArr = new int[] {10, 20, 30};
-        innerPortable.lArr = new long[] {10, 20, 30};
-        innerPortable.fArr = new float[] {10.01f, 20.02f, 30.03f};
-        innerPortable.dArr = new double[] {10.01d, 20.02d, 30.03d};
-        innerPortable.cArr = new char[] {10, 20, 30};
-        innerPortable.boolArr = new boolean[] {true, false, true};
-        innerPortable.strArr = new String[] {"str10", "str20", "str30"};
-        innerPortable.uuidArr = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
-        innerPortable.dateArr = new Date[] {new Date(44444), new Date(55555), new Date(66666)};
-        innerPortable.objArr = new Object[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
-        innerPortable.bRaw = 3;
-        innerPortable.sRaw = 3;
-        innerPortable.iRaw = 3;
-        innerPortable.lRaw = 3;
-        innerPortable.fRaw = 3.3f;
-        innerPortable.dRaw = 3.3d;
-        innerPortable.cRaw = 3;
-        innerPortable.boolRaw = true;
-        innerPortable.strRaw = "str3";
-        innerPortable.uuidRaw = UUID.randomUUID();
-        innerPortable.dateRaw = new Date();
-        innerPortable.tsRaw = new Timestamp(System.currentTimeMillis());
-        innerPortable.bArrRaw = new byte[] {11, 21, 31};
-        innerPortable.sArrRaw = new short[] {11, 21, 31};
-        innerPortable.iArrRaw = new int[] {11, 21, 31};
-        innerPortable.lArrRaw = new long[] {11, 21, 31};
-        innerPortable.fArrRaw = new float[] {11.11f, 21.12f, 31.13f};
-        innerPortable.dArrRaw = new double[] {11.11d, 21.12d, 31.13d};
-        innerPortable.cArrRaw = new char[] {11, 21, 31};
-        innerPortable.boolArrRaw = new boolean[] {true, false, true};
-        innerPortable.strArrRaw = new String[] {"str11", "str21", "str31"};
-        innerPortable.uuidArrRaw = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
-        innerPortable.dateArrRaw = new Date[] {new Date(77777), new Date(88888), new Date(99999)};
-        innerPortable.objArrRaw = new Object[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
-        innerPortable.col = new ArrayList<>();
-        innerPortable.colRaw = new ArrayList<>();
-        innerPortable.map = new HashMap<>();
-        innerPortable.mapRaw = new HashMap<>();
-        innerPortable.enumVal = TestEnum.B;
-        innerPortable.enumValRaw = TestEnum.C;
-        innerPortable.enumArr = new TestEnum[] {TestEnum.B, TestEnum.C};
-        innerPortable.enumArrRaw = new TestEnum[] {TestEnum.C, TestEnum.D};
-
-        innerPortable.col.add("str4");
-        innerPortable.col.add("str5");
-        innerPortable.col.add("str6");
-
-        innerPortable.map.put(4, "str4");
-        innerPortable.map.put(5, "str5");
-        innerPortable.map.put(6, "str6");
-
-        innerPortable.colRaw.add("str7");
-        innerPortable.colRaw.add("str8");
-        innerPortable.colRaw.add("str9");
-
-        innerPortable.mapRaw.put(7, "str7");
-        innerPortable.mapRaw.put(8, "str8");
-        innerPortable.mapRaw.put(9, "str9");
+        TestBinary innerBinary = new TestBinary();
+
+        innerBinary.b = 2;
+        innerBinary.s = 2;
+        innerBinary.i = 2;
+        innerBinary.l = 2;
+        innerBinary.f = 2.2f;
+        innerBinary.d = 2.2d;
+        innerBinary.c = 2;
+        innerBinary.bool = true;
+        innerBinary.str = "str2";
+        innerBinary.uuid = UUID.randomUUID();
+        innerBinary.date = new Date();
+        innerBinary.ts = new Timestamp(System.currentTimeMillis());
+        innerBinary.bArr = new byte[] {10, 20, 30};
+        innerBinary.sArr = new short[] {10, 20, 30};
+        innerBinary.iArr = new int[] {10, 20, 30};
+        innerBinary.lArr = new long[] {10, 20, 30};
+        innerBinary.fArr = new float[] {10.01f, 20.02f, 30.03f};
+        innerBinary.dArr = new double[] {10.01d, 20.02d, 30.03d};
+        innerBinary.cArr = new char[] {10, 20, 30};
+        innerBinary.boolArr = new boolean[] {true, false, true};
+        innerBinary.strArr = new String[] {"str10", "str20", "str30"};
+        innerBinary.uuidArr = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        innerBinary.dateArr = new Date[] {new Date(44444), new Date(55555), new Date(66666)};
+        innerBinary.objArr = new Object[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        innerBinary.bRaw = 3;
+        innerBinary.sRaw = 3;
+        innerBinary.iRaw = 3;
+        innerBinary.lRaw = 3;
+        innerBinary.fRaw = 3.3f;
+        innerBinary.dRaw = 3.3d;
+        innerBinary.cRaw = 3;
+        innerBinary.boolRaw = true;
+        innerBinary.strRaw = "str3";
+        innerBinary.uuidRaw = UUID.randomUUID();
+        innerBinary.dateRaw = new Date();
+        innerBinary.tsRaw = new Timestamp(System.currentTimeMillis());
+        innerBinary.bArrRaw = new byte[] {11, 21, 31};
+        innerBinary.sArrRaw = new short[] {11, 21, 31};
+        innerBinary.iArrRaw = new int[] {11, 21, 31};
+        innerBinary.lArrRaw = new long[] {11, 21, 31};
+        innerBinary.fArrRaw = new float[] {11.11f, 21.12f, 31.13f};
+        innerBinary.dArrRaw = new double[] {11.11d, 21.12d, 31.13d};
+        innerBinary.cArrRaw = new char[] {11, 21, 31};
+        innerBinary.boolArrRaw = new boolean[] {true, false, true};
+        innerBinary.strArrRaw = new String[] {"str11", "str21", "str31"};
+        innerBinary.uuidArrRaw = new UUID[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        innerBinary.dateArrRaw = new Date[] {new Date(77777), new Date(88888), new Date(99999)};
+        innerBinary.objArrRaw = new Object[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
+        innerBinary.col = new ArrayList<>();
+        innerBinary.colRaw = new ArrayList<>();
+        innerBinary.map = new HashMap<>();
+        innerBinary.mapRaw = new HashMap<>();
+        innerBinary.enumVal = TestEnum.B;
+        innerBinary.enumValRaw = TestEnum.C;
+        innerBinary.enumArr = new TestEnum[] {TestEnum.B, TestEnum.C};
+        innerBinary.enumArrRaw = new TestEnum[] {TestEnum.C, TestEnum.D};
+
+        innerBinary.col.add("str4");
+        innerBinary.col.add("str5");
+        innerBinary.col.add("str6");
+
+        innerBinary.map.put(4, "str4");
+        innerBinary.map.put(5, "str5");
+        innerBinary.map.put(6, "str6");
+
+        innerBinary.colRaw.add("str7");
+        innerBinary.colRaw.add("str8");
+        innerBinary.colRaw.add("str9");
+
+        innerBinary.mapRaw.put(7, "str7");
+        innerBinary.mapRaw.put(8, "str8");
+        innerBinary.mapRaw.put(9, "str9");
 
         TestBinary outer = new TestBinary();
 
@@ -2993,7 +2993,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
         outer.dateArr = new Date[] {new Date(10101), new Date(20202), new Date(30303)};
         outer.objArr = new Object[] {UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID()};
         outer.simple = innerSimple;
-        outer.portable = innerPortable;
+        outer.binary = innerBinary;
         outer.bRaw = 5;
         outer.sRaw = 5;
         outer.iRaw = 5;
@@ -3027,7 +3027,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
         outer.enumArr = new TestEnum[] {TestEnum.D, TestEnum.E};
         outer.enumArrRaw = new TestEnum[] {TestEnum.E, TestEnum.A};
         outer.simpleRaw = innerSimple;
-        outer.portableRaw = innerPortable;
+        outer.binaryRaw = innerBinary;
 
         outer.col.add("str10");
         outer.col.add("str11");
@@ -3346,10 +3346,10 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
         private SimpleObject simpleRaw;
 
         /** */
-        private TestBinary portable;
+        private TestBinary binary;
 
         /** */
-        private TestBinary portableRaw;
+        private TestBinary binaryRaw;
 
         /** {@inheritDoc} */
         @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
@@ -3382,7 +3382,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
             writer.writeEnum("_enumVal", enumVal);
             writer.writeEnumArray("_enumArr", enumArr);
             writer.writeObject("_simple", simple);
-            writer.writeObject("_portable", portable);
+            writer.writeObject("_binary", binary);
 
             BinaryRawWriter raw = writer.rawWriter();
 
@@ -3415,7 +3415,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
             raw.writeEnum(enumValRaw);
             raw.writeEnumArray(enumArrRaw);
             raw.writeObject(simpleRaw);
-            raw.writeObject(portableRaw);
+            raw.writeObject(binaryRaw);
         }
 
         /** {@inheritDoc} */
@@ -3449,7 +3449,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
             enumVal = reader.readEnum("_enumVal");
             enumArr = reader.readEnumArray("_enumArr");
             simple = reader.readObject("_simple");
-            portable = reader.readObject("_portable");
+            binary = reader.readObject("_binary");
 
             BinaryRawReader raw = reader.rawReader();
 
@@ -3482,7 +3482,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
             enumValRaw = raw.readEnum();
             enumArrRaw = raw.readEnumArray();
             simpleRaw = raw.readObject();
-            portableRaw = raw.readObject();
+            binaryRaw = raw.readObject();
         }
 
         /** {@inheritDoc} */
@@ -4089,7 +4089,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      *
      */
-    public static class ChildPortable extends ParentPortable {
+    public static class ChildBinary extends ParentBinary {
 
     }
 
@@ -4147,7 +4147,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     /**
      *
      */
-    private static class ParentPortable {
+    private static class ParentBinary {
         /** */
         public String s;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
index a1f980c..572df88 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
@@ -106,9 +106,9 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
     }
 
     /**
-     * @return Portables API.
+     * @return Binaries API.
      */
-    protected IgniteBinary portables() {
+    protected IgniteBinary binaries() {
         return grid(0).binary();
     }
 
@@ -931,7 +931,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         mutableObj.build();
 
-        BinaryType metadata = portables().type(GridBinaryTestClasses.TestObjectContainer.class);
+        BinaryType metadata = binaries().type(GridBinaryTestClasses.TestObjectContainer.class);
 
         assertEquals("String", metadata.fieldTypeName("xx567"));
     }
@@ -947,7 +947,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         mutableObj.build();
 
-        BinaryType metadata = portables().type(GridBinaryTestClasses.TestObjectContainer.class);
+        BinaryType metadata = binaries().type(GridBinaryTestClasses.TestObjectContainer.class);
 
         assertEquals("String", metadata.fieldTypeName("xx567"));
     }
@@ -971,7 +971,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         mutableObj.build();
 
-        BinaryType metadata = portables().type(c.getClass());
+        BinaryType metadata = binaries().type(c.getClass());
 
         assertTrue(metadata.fieldNames().containsAll(Arrays.asList("intField", "intArrField", "arrField", "strField",
             "colField", "mapField", "enumField", "enumArrField")));
@@ -1140,8 +1140,8 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
     /**
      *
      */
-    public void testPortableObjectField() {
-        GridBinaryTestClasses.TestObjectContainer container = new GridBinaryTestClasses.TestObjectContainer(toPortable(new GridBinaryTestClasses.TestObjectArrayList()));
+    public void testBinaryObjectField() {
+        GridBinaryTestClasses.TestObjectContainer container = new GridBinaryTestClasses.TestObjectContainer(toBinary(new GridBinaryTestClasses.TestObjectArrayList()));
 
         BinaryObjectBuilderImpl wrapper = wrap(container);
 
@@ -1154,12 +1154,12 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
     /**
      *
      */
-    public void testAssignPortableObject() {
+    public void testAssignBinaryObject() {
         GridBinaryTestClasses.TestObjectContainer container = new GridBinaryTestClasses.TestObjectContainer();
 
         BinaryObjectBuilderImpl wrapper = wrap(container);
 
-        wrapper.setField("foo", toPortable(new GridBinaryTestClasses.TestObjectArrayList()));
+        wrapper.setField("foo", toBinary(new GridBinaryTestClasses.TestObjectArrayList()));
 
         GridBinaryTestClasses.TestObjectContainer deserialized = wrapper.build().deserialize();
         assertTrue(deserialized.foo instanceof GridBinaryTestClasses.TestObjectArrayList);
@@ -1185,7 +1185,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
         obj.setDefaultData();
 
-        BinaryObjectBuilderImpl wrapper = wrap(toPortable(obj));
+        BinaryObjectBuilderImpl wrapper = wrap(toBinary(obj));
 
         wrapper.removeField("str");
 
@@ -1205,7 +1205,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         obj.foo = arr1;
 
-        GridBinaryTestClasses.TestObjectContainer res = toPortable(obj).deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = toBinary(obj).deserialize();
 
         Object[] resArr = (Object[])res.foo;
 
@@ -1227,7 +1227,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         obj.foo = arr1;
 
-        GridBinaryTestClasses.TestObjectContainer res = toPortable(obj).deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = toBinary(obj).deserialize();
 
         List<?> resArr = (List<?>)res.foo;
 
@@ -1236,18 +1236,18 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
     /**
      * @param obj Object.
-     * @return Object in portable format.
+     * @return Object in binary format.
      */
-    private BinaryObject toPortable(Object obj) {
-        return portables().toBinary(obj);
+    private BinaryObject toBinary(Object obj) {
+        return binaries().toBinary(obj);
     }
 
     /**
      * @param obj Object.
-     * @return GridMutablePortableObject.
+     * @return GridMutableBinaryObject.
      */
     private BinaryObjectBuilderImpl wrap(Object obj) {
-        return BinaryObjectBuilderImpl.wrap(toPortable(obj));
+        return BinaryObjectBuilderImpl.wrap(toBinary(obj));
     }
 
     /**
@@ -1256,9 +1256,9 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      */
     private BinaryObjectBuilderImpl newWrapper(Class<?> aCls) {
         CacheObjectBinaryProcessorImpl processor = (CacheObjectBinaryProcessorImpl)(
-            (IgniteBinaryImpl)portables()).processor();
+            (IgniteBinaryImpl)binaries()).processor();
 
-        return new BinaryObjectBuilderImpl(processor.portableContext(), processor.typeId(aCls.getName()),
+        return new BinaryObjectBuilderImpl(processor.binaryContext(), processor.typeId(aCls.getName()),
             aCls.getSimpleName());
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java
index 2a3fe53..2424fe8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java
@@ -46,7 +46,7 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import sun.misc.Unsafe;
 
 /**
- * Portable builder test.
+ * Binary builder test.
  */
 @SuppressWarnings("ResultOfMethodCallIgnored")
 public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
@@ -80,7 +80,7 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
         bCfg.setTypeConfigurations(Arrays.asList(
             new BinaryTypeConfiguration(Key.class.getName()),
             new BinaryTypeConfiguration(Value.class.getName()),
-            new BinaryTypeConfiguration("org.gridgain.grid.internal.util.portable.mutabletest.*"),
+            new BinaryTypeConfiguration("org.gridgain.grid.internal.util.binary.mutabletest.*"),
             customTypeCfg));
 
         cfg.setBinaryConfiguration(bCfg);
@@ -115,7 +115,7 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
         obj.setDefaultData();
         obj.enumArr = null;
 
-        GridBinaryTestClasses.TestObjectAllTypes deserialized = builder(toPortable(obj)).build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes deserialized = builder(toBinary(obj)).build().deserialize();
 
         GridTestUtils.deepEquals(obj, deserialized);
     }
@@ -723,7 +723,7 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testOffheapPortable() throws Exception {
+    public void testOffheapBinary() throws Exception {
         BinaryObjectBuilder builder = builder("Class");
 
         builder.hashCode(100);
@@ -891,7 +891,7 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
 
         GridBinaryTestClasses.TestObjectContainer c = new GridBinaryTestClasses.TestObjectContainer(list);
 
-        BinaryObjectBuilderImpl builder = builder(toPortable(c));
+        BinaryObjectBuilderImpl builder = builder(toBinary(c));
         builder.<List>getField("foo").add("!!!");
 
         BinaryObject res = builder.build();
@@ -908,25 +908,25 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
     /**
      *
      */
-    public void testSetPortableObject() {
-        BinaryObject portableObj = builder(GridBinaryTestClasses.TestObjectContainer.class.getName())
-            .setField("foo", toPortable(new GridBinaryTestClasses.TestObjectAllTypes()))
+    public void testSetBinaryObject() {
+        BinaryObject binaryObj = builder(GridBinaryTestClasses.TestObjectContainer.class.getName())
+            .setField("foo", toBinary(new GridBinaryTestClasses.TestObjectAllTypes()))
             .build();
 
-        assertTrue(portableObj.<GridBinaryTestClasses.TestObjectContainer>deserialize().foo instanceof GridBinaryTestClasses.TestObjectAllTypes);
+        assertTrue(binaryObj.<GridBinaryTestClasses.TestObjectContainer>deserialize().foo instanceof GridBinaryTestClasses.TestObjectAllTypes);
     }
 
     /**
      *
      */
-    public void testPlainPortableObjectCopyFrom() {
-        GridBinaryTestClasses.TestObjectPlainPortable obj = new GridBinaryTestClasses.TestObjectPlainPortable(toPortable(new GridBinaryTestClasses.TestObjectAllTypes()));
+    public void testPlainBinaryObjectCopyFrom() {
+        GridBinaryTestClasses.TestObjectPlainBinary obj = new GridBinaryTestClasses.TestObjectPlainBinary(toBinary(new GridBinaryTestClasses.TestObjectAllTypes()));
 
-        BinaryObjectBuilderImpl builder = builder(toPortable(obj));
-        assertTrue(builder.getField("plainPortable") instanceof BinaryObject);
+        BinaryObjectBuilderImpl builder = builder(toBinary(obj));
+        assertTrue(builder.getField("plainBinary") instanceof BinaryObject);
 
-        GridBinaryTestClasses.TestObjectPlainPortable deserialized = builder.build().deserialize();
-        assertTrue(deserialized.plainPortable != null);
+        GridBinaryTestClasses.TestObjectPlainBinary deserialized = builder.build().deserialize();
+        assertTrue(deserialized.plainBinary != null);
     }
 
     /**
@@ -950,7 +950,7 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
         obj.setDefaultData();
         obj.enumArr = null;
 
-        BinaryObjectBuilder builder = builder(toPortable(obj));
+        BinaryObjectBuilder builder = builder(toBinary(obj));
 
         builder.removeField("str");
 
@@ -969,7 +969,7 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
         obj.setDefaultData();
         obj.enumArr = null;
 
-        BinaryObjectBuilderImpl builder = builder(toPortable(obj));
+        BinaryObjectBuilderImpl builder = builder(toBinary(obj));
 
         builder.getField("i_");
 
@@ -987,7 +987,7 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
         outer.inner.outer = outer;
         outer.foo = "a";
 
-        BinaryObjectBuilder builder = builder(toPortable(outer));
+        BinaryObjectBuilder builder = builder(toBinary(outer));
 
         builder.setField("foo", "b");
 
@@ -998,32 +998,32 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
     }
 
     /**
-     * @return Portables.
+     * @return Binaries.
      */
-    private IgniteBinary portables() {
+    private IgniteBinary binaries() {
         return grid(0).binary();
     }
 
     /**
      * @param obj Object.
-     * @return Portable object.
+     * @return Binary object.
      */
-    private BinaryObject toPortable(Object obj) {
-        return portables().toBinary(obj);
+    private BinaryObject toBinary(Object obj) {
+        return binaries().toBinary(obj);
     }
 
     /**
      * @return Builder.
      */
     private BinaryObjectBuilder builder(String clsName) {
-        return portables().builder(clsName);
+        return binaries().builder(clsName);
     }
 
     /**
      * @return Builder.
      */
     private BinaryObjectBuilderImpl builder(BinaryObject obj) {
-        return (BinaryObjectBuilderImpl)portables().builder(obj);
+        return (BinaryObjectBuilderImpl)binaries().builder(obj);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryAffinityKeySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryAffinityKeySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryAffinityKeySelfTest.java
index 2528f17..06406e0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryAffinityKeySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryAffinityKeySelfTest.java
@@ -44,7 +44,7 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 
 /**
- * Test for portable object affinity key.
+ * Test for binary object affinity key.
  */
 public class GridBinaryAffinityKeySelfTest extends GridCommonAbstractTest {
     /** */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java
index c48b056..e433ec0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java
@@ -48,7 +48,7 @@ public class GridBinaryMarshallerCtxDisabledSelfTest extends GridCommonAbstractT
 
         BinaryContext context = new BinaryContext(BinaryCachingMetadataHandler.create(), cfg);
 
-        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", context, cfg);
+        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", context, cfg);
 
         SimpleObject simpleObj = new SimpleObject();
 
@@ -68,12 +68,12 @@ public class GridBinaryMarshallerCtxDisabledSelfTest extends GridCommonAbstractT
 
         assertEquals(simpleObj, marsh.unmarshal(marsh.marshal(simpleObj), null));
 
-        SimpleBinary simplePortable = new SimpleBinary();
+        SimpleBinary simpleBinary = new SimpleBinary();
 
-        simplePortable.str = "portable";
-        simplePortable.arr = new long[] {100, 200, 300};
+        simpleBinary.str = "binary";
+        simpleBinary.arr = new long[] {100, 200, 300};
 
-        assertEquals(simplePortable, marsh.unmarshal(marsh.marshal(simplePortable), null));
+        assertEquals(simpleBinary, marsh.unmarshal(marsh.marshal(simpleBinary), null));
 
         SimpleExternalizable simpleExtr = new SimpleExternalizable();
 
@@ -85,7 +85,7 @@ public class GridBinaryMarshallerCtxDisabledSelfTest extends GridCommonAbstractT
 
     /**
      * Marshaller context with no storage. Platform has to work in such environment as well by marshalling class name of
-     * a portable object.
+     * a binary object.
      */
     private static class MarshallerContextWithNoStorage extends MarshallerContextAdapter {
         /** */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMetaDataSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMetaDataSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMetaDataSelfTest.java
index 970cbc7..5c5d6c3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMetaDataSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMetaDataSelfTest.java
@@ -36,7 +36,7 @@ import org.apache.ignite.binary.BinaryWriter;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
 /**
- * Portable meta data test.
+ * Binary meta data test.
  */
 public class GridBinaryMetaDataSelfTest extends GridCommonAbstractTest {
     /** */
@@ -74,9 +74,9 @@ public class GridBinaryMetaDataSelfTest extends GridCommonAbstractTest {
     }
 
     /**
-     * @return Portables API.
+     * @return Binaries API.
      */
-    protected IgniteBinary portables() {
+    protected IgniteBinary binaries() {
         return grid().binary();
     }
 
@@ -84,9 +84,9 @@ public class GridBinaryMetaDataSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testGetAll() throws Exception {
-        portables().toBinary(new TestObject2());
+        binaries().toBinary(new TestObject2());
 
-        Collection<BinaryType> metas = portables().types();
+        Collection<BinaryType> metas = binaries().types();
 
         assertEquals(2, metas.size());
 
@@ -150,16 +150,16 @@ public class GridBinaryMetaDataSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testNoConfiguration() throws Exception {
-        portables().toBinary(new TestObject3());
+        binaries().toBinary(new TestObject3());
 
-        assertNotNull(portables().type(TestObject3.class));
+        assertNotNull(binaries().type(TestObject3.class));
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testReflection() throws Exception {
-        BinaryType meta = portables().type(TestObject1.class);
+        BinaryType meta = binaries().type(TestObject1.class);
 
         assertNotNull(meta);
 
@@ -189,10 +189,10 @@ public class GridBinaryMetaDataSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
-    public void testPortableMarshalAware() throws Exception {
-        portables().toBinary(new TestObject2());
+    public void testBinaryMarshalAware() throws Exception {
+        binaries().toBinary(new TestObject2());
 
-        BinaryType meta = portables().type(TestObject2.class);
+        BinaryType meta = binaries().type(TestObject2.class);
 
         assertNotNull(meta);
 
@@ -223,13 +223,13 @@ public class GridBinaryMetaDataSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testMerge() throws Exception {
-        portables().toBinary(new TestObject2());
+        binaries().toBinary(new TestObject2());
 
         idx = 1;
 
-        portables().toBinary(new TestObject2());
+        binaries().toBinary(new TestObject2());
 
-        BinaryType meta = portables().type(TestObject2.class);
+        BinaryType meta = binaries().type(TestObject2.class);
 
         assertNotNull(meta);
 
@@ -274,7 +274,7 @@ public class GridBinaryMetaDataSelfTest extends GridCommonAbstractTest {
         obj.decVal = BigDecimal.ZERO;
         obj.decArrVal = new BigDecimal[] { BigDecimal.ONE };
 
-        BinaryObject po = portables().toBinary(obj);
+        BinaryObject po = binaries().toBinary(obj);
 
         info(po.toString());
 


[04/50] [abbrv] ignite git commit: ignite-2065: Fix RAT

Posted by vo...@apache.org.
ignite-2065: Fix RAT


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

Branch: refs/heads/ignite-2100
Commit: 2b3c93ec97761f70a889c6d408ff43272e786b06
Parents: 98ef0ba
Author: ashutak <as...@gridgain.com>
Authored: Fri Dec 11 17:30:23 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Fri Dec 11 17:30:23 2015 +0300

----------------------------------------------------------------------
 parent/pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2b3c93ec/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 8728858..0f2d363 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -846,10 +846,10 @@
                                         <exclude>dev-tools/.gradle/**/*</exclude>
                                         <exclude>dev-tools/gradle/wrapper/**/*</exclude>
                                         <exclude>dev-tools/gradlew</exclude>
-                                        <exclude>src/test/portables/repo/org/apache/ignite/portable/test2/1.1/test2-1.1.pom</exclude>
-                                        <exclude>src/test/portables/repo/org/apache/ignite/portable/test2/maven-metadata-local.xml</exclude>
-                                        <exclude>src/test/portables/repo/org/apache/ignite/portable/test1/1.1/test1-1.1.pom</exclude>
-                                        <exclude>src/test/portables/repo/org/apache/ignite/portable/test1/maven-metadata-local.xml</exclude>
+                                        <exclude>src/test/portables/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.pom</exclude>
+                                        <exclude>src/test/portables/repo/org/apache/ignite/binary/test2/maven-metadata-local.xml</exclude>
+                                        <exclude>src/test/portables/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.pom</exclude>
+                                        <exclude>src/test/portables/repo/org/apache/ignite/binary/test1/maven-metadata-local.xml</exclude>
                                         <!--shmem-->
                                         <exclude>ipc/shmem/**/Makefile.in</exclude><!--auto generated files-->
                                         <exclude>ipc/shmem/**/Makefile</exclude><!--auto generated files-->


[09/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary"

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableValueWithType.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableValueWithType.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableValueWithType.java
deleted file mode 100644
index 6c5ddfe..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/PortableValueWithType.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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.binary.builder;
-
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- *
- */
-class PortableValueWithType implements PortableLazyValue {
-    /** */
-    private byte type;
-
-    /** */
-    private Object val;
-
-    /**
-     * @param type Type
-     * @param val Value.
-     */
-    PortableValueWithType(byte type, Object val) {
-        this.type = type;
-        this.val = val;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeTo(BinaryWriterExImpl writer, PortableBuilderSerializer ctx) {
-        if (val instanceof PortableBuilderSerializationAware)
-            ((PortableBuilderSerializationAware)val).writeTo(writer, ctx);
-        else
-            ctx.writeValue(writer, val);
-    }
-
-    /**
-     * @return Type ID.
-     */
-    public int typeId() {
-        return type;
-    }
-
-    /** {@inheritDoc} */
-    @Override public Object value() {
-        if (val instanceof PortableLazyValue)
-            return ((PortableLazyValue)val).value();
-
-        return val;
-    }
-
-    /**
-     * @param val New value.
-     */
-    public void value(Object val) {
-        this.val = val;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(PortableValueWithType.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java
new file mode 100644
index 0000000..e3be794
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractInputStream.java
@@ -0,0 +1,379 @@
+/*
+ * 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.binary.streams;
+
+import org.apache.ignite.binary.BinaryObjectException;
+
+/**
+ * Portable abstract input stream.
+ */
+public abstract class BinaryAbstractInputStream extends BinaryAbstractStream
+    implements BinaryInputStream {
+    /** Length of data inside array. */
+    protected int len;
+
+    /** {@inheritDoc} */
+    @Override public byte readByte() {
+        ensureEnoughData(1);
+
+        return readByteAndShift();
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] readByteArray(int cnt) {
+        ensureEnoughData(cnt);
+
+        byte[] res = new byte[cnt];
+
+        copyAndShift(res, BYTE_ARR_OFF, cnt);
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean readBoolean() {
+        return readByte() == BYTE_ONE;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean[] readBooleanArray(int cnt) {
+        ensureEnoughData(cnt);
+
+        boolean[] res = new boolean[cnt];
+
+        copyAndShift(res, BOOLEAN_ARR_OFF, cnt);
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public short readShort() {
+        ensureEnoughData(2);
+
+        short res = readShortFast();
+
+        shift(2);
+
+        if (!LITTLE_ENDIAN)
+            res = Short.reverseBytes(res);
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public short[] readShortArray(int cnt) {
+        int len = cnt << 1;
+
+        ensureEnoughData(len);
+
+        short[] res = new short[cnt];
+
+        copyAndShift(res, SHORT_ARR_OFF, len);
+
+        if (!LITTLE_ENDIAN) {
+            for (int i = 0; i < res.length; i++)
+                res[i] = Short.reverseBytes(res[i]);
+        }
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public char readChar() {
+        ensureEnoughData(2);
+
+        char res = readCharFast();
+
+        shift(2);
+
+        if (!LITTLE_ENDIAN)
+            res = Character.reverseBytes(res);
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public char[] readCharArray(int cnt) {
+        int len = cnt << 1;
+
+        ensureEnoughData(len);
+
+        char[] res = new char[cnt];
+
+        copyAndShift(res, CHAR_ARR_OFF, len);
+
+        if (!LITTLE_ENDIAN) {
+            for (int i = 0; i < res.length; i++)
+                res[i] = Character.reverseBytes(res[i]);
+        }
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int readInt() {
+        ensureEnoughData(4);
+
+        int res = readIntFast();
+
+        shift(4);
+
+        if (!LITTLE_ENDIAN)
+            res = Integer.reverseBytes(res);
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int[] readIntArray(int cnt) {
+        int len = cnt << 2;
+
+        ensureEnoughData(len);
+
+        int[] res = new int[cnt];
+
+        copyAndShift(res, INT_ARR_OFF, len);
+
+        if (!LITTLE_ENDIAN) {
+            for (int i = 0; i < res.length; i++)
+                res[i] = Integer.reverseBytes(res[i]);
+        }
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte readBytePositioned(int pos) {
+        int delta = pos + 1 - this.pos;
+
+        if (delta > 0)
+            ensureEnoughData(delta);
+
+        return readBytePositioned0(pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public short readShortPositioned(int pos) {
+        int delta = pos + 2 - this.pos;
+
+        if (delta > 0)
+            ensureEnoughData(delta);
+
+        return readShortPositioned0(pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int readIntPositioned(int pos) {
+        int delta = pos + 4 - this.pos;
+
+        if (delta > 0)
+            ensureEnoughData(delta);
+
+        return readIntPositioned0(pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public float readFloat() {
+        return Float.intBitsToFloat(readInt());
+    }
+
+    /** {@inheritDoc} */
+    @Override public float[] readFloatArray(int cnt) {
+        int len = cnt << 2;
+
+        ensureEnoughData(len);
+
+        float[] res = new float[cnt];
+
+        if (LITTLE_ENDIAN)
+            copyAndShift(res, FLOAT_ARR_OFF, len);
+        else {
+            for (int i = 0; i < res.length; i++) {
+                int x = readIntFast();
+
+                shift(4);
+
+                res[i] = Float.intBitsToFloat(Integer.reverseBytes(x));
+            }
+        }
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public long readLong() {
+        ensureEnoughData(8);
+
+        long res = readLongFast();
+
+        shift(8);
+
+        if (!LITTLE_ENDIAN)
+            res = Long.reverseBytes(res);
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public long[] readLongArray(int cnt) {
+        int len = cnt << 3;
+
+        ensureEnoughData(len);
+
+        long[] res = new long[cnt];
+
+        copyAndShift(res, LONG_ARR_OFF, len);
+
+        if (!LITTLE_ENDIAN) {
+            for (int i = 0; i < res.length; i++)
+                res[i] = Long.reverseBytes(res[i]);
+        }
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public double readDouble() {
+        return Double.longBitsToDouble(readLong());
+    }
+
+    /** {@inheritDoc} */
+    @Override public double[] readDoubleArray(int cnt) {
+        int len = cnt << 3;
+
+        ensureEnoughData(len);
+
+        double[] res = new double[cnt];
+
+        if (LITTLE_ENDIAN)
+            copyAndShift(res, DOUBLE_ARR_OFF, len);
+        else {
+            for (int i = 0; i < res.length; i++) {
+                long x = readLongFast();
+
+                shift(8);
+
+                res[i] = Double.longBitsToDouble(Long.reverseBytes(x));
+            }
+        }
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int read(byte[] arr, int off, int len) {
+        if (len > remaining())
+            len = remaining();
+
+        copyAndShift(arr, BYTE_ARR_OFF + off, len);
+
+        return len;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void position(int pos) {
+        if (remaining() + this.pos < pos)
+            throw new BinaryObjectException("Position is out of bounds: " + pos);
+        else
+            this.pos = pos;
+    }
+
+    /** {@inheritDoc} */
+    @Override public long offheapPointer() {
+        return 0;
+    }
+
+    /**
+     * Ensure that there is enough data.
+     *
+     * @param cnt Length.
+     */
+    protected void ensureEnoughData(int cnt) {
+        if (remaining() < cnt)
+            throw new BinaryObjectException("Not enough data to read the value [position=" + pos +
+                ", requiredBytes=" + cnt + ", remainingBytes=" + remaining() + ']');
+    }
+
+    /**
+     * Read next byte from the stream and perform shift.
+     *
+     * @return Next byte.
+     */
+    protected abstract byte readByteAndShift();
+
+    /**
+     * Copy data to target object shift position afterwards.
+     *
+     * @param target Target.
+     * @param off Offset.
+     * @param len Length.
+     */
+    protected abstract void copyAndShift(Object target, long off, int len);
+
+    /**
+     * Read short value (fast path).
+     *
+     * @return Short value.
+     */
+    protected abstract short readShortFast();
+
+    /**
+     * Read char value (fast path).
+     *
+     * @return Char value.
+     */
+    protected abstract char readCharFast();
+
+    /**
+     * Read int value (fast path).
+     *
+     * @return Int value.
+     */
+    protected abstract int readIntFast();
+
+    /**
+     * Read long value (fast path).
+     *
+     * @return Long value.
+     */
+    protected abstract long readLongFast();
+
+    /**
+     * Internal routine for positioned byte value read.
+     *
+     * @param pos Position.
+     * @return Int value.
+     */
+    protected abstract byte readBytePositioned0(int pos);
+
+    /**
+     * Internal routine for positioned short value read.
+     *
+     * @param pos Position.
+     * @return Int value.
+     */
+    protected abstract short readShortPositioned0(int pos);
+
+    /**
+     * Internal routine for positioned int value read.
+     *
+     * @param pos Position.
+     * @return Int value.
+     */
+    protected abstract int readIntPositioned0(int pos);
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java
new file mode 100644
index 0000000..199ee71
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractOutputStream.java
@@ -0,0 +1,347 @@
+/*
+ * 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.binary.streams;
+
+/**
+ * Base portable output stream.
+ */
+public abstract class BinaryAbstractOutputStream extends BinaryAbstractStream
+    implements BinaryOutputStream {
+    /** Minimal capacity when it is reasonable to start doubling resize. */
+    private static final int MIN_CAP = 256;
+
+    /** {@inheritDoc} */
+    @Override public void writeByte(byte val) {
+        ensureCapacity(pos + 1);
+
+        writeByteAndShift(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeByteArray(byte[] val) {
+        ensureCapacity(pos + val.length);
+
+        copyAndShift(val, BYTE_ARR_OFF, val.length);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeBoolean(boolean val) {
+        writeByte(val ? BYTE_ONE : BYTE_ZERO);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeBooleanArray(boolean[] val) {
+        ensureCapacity(pos + val.length);
+
+        copyAndShift(val, BOOLEAN_ARR_OFF, val.length);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeShort(short val) {
+        ensureCapacity(pos + 2);
+
+        if (!LITTLE_ENDIAN)
+            val = Short.reverseBytes(val);
+
+        writeShortFast(val);
+
+        shift(2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeShortArray(short[] val) {
+        int cnt = val.length << 1;
+
+        ensureCapacity(pos + cnt);
+
+        if (LITTLE_ENDIAN)
+            copyAndShift(val, SHORT_ARR_OFF, cnt);
+        else {
+            for (short item : val)
+                writeShortFast(Short.reverseBytes(item));
+
+            shift(cnt);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeChar(char val) {
+        ensureCapacity(pos + 2);
+
+        if (!LITTLE_ENDIAN)
+            val = Character.reverseBytes(val);
+
+        writeCharFast(val);
+
+        shift(2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeCharArray(char[] val) {
+        int cnt = val.length << 1;
+
+        ensureCapacity(pos + cnt);
+
+        if (LITTLE_ENDIAN)
+            copyAndShift(val, CHAR_ARR_OFF, cnt);
+        else {
+            for (char item : val)
+                writeCharFast(Character.reverseBytes(item));
+
+            shift(cnt);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeInt(int val) {
+        ensureCapacity(pos + 4);
+
+        if (!LITTLE_ENDIAN)
+            val = Integer.reverseBytes(val);
+
+        writeIntFast(val);
+
+        shift(4);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeShort(int pos, short val) {
+        ensureCapacity(pos + 2);
+
+        unsafeWriteShort(pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeInt(int pos, int val) {
+        ensureCapacity(pos + 4);
+
+        unsafeWriteInt(pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeIntArray(int[] val) {
+        int cnt = val.length << 2;
+
+        ensureCapacity(pos + cnt);
+
+        if (LITTLE_ENDIAN)
+            copyAndShift(val, INT_ARR_OFF, cnt);
+        else {
+            for (int item : val)
+                writeIntFast(Integer.reverseBytes(item));
+
+            shift(cnt);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeFloat(float val) {
+        writeInt(Float.floatToIntBits(val));
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeFloatArray(float[] val) {
+        int cnt = val.length << 2;
+
+        ensureCapacity(pos + cnt);
+
+        if (LITTLE_ENDIAN)
+            copyAndShift(val, FLOAT_ARR_OFF, cnt);
+        else {
+            for (float item : val) {
+                writeIntFast(Integer.reverseBytes(Float.floatToIntBits(item)));
+
+                shift(4);
+            }
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeLong(long val) {
+        ensureCapacity(pos + 8);
+
+        if (!LITTLE_ENDIAN)
+            val = Long.reverseBytes(val);
+
+        writeLongFast(val);
+
+        shift(8);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeLongArray(long[] val) {
+        int cnt = val.length << 3;
+
+        ensureCapacity(pos + cnt);
+
+        if (LITTLE_ENDIAN)
+            copyAndShift(val, LONG_ARR_OFF, cnt);
+        else {
+            for (long item : val)
+                writeLongFast(Long.reverseBytes(item));
+
+            shift(cnt);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeDouble(double val) {
+        writeLong(Double.doubleToLongBits(val));
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeDoubleArray(double[] val) {
+        int cnt = val.length << 3;
+
+        ensureCapacity(pos + cnt);
+
+        if (LITTLE_ENDIAN)
+            copyAndShift(val, DOUBLE_ARR_OFF, cnt);
+        else {
+            for (double item : val) {
+                writeLongFast(Long.reverseBytes(Double.doubleToLongBits(item)));
+
+                shift(8);
+            }
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void write(byte[] arr, int off, int len) {
+        ensureCapacity(pos + len);
+
+        copyAndShift(arr, BYTE_ARR_OFF + off, len);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void write(long addr, int cnt) {
+        ensureCapacity(pos + cnt);
+
+        copyAndShift(null, addr, cnt);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void position(int pos) {
+        ensureCapacity(pos);
+
+        unsafePosition(pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public long offheapPointer() {
+        return 0;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeEnsure(int cap) {
+        ensureCapacity(pos + cap);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafePosition(int pos) {
+        this.pos = pos;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteBoolean(boolean val) {
+        unsafeWriteByte(val ? BYTE_ONE : BYTE_ZERO);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteFloat(float val) {
+        unsafeWriteInt(Float.floatToIntBits(val));
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteDouble(double val) {
+        unsafeWriteLong(Double.doubleToLongBits(val));
+    }
+
+    /**
+     * Calculate new capacity.
+     *
+     * @param curCap Current capacity.
+     * @param reqCap Required capacity.
+     * @return New capacity.
+     */
+    protected static int capacity(int curCap, int reqCap) {
+        int newCap;
+
+        if (reqCap < MIN_CAP)
+            newCap = MIN_CAP;
+        else {
+            newCap = curCap << 1;
+
+            if (newCap < reqCap)
+                newCap = reqCap;
+        }
+
+        return newCap;
+    }
+
+    /**
+     * Write next byte to the stream.
+     *
+     * @param val Value.
+     */
+    protected abstract void writeByteAndShift(byte val);
+
+    /**
+     * Copy source object to the stream shift position afterwards.
+     *
+     * @param src Source.
+     * @param off Offset.
+     * @param len Length.
+     */
+    protected abstract void copyAndShift(Object src, long off, int len);
+
+    /**
+     * Write short value (fast path).
+     *
+     * @param val Short value.
+     */
+    protected abstract void writeShortFast(short val);
+
+    /**
+     * Write char value (fast path).
+     *
+     * @param val Char value.
+     */
+    protected abstract void writeCharFast(char val);
+
+    /**
+     * Write int value (fast path).
+     *
+     * @param val Int value.
+     */
+    protected abstract void writeIntFast(int val);
+
+    /**
+     * Write long value (fast path).
+     *
+     * @param val Long value.
+     */
+    protected abstract void writeLongFast(long val);
+
+    /**
+     * Ensure capacity.
+     *
+     * @param cnt Required byte count.
+     */
+    protected abstract void ensureCapacity(int cnt);
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java
new file mode 100644
index 0000000..ce57631
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryAbstractStream.java
@@ -0,0 +1,80 @@
+/*
+ * 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.binary.streams;
+
+import java.nio.ByteOrder;
+import org.apache.ignite.internal.util.GridUnsafe;
+import sun.misc.Unsafe;
+
+/**
+ * Portable abstract stream.
+ */
+public abstract class BinaryAbstractStream implements BinaryStream {
+    /** Byte: zero. */
+    protected static final byte BYTE_ZERO = 0;
+
+    /** Byte: one. */
+    protected static final byte BYTE_ONE = 1;
+
+    /** Whether little endian is used on the platform. */
+    protected static final boolean LITTLE_ENDIAN = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN;
+
+    /** Unsafe instance. */
+    protected static final Unsafe UNSAFE = GridUnsafe.unsafe();
+
+    /** Array offset: boolean. */
+    protected static final long BOOLEAN_ARR_OFF = UNSAFE.arrayBaseOffset(boolean[].class);
+
+    /** Array offset: byte. */
+    protected static final long BYTE_ARR_OFF = UNSAFE.arrayBaseOffset(byte[].class);
+
+    /** Array offset: short. */
+    protected static final long SHORT_ARR_OFF = UNSAFE.arrayBaseOffset(short[].class);
+
+    /** Array offset: char. */
+    protected static final long CHAR_ARR_OFF = UNSAFE.arrayBaseOffset(char[].class);
+
+    /** Array offset: int. */
+    protected static final long INT_ARR_OFF = UNSAFE.arrayBaseOffset(int[].class);
+
+    /** Array offset: float. */
+    protected static final long FLOAT_ARR_OFF = UNSAFE.arrayBaseOffset(float[].class);
+
+    /** Array offset: long. */
+    protected static final long LONG_ARR_OFF = UNSAFE.arrayBaseOffset(long[].class);
+
+    /** Array offset: double. */
+    protected static final long DOUBLE_ARR_OFF = UNSAFE.arrayBaseOffset(double[].class);
+
+    /** Position. */
+    protected int pos;
+
+    /** {@inheritDoc} */
+    @Override public int position() {
+        return pos;
+    }
+
+    /**
+     * Shift position.
+     *
+     * @param cnt Byte count.
+     */
+    protected void shift(int cnt) {
+        pos += cnt;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java
new file mode 100644
index 0000000..502b9dc
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapInputStream.java
@@ -0,0 +1,166 @@
+/*
+ * 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.binary.streams;
+
+import java.util.Arrays;
+
+/**
+ * Portable off-heap input stream.
+ */
+public final class BinaryHeapInputStream extends BinaryAbstractInputStream {
+    /**
+     * Create stream with pointer set at the given position.
+     *
+     * @param data Data.
+     * @param pos Position.
+     * @return Stream.
+     */
+    public static BinaryHeapInputStream create(byte[] data, int pos) {
+        assert pos < data.length;
+
+        BinaryHeapInputStream stream = new BinaryHeapInputStream(data);
+
+        stream.pos = pos;
+
+        return stream;
+    }
+
+    /** Data. */
+    private byte[] data;
+
+    /**
+     * Constructor.
+     *
+     * @param data Data.
+     */
+    public BinaryHeapInputStream(byte[] data) {
+        this.data = data;
+
+        len = data.length;
+    }
+
+    /**
+     * @return Copy of this stream.
+     */
+    public BinaryHeapInputStream copy() {
+        BinaryHeapInputStream in = new BinaryHeapInputStream(Arrays.copyOf(data, data.length));
+
+        in.position(pos);
+
+        return in;
+    }
+
+    /**
+     * Method called from JNI to resize stream.
+     *
+     * @param len Required length.
+     * @return Underlying byte array.
+     */
+    public byte[] resize(int len) {
+        if (data.length < len) {
+            byte[] data0 = new byte[len];
+
+            UNSAFE.copyMemory(data, BYTE_ARR_OFF, data0, BYTE_ARR_OFF, data.length);
+
+            data = data0;
+        }
+
+        return data;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int remaining() {
+        return data.length - pos;
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] array() {
+        return data;
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] arrayCopy() {
+        byte[] res = new byte[len];
+
+        UNSAFE.copyMemory(data, BYTE_ARR_OFF, res, BYTE_ARR_OFF, res.length);
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean hasArray() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected byte readByteAndShift() {
+        return data[pos++];
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void copyAndShift(Object target, long off, int len) {
+        UNSAFE.copyMemory(data, BYTE_ARR_OFF + pos, target, off, len);
+
+        shift(len);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected short readShortFast() {
+        return UNSAFE.getShort(data, BYTE_ARR_OFF + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected char readCharFast() {
+        return UNSAFE.getChar(data, BYTE_ARR_OFF + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected int readIntFast() {
+        return UNSAFE.getInt(data, BYTE_ARR_OFF + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected long readLongFast() {
+        return UNSAFE.getLong(data, BYTE_ARR_OFF + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected byte readBytePositioned0(int pos) {
+        return UNSAFE.getByte(data, BYTE_ARR_OFF + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected short readShortPositioned0(int pos) {
+        short res = UNSAFE.getShort(data, BYTE_ARR_OFF + pos);
+
+        if (!LITTLE_ENDIAN)
+            res = Short.reverseBytes(res);
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected int readIntPositioned0(int pos) {
+        int res = UNSAFE.getInt(data, BYTE_ARR_OFF + pos);
+
+        if (!LITTLE_ENDIAN)
+            res = Integer.reverseBytes(res);
+
+        return res;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java
new file mode 100644
index 0000000..02c3441
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryHeapOutputStream.java
@@ -0,0 +1,176 @@
+/*
+ * 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.binary.streams;
+
+/**
+ * Portable heap output stream.
+ */
+public final class BinaryHeapOutputStream extends BinaryAbstractOutputStream {
+    /** Allocator. */
+    private final BinaryMemoryAllocatorChunk chunk;
+
+    /** Data. */
+    private byte[] data;
+
+    /**
+     * Constructor.
+     *
+     * @param cap Initial capacity.
+     */
+    public BinaryHeapOutputStream(int cap) {
+        this(cap, BinaryMemoryAllocator.INSTANCE.chunk());
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param cap Capacity.
+     * @param chunk Chunk.
+     */
+    public BinaryHeapOutputStream(int cap, BinaryMemoryAllocatorChunk chunk) {
+        this.chunk = chunk;
+
+        data = chunk.allocate(cap);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void close() {
+        chunk.release(data, pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void ensureCapacity(int cnt) {
+        if (cnt > data.length) {
+            int newCap = capacity(data.length, cnt);
+
+            data = chunk.reallocate(data, newCap);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] array() {
+        return data;
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] arrayCopy() {
+        byte[] res = new byte[pos];
+
+        UNSAFE.copyMemory(data, BYTE_ARR_OFF, res, BYTE_ARR_OFF, pos);
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean hasArray() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeByteAndShift(byte val) {
+        data[pos++] = val;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void copyAndShift(Object src, long off, int len) {
+        UNSAFE.copyMemory(src, off, data, BYTE_ARR_OFF + pos, len);
+
+        shift(len);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeShortFast(short val) {
+        UNSAFE.putShort(data, BYTE_ARR_OFF + pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeCharFast(char val) {
+        UNSAFE.putChar(data, BYTE_ARR_OFF + pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeIntFast(int val) {
+        UNSAFE.putInt(data, BYTE_ARR_OFF + pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeLongFast(long val) {
+        UNSAFE.putLong(data, BYTE_ARR_OFF + pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteByte(byte val) {
+        UNSAFE.putByte(data, BYTE_ARR_OFF + pos++, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteShort(short val) {
+        if (!LITTLE_ENDIAN)
+            val = Short.reverseBytes(val);
+
+        UNSAFE.putShort(data, BYTE_ARR_OFF + pos, val);
+
+        shift(2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteShort(int pos, short val) {
+        if (!LITTLE_ENDIAN)
+            val = Short.reverseBytes(val);
+
+        UNSAFE.putShort(data, BYTE_ARR_OFF + pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteChar(char val) {
+        if (!LITTLE_ENDIAN)
+            val = Character.reverseBytes(val);
+
+        UNSAFE.putChar(data, BYTE_ARR_OFF + pos, val);
+
+        shift(2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteInt(int val) {
+        if (!LITTLE_ENDIAN)
+            val = Integer.reverseBytes(val);
+
+        UNSAFE.putInt(data, BYTE_ARR_OFF + pos, val);
+
+        shift(4);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteInt(int pos, int val) {
+        if (!LITTLE_ENDIAN)
+            val = Integer.reverseBytes(val);
+
+        UNSAFE.putInt(data, BYTE_ARR_OFF + pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteLong(long val) {
+        if (!LITTLE_ENDIAN)
+            val = Long.reverseBytes(val);
+
+        UNSAFE.putLong(data, BYTE_ARR_OFF + pos, val);
+
+        shift(8);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java
new file mode 100644
index 0000000..63457e4
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryInputStream.java
@@ -0,0 +1,162 @@
+/*
+ * 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.binary.streams;
+
+import org.apache.ignite.internal.binary.BinaryPositionReadable;
+
+/**
+ * Portable input stream.
+ */
+public interface BinaryInputStream extends BinaryStream, BinaryPositionReadable {
+    /**
+     * Read byte value.
+     *
+     * @return Byte value.
+     */
+    public byte readByte();
+
+    /**
+     * Read byte array.
+     *
+     * @param cnt Expected item count.
+     * @return Byte array.
+     */
+    public byte[] readByteArray(int cnt);
+
+    /**
+     * Reads {@code cnt} of bytes into byte array.
+     *
+     * @param arr Expected item count.
+     * @param off offset
+     * @param cnt number of bytes to read.
+     * @return actual length read.
+     */
+    public int read(byte[] arr, int off, int cnt);
+
+    /**
+     * Read boolean value.
+     *
+     * @return Boolean value.
+     */
+    public boolean readBoolean();
+
+    /**
+     * Read boolean array.
+     *
+     * @param cnt Expected item count.
+     * @return Boolean array.
+     */
+    public boolean[] readBooleanArray(int cnt);
+
+    /**
+     * Read short value.
+     *
+     * @return Short value.
+     */
+    public short readShort();
+
+    /**
+     * Read short array.
+     *
+     * @param cnt Expected item count.
+     * @return Short array.
+     */
+    public short[] readShortArray(int cnt);
+
+    /**
+     * Read char value.
+     *
+     * @return Char value.
+     */
+    public char readChar();
+
+    /**
+     * Read char array.
+     *
+     * @param cnt Expected item count.
+     * @return Char array.
+     */
+    public char[] readCharArray(int cnt);
+
+    /**
+     * Read int value.
+     *
+     * @return Int value.
+     */
+    public int readInt();
+
+    /**
+     * Read int array.
+     *
+     * @param cnt Expected item count.
+     * @return Int array.
+     */
+    public int[] readIntArray(int cnt);
+
+    /**
+     * Read float value.
+     *
+     * @return Float value.
+     */
+    public float readFloat();
+
+    /**
+     * Read float array.
+     *
+     * @param cnt Expected item count.
+     * @return Float array.
+     */
+    public float[] readFloatArray(int cnt);
+
+    /**
+     * Read long value.
+     *
+     * @return Long value.
+     */
+    public long readLong();
+
+    /**
+     * Read long array.
+     *
+     * @param cnt Expected item count.
+     * @return Long array.
+     */
+    public long[] readLongArray(int cnt);
+
+    /**
+     * Read double value.
+     *
+     * @return Double value.
+     */
+    public double readDouble();
+
+    /**
+     * Read double array.
+     *
+     * @param cnt Expected item count.
+     * @return Double array.
+     */
+    public double[] readDoubleArray(int cnt);
+
+    /**
+     * Gets amount of remaining data in bytes.
+     *
+     * @return Remaining data.
+     */
+    public int remaining();
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryMemoryAllocator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryMemoryAllocator.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryMemoryAllocator.java
new file mode 100644
index 0000000..5471bc5
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryMemoryAllocator.java
@@ -0,0 +1,57 @@
+/*
+ * 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.binary.streams;
+
+/**
+ * Thread-local memory allocator.
+ */
+public final class BinaryMemoryAllocator {
+    /** Memory allocator instance. */
+    public static final BinaryMemoryAllocator INSTANCE = new BinaryMemoryAllocator();
+
+    /** Holders. */
+    private static final ThreadLocal<BinaryMemoryAllocatorChunk> holders = new ThreadLocal<>();
+
+    /**
+     * Ensures singleton.
+     */
+    private BinaryMemoryAllocator() {
+        // No-op.
+    }
+
+    public BinaryMemoryAllocatorChunk chunk() {
+        BinaryMemoryAllocatorChunk holder = holders.get();
+
+        if (holder == null)
+            holders.set(holder = new BinaryMemoryAllocatorChunk());
+
+        return holder;
+    }
+
+    /**
+     * Checks whether a thread-local array is acquired or not.
+     * The function is used by Unit tests.
+     *
+     * @return {@code true} if acquired {@code false} otherwise.
+     */
+    public boolean isAcquired() {
+        BinaryMemoryAllocatorChunk holder = holders.get();
+
+        return holder != null && holder.isAcquired();
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryMemoryAllocatorChunk.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryMemoryAllocatorChunk.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryMemoryAllocatorChunk.java
new file mode 100644
index 0000000..7c73742
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryMemoryAllocatorChunk.java
@@ -0,0 +1,117 @@
+/*
+ * 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.binary.streams;
+
+import org.apache.ignite.internal.util.GridUnsafe;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import sun.misc.Unsafe;
+
+import static org.apache.ignite.IgniteSystemProperties.IGNITE_MARSHAL_BUFFERS_RECHECK;
+
+/**
+ * Memory allocator chunk.
+ */
+public class BinaryMemoryAllocatorChunk {
+    /** Unsafe instance. */
+    protected static final Unsafe UNSAFE = GridUnsafe.unsafe();
+
+    /** Array offset: byte. */
+    protected static final long BYTE_ARR_OFF = UNSAFE.arrayBaseOffset(byte[].class);
+
+    /** Buffer size re-check frequency. */
+    private static final Long CHECK_FREQ = Long.getLong(IGNITE_MARSHAL_BUFFERS_RECHECK, 10000);
+
+    /** Data array */
+    private byte[] data;
+
+    /** Max message size detected between checks. */
+    private int maxMsgSize;
+
+    /** Last time array size is checked. */
+    private long lastCheck = U.currentTimeMillis();
+
+    /** Whether the holder is acquired or not. */
+    private boolean acquired;
+
+    /**
+     * Allocate.
+     *
+     * @param size Desired size.
+     * @return Data.
+     */
+    public byte[] allocate(int size) {
+        if (acquired)
+            return new byte[size];
+
+        acquired = true;
+
+        if (data == null || size > data.length)
+            data = new byte[size];
+
+        return data;
+    }
+
+    /**
+     * Reallocate.
+     *
+     * @param data Old data.
+     * @param size Size.
+     * @return New data.
+     */
+    public byte[] reallocate(byte[] data, int size) {
+        byte[] newData = new byte[size];
+
+        if (this.data == data)
+            this.data = newData;
+
+        UNSAFE.copyMemory(data, BYTE_ARR_OFF, newData, BYTE_ARR_OFF, data.length);
+
+        return newData;
+    }
+
+    /**
+     * Shrinks array size if needed.
+     */
+    public void release(byte[] data, int maxMsgSize) {
+        if (this.data != data)
+            return;
+
+        if (maxMsgSize > this.maxMsgSize)
+            this.maxMsgSize = maxMsgSize;
+
+        this.acquired = false;
+
+        long now = U.currentTimeMillis();
+
+        if (now - this.lastCheck >= CHECK_FREQ) {
+            int halfSize = data.length >> 1;
+
+            if (this.maxMsgSize < halfSize)
+                this.data = new byte[halfSize];
+
+            this.lastCheck = now;
+        }
+    }
+
+    /**
+     * @return {@code True} if acquired.
+     */
+    public boolean isAcquired() {
+        return acquired;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java
new file mode 100644
index 0000000..dc18c9e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapInputStream.java
@@ -0,0 +1,144 @@
+/*
+ * 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.binary.streams;
+
+/**
+ * Portable off-heap input stream.
+ */
+public class BinaryOffheapInputStream extends BinaryAbstractInputStream {
+    /** Pointer. */
+    private final long ptr;
+
+    /** Capacity. */
+    private final int cap;
+
+    /** */
+    private boolean forceHeap;
+
+    /**
+     * Constructor.
+     *
+     * @param ptr Pointer.
+     * @param cap Capacity.
+     */
+    public BinaryOffheapInputStream(long ptr, int cap) {
+        this(ptr, cap, false);
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param ptr Pointer.
+     * @param cap Capacity.
+     * @param forceHeap If {@code true} method {@link #offheapPointer} returns 0 and unmarshalling will
+     *        create heap-based objects.
+     */
+    public BinaryOffheapInputStream(long ptr, int cap, boolean forceHeap) {
+        this.ptr = ptr;
+        this.cap = cap;
+        this.forceHeap = forceHeap;
+
+        len = cap;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int remaining() {
+        return cap - pos;
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] array() {
+        return arrayCopy();
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] arrayCopy() {
+        byte[] res = new byte[len];
+
+        UNSAFE.copyMemory(null, ptr, res, BYTE_ARR_OFF, res.length);
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean hasArray() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected byte readByteAndShift() {
+        return UNSAFE.getByte(ptr + pos++);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void copyAndShift(Object target, long off, int len) {
+        UNSAFE.copyMemory(null, ptr + pos, target, off, len);
+
+        shift(len);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected short readShortFast() {
+        return UNSAFE.getShort(ptr + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected char readCharFast() {
+        return UNSAFE.getChar(ptr + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected int readIntFast() {
+        return UNSAFE.getInt(ptr + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected long readLongFast() {
+        return UNSAFE.getLong(ptr + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected byte readBytePositioned0(int pos) {
+        return UNSAFE.getByte(ptr + pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected short readShortPositioned0(int pos) {
+        short res = UNSAFE.getShort(ptr + pos);
+
+        if (!LITTLE_ENDIAN)
+            res = Short.reverseBytes(res);
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected int readIntPositioned0(int pos) {
+        int res = UNSAFE.getInt(ptr + pos);
+
+        if (!LITTLE_ENDIAN)
+            res = Integer.reverseBytes(res);
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public long offheapPointer() {
+        return forceHeap ? 0 : ptr;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java
new file mode 100644
index 0000000..24b65b2
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOffheapOutputStream.java
@@ -0,0 +1,222 @@
+/*
+ * 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.binary.streams;
+
+/**
+ * Portable offheap output stream.
+ */
+public class BinaryOffheapOutputStream extends BinaryAbstractOutputStream {
+    /** Pointer. */
+    private long ptr;
+
+    /** Length of bytes that cen be used before resize is necessary. */
+    private int cap;
+
+    /**
+     * Constructor.
+     *
+     * @param cap Capacity.
+     */
+    public BinaryOffheapOutputStream(int cap) {
+        this(0, cap);
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param ptr Pointer to existing address.
+     * @param cap Capacity.
+     */
+    public BinaryOffheapOutputStream(long ptr, int cap) {
+        this.ptr = ptr == 0 ? allocate(cap) : ptr;
+
+        this.cap = cap;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void close() {
+        release(ptr);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void ensureCapacity(int cnt) {
+        if (cnt > cap) {
+            int newCap = capacity(cap, cnt);
+
+            ptr = reallocate(ptr, newCap);
+
+            cap = newCap;
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] array() {
+        return arrayCopy();
+    }
+
+    /** {@inheritDoc} */
+    @Override public byte[] arrayCopy() {
+        byte[] res = new byte[pos];
+
+        UNSAFE.copyMemory(null, ptr, res, BYTE_ARR_OFF, pos);
+
+        return res;
+    }
+
+    /**
+     * @return Pointer.
+     */
+    public long pointer() {
+        return ptr;
+    }
+
+    /**
+     * @return Capacity.
+     */
+    public int capacity() {
+        return cap;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeByteAndShift(byte val) {
+        UNSAFE.putByte(ptr + pos++, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void copyAndShift(Object src, long offset, int len) {
+        UNSAFE.copyMemory(src, offset, null, ptr + pos, len);
+
+        shift(len);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeShortFast(short val) {
+        UNSAFE.putShort(ptr + pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeCharFast(char val) {
+        UNSAFE.putChar(ptr + pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeIntFast(int val) {
+        UNSAFE.putInt(ptr + pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void writeLongFast(long val) {
+        UNSAFE.putLong(ptr + pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean hasArray() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteByte(byte val) {
+        UNSAFE.putByte(ptr + pos++, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteShort(short val) {
+        if (!LITTLE_ENDIAN)
+            val = Short.reverseBytes(val);
+
+        UNSAFE.putShort(ptr + pos, val);
+
+        shift(2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteShort(int pos, short val) {
+        if (!LITTLE_ENDIAN)
+            val = Short.reverseBytes(val);
+
+        UNSAFE.putShort(ptr + pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteChar(char val) {
+        if (!LITTLE_ENDIAN)
+            val = Character.reverseBytes(val);
+
+        UNSAFE.putChar(ptr + pos, val);
+
+        shift(2);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteInt(int val) {
+        if (!LITTLE_ENDIAN)
+            val = Integer.reverseBytes(val);
+
+        UNSAFE.putInt(ptr + pos, val);
+
+        shift(4);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteInt(int pos, int val) {
+        if (!LITTLE_ENDIAN)
+            val = Integer.reverseBytes(val);
+
+        UNSAFE.putInt(ptr + pos, val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void unsafeWriteLong(long val) {
+        if (!LITTLE_ENDIAN)
+            val = Long.reverseBytes(val);
+
+        UNSAFE.putLong(ptr + pos, val);
+
+        shift(8);
+    }
+
+    /**
+     * Allocate memory.
+     *
+     * @param cap Capacity.
+     * @return Pointer.
+     */
+    protected long allocate(int cap) {
+        return UNSAFE.allocateMemory(cap);
+    }
+
+    /**
+     * Reallocate memory.
+     *
+     * @param ptr Old pointer.
+     * @param cap Capacity.
+     * @return New pointer.
+     */
+    protected long reallocate(long ptr, int cap) {
+        return UNSAFE.reallocateMemory(ptr, cap);
+    }
+
+    /**
+     * Release memory.
+     *
+     * @param ptr Pointer.
+     */
+    protected void release(long ptr) {
+        UNSAFE.freeMemory(ptr);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java
new file mode 100644
index 0000000..1c3f4bf
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryOutputStream.java
@@ -0,0 +1,259 @@
+/*
+ * 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.binary.streams;
+
+/**
+ * Portable output stream.
+ */
+public interface BinaryOutputStream extends BinaryStream, AutoCloseable {
+    /**
+     * Write byte value.
+     *
+     * @param val Byte value.
+     */
+    public void writeByte(byte val);
+
+    /**
+     * Write byte array.
+     *
+     * @param val Byte array.
+     */
+    public void writeByteArray(byte[] val);
+
+    /**
+     * Write boolean value.
+     *
+     * @param val Boolean value.
+     */
+    public void writeBoolean(boolean val);
+
+    /**
+     * Write boolean array.
+     *
+     * @param val Boolean array.
+     */
+    public void writeBooleanArray(boolean[] val);
+
+    /**
+     * Write short value.
+     *
+     * @param val Short value.
+     */
+    public void writeShort(short val);
+
+    /**
+     * Write short array.
+     *
+     * @param val Short array.
+     */
+    public void writeShortArray(short[] val);
+
+    /**
+     * Write char value.
+     *
+     * @param val Char value.
+     */
+    public void writeChar(char val);
+
+    /**
+     * Write char array.
+     *
+     * @param val Char array.
+     */
+    public void writeCharArray(char[] val);
+
+    /**
+     * Write int value.
+     *
+     * @param val Int value.
+     */
+    public void writeInt(int val);
+
+    /**
+     * Write short value at the given position.
+     *
+     * @param pos Position.
+     * @param val Value.
+     */
+    public void writeShort(int pos, short val);
+
+    /**
+     * Write int value to the given position.
+     *
+     * @param pos Position.
+     * @param val Value.
+     */
+    public void writeInt(int pos, int val);
+
+    /**
+     * Write int array.
+     *
+     * @param val Int array.
+     */
+    public void writeIntArray(int[] val);
+
+    /**
+     * Write float value.
+     *
+     * @param val Float value.
+     */
+    public void writeFloat(float val);
+
+    /**
+     * Write float array.
+     *
+     * @param val Float array.
+     */
+    public void writeFloatArray(float[] val);
+
+    /**
+     * Write long value.
+     *
+     * @param val Long value.
+     */
+    public void writeLong(long val);
+
+    /**
+     * Write long array.
+     *
+     * @param val Long array.
+     */
+    public void writeLongArray(long[] val);
+
+    /**
+     * Write double value.
+     *
+     * @param val Double value.
+     */
+    public void writeDouble(double val);
+
+    /**
+     * Write double array.
+     *
+     * @param val Double array.
+     */
+    public void writeDoubleArray(double[] val);
+
+    /**
+     * Write byte array.
+     *
+     * @param arr Array.
+     * @param off Offset.
+     * @param len Length.
+     */
+    public void write(byte[] arr, int off, int len);
+
+    /**
+     * Write data from unmanaged memory.
+     *
+     * @param addr Address.
+     * @param cnt Count.
+     */
+    public void write(long addr, int cnt);
+
+    /**
+     * Close the stream releasing resources.
+     */
+    @Override public void close();
+
+    /**
+     * Set position in unsafe mode.
+     *
+     * @param pos Position.
+     */
+    public void unsafePosition(int pos);
+
+    /**
+     * Ensure capacity for unsafe writes.
+     *
+     * @param cap Capacity.
+     */
+    public void unsafeEnsure(int cap);
+
+    /**
+     * Write byte in unsafe mode.
+     *
+     * @param val Value.
+     */
+    public void unsafeWriteByte(byte val);
+
+    /**
+     * Write boolean in unsafe mode.
+     *
+     * @param val Value.
+     */
+    public void unsafeWriteBoolean(boolean val);
+
+    /**
+     * Write short in unsafe mode.
+     *
+     * @param val Value.
+     */
+    public void unsafeWriteShort(short val);
+
+    /**
+     * Write short in unsafe mode.
+     *
+     * @param pos Position.
+     * @param val Value.
+     */
+    public void unsafeWriteShort(int pos, short val);
+
+    /**
+     * Write char in unsafe mode.
+     *
+     * @param val Value.
+     */
+    public void unsafeWriteChar(char val);
+
+    /**
+     * Write int in unsafe mode.
+     *
+     * @param val Value.
+     */
+    public void unsafeWriteInt(int val);
+
+    /**
+     * Write int in unsafe mode.
+     *
+     * @param pos Position.
+     * @param val Value.
+     */
+    public void unsafeWriteInt(int pos, int val);
+
+    /**
+     * Write long in unsafe mode.
+     *
+     * @param val Value.
+     */
+    public void unsafeWriteLong(long val);
+
+    /**
+     * Write float in unsafe mode.
+     *
+     * @param val Value.
+     */
+    public void unsafeWriteFloat(float val);
+
+    /**
+     * Write double in unsafe mode.
+     *
+     * @param val Value.
+     */
+    public void unsafeWriteDouble(double val);
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java
new file mode 100644
index 0000000..229e34c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/BinaryStream.java
@@ -0,0 +1,53 @@
+/*
+ * 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.binary.streams;
+
+/**
+ * Portable stream.
+ */
+public interface BinaryStream {
+    /**
+     * @return Position.
+     */
+    public int position();
+
+    /**
+     * @param pos Position.
+     */
+    public void position(int pos);
+
+    /**
+     * @return Underlying array.
+     */
+    public byte[] array();
+
+    /**
+     * @return Copy of data in the stream.
+     */
+    public byte[] arrayCopy();
+
+    /**
+     * @return Offheap pointer if stream is offheap based, otherwise {@code 0}.
+     */
+    public long offheapPointer();
+
+    /**
+     * @return {@code True} is stream is array based.
+     */
+    public boolean hasArray();
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableAbstractInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableAbstractInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableAbstractInputStream.java
deleted file mode 100644
index 9d36b47..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableAbstractInputStream.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * 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.binary.streams;
-
-import org.apache.ignite.binary.BinaryObjectException;
-
-/**
- * Portable abstract input stream.
- */
-public abstract class PortableAbstractInputStream extends PortableAbstractStream
-    implements PortableInputStream {
-    /** Length of data inside array. */
-    protected int len;
-
-    /** {@inheritDoc} */
-    @Override public byte readByte() {
-        ensureEnoughData(1);
-
-        return readByteAndShift();
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] readByteArray(int cnt) {
-        ensureEnoughData(cnt);
-
-        byte[] res = new byte[cnt];
-
-        copyAndShift(res, BYTE_ARR_OFF, cnt);
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean readBoolean() {
-        return readByte() == BYTE_ONE;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean[] readBooleanArray(int cnt) {
-        ensureEnoughData(cnt);
-
-        boolean[] res = new boolean[cnt];
-
-        copyAndShift(res, BOOLEAN_ARR_OFF, cnt);
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public short readShort() {
-        ensureEnoughData(2);
-
-        short res = readShortFast();
-
-        shift(2);
-
-        if (!LITTLE_ENDIAN)
-            res = Short.reverseBytes(res);
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public short[] readShortArray(int cnt) {
-        int len = cnt << 1;
-
-        ensureEnoughData(len);
-
-        short[] res = new short[cnt];
-
-        copyAndShift(res, SHORT_ARR_OFF, len);
-
-        if (!LITTLE_ENDIAN) {
-            for (int i = 0; i < res.length; i++)
-                res[i] = Short.reverseBytes(res[i]);
-        }
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public char readChar() {
-        ensureEnoughData(2);
-
-        char res = readCharFast();
-
-        shift(2);
-
-        if (!LITTLE_ENDIAN)
-            res = Character.reverseBytes(res);
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public char[] readCharArray(int cnt) {
-        int len = cnt << 1;
-
-        ensureEnoughData(len);
-
-        char[] res = new char[cnt];
-
-        copyAndShift(res, CHAR_ARR_OFF, len);
-
-        if (!LITTLE_ENDIAN) {
-            for (int i = 0; i < res.length; i++)
-                res[i] = Character.reverseBytes(res[i]);
-        }
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int readInt() {
-        ensureEnoughData(4);
-
-        int res = readIntFast();
-
-        shift(4);
-
-        if (!LITTLE_ENDIAN)
-            res = Integer.reverseBytes(res);
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int[] readIntArray(int cnt) {
-        int len = cnt << 2;
-
-        ensureEnoughData(len);
-
-        int[] res = new int[cnt];
-
-        copyAndShift(res, INT_ARR_OFF, len);
-
-        if (!LITTLE_ENDIAN) {
-            for (int i = 0; i < res.length; i++)
-                res[i] = Integer.reverseBytes(res[i]);
-        }
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte readBytePositioned(int pos) {
-        int delta = pos + 1 - this.pos;
-
-        if (delta > 0)
-            ensureEnoughData(delta);
-
-        return readBytePositioned0(pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public short readShortPositioned(int pos) {
-        int delta = pos + 2 - this.pos;
-
-        if (delta > 0)
-            ensureEnoughData(delta);
-
-        return readShortPositioned0(pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public int readIntPositioned(int pos) {
-        int delta = pos + 4 - this.pos;
-
-        if (delta > 0)
-            ensureEnoughData(delta);
-
-        return readIntPositioned0(pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public float readFloat() {
-        return Float.intBitsToFloat(readInt());
-    }
-
-    /** {@inheritDoc} */
-    @Override public float[] readFloatArray(int cnt) {
-        int len = cnt << 2;
-
-        ensureEnoughData(len);
-
-        float[] res = new float[cnt];
-
-        if (LITTLE_ENDIAN)
-            copyAndShift(res, FLOAT_ARR_OFF, len);
-        else {
-            for (int i = 0; i < res.length; i++) {
-                int x = readIntFast();
-
-                shift(4);
-
-                res[i] = Float.intBitsToFloat(Integer.reverseBytes(x));
-            }
-        }
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long readLong() {
-        ensureEnoughData(8);
-
-        long res = readLongFast();
-
-        shift(8);
-
-        if (!LITTLE_ENDIAN)
-            res = Long.reverseBytes(res);
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long[] readLongArray(int cnt) {
-        int len = cnt << 3;
-
-        ensureEnoughData(len);
-
-        long[] res = new long[cnt];
-
-        copyAndShift(res, LONG_ARR_OFF, len);
-
-        if (!LITTLE_ENDIAN) {
-            for (int i = 0; i < res.length; i++)
-                res[i] = Long.reverseBytes(res[i]);
-        }
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public double readDouble() {
-        return Double.longBitsToDouble(readLong());
-    }
-
-    /** {@inheritDoc} */
-    @Override public double[] readDoubleArray(int cnt) {
-        int len = cnt << 3;
-
-        ensureEnoughData(len);
-
-        double[] res = new double[cnt];
-
-        if (LITTLE_ENDIAN)
-            copyAndShift(res, DOUBLE_ARR_OFF, len);
-        else {
-            for (int i = 0; i < res.length; i++) {
-                long x = readLongFast();
-
-                shift(8);
-
-                res[i] = Double.longBitsToDouble(Long.reverseBytes(x));
-            }
-        }
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int read(byte[] arr, int off, int len) {
-        if (len > remaining())
-            len = remaining();
-
-        copyAndShift(arr, BYTE_ARR_OFF + off, len);
-
-        return len;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void position(int pos) {
-        if (remaining() + this.pos < pos)
-            throw new BinaryObjectException("Position is out of bounds: " + pos);
-        else
-            this.pos = pos;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long offheapPointer() {
-        return 0;
-    }
-
-    /**
-     * Ensure that there is enough data.
-     *
-     * @param cnt Length.
-     */
-    protected void ensureEnoughData(int cnt) {
-        if (remaining() < cnt)
-            throw new BinaryObjectException("Not enough data to read the value [position=" + pos +
-                ", requiredBytes=" + cnt + ", remainingBytes=" + remaining() + ']');
-    }
-
-    /**
-     * Read next byte from the stream and perform shift.
-     *
-     * @return Next byte.
-     */
-    protected abstract byte readByteAndShift();
-
-    /**
-     * Copy data to target object shift position afterwards.
-     *
-     * @param target Target.
-     * @param off Offset.
-     * @param len Length.
-     */
-    protected abstract void copyAndShift(Object target, long off, int len);
-
-    /**
-     * Read short value (fast path).
-     *
-     * @return Short value.
-     */
-    protected abstract short readShortFast();
-
-    /**
-     * Read char value (fast path).
-     *
-     * @return Char value.
-     */
-    protected abstract char readCharFast();
-
-    /**
-     * Read int value (fast path).
-     *
-     * @return Int value.
-     */
-    protected abstract int readIntFast();
-
-    /**
-     * Read long value (fast path).
-     *
-     * @return Long value.
-     */
-    protected abstract long readLongFast();
-
-    /**
-     * Internal routine for positioned byte value read.
-     *
-     * @param pos Position.
-     * @return Int value.
-     */
-    protected abstract byte readBytePositioned0(int pos);
-
-    /**
-     * Internal routine for positioned short value read.
-     *
-     * @param pos Position.
-     * @return Int value.
-     */
-    protected abstract short readShortPositioned0(int pos);
-
-    /**
-     * Internal routine for positioned int value read.
-     *
-     * @param pos Position.
-     * @return Int value.
-     */
-    protected abstract int readIntPositioned0(int pos);
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableAbstractOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableAbstractOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableAbstractOutputStream.java
deleted file mode 100644
index 85064c5..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableAbstractOutputStream.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * 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.binary.streams;
-
-/**
- * Base portable output stream.
- */
-public abstract class PortableAbstractOutputStream extends PortableAbstractStream
-    implements PortableOutputStream {
-    /** Minimal capacity when it is reasonable to start doubling resize. */
-    private static final int MIN_CAP = 256;
-
-    /** {@inheritDoc} */
-    @Override public void writeByte(byte val) {
-        ensureCapacity(pos + 1);
-
-        writeByteAndShift(val);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeByteArray(byte[] val) {
-        ensureCapacity(pos + val.length);
-
-        copyAndShift(val, BYTE_ARR_OFF, val.length);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeBoolean(boolean val) {
-        writeByte(val ? BYTE_ONE : BYTE_ZERO);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeBooleanArray(boolean[] val) {
-        ensureCapacity(pos + val.length);
-
-        copyAndShift(val, BOOLEAN_ARR_OFF, val.length);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeShort(short val) {
-        ensureCapacity(pos + 2);
-
-        if (!LITTLE_ENDIAN)
-            val = Short.reverseBytes(val);
-
-        writeShortFast(val);
-
-        shift(2);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeShortArray(short[] val) {
-        int cnt = val.length << 1;
-
-        ensureCapacity(pos + cnt);
-
-        if (LITTLE_ENDIAN)
-            copyAndShift(val, SHORT_ARR_OFF, cnt);
-        else {
-            for (short item : val)
-                writeShortFast(Short.reverseBytes(item));
-
-            shift(cnt);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeChar(char val) {
-        ensureCapacity(pos + 2);
-
-        if (!LITTLE_ENDIAN)
-            val = Character.reverseBytes(val);
-
-        writeCharFast(val);
-
-        shift(2);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeCharArray(char[] val) {
-        int cnt = val.length << 1;
-
-        ensureCapacity(pos + cnt);
-
-        if (LITTLE_ENDIAN)
-            copyAndShift(val, CHAR_ARR_OFF, cnt);
-        else {
-            for (char item : val)
-                writeCharFast(Character.reverseBytes(item));
-
-            shift(cnt);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeInt(int val) {
-        ensureCapacity(pos + 4);
-
-        if (!LITTLE_ENDIAN)
-            val = Integer.reverseBytes(val);
-
-        writeIntFast(val);
-
-        shift(4);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeShort(int pos, short val) {
-        ensureCapacity(pos + 2);
-
-        unsafeWriteShort(pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeInt(int pos, int val) {
-        ensureCapacity(pos + 4);
-
-        unsafeWriteInt(pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeIntArray(int[] val) {
-        int cnt = val.length << 2;
-
-        ensureCapacity(pos + cnt);
-
-        if (LITTLE_ENDIAN)
-            copyAndShift(val, INT_ARR_OFF, cnt);
-        else {
-            for (int item : val)
-                writeIntFast(Integer.reverseBytes(item));
-
-            shift(cnt);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeFloat(float val) {
-        writeInt(Float.floatToIntBits(val));
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeFloatArray(float[] val) {
-        int cnt = val.length << 2;
-
-        ensureCapacity(pos + cnt);
-
-        if (LITTLE_ENDIAN)
-            copyAndShift(val, FLOAT_ARR_OFF, cnt);
-        else {
-            for (float item : val) {
-                writeIntFast(Integer.reverseBytes(Float.floatToIntBits(item)));
-
-                shift(4);
-            }
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeLong(long val) {
-        ensureCapacity(pos + 8);
-
-        if (!LITTLE_ENDIAN)
-            val = Long.reverseBytes(val);
-
-        writeLongFast(val);
-
-        shift(8);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeLongArray(long[] val) {
-        int cnt = val.length << 3;
-
-        ensureCapacity(pos + cnt);
-
-        if (LITTLE_ENDIAN)
-            copyAndShift(val, LONG_ARR_OFF, cnt);
-        else {
-            for (long item : val)
-                writeLongFast(Long.reverseBytes(item));
-
-            shift(cnt);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeDouble(double val) {
-        writeLong(Double.doubleToLongBits(val));
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeDoubleArray(double[] val) {
-        int cnt = val.length << 3;
-
-        ensureCapacity(pos + cnt);
-
-        if (LITTLE_ENDIAN)
-            copyAndShift(val, DOUBLE_ARR_OFF, cnt);
-        else {
-            for (double item : val) {
-                writeLongFast(Long.reverseBytes(Double.doubleToLongBits(item)));
-
-                shift(8);
-            }
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public void write(byte[] arr, int off, int len) {
-        ensureCapacity(pos + len);
-
-        copyAndShift(arr, BYTE_ARR_OFF + off, len);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void write(long addr, int cnt) {
-        ensureCapacity(pos + cnt);
-
-        copyAndShift(null, addr, cnt);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void position(int pos) {
-        ensureCapacity(pos);
-
-        unsafePosition(pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public long offheapPointer() {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeEnsure(int cap) {
-        ensureCapacity(pos + cap);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafePosition(int pos) {
-        this.pos = pos;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteBoolean(boolean val) {
-        unsafeWriteByte(val ? BYTE_ONE : BYTE_ZERO);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteFloat(float val) {
-        unsafeWriteInt(Float.floatToIntBits(val));
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteDouble(double val) {
-        unsafeWriteLong(Double.doubleToLongBits(val));
-    }
-
-    /**
-     * Calculate new capacity.
-     *
-     * @param curCap Current capacity.
-     * @param reqCap Required capacity.
-     * @return New capacity.
-     */
-    protected static int capacity(int curCap, int reqCap) {
-        int newCap;
-
-        if (reqCap < MIN_CAP)
-            newCap = MIN_CAP;
-        else {
-            newCap = curCap << 1;
-
-            if (newCap < reqCap)
-                newCap = reqCap;
-        }
-
-        return newCap;
-    }
-
-    /**
-     * Write next byte to the stream.
-     *
-     * @param val Value.
-     */
-    protected abstract void writeByteAndShift(byte val);
-
-    /**
-     * Copy source object to the stream shift position afterwards.
-     *
-     * @param src Source.
-     * @param off Offset.
-     * @param len Length.
-     */
-    protected abstract void copyAndShift(Object src, long off, int len);
-
-    /**
-     * Write short value (fast path).
-     *
-     * @param val Short value.
-     */
-    protected abstract void writeShortFast(short val);
-
-    /**
-     * Write char value (fast path).
-     *
-     * @param val Char value.
-     */
-    protected abstract void writeCharFast(char val);
-
-    /**
-     * Write int value (fast path).
-     *
-     * @param val Int value.
-     */
-    protected abstract void writeIntFast(int val);
-
-    /**
-     * Write long value (fast path).
-     *
-     * @param val Long value.
-     */
-    protected abstract void writeLongFast(long val);
-
-    /**
-     * Ensure capacity.
-     *
-     * @param cnt Required byte count.
-     */
-    protected abstract void ensureCapacity(int cnt);
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableAbstractStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableAbstractStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableAbstractStream.java
deleted file mode 100644
index fcc32cb..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableAbstractStream.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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.binary.streams;
-
-import java.nio.ByteOrder;
-import org.apache.ignite.internal.util.GridUnsafe;
-import sun.misc.Unsafe;
-
-/**
- * Portable abstract stream.
- */
-public abstract class PortableAbstractStream implements PortableStream {
-    /** Byte: zero. */
-    protected static final byte BYTE_ZERO = 0;
-
-    /** Byte: one. */
-    protected static final byte BYTE_ONE = 1;
-
-    /** Whether little endian is used on the platform. */
-    protected static final boolean LITTLE_ENDIAN = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN;
-
-    /** Unsafe instance. */
-    protected static final Unsafe UNSAFE = GridUnsafe.unsafe();
-
-    /** Array offset: boolean. */
-    protected static final long BOOLEAN_ARR_OFF = UNSAFE.arrayBaseOffset(boolean[].class);
-
-    /** Array offset: byte. */
-    protected static final long BYTE_ARR_OFF = UNSAFE.arrayBaseOffset(byte[].class);
-
-    /** Array offset: short. */
-    protected static final long SHORT_ARR_OFF = UNSAFE.arrayBaseOffset(short[].class);
-
-    /** Array offset: char. */
-    protected static final long CHAR_ARR_OFF = UNSAFE.arrayBaseOffset(char[].class);
-
-    /** Array offset: int. */
-    protected static final long INT_ARR_OFF = UNSAFE.arrayBaseOffset(int[].class);
-
-    /** Array offset: float. */
-    protected static final long FLOAT_ARR_OFF = UNSAFE.arrayBaseOffset(float[].class);
-
-    /** Array offset: long. */
-    protected static final long LONG_ARR_OFF = UNSAFE.arrayBaseOffset(long[].class);
-
-    /** Array offset: double. */
-    protected static final long DOUBLE_ARR_OFF = UNSAFE.arrayBaseOffset(double[].class);
-
-    /** Position. */
-    protected int pos;
-
-    /** {@inheritDoc} */
-    @Override public int position() {
-        return pos;
-    }
-
-    /**
-     * Shift position.
-     *
-     * @param cnt Byte count.
-     */
-    protected void shift(int cnt) {
-        pos += cnt;
-    }
-}


[37/50] [abbrv] ignite git commit: Merge remote-tracking branch 'origin/ignite-1.5' into ignite-1.5

Posted by vo...@apache.org.
Merge remote-tracking branch 'origin/ignite-1.5' into ignite-1.5


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

Branch: refs/heads/ignite-2100
Commit: ec2a64714c176f3a5aca60a058686d3354dc6a76
Parents: acb57c5 3db1448
Author: sboikov <sb...@gridgain.com>
Authored: Mon Dec 14 10:41:18 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Dec 14 10:41:18 2015 +0300

----------------------------------------------------------------------
 .../ignite/internal/binary/BinaryUtils.java      | 19 ++++++++++++-------
 .../binary/BinaryObjectBuilderSelfTest.java      | 10 +++++++++-
 .../binary/GridBinaryWildcardsSelfTest.java      | 16 ++++++++--------
 3 files changed, 29 insertions(+), 16 deletions(-)
----------------------------------------------------------------------



[20/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary" (in tests)

Posted by vo...@apache.org.
ignite-2065: rename "portable" classes to "binary" (in tests)


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

Branch: refs/heads/ignite-2100
Commit: 469bf6d62f4ce6088ca99a2cb6823523958c3470
Parents: 71ad9ce
Author: ashutak <as...@gridgain.com>
Authored: Fri Dec 11 18:08:18 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Fri Dec 11 18:08:18 2015 +0300

----------------------------------------------------------------------
 .../BinaryObjectBuilderAdditionalSelfTest.java  | 258 +++++-----
 .../binary/BinaryObjectBuilderSelfTest.java     |  46 +-
 .../binary/GridBinaryMetaDataSelfTest.java      | 371 ++++++++++++++
 .../binary/GridBinaryWildcardsSelfTest.java     | 464 ++++++++++++++++++
 .../binary/GridPortableMetaDataSelfTest.java    | 371 --------------
 .../binary/GridPortableWildcardsSelfTest.java   | 464 ------------------
 .../mutabletest/GridBinaryTestClasses.java      | 484 +++++++++++++++++++
 .../mutabletest/GridPortableTestClasses.java    | 484 -------------------
 .../binary/test/GridBinaryTestClass1.java       |  28 ++
 .../binary/test/GridBinaryTestClass2.java       |  24 +
 .../binary/test/GridPortableTestClass1.java     |  28 --
 .../binary/test/GridPortableTestClass2.java     |  24 -
 .../test/subpackage/GridBinaryTestClass3.java   |  24 +
 .../test/subpackage/GridPortableTestClass3.java |  24 -
 .../GridCacheBinaryStoreBinariesSelfTest.java   |  66 +++
 .../GridCacheBinaryStorePortablesSelfTest.java  |  66 ---
 ...sNearPartitionedByteArrayValuesSelfTest.java |  41 ++
 ...sNearPartitionedByteArrayValuesSelfTest.java |  41 --
 .../IgniteBinaryCacheFullApiTestSuite.java      |  37 ++
 .../testsuites/IgniteBinaryCacheTestSuite.java  | 101 ++++
 .../IgniteBinaryObjectsTestSuite.java           | 114 +++++
 .../IgnitePortableCacheFullApiTestSuite.java    |  37 --
 .../IgnitePortableCacheTestSuite.java           | 101 ----
 .../IgnitePortableObjectsTestSuite.java         | 114 -----
 .../IgniteBinaryCacheQueryTestSuite.java        | 119 +++++
 .../IgnitePortableCacheQueryTestSuite.java      | 119 -----
 26 files changed, 2025 insertions(+), 2025 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
index bf329a5..a1f980c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
@@ -30,7 +30,7 @@ import org.apache.ignite.binary.BinaryType;
 import org.apache.ignite.configuration.BinaryConfiguration;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.binary.mutabletest.GridPortableTestClasses;
+import org.apache.ignite.internal.binary.mutabletest.GridBinaryTestClasses;
 import org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl;
 import org.apache.ignite.internal.binary.builder.BinaryBuilderEnum;
 import org.apache.ignite.internal.binary.mutabletest.GridBinaryMarshalerAwareTestClass;
@@ -116,13 +116,13 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      * @throws Exception If failed.
      */
     public void testSimpleTypeFieldRead() throws Exception {
-        GridPortableTestClasses.TestObjectAllTypes exp = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes exp = new GridBinaryTestClasses.TestObjectAllTypes();
 
         exp.setDefaultData();
 
         BinaryObjectBuilder mutPo = wrap(exp);
 
-        for (Field field : GridPortableTestClasses.TestObjectAllTypes.class.getDeclaredFields()) {
+        for (Field field : GridBinaryTestClasses.TestObjectAllTypes.class.getDeclaredFields()) {
             Object expVal = field.get(exp);
             Object actVal = mutPo.getField(field.getName());
 
@@ -150,13 +150,13 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testSimpleTypeFieldSerialize() {
-        GridPortableTestClasses.TestObjectAllTypes exp = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes exp = new GridBinaryTestClasses.TestObjectAllTypes();
 
         exp.setDefaultData();
 
         BinaryObjectBuilderImpl mutPo = wrap(exp);
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutPo.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutPo.build().deserialize();
 
         GridTestUtils.deepEquals(exp, res);
     }
@@ -165,16 +165,16 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      * @throws Exception If any error occurs.
      */
     public void testSimpleTypeFieldOverride() throws Exception {
-        GridPortableTestClasses.TestObjectAllTypes exp = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes exp = new GridBinaryTestClasses.TestObjectAllTypes();
 
         exp.setDefaultData();
 
-        BinaryObjectBuilderImpl mutPo = wrap(new GridPortableTestClasses.TestObjectAllTypes());
+        BinaryObjectBuilderImpl mutPo = wrap(new GridBinaryTestClasses.TestObjectAllTypes());
 
-        for (Field field : GridPortableTestClasses.TestObjectAllTypes.class.getDeclaredFields())
+        for (Field field : GridBinaryTestClasses.TestObjectAllTypes.class.getDeclaredFields())
             mutPo.setField(field.getName(), field.get(exp));
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutPo.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutPo.build().deserialize();
 
         GridTestUtils.deepEquals(exp, res);
     }
@@ -183,20 +183,20 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      * @throws Exception If any error occurs.
      */
     public void testSimpleTypeFieldSetNull() throws Exception {
-        GridPortableTestClasses.TestObjectAllTypes exp = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes exp = new GridBinaryTestClasses.TestObjectAllTypes();
 
         exp.setDefaultData();
 
         BinaryObjectBuilderImpl mutPo = wrap(exp);
 
-        for (Field field : GridPortableTestClasses.TestObjectAllTypes.class.getDeclaredFields()) {
+        for (Field field : GridBinaryTestClasses.TestObjectAllTypes.class.getDeclaredFields()) {
             if (!field.getType().isPrimitive())
                 mutPo.setField(field.getName(), null);
         }
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutPo.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutPo.build().deserialize();
 
-        for (Field field : GridPortableTestClasses.TestObjectAllTypes.class.getDeclaredFields()) {
+        for (Field field : GridBinaryTestClasses.TestObjectAllTypes.class.getDeclaredFields()) {
             if (!field.getType().isPrimitive())
                 assertNull(field.getName(), field.get(res));
         }
@@ -206,8 +206,8 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      * @throws IgniteCheckedException If any error occurs.
      */
     public void testMakeCyclicDependency() throws IgniteCheckedException {
-        GridPortableTestClasses.TestObjectOuter outer = new GridPortableTestClasses.TestObjectOuter();
-        outer.inner = new GridPortableTestClasses.TestObjectInner();
+        GridBinaryTestClasses.TestObjectOuter outer = new GridBinaryTestClasses.TestObjectOuter();
+        outer.inner = new GridBinaryTestClasses.TestObjectInner();
 
         BinaryObjectBuilderImpl mutOuter = wrap(outer);
 
@@ -216,7 +216,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         mutInner.setField("outer", mutOuter);
         mutInner.setField("foo", mutInner);
 
-        GridPortableTestClasses.TestObjectOuter res = mutOuter.build().deserialize();
+        GridBinaryTestClasses.TestObjectOuter res = mutOuter.build().deserialize();
 
         assertEquals(res, res.inner.outer);
         assertEquals(res.inner, res.inner.foo);
@@ -226,7 +226,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testDateArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
         obj.dateArr =  new Date[] {new Date(11111), new Date(11111), new Date(11111)};
 
@@ -235,7 +235,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         Date[] arr = mutObj.getField("dateArr");
         arr[0] = new Date(22222);
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 
         Assert.assertArrayEquals(new Date[] {new Date(22222), new Date(11111), new Date(11111)}, res.dateArr);
     }
@@ -244,7 +244,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testTimestampArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
         obj.tsArr = new Timestamp[] {new Timestamp(111222333), new Timestamp(222333444)};
 
@@ -253,7 +253,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         Timestamp[] arr = mutObj.getField("tsArr");
         arr[0] = new Timestamp(333444555);
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 
         Assert.assertArrayEquals(new Timestamp[] {new Timestamp(333444555), new Timestamp(222333444)}, res.tsArr);
     }
@@ -262,7 +262,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testUUIDArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
         obj.uuidArr = new UUID[] {new UUID(1, 1), new UUID(1, 1), new UUID(1, 1)};
 
@@ -271,7 +271,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         UUID[] arr = mutObj.getField("uuidArr");
         arr[0] = new UUID(2, 2);
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 
         Assert.assertArrayEquals(new UUID[] {new UUID(2, 2), new UUID(1, 1), new UUID(1, 1)}, res.uuidArr);
     }
@@ -280,7 +280,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testDecimalArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
         obj.bdArr = new BigDecimal[] {new BigDecimal(1000), new BigDecimal(1000), new BigDecimal(1000)};
 
@@ -289,7 +289,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         BigDecimal[] arr = mutObj.getField("bdArr");
         arr[0] = new BigDecimal(2000);
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 
         Assert.assertArrayEquals(new BigDecimal[] {new BigDecimal(1000), new BigDecimal(1000), new BigDecimal(1000)},
             res.bdArr);
@@ -299,7 +299,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testBooleanArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
         obj.zArr = new boolean[] {false, false, false};
 
@@ -308,7 +308,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         boolean[] arr = mutObj.getField("zArr");
         arr[0] = true;
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 
         boolean[] expected = new boolean[] {true, false, false};
 
@@ -322,7 +322,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testCharArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
         obj.cArr = new char[] {'a', 'a', 'a'};
 
@@ -331,7 +331,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         char[] arr = mutObj.getField("cArr");
         arr[0] = 'b';
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 
         Assert.assertArrayEquals(new char[] {'b', 'a', 'a'}, res.cArr);
     }
@@ -340,7 +340,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testDoubleArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
         obj.dArr = new double[] {1.0, 1.0, 1.0};
 
@@ -349,7 +349,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         double[] arr = mutObj.getField("dArr");
         arr[0] = 2.0;
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 
         Assert.assertArrayEquals(new double[] {2.0, 1.0, 1.0}, res.dArr, 0);
     }
@@ -358,7 +358,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testFloatArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
         obj.fArr = new float[] {1.0f, 1.0f, 1.0f};
 
@@ -369,7 +369,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         BinaryObject resBinary = mutObj.build();
 
-        GridPortableTestClasses.TestObjectAllTypes res = resBinary.deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = resBinary.deserialize();
 
         Assert.assertArrayEquals(new float[] {2.0f, 1.0f, 1.0f}, res.fArr, 0);
     }
@@ -378,7 +378,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testLongArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
         obj.lArr = new long[] {1, 1, 1};
 
@@ -387,7 +387,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         long[] arr = mutObj.getField("lArr");
         arr[0] = 2;
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 
         Assert.assertArrayEquals(new long[] {2, 1, 1}, res.lArr);
     }
@@ -396,7 +396,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testIntArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
         obj.iArr = new int[] {1, 1, 1};
 
@@ -405,7 +405,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         int[] arr = mutObj.getField("iArr");
         arr[0] = 2;
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 
         Assert.assertArrayEquals(new int[] {2, 1, 1}, res.iArr);
     }
@@ -414,7 +414,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testShortArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
         obj.sArr = new short[] {1, 1, 1};
 
@@ -423,7 +423,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         short[] arr = mutObj.getField("sArr");
         arr[0] = 2;
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 
         Assert.assertArrayEquals(new short[] {2, 1, 1}, res.sArr);
     }
@@ -432,7 +432,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testByteArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
         obj.bArr = new byte[] {1, 1, 1};
 
@@ -441,7 +441,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         byte[] arr = mutObj.getField("bArr");
         arr[0] = 2;
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 
         Assert.assertArrayEquals(new byte[] {2, 1, 1}, res.bArr);
     }
@@ -450,7 +450,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testStringArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
         obj.strArr = new String[] {"a", "a", "a"};
 
@@ -459,7 +459,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         String[] arr = mutObj.getField("strArr");
         arr[0] = "b";
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 
         Assert.assertArrayEquals(new String[] {"b", "a", "a"}, res.strArr);
     }
@@ -468,7 +468,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testModifyObjectArray() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
         obj.foo = new Object[] {"a"};
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
@@ -479,7 +479,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         arr[0] = "b";
 
-        GridPortableTestClasses.TestObjectContainer res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
         Assert.assertArrayEquals(new Object[] {"b"}, (Object[])res.foo);
     }
@@ -488,13 +488,13 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testOverrideObjectArrayField() {
-        BinaryObjectBuilderImpl mutObj = wrap(new GridPortableTestClasses.TestObjectContainer());
+        BinaryObjectBuilderImpl mutObj = wrap(new GridBinaryTestClasses.TestObjectContainer());
 
         Object[] createdArr = {mutObj, "a", 1, new String[] {"s", "s"}, new byte[] {1, 2}, new UUID(3, 0)};
 
         mutObj.setField("foo", createdArr.clone());
 
-        GridPortableTestClasses.TestObjectContainer res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
         createdArr[0] = res;
 
@@ -505,7 +505,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testDeepArray() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
         obj.foo = new Object[] {new Object[] {"a", obj}};
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
@@ -517,7 +517,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         arr[0] = mutObj;
 
-        GridPortableTestClasses.TestObjectContainer res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
         arr = (Object[])((Object[])res.foo)[0];
 
@@ -529,7 +529,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testArrayListRead() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
         obj.foo = Lists.newArrayList(obj, "a");
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
@@ -543,7 +543,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testArrayListOverride() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
 
@@ -551,7 +551,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         mutObj.setField("foo", list);
 
-        GridPortableTestClasses.TestObjectContainer res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
         list.set(0, res);
 
@@ -563,7 +563,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testArrayListModification() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
         obj.foo = Lists.newArrayList("a", "b", "c");
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
@@ -580,7 +580,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         assertEquals(1, list.indexOf("b"));
         assertEquals(1, list.lastIndexOf("b"));
 
-        GridPortableTestClasses.TestObjectContainer res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
         assertTrue(res.foo instanceof ArrayList);
         assertEquals(Arrays.asList("_", "b", "c", "!"), res.foo);
@@ -590,7 +590,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testArrayListClear() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
         obj.foo = Lists.newArrayList("a", "b", "c");
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
@@ -599,14 +599,14 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         list.clear();
 
-        TestCase.assertEquals(Collections.emptyList(), mutObj.build().<GridPortableTestClasses.TestObjectContainer>deserialize().foo);
+        TestCase.assertEquals(Collections.emptyList(), mutObj.build().<GridBinaryTestClasses.TestObjectContainer>deserialize().foo);
     }
 
     /**
      *
      */
     public void testArrayListWriteUnmodifiable() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         ArrayList<Object> src = Lists.newArrayList(obj, "a", "b", "c");
 
@@ -614,7 +614,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
 
-        GridPortableTestClasses.TestObjectContainer deserialized = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer deserialized = mutObj.build().deserialize();
 
         List<Object> res = (List<Object>)deserialized.foo;
 
@@ -627,7 +627,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testLinkedListRead() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
         obj.foo = Lists.newLinkedList(Arrays.asList(obj, "a"));
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
@@ -641,7 +641,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testLinkedListOverride() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
 
@@ -649,7 +649,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         mutObj.setField("foo", list);
 
-        GridPortableTestClasses.TestObjectContainer res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
         list.set(0, res);
 
@@ -661,7 +661,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testLinkedListModification() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         obj.foo = Lists.newLinkedList(Arrays.asList("a", "b", "c"));
 
@@ -679,7 +679,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         assertEquals(1, list.indexOf("b"));
         assertEquals(1, list.lastIndexOf("b"));
 
-        GridPortableTestClasses.TestObjectContainer res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
         assertTrue(res.foo instanceof LinkedList);
         assertEquals(Arrays.asList("_", "b", "c", "!"), res.foo);
@@ -689,7 +689,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testLinkedListWriteUnmodifiable() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         LinkedList<Object> src = Lists.newLinkedList(Arrays.asList(obj, "a", "b", "c"));
 
@@ -697,7 +697,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
 
-        GridPortableTestClasses.TestObjectContainer deserialized = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer deserialized = mutObj.build().deserialize();
 
         List<Object> res = (List<Object>)deserialized.foo;
 
@@ -710,7 +710,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testHashSetRead() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
         obj.foo = Sets.newHashSet(obj, "a");
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
@@ -724,7 +724,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testHashSetOverride() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
 
@@ -732,7 +732,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         mutObj.setField("foo", c);
 
-        GridPortableTestClasses.TestObjectContainer res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
         c.remove(mutObj);
         c.add(res);
@@ -745,7 +745,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testHashSetModification() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
         obj.foo = Sets.newHashSet("a", "b", "c");
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
@@ -759,7 +759,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         assertTrue(set.contains("a"));
         assertTrue(set.contains("!"));
 
-        GridPortableTestClasses.TestObjectContainer res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
         assertTrue(res.foo instanceof HashSet);
         assertEquals(Sets.newHashSet("a", "!", "c"), res.foo);
@@ -769,13 +769,13 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testHashSetWriteUnmodifiable() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         Set<Object> src = Sets.newHashSet(obj, "a", "b", "c");
 
         obj.foo = src;
 
-        GridPortableTestClasses.TestObjectContainer deserialized = wrap(obj).build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer deserialized = wrap(obj).build().deserialize();
 
         Set<Object> res = (Set<Object>)deserialized.foo;
 
@@ -789,7 +789,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testMapRead() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
         obj.foo = Maps.newHashMap(ImmutableMap.of(obj, "a", "b", obj));
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
@@ -803,7 +803,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testMapOverride() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
 
@@ -811,7 +811,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         mutObj.setField("foo", map);
 
-        GridPortableTestClasses.TestObjectContainer res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
         assertEquals(ImmutableMap.of(res, "a", "b", res), res.foo);
     }
@@ -820,7 +820,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testMapModification() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
         obj.foo = Maps.newHashMap(ImmutableMap.of(1, "a", 2, "b"));
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
@@ -832,7 +832,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         assertEquals("a", rmv);
 
-        GridPortableTestClasses.TestObjectContainer res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutObj.build().deserialize();
 
         assertEquals(ImmutableMap.of(2, "b", 3, res), res.foo);
     }
@@ -841,18 +841,18 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testEnumArrayModification() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
 
-        obj.enumArr = new GridPortableTestClasses.TestObjectEnum[] {GridPortableTestClasses.TestObjectEnum.A, GridPortableTestClasses.TestObjectEnum.B};
+        obj.enumArr = new GridBinaryTestClasses.TestObjectEnum[] {GridBinaryTestClasses.TestObjectEnum.A, GridBinaryTestClasses.TestObjectEnum.B};
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
 
         BinaryBuilderEnum[] arr = mutObj.getField("enumArr");
-        arr[0] = new BinaryBuilderEnum(mutObj.typeId(), GridPortableTestClasses.TestObjectEnum.B);
+        arr[0] = new BinaryBuilderEnum(mutObj.typeId(), GridBinaryTestClasses.TestObjectEnum.B);
 
-        GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 
-        Assert.assertArrayEquals(new GridPortableTestClasses.TestObjectEnum[] {GridPortableTestClasses.TestObjectEnum.A, GridPortableTestClasses.TestObjectEnum.B}, res.enumArr);
+        Assert.assertArrayEquals(new GridBinaryTestClasses.TestObjectEnum[] {GridBinaryTestClasses.TestObjectEnum.A, GridBinaryTestClasses.TestObjectEnum.B}, res.enumArr);
     }
 
     /**
@@ -877,7 +877,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testHashCode() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         BinaryObjectBuilderImpl mutableObj = wrap(obj);
 
@@ -892,7 +892,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testCollectionsInCollection() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
         obj.foo = Lists.newArrayList(
             Lists.newArrayList(1, 2),
             Lists.newLinkedList(Arrays.asList(1, 2)),
@@ -900,7 +900,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
             Sets.newLinkedHashSet(Arrays.asList("a", "b")),
             Maps.newHashMap(ImmutableMap.of(1, "a", 2, "b")));
 
-        GridPortableTestClasses.TestObjectContainer deserialized = wrap(obj).build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer deserialized = wrap(obj).build().deserialize();
 
         assertEquals(obj.foo, deserialized.foo);
     }
@@ -909,13 +909,13 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testMapEntryOverride() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         BinaryObjectBuilderImpl mutableObj = wrap(obj);
 
         mutableObj.setField("foo", new GridMapEntry<>(1, "a"));
 
-        GridPortableTestClasses.TestObjectContainer res = mutableObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutableObj.build().deserialize();
 
         assertEquals(new GridMapEntry<>(1, "a"), res.foo);
     }
@@ -924,14 +924,14 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testMetadataChangingDoublePut() {
-        BinaryObjectBuilderImpl mutableObj = wrap(new GridPortableTestClasses.TestObjectContainer());
+        BinaryObjectBuilderImpl mutableObj = wrap(new GridBinaryTestClasses.TestObjectContainer());
 
         mutableObj.setField("xx567", "a");
         mutableObj.setField("xx567", "b");
 
         mutableObj.build();
 
-        BinaryType metadata = portables().type(GridPortableTestClasses.TestObjectContainer.class);
+        BinaryType metadata = portables().type(GridBinaryTestClasses.TestObjectContainer.class);
 
         assertEquals("String", metadata.fieldTypeName("xx567"));
     }
@@ -940,14 +940,14 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testMetadataChangingDoublePut2() {
-        BinaryObjectBuilderImpl mutableObj = wrap(new GridPortableTestClasses.TestObjectContainer());
+        BinaryObjectBuilderImpl mutableObj = wrap(new GridBinaryTestClasses.TestObjectContainer());
 
         mutableObj.setField("xx567", "a");
         mutableObj.setField("xx567", "b");
 
         mutableObj.build();
 
-        BinaryType metadata = portables().type(GridPortableTestClasses.TestObjectContainer.class);
+        BinaryType metadata = portables().type(GridBinaryTestClasses.TestObjectContainer.class);
 
         assertEquals("String", metadata.fieldTypeName("xx567"));
     }
@@ -956,7 +956,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testMetadataChanging() {
-        GridPortableTestClasses.TestObjectContainer c = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer c = new GridBinaryTestClasses.TestObjectContainer();
 
         BinaryObjectBuilderImpl mutableObj = wrap(c);
 
@@ -966,8 +966,8 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
         mutableObj.setField("strField", "1");
         mutableObj.setField("colField", Lists.newArrayList("1"));
         mutableObj.setField("mapField", Maps.newHashMap(ImmutableMap.of(1, "1")));
-        mutableObj.setField("enumField", GridPortableTestClasses.TestObjectEnum.A);
-        mutableObj.setField("enumArrField", new Enum[] {GridPortableTestClasses.TestObjectEnum.A});
+        mutableObj.setField("enumField", GridBinaryTestClasses.TestObjectEnum.A);
+        mutableObj.setField("enumArrField", new Enum[] {GridBinaryTestClasses.TestObjectEnum.A});
 
         mutableObj.build();
 
@@ -990,7 +990,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testDateInObjectField() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         obj.foo = new Date();
 
@@ -1003,7 +1003,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testTimestampInObjectField() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         obj.foo = new Timestamp(100020003);
 
@@ -1016,7 +1016,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testDateInCollection() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         obj.foo = Lists.newArrayList(new Date());
 
@@ -1029,7 +1029,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testTimestampInCollection() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         obj.foo = Lists.newArrayList(new Timestamp(100020003));
 
@@ -1043,7 +1043,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      */
     @SuppressWarnings("AssertEqualsBetweenInconvertibleTypes")
     public void testDateArrayOverride() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         BinaryObjectBuilderImpl mutableObj = wrap(obj);
 
@@ -1051,7 +1051,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         mutableObj.setField("foo", arr);
 
-        GridPortableTestClasses.TestObjectContainer res = mutableObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutableObj.build().deserialize();
 
         assertEquals(Date[].class, res.foo.getClass());
         assertTrue(Objects.deepEquals(arr, res.foo));
@@ -1062,7 +1062,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      */
     @SuppressWarnings("AssertEqualsBetweenInconvertibleTypes")
     public void testTimestampArrayOverride() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         BinaryObjectBuilderImpl mutableObj = wrap(obj);
 
@@ -1070,7 +1070,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         mutableObj.setField("foo", arr);
 
-        GridPortableTestClasses.TestObjectContainer res = mutableObj.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = mutableObj.build().deserialize();
 
         assertEquals(Timestamp[].class, res.foo.getClass());
         assertTrue(Objects.deepEquals(arr, res.foo));
@@ -1080,19 +1080,19 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testChangeMap() {
-        GridPortableTestClasses.Addresses addrs = new GridPortableTestClasses.Addresses();
+        GridBinaryTestClasses.Addresses addrs = new GridBinaryTestClasses.Addresses();
 
-        addrs.addCompany(new GridPortableTestClasses.Company(1, "Google inc", 100,
-            new GridPortableTestClasses.Address("Saint-Petersburg", "Torzhkovskya", 1, 53), "occupation"));
+        addrs.addCompany(new GridBinaryTestClasses.Company(1, "Google inc", 100,
+            new GridBinaryTestClasses.Address("Saint-Petersburg", "Torzhkovskya", 1, 53), "occupation"));
 
-        addrs.addCompany(new GridPortableTestClasses.Company(2, "Apple inc", 100,
-            new GridPortableTestClasses.Address("Saint-Petersburg", "Torzhkovskya", 1, 54), "occupation"));
+        addrs.addCompany(new GridBinaryTestClasses.Company(2, "Apple inc", 100,
+            new GridBinaryTestClasses.Address("Saint-Petersburg", "Torzhkovskya", 1, 54), "occupation"));
 
-        addrs.addCompany(new GridPortableTestClasses.Company(3, "Microsoft", 100,
-            new GridPortableTestClasses.Address("Saint-Petersburg", "Torzhkovskya", 1, 55), "occupation"));
+        addrs.addCompany(new GridBinaryTestClasses.Company(3, "Microsoft", 100,
+            new GridBinaryTestClasses.Address("Saint-Petersburg", "Torzhkovskya", 1, 55), "occupation"));
 
-        addrs.addCompany(new GridPortableTestClasses.Company(4, "Oracle", 100,
-            new GridPortableTestClasses.Address("Saint-Petersburg", "Nevskiy", 1, 1), "occupation"));
+        addrs.addCompany(new GridBinaryTestClasses.Company(4, "Oracle", 100,
+            new GridBinaryTestClasses.Address("Saint-Petersburg", "Nevskiy", 1, 1), "occupation"));
 
         BinaryObjectBuilderImpl binaryAddres = wrap(addrs);
 
@@ -1108,11 +1108,11 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         binaryCompaniesList.remove(0);
 
-        GridPortableTestClasses.Addresses res = binaryAddres.build().deserialize();
+        GridBinaryTestClasses.Addresses res = binaryAddres.build().deserialize();
 
         assertEquals(Arrays.asList("Nevskiy", "Torzhkovskya"), new ArrayList<>(res.getCompanyByStreet().keySet()));
 
-        GridPortableTestClasses.Companies torzhkovskyaCompanies = res.getCompanyByStreet().get("Torzhkovskya");
+        GridBinaryTestClasses.Companies torzhkovskyaCompanies = res.getCompanyByStreet().get("Torzhkovskya");
 
         assertEquals(2, torzhkovskyaCompanies.size());
         assertEquals("Apple inc", torzhkovskyaCompanies.get(0).name);
@@ -1122,8 +1122,8 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testSavingObjectWithNotZeroStart() {
-        GridPortableTestClasses.TestObjectOuter out = new GridPortableTestClasses.TestObjectOuter();
-        GridPortableTestClasses.TestObjectInner inner = new GridPortableTestClasses.TestObjectInner();
+        GridBinaryTestClasses.TestObjectOuter out = new GridBinaryTestClasses.TestObjectOuter();
+        GridBinaryTestClasses.TestObjectInner inner = new GridBinaryTestClasses.TestObjectInner();
 
         out.inner = inner;
         inner.outer = out;
@@ -1132,7 +1132,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         BinaryObjectBuilderImpl innerBuilder = builder.getField("inner");
 
-        GridPortableTestClasses.TestObjectInner res = innerBuilder.build().deserialize();
+        GridBinaryTestClasses.TestObjectInner res = innerBuilder.build().deserialize();
 
         assertSame(res, res.outer.inner);
     }
@@ -1141,13 +1141,13 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testPortableObjectField() {
-        GridPortableTestClasses.TestObjectContainer container = new GridPortableTestClasses.TestObjectContainer(toPortable(new GridPortableTestClasses.TestObjectArrayList()));
+        GridBinaryTestClasses.TestObjectContainer container = new GridBinaryTestClasses.TestObjectContainer(toPortable(new GridBinaryTestClasses.TestObjectArrayList()));
 
         BinaryObjectBuilderImpl wrapper = wrap(container);
 
         assertTrue(wrapper.getField("foo") instanceof BinaryObject);
 
-        GridPortableTestClasses.TestObjectContainer deserialized = wrapper.build().deserialize();
+        GridBinaryTestClasses.TestObjectContainer deserialized = wrapper.build().deserialize();
         assertTrue(deserialized.foo instanceof BinaryObject);
     }
 
@@ -1155,48 +1155,48 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      *
      */
     public void testAssignPortableObject() {
-        GridPortableTestClasses.TestObjectContainer container = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer container = new GridBinaryTestClasses.TestObjectContainer();
 
         BinaryObjectBuilderImpl wrapper = wrap(container);
 
-        wrapper.setField("foo", toPortable(new GridPortableTestClasses.TestObjectArrayList()));
+        wrapper.setField("foo", toPortable(new GridBinaryTestClasses.TestObjectArrayList()));
 
-        GridPortableTestClasses.TestObjectContainer deserialized = wrapper.build().deserialize();
-        assertTrue(deserialized.foo instanceof GridPortableTestClasses.TestObjectArrayList);
+        GridBinaryTestClasses.TestObjectContainer deserialized = wrapper.build().deserialize();
+        assertTrue(deserialized.foo instanceof GridBinaryTestClasses.TestObjectArrayList);
     }
 
     /**
      *
      */
     public void testRemoveFromNewObject() {
-        BinaryObjectBuilderImpl wrapper = newWrapper(GridPortableTestClasses.TestObjectAllTypes.class);
+        BinaryObjectBuilderImpl wrapper = newWrapper(GridBinaryTestClasses.TestObjectAllTypes.class);
 
         wrapper.setField("str", "a");
 
         wrapper.removeField("str");
 
-        TestCase.assertNull(wrapper.build().<GridPortableTestClasses.TestObjectAllTypes>deserialize().str);
+        TestCase.assertNull(wrapper.build().<GridBinaryTestClasses.TestObjectAllTypes>deserialize().str);
     }
 
     /**
      *
      */
     public void testRemoveFromExistingObject() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
         obj.setDefaultData();
 
         BinaryObjectBuilderImpl wrapper = wrap(toPortable(obj));
 
         wrapper.removeField("str");
 
-        TestCase.assertNull(wrapper.build().<GridPortableTestClasses.TestObjectAllTypes>deserialize().str);
+        TestCase.assertNull(wrapper.build().<GridBinaryTestClasses.TestObjectAllTypes>deserialize().str);
     }
 
     /**
      *
      */
     public void testCyclicArrays() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         Object[] arr1 = new Object[1];
         Object[] arr2 = new Object[] {arr1};
@@ -1205,7 +1205,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         obj.foo = arr1;
 
-        GridPortableTestClasses.TestObjectContainer res = toPortable(obj).deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = toPortable(obj).deserialize();
 
         Object[] resArr = (Object[])res.foo;
 
@@ -1217,7 +1217,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
      */
     @SuppressWarnings("TypeMayBeWeakened")
     public void testCyclicArrayList() {
-        GridPortableTestClasses.TestObjectContainer obj = new GridPortableTestClasses.TestObjectContainer();
+        GridBinaryTestClasses.TestObjectContainer obj = new GridBinaryTestClasses.TestObjectContainer();
 
         List<Object> arr1 = new ArrayList<>();
         List<Object> arr2 = new ArrayList<>();
@@ -1227,7 +1227,7 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         obj.foo = arr1;
 
-        GridPortableTestClasses.TestObjectContainer res = toPortable(obj).deserialize();
+        GridBinaryTestClasses.TestObjectContainer res = toPortable(obj).deserialize();
 
         List<?> resArr = (List<?>)res.foo;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java
index d02347c..2a3fe53 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java
@@ -36,7 +36,7 @@ import org.apache.ignite.binary.BinaryType;
 import org.apache.ignite.binary.BinaryTypeConfiguration;
 import org.apache.ignite.configuration.BinaryConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.binary.mutabletest.GridPortableTestClasses;
+import org.apache.ignite.internal.binary.mutabletest.GridBinaryTestClasses;
 import org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl;
 import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
 import org.apache.ignite.internal.util.GridUnsafe;
@@ -111,11 +111,11 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
      *
      */
     public void testAllFieldsSerialization() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
         obj.setDefaultData();
         obj.enumArr = null;
 
-        GridPortableTestClasses.TestObjectAllTypes deserialized = builder(toPortable(obj)).build().deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes deserialized = builder(toPortable(obj)).build().deserialize();
 
         GridTestUtils.deepEquals(obj, deserialized);
     }
@@ -868,7 +868,7 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
      *
      */
     public void testGetFromCopiedObj() {
-        BinaryObject objStr = builder(GridPortableTestClasses.TestObjectAllTypes.class.getName()).setField("str", "aaa").build();
+        BinaryObject objStr = builder(GridBinaryTestClasses.TestObjectAllTypes.class.getName()).setField("str", "aaa").build();
 
         BinaryObjectBuilderImpl builder = builder(objStr);
         assertEquals("aaa", builder.getField("str"));
@@ -877,7 +877,7 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
         assertEquals("bbb", builder.getField("str"));
 
         assertNull(builder.getField("i_"));
-        TestCase.assertEquals("bbb", builder.build().<GridPortableTestClasses.TestObjectAllTypes>deserialize().str);
+        TestCase.assertEquals("bbb", builder.build().<GridBinaryTestClasses.TestObjectAllTypes>deserialize().str);
     }
 
     /**
@@ -886,46 +886,46 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
     @SuppressWarnings("unchecked")
     public void testCopyFromInnerObjects() {
         ArrayList<Object> list = new ArrayList<>();
-        list.add(new GridPortableTestClasses.TestObjectAllTypes());
+        list.add(new GridBinaryTestClasses.TestObjectAllTypes());
         list.add(list.get(0));
 
-        GridPortableTestClasses.TestObjectContainer c = new GridPortableTestClasses.TestObjectContainer(list);
+        GridBinaryTestClasses.TestObjectContainer c = new GridBinaryTestClasses.TestObjectContainer(list);
 
         BinaryObjectBuilderImpl builder = builder(toPortable(c));
         builder.<List>getField("foo").add("!!!");
 
         BinaryObject res = builder.build();
 
-        GridPortableTestClasses.TestObjectContainer deserialized = res.deserialize();
+        GridBinaryTestClasses.TestObjectContainer deserialized = res.deserialize();
 
         List deserializedList = (List)deserialized.foo;
 
         assertSame(deserializedList.get(0), deserializedList.get(1));
         assertEquals("!!!", deserializedList.get(2));
-        assertTrue(deserializedList.get(0) instanceof GridPortableTestClasses.TestObjectAllTypes);
+        assertTrue(deserializedList.get(0) instanceof GridBinaryTestClasses.TestObjectAllTypes);
     }
 
     /**
      *
      */
     public void testSetPortableObject() {
-        BinaryObject portableObj = builder(GridPortableTestClasses.TestObjectContainer.class.getName())
-            .setField("foo", toPortable(new GridPortableTestClasses.TestObjectAllTypes()))
+        BinaryObject portableObj = builder(GridBinaryTestClasses.TestObjectContainer.class.getName())
+            .setField("foo", toPortable(new GridBinaryTestClasses.TestObjectAllTypes()))
             .build();
 
-        assertTrue(portableObj.<GridPortableTestClasses.TestObjectContainer>deserialize().foo instanceof GridPortableTestClasses.TestObjectAllTypes);
+        assertTrue(portableObj.<GridBinaryTestClasses.TestObjectContainer>deserialize().foo instanceof GridBinaryTestClasses.TestObjectAllTypes);
     }
 
     /**
      *
      */
     public void testPlainPortableObjectCopyFrom() {
-        GridPortableTestClasses.TestObjectPlainPortable obj = new GridPortableTestClasses.TestObjectPlainPortable(toPortable(new GridPortableTestClasses.TestObjectAllTypes()));
+        GridBinaryTestClasses.TestObjectPlainPortable obj = new GridBinaryTestClasses.TestObjectPlainPortable(toPortable(new GridBinaryTestClasses.TestObjectAllTypes()));
 
         BinaryObjectBuilderImpl builder = builder(toPortable(obj));
         assertTrue(builder.getField("plainPortable") instanceof BinaryObject);
 
-        GridPortableTestClasses.TestObjectPlainPortable deserialized = builder.build().deserialize();
+        GridBinaryTestClasses.TestObjectPlainPortable deserialized = builder.build().deserialize();
         assertTrue(deserialized.plainPortable != null);
     }
 
@@ -933,20 +933,20 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
      *
      */
     public void testRemoveFromNewObject() {
-        BinaryObjectBuilder builder = builder(GridPortableTestClasses.TestObjectAllTypes.class.getName());
+        BinaryObjectBuilder builder = builder(GridBinaryTestClasses.TestObjectAllTypes.class.getName());
 
         builder.setField("str", "a");
 
         builder.removeField("str");
 
-        TestCase.assertNull(builder.build().<GridPortableTestClasses.TestObjectAllTypes>deserialize().str);
+        TestCase.assertNull(builder.build().<GridBinaryTestClasses.TestObjectAllTypes>deserialize().str);
     }
 
     /**
      *
      */
     public void testRemoveFromExistingObject() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
         obj.setDefaultData();
         obj.enumArr = null;
 
@@ -956,7 +956,7 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
 
         BinaryObject binary = builder.build();
 
-        GridPortableTestClasses.TestObjectAllTypes deserialzied = binary.deserialize();
+        GridBinaryTestClasses.TestObjectAllTypes deserialzied = binary.deserialize();
 
         assertNull(deserialzied.str);
     }
@@ -965,7 +965,7 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
      *
      */
     public void testRemoveFromExistingObjectAfterGet() {
-        GridPortableTestClasses.TestObjectAllTypes obj = new GridPortableTestClasses.TestObjectAllTypes();
+        GridBinaryTestClasses.TestObjectAllTypes obj = new GridBinaryTestClasses.TestObjectAllTypes();
         obj.setDefaultData();
         obj.enumArr = null;
 
@@ -975,15 +975,15 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
 
         builder.removeField("str");
 
-        TestCase.assertNull(builder.build().<GridPortableTestClasses.TestObjectAllTypes>deserialize().str);
+        TestCase.assertNull(builder.build().<GridBinaryTestClasses.TestObjectAllTypes>deserialize().str);
     }
 
     /**
      * @throws IgniteCheckedException If any error occurs.
      */
     public void testDontBrokeCyclicDependency() throws IgniteCheckedException {
-        GridPortableTestClasses.TestObjectOuter outer = new GridPortableTestClasses.TestObjectOuter();
-        outer.inner = new GridPortableTestClasses.TestObjectInner();
+        GridBinaryTestClasses.TestObjectOuter outer = new GridBinaryTestClasses.TestObjectOuter();
+        outer.inner = new GridBinaryTestClasses.TestObjectInner();
         outer.inner.outer = outer;
         outer.foo = "a";
 
@@ -991,7 +991,7 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
 
         builder.setField("foo", "b");
 
-        GridPortableTestClasses.TestObjectOuter res = builder.build().deserialize();
+        GridBinaryTestClasses.TestObjectOuter res = builder.build().deserialize();
 
         assertEquals("b", res.foo);
         assertSame(res, res.inner.outer);

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMetaDataSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMetaDataSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMetaDataSelfTest.java
new file mode 100644
index 0000000..970cbc7
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMetaDataSelfTest.java
@@ -0,0 +1,371 @@
+/*
+ * 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.binary;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import org.apache.ignite.IgniteBinary;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.binary.BinaryType;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+/**
+ * Portable meta data test.
+ */
+public class GridBinaryMetaDataSelfTest extends GridCommonAbstractTest {
+    /** */
+    private static int idx;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        BinaryConfiguration bCfg = new BinaryConfiguration();
+
+        bCfg.setClassNames(Arrays.asList(TestObject1.class.getName(), TestObject2.class.getName()));
+
+        cfg.setBinaryConfiguration(bCfg);
+
+        cfg.setMarshaller(new BinaryMarshaller());
+
+        CacheConfiguration ccfg = new CacheConfiguration();
+
+        cfg.setCacheConfiguration(ccfg);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        idx = 0;
+
+        startGrid();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        stopGrid();
+    }
+
+    /**
+     * @return Portables API.
+     */
+    protected IgniteBinary portables() {
+        return grid().binary();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testGetAll() throws Exception {
+        portables().toBinary(new TestObject2());
+
+        Collection<BinaryType> metas = portables().types();
+
+        assertEquals(2, metas.size());
+
+        for (BinaryType meta : metas) {
+            Collection<String> fields;
+
+            switch (meta.typeName()) {
+                case "TestObject1":
+                    fields = meta.fieldNames();
+
+                    assertEquals(7, fields.size());
+
+                    assertTrue(fields.contains("intVal"));
+                    assertTrue(fields.contains("strVal"));
+                    assertTrue(fields.contains("arrVal"));
+                    assertTrue(fields.contains("obj1Val"));
+                    assertTrue(fields.contains("obj2Val"));
+                    assertTrue(fields.contains("decVal"));
+                    assertTrue(fields.contains("decArrVal"));
+
+                    assertEquals("int", meta.fieldTypeName("intVal"));
+                    assertEquals("String", meta.fieldTypeName("strVal"));
+                    assertEquals("byte[]", meta.fieldTypeName("arrVal"));
+                    assertEquals("Object", meta.fieldTypeName("obj1Val"));
+                    assertEquals("Object", meta.fieldTypeName("obj2Val"));
+                    assertEquals("decimal", meta.fieldTypeName("decVal"));
+                    assertEquals("decimal[]", meta.fieldTypeName("decArrVal"));
+
+                    break;
+
+                case "TestObject2":
+                    fields = meta.fieldNames();
+
+                    assertEquals(7, fields.size());
+
+                    assertTrue(fields.contains("boolVal"));
+                    assertTrue(fields.contains("dateVal"));
+                    assertTrue(fields.contains("uuidArrVal"));
+                    assertTrue(fields.contains("objVal"));
+                    assertTrue(fields.contains("mapVal"));
+                    assertTrue(fields.contains("decVal"));
+                    assertTrue(fields.contains("decArrVal"));
+
+                    assertEquals("boolean", meta.fieldTypeName("boolVal"));
+                    assertEquals("Date", meta.fieldTypeName("dateVal"));
+                    assertEquals("UUID[]", meta.fieldTypeName("uuidArrVal"));
+                    assertEquals("Object", meta.fieldTypeName("objVal"));
+                    assertEquals("Map", meta.fieldTypeName("mapVal"));
+                    assertEquals("decimal", meta.fieldTypeName("decVal"));
+                    assertEquals("decimal[]", meta.fieldTypeName("decArrVal"));
+
+                    break;
+
+                default:
+                    assert false : meta.typeName();
+            }
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testNoConfiguration() throws Exception {
+        portables().toBinary(new TestObject3());
+
+        assertNotNull(portables().type(TestObject3.class));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testReflection() throws Exception {
+        BinaryType meta = portables().type(TestObject1.class);
+
+        assertNotNull(meta);
+
+        assertEquals("TestObject1", meta.typeName());
+
+        Collection<String> fields = meta.fieldNames();
+
+        assertEquals(7, fields.size());
+
+        assertTrue(fields.contains("intVal"));
+        assertTrue(fields.contains("strVal"));
+        assertTrue(fields.contains("arrVal"));
+        assertTrue(fields.contains("obj1Val"));
+        assertTrue(fields.contains("obj2Val"));
+        assertTrue(fields.contains("decVal"));
+        assertTrue(fields.contains("decArrVal"));
+
+        assertEquals("int", meta.fieldTypeName("intVal"));
+        assertEquals("String", meta.fieldTypeName("strVal"));
+        assertEquals("byte[]", meta.fieldTypeName("arrVal"));
+        assertEquals("Object", meta.fieldTypeName("obj1Val"));
+        assertEquals("Object", meta.fieldTypeName("obj2Val"));
+        assertEquals("decimal", meta.fieldTypeName("decVal"));
+        assertEquals("decimal[]", meta.fieldTypeName("decArrVal"));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPortableMarshalAware() throws Exception {
+        portables().toBinary(new TestObject2());
+
+        BinaryType meta = portables().type(TestObject2.class);
+
+        assertNotNull(meta);
+
+        assertEquals("TestObject2", meta.typeName());
+
+        Collection<String> fields = meta.fieldNames();
+
+        assertEquals(7, fields.size());
+
+        assertTrue(fields.contains("boolVal"));
+        assertTrue(fields.contains("dateVal"));
+        assertTrue(fields.contains("uuidArrVal"));
+        assertTrue(fields.contains("objVal"));
+        assertTrue(fields.contains("mapVal"));
+        assertTrue(fields.contains("decVal"));
+        assertTrue(fields.contains("decArrVal"));
+
+        assertEquals("boolean", meta.fieldTypeName("boolVal"));
+        assertEquals("Date", meta.fieldTypeName("dateVal"));
+        assertEquals("UUID[]", meta.fieldTypeName("uuidArrVal"));
+        assertEquals("Object", meta.fieldTypeName("objVal"));
+        assertEquals("Map", meta.fieldTypeName("mapVal"));
+        assertEquals("decimal", meta.fieldTypeName("decVal"));
+        assertEquals("decimal[]", meta.fieldTypeName("decArrVal"));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testMerge() throws Exception {
+        portables().toBinary(new TestObject2());
+
+        idx = 1;
+
+        portables().toBinary(new TestObject2());
+
+        BinaryType meta = portables().type(TestObject2.class);
+
+        assertNotNull(meta);
+
+        assertEquals("TestObject2", meta.typeName());
+
+        Collection<String> fields = meta.fieldNames();
+
+        assertEquals(9, fields.size());
+
+        assertTrue(fields.contains("boolVal"));
+        assertTrue(fields.contains("dateVal"));
+        assertTrue(fields.contains("uuidArrVal"));
+        assertTrue(fields.contains("objVal"));
+        assertTrue(fields.contains("mapVal"));
+        assertTrue(fields.contains("charVal"));
+        assertTrue(fields.contains("colVal"));
+        assertTrue(fields.contains("decVal"));
+        assertTrue(fields.contains("decArrVal"));
+
+        assertEquals("boolean", meta.fieldTypeName("boolVal"));
+        assertEquals("Date", meta.fieldTypeName("dateVal"));
+        assertEquals("UUID[]", meta.fieldTypeName("uuidArrVal"));
+        assertEquals("Object", meta.fieldTypeName("objVal"));
+        assertEquals("Map", meta.fieldTypeName("mapVal"));
+        assertEquals("char", meta.fieldTypeName("charVal"));
+        assertEquals("Collection", meta.fieldTypeName("colVal"));
+        assertEquals("decimal", meta.fieldTypeName("decVal"));
+        assertEquals("decimal[]", meta.fieldTypeName("decArrVal"));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testSerializedObject() throws Exception {
+        TestObject1 obj = new TestObject1();
+
+        obj.intVal = 10;
+        obj.strVal = "str";
+        obj.arrVal = new byte[] {2, 4, 6};
+        obj.obj1Val = null;
+        obj.obj2Val = new TestObject2();
+        obj.decVal = BigDecimal.ZERO;
+        obj.decArrVal = new BigDecimal[] { BigDecimal.ONE };
+
+        BinaryObject po = portables().toBinary(obj);
+
+        info(po.toString());
+
+        BinaryType meta = po.type();
+
+        assertNotNull(meta);
+
+        assertEquals("TestObject1", meta.typeName());
+
+        Collection<String> fields = meta.fieldNames();
+
+        assertEquals(7, fields.size());
+
+        assertTrue(fields.contains("intVal"));
+        assertTrue(fields.contains("strVal"));
+        assertTrue(fields.contains("arrVal"));
+        assertTrue(fields.contains("obj1Val"));
+        assertTrue(fields.contains("obj2Val"));
+        assertTrue(fields.contains("decVal"));
+        assertTrue(fields.contains("decArrVal"));
+
+        assertEquals("int", meta.fieldTypeName("intVal"));
+        assertEquals("String", meta.fieldTypeName("strVal"));
+        assertEquals("byte[]", meta.fieldTypeName("arrVal"));
+        assertEquals("Object", meta.fieldTypeName("obj1Val"));
+        assertEquals("Object", meta.fieldTypeName("obj2Val"));
+        assertEquals("decimal", meta.fieldTypeName("decVal"));
+        assertEquals("decimal[]", meta.fieldTypeName("decArrVal"));
+    }
+
+    /**
+     */
+    @SuppressWarnings("UnusedDeclaration")
+    private static class TestObject1 {
+        /** */
+        private int intVal;
+
+        /** */
+        private String strVal;
+
+        /** */
+        private byte[] arrVal;
+
+        /** */
+        private TestObject1 obj1Val;
+
+        /** */
+        private TestObject2 obj2Val;
+
+        /** */
+        private BigDecimal decVal;
+
+        /** */
+        private BigDecimal[] decArrVal;
+    }
+
+    /**
+     */
+    private static class TestObject2 implements Binarylizable {
+        /** {@inheritDoc} */
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            writer.writeBoolean("boolVal", false);
+            writer.writeDate("dateVal", new Date());
+            writer.writeUuidArray("uuidArrVal", null);
+            writer.writeObject("objVal", null);
+            writer.writeMap("mapVal", new HashMap<>());
+            writer.writeDecimal("decVal", BigDecimal.ZERO);
+            writer.writeDecimalArray("decArrVal", new BigDecimal[] { BigDecimal.ONE });
+
+            if (idx == 1) {
+                writer.writeChar("charVal", (char)0);
+                writer.writeCollection("colVal", null);
+            }
+
+            BinaryRawWriter raw = writer.rawWriter();
+
+            raw.writeChar((char)0);
+            raw.writeCollection(null);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            // No-op.
+        }
+    }
+
+    /**
+     */
+    @SuppressWarnings("UnusedDeclaration")
+    private static class TestObject3 {
+        /** */
+        private int intVal;
+    }
+}


[23/50] [abbrv] ignite git commit: ignite-2065: portable -> binary renaming (methods, javadoc and etc.)

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java
index 9cf1242..dc70f4d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java
@@ -40,19 +40,19 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testClassNames() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
+        BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
 
         assertEquals(3, typeIds.size());
 
-        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
-        assertTrue(typeIds.containsKey("gridportabletestclass2".hashCode()));
+        assertTrue(typeIds.containsKey("gridbinarytestclass1".hashCode()));
+        assertTrue(typeIds.containsKey("gridbinarytestclass2".hashCode()));
         assertTrue(typeIds.containsKey("innerclass".hashCode()));
     }
 
@@ -60,7 +60,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testClassNamesWithMapper() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
+        BinaryMarshaller marsh = binaryMarshaller(new BinaryIdMapper() {
             @SuppressWarnings("IfMayBeConditional")
             @Override public int typeId(String clsName) {
                 if (clsName.endsWith("1"))
@@ -81,14 +81,14 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
         assertEquals(3, typeMappers.size());
 
-        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(300, typeMappers.get("GridBinaryTestClass1").typeId("GridBinaryTestClass1"));
+        assertEquals(400, typeMappers.get("GridBinaryTestClass2").typeId("GridBinaryTestClass2"));
         assertEquals(500, typeMappers.get("InnerClass").typeId("InnerClass"));
     }
 
@@ -96,19 +96,19 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testTypeConfigurations() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
+        BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
 
         assertEquals(3, typeIds.size());
 
-        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
-        assertTrue(typeIds.containsKey("gridportabletestclass2".hashCode()));
+        assertTrue(typeIds.containsKey("gridbinarytestclass1".hashCode()));
+        assertTrue(typeIds.containsKey("gridbinarytestclass2".hashCode()));
         assertTrue(typeIds.containsKey("innerclass".hashCode()));
     }
 
@@ -116,7 +116,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testTypeConfigurationsWithGlobalMapper() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
+        BinaryMarshaller marsh = binaryMarshaller(new BinaryIdMapper() {
             @SuppressWarnings("IfMayBeConditional")
             @Override public int typeId(String clsName) {
                 if (clsName.endsWith("1"))
@@ -137,14 +137,14 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
         assertEquals(3, typeMappers.size());
 
-        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(300, typeMappers.get("GridBinaryTestClass1").typeId("GridBinaryTestClass1"));
+        assertEquals(400, typeMappers.get("GridBinaryTestClass2").typeId("GridBinaryTestClass2"));
         assertEquals(500, typeMappers.get("InnerClass").typeId("InnerClass"));
     }
 
@@ -152,7 +152,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
      * @throws Exception If failed.
      */
     public void testTypeConfigurationsWithNonGlobalMapper() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
+        BinaryMarshaller marsh = binaryMarshaller(new BinaryIdMapper() {
             @SuppressWarnings("IfMayBeConditional")
             @Override public int typeId(String clsName) {
                 if (clsName.endsWith("1"))
@@ -173,14 +173,14 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
         assertEquals(3, typeMappers.size());
 
-        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(300, typeMappers.get("GridBinaryTestClass1").typeId("GridBinaryTestClass1"));
+        assertEquals(400, typeMappers.get("GridBinaryTestClass2").typeId("GridBinaryTestClass2"));
         assertEquals(500, typeMappers.get("InnerClass").typeId("InnerClass"));
     }
 
@@ -190,7 +190,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
     public void testOverride() throws Exception {
         BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();
 
-        typeCfg.setTypeName("GridPortableTestClass2");
+        typeCfg.setTypeName("GridBinaryTestClass2");
         typeCfg.setIdMapper(new BinaryIdMapper() {
             @Override public int typeId(String clsName) {
                 return 100;
@@ -201,49 +201,49 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
             }
         });
 
-        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
+        BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
             typeCfg));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
 
         assertEquals(3, typeIds.size());
 
-        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
+        assertTrue(typeIds.containsKey("gridbinarytestclass1".hashCode()));
         assertTrue(typeIds.containsKey("innerclass".hashCode()));
-        assertFalse(typeIds.containsKey("gridportabletestclass2".hashCode()));
+        assertFalse(typeIds.containsKey("gridbinarytestclass2".hashCode()));
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
-        assertEquals(100, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(100, typeMappers.get("GridBinaryTestClass2").typeId("GridBinaryTestClass2"));
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testClassNamesJar() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
+        BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
 
         assertEquals(3, typeIds.size());
 
-        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
-        assertTrue(typeIds.containsKey("gridportabletestclass2".hashCode()));
+        assertTrue(typeIds.containsKey("gridbinarytestclass1".hashCode()));
+        assertTrue(typeIds.containsKey("gridbinarytestclass2".hashCode()));
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testClassNamesWithMapperJar() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
+        BinaryMarshaller marsh = binaryMarshaller(new BinaryIdMapper() {
             @SuppressWarnings("IfMayBeConditional")
             @Override public int typeId(String clsName) {
                 if (clsName.endsWith("1"))
@@ -262,40 +262,40 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
         assertEquals(3, typeMappers.size());
 
-        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(300, typeMappers.get("GridBinaryTestClass1").typeId("GridBinaryTestClass1"));
+        assertEquals(400, typeMappers.get("GridBinaryTestClass2").typeId("GridBinaryTestClass2"));
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testTypeConfigurationsJar() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
+        BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
 
         assertEquals(3, typeIds.size());
 
-        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
-        assertTrue(typeIds.containsKey("gridportabletestclass2".hashCode()));
+        assertTrue(typeIds.containsKey("gridbinarytestclass1".hashCode()));
+        assertTrue(typeIds.containsKey("gridbinarytestclass2".hashCode()));
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testTypeConfigurationsWithGlobalMapperJar() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
+        BinaryMarshaller marsh = binaryMarshaller(new BinaryIdMapper() {
             @SuppressWarnings("IfMayBeConditional")
             @Override public int typeId(String clsName) {
                 if (clsName.endsWith("1"))
@@ -314,21 +314,21 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
         assertEquals(3, typeMappers.size());
 
-        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(300, typeMappers.get("GridBinaryTestClass1").typeId("GridBinaryTestClass1"));
+        assertEquals(400, typeMappers.get("GridBinaryTestClass2").typeId("GridBinaryTestClass2"));
     }
 
     /**
      * @throws Exception If failed.
      */
     public void testTypeConfigurationsWithNonGlobalMapperJar() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
+        BinaryMarshaller marsh = binaryMarshaller(new BinaryIdMapper() {
             @SuppressWarnings("IfMayBeConditional")
             @Override public int typeId(String clsName) {
                 if (clsName.endsWith("1"))
@@ -347,14 +347,14 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
         assertEquals(3, typeMappers.size());
 
-        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(300, typeMappers.get("GridBinaryTestClass1").typeId("GridBinaryTestClass1"));
+        assertEquals(400, typeMappers.get("GridBinaryTestClass2").typeId("GridBinaryTestClass2"));
     }
 
     /**
@@ -362,7 +362,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
      */
     public void testOverrideJar() throws Exception {
         BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration(
-            "org.apache.ignite.binary.testjar.GridPortableTestClass2");
+            "org.apache.ignite.binary.testjar.GridBinaryTestClass2");
 
         typeCfg.setIdMapper(new BinaryIdMapper() {
             @Override public int typeId(String clsName) {
@@ -374,30 +374,30 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
             }
         });
 
-        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
+        BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
             new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
             typeCfg));
 
-        BinaryContext ctx = portableContext(marsh);
+        BinaryContext ctx = binaryContext(marsh);
 
         Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
 
         assertEquals(3, typeIds.size());
 
-        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
+        assertTrue(typeIds.containsKey("gridbinarytestclass1".hashCode()));
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
         assertEquals(3, typeMappers.size());
 
-        assertEquals(100, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(100, typeMappers.get("GridBinaryTestClass2").typeId("GridBinaryTestClass2"));
     }
 
     /**
      * @param marsh Marshaller.
-     * @return Portable context.
+     * @return Binary context.
      */
-    protected BinaryContext portableContext(BinaryMarshaller marsh) {
+    protected BinaryContext binaryContext(BinaryMarshaller marsh) {
         GridBinaryMarshaller impl = U.field(marsh, "impl");
 
         return impl.context();
@@ -406,36 +406,36 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
     /**
      *
      */
-    protected BinaryMarshaller portableMarshaller()
+    protected BinaryMarshaller binaryMarshaller()
         throws IgniteCheckedException {
-        return portableMarshaller(null, null, null);
+        return binaryMarshaller(null, null, null);
     }
 
     /**
      *
      */
-    protected BinaryMarshaller portableMarshaller(Collection<BinaryTypeConfiguration> cfgs)
+    protected BinaryMarshaller binaryMarshaller(Collection<BinaryTypeConfiguration> cfgs)
         throws IgniteCheckedException {
-        return portableMarshaller(null, null, cfgs);
+        return binaryMarshaller(null, null, cfgs);
     }
 
     /**
      *
      */
-    protected BinaryMarshaller portableMarshaller(BinaryIdMapper mapper, Collection<BinaryTypeConfiguration> cfgs)
+    protected BinaryMarshaller binaryMarshaller(BinaryIdMapper mapper, Collection<BinaryTypeConfiguration> cfgs)
         throws IgniteCheckedException {
-        return portableMarshaller(mapper, null, cfgs);
+        return binaryMarshaller(mapper, null, cfgs);
     }
 
     /**
      *
      */
-    protected BinaryMarshaller portableMarshaller(BinarySerializer serializer, Collection<BinaryTypeConfiguration> cfgs)
+    protected BinaryMarshaller binaryMarshaller(BinarySerializer serializer, Collection<BinaryTypeConfiguration> cfgs)
         throws IgniteCheckedException {
-        return portableMarshaller(null, serializer, cfgs);
+        return binaryMarshaller(null, serializer, cfgs);
     }
 
-    protected BinaryMarshaller portableMarshaller(
+    protected BinaryMarshaller binaryMarshaller(
         BinaryIdMapper mapper,
         BinarySerializer serializer,
         Collection<BinaryTypeConfiguration> cfgs
@@ -457,7 +457,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
 
         marsh.setContext(new MarshallerContextTestImpl(null));
 
-        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", ctx, iCfg);
+        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, iCfg);
 
         return marsh;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/mutabletest/GridBinaryTestClasses.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/mutabletest/GridBinaryTestClasses.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/mutabletest/GridBinaryTestClasses.java
index 0170f99..ae615b1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/mutabletest/GridBinaryTestClasses.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/mutabletest/GridBinaryTestClasses.java
@@ -110,22 +110,22 @@ public class GridBinaryTestClasses {
     /**
      *
      */
-    public static class TestObjectPlainPortable {
+    public static class TestObjectPlainBinary {
         /** */
-        public BinaryObject plainPortable;
+        public BinaryObject plainBinary;
 
         /**
          *
          */
-        public TestObjectPlainPortable() {
+        public TestObjectPlainBinary() {
             // No-op.
         }
 
         /**
-         * @param plainPortable Object.
+         * @param plainBinary Object.
          */
-        public TestObjectPlainPortable(BinaryObject plainPortable) {
-            this.plainPortable = plainPortable;
+        public TestObjectPlainBinary(BinaryObject plainBinary) {
+            this.plainBinary = plainBinary;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFieldsHeapNonCompactSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFieldsHeapNonCompactSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFieldsHeapNonCompactSelfTest.java
index 7687f38..c657cfd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFieldsHeapNonCompactSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFieldsHeapNonCompactSelfTest.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.binary.noncompact;
 import org.apache.ignite.internal.binary.BinaryFieldsHeapSelfTest;
 
 /**
- * Field tests for heap-based portables with non-compact footer.
+ * Field tests for heap-based binaries with non-compact footer.
  */
 public class BinaryFieldsHeapNonCompactSelfTest extends BinaryFieldsHeapSelfTest {
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFieldsOffheapNonCompactSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFieldsOffheapNonCompactSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFieldsOffheapNonCompactSelfTest.java
index 52bccd8..f717f57 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFieldsOffheapNonCompactSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFieldsOffheapNonCompactSelfTest.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.binary.noncompact;
 import org.apache.ignite.internal.binary.BinaryFieldsOffheapSelfTest;
 
 /**
- * Field tests for offheap-based portables with non-compact footer.
+ * Field tests for offheap-based binaries with non-compact footer.
  */
 public class BinaryFieldsOffheapNonCompactSelfTest extends BinaryFieldsOffheapSelfTest {
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFooterOffsetsHeapNonCompactSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFooterOffsetsHeapNonCompactSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFooterOffsetsHeapNonCompactSelfTest.java
index 279e4f0..14cc991 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFooterOffsetsHeapNonCompactSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFooterOffsetsHeapNonCompactSelfTest.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.binary.noncompact;
 import org.apache.ignite.internal.binary.BinaryFooterOffsetsHeapSelfTest;
 
 /**
- * Compact offsets tests for heap portable objects with non-compact footer.
+ * Compact offsets tests for heap binary objects with non-compact footer.
  */
 public class BinaryFooterOffsetsHeapNonCompactSelfTest extends BinaryFooterOffsetsHeapSelfTest {
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFooterOffsetsOffheapNonCompactSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFooterOffsetsOffheapNonCompactSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFooterOffsetsOffheapNonCompactSelfTest.java
index 66a8d1a..fe2929a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFooterOffsetsOffheapNonCompactSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryFooterOffsetsOffheapNonCompactSelfTest.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.binary.noncompact;
 import org.apache.ignite.internal.binary.BinaryFooterOffsetsOffheapSelfTest;
 
 /**
- * Compact offsets tests for offheap portable objects with non-compact footer.
+ * Compact offsets tests for offheap binary objects with non-compact footer.
  */
 public class BinaryFooterOffsetsOffheapNonCompactSelfTest extends BinaryFooterOffsetsOffheapSelfTest {
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryObjectBuilderNonCompactSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryObjectBuilderNonCompactSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryObjectBuilderNonCompactSelfTest.java
index 1305b6e..c698783 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryObjectBuilderNonCompactSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/noncompact/BinaryObjectBuilderNonCompactSelfTest.java
@@ -20,7 +20,7 @@ package org.apache.ignite.internal.binary.noncompact;
 import org.apache.ignite.internal.binary.BinaryObjectBuilderSelfTest;
 
 /**
- * Portable builder test for objects with non-compact footer.
+ * Binary builder test for objects with non-compact footer.
  */
 public class BinaryObjectBuilderNonCompactSelfTest extends BinaryObjectBuilderSelfTest {
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
index 363b8e4..23d248d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOffHeapTieredAbstractSelfTest.java
@@ -66,7 +66,7 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
     }
 
     /** {@inheritDoc} */
-    protected boolean portableEnabled() {
+    protected boolean binaryEnabled() {
         return false;
     }
 
@@ -444,14 +444,14 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
 
         TestValue val2 = new TestValue(new byte[10]);
 
-        if (portableEnabled()) // TODO: IGNITE-608, check return value when fixed.
+        if (binaryEnabled()) // TODO: IGNITE-608, check return value when fixed.
             c.put(key, val);
         else
             assertEquals(val, c.getAndPut(key, val));
 
         checkValue(key, val2);
 
-        if (portableEnabled()) // TODO: IGNITE-608, check return value when fixed.
+        if (binaryEnabled()) // TODO: IGNITE-608, check return value when fixed.
             c.remove(key);
         else
             assertEquals(val2, c.getAndRemove(key));
@@ -672,4 +672,4 @@ public abstract class GridCacheOffHeapTieredAbstractSelfTest extends GridCacheAb
                 '}';
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
index b9c1449..d29440e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheOnCopyFlagAbstractSelfTest.java
@@ -284,7 +284,7 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
 
         GridCacheContext cctx = cache0.context();
 
-        boolean binary = cctx.cacheObjects().isPortableEnabled(null);
+        boolean binary = cctx.cacheObjects().isBinaryEnabled(null);
 
         for (Map.Entry<TestKey, TestValue> e : map.entrySet()) {
             GridCacheEntryEx entry = cache0.peekEx(e.getKey());
@@ -335,7 +335,7 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
 
         GridCacheContext cctx = cache0.context();
 
-        boolean binary = cctx.cacheObjects().isPortableEnabled(null);
+        boolean binary = cctx.cacheObjects().isBinaryEnabled(null);
 
         for (Map.Entry<TestKey, byte[]> e : map.entrySet()) {
             GridCacheEntryEx entry = cache0.peekEx(e.getKey());
@@ -603,4 +603,4 @@ public abstract class GridCacheOnCopyFlagAbstractSelfTest extends GridCacheAbstr
             this.delegate = delegate;
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
index a34e7df..f6eb430 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
@@ -474,7 +474,7 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr
         long ttl,
         boolean evt,
         boolean metrics,
-        boolean keepPortable,
+        boolean keepBinary,
         AffinityTopologyVersion topVer,
         CacheEntryPredicate[] filter,
         GridDrType drType,
@@ -497,7 +497,7 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr
         boolean writeThrough,
         boolean readThrough,
         boolean retval,
-        boolean keepPortable,
+        boolean keepBinary,
         @Nullable ExpiryPolicy expiryPlc,
         boolean evt,
         boolean metrics,
@@ -520,7 +520,7 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr
         boolean writeThrough,
         boolean readThrough,
         boolean retval,
-        boolean keepPortable,
+        boolean keepBinary,
         @Nullable IgniteCacheExpiryPolicy expiryPlc,
         boolean evt,
         boolean metrics,
@@ -552,7 +552,7 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr
         boolean retval,
         boolean evt,
         boolean metrics,
-        boolean keepPortable,
+        boolean keepBinary,
         AffinityTopologyVersion topVer,
         CacheEntryPredicate[] filter,
         GridDrType drType,

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryCacheEntryMemorySizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryCacheEntryMemorySizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryCacheEntryMemorySizeSelfTest.java
index 128e316..d1f7826 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryCacheEntryMemorySizeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryCacheEntryMemorySizeSelfTest.java
@@ -41,7 +41,7 @@ public class GridBinaryCacheEntryMemorySizeSelfTest extends GridCacheEntryMemory
 
         BinaryContext pCtx = new BinaryContext(BinaryNoopMetadataHandler.instance(), iCfg);
 
-        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", pCtx, iCfg);
+        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", pCtx, iCfg);
 
         return marsh;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java
index 9306958..a3f8055 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java
@@ -35,7 +35,7 @@ import org.apache.ignite.internal.binary.BinaryMarshaller;
 import org.apache.ignite.binary.BinaryObject;
 
 /**
- * Tests that portable object is the same in cache entry and in index.
+ * Tests that binary object is the same in cache entry and in index.
  */
 public abstract class GridBinaryDuplicateIndexObjectsAbstractSelfTest extends GridCacheAbstractSelfTest {
     /** {@inheritDoc} */
@@ -49,7 +49,7 @@ public abstract class GridBinaryDuplicateIndexObjectsAbstractSelfTest extends Gr
 
         BinaryConfiguration bCfg = new BinaryConfiguration();
 
-        bCfg.setClassNames(Collections.singletonList(TestPortable.class.getName()));
+        bCfg.setClassNames(Collections.singletonList(TestBinary.class.getName()));
 
         cfg.setBinaryConfiguration(bCfg);
 
@@ -67,7 +67,7 @@ public abstract class GridBinaryDuplicateIndexObjectsAbstractSelfTest extends Gr
         CacheTypeMetadata meta = new CacheTypeMetadata();
 
         meta.setKeyType(Integer.class);
-        meta.setValueType(TestPortable.class.getName());
+        meta.setValueType(TestBinary.class.getName());
 
         Map<String, Class<?>> idx = new HashMap<>();
 
@@ -91,13 +91,13 @@ public abstract class GridBinaryDuplicateIndexObjectsAbstractSelfTest extends Gr
      * @throws Exception If failed.
      */
     public void testIndexReferences() throws Exception {
-        IgniteCache<Integer, TestPortable> cache = grid(0).cache(null);
+        IgniteCache<Integer, TestBinary> cache = grid(0).cache(null);
 
         String fieldOneVal = "123";
         int fieldTwoVal = 123;
         int key = 0;
 
-        cache.put(key, new TestPortable(fieldOneVal, fieldTwoVal));
+        cache.put(key, new TestBinary(fieldOneVal, fieldTwoVal));
 
         IgniteCache<Integer, BinaryObject> prj = grid(0).cache(null).withKeepBinary();
 
@@ -107,7 +107,7 @@ public abstract class GridBinaryDuplicateIndexObjectsAbstractSelfTest extends Gr
         assertEquals(new Integer(fieldTwoVal), cacheVal.field("fieldTwo"));
 
         List<?> row = F.first(prj.query(new SqlFieldsQuery("select _val from " +
-            "TestPortable where _key = ?").setArgs(key)).getAll());
+            "TestBinary where _key = ?").setArgs(key)).getAll());
 
         assertEquals(1, row.size());
 
@@ -119,9 +119,9 @@ public abstract class GridBinaryDuplicateIndexObjectsAbstractSelfTest extends Gr
     }
 
     /**
-     * Test portable object.
+     * Test binary object.
      */
-    private static class TestPortable {
+    private static class TestBinary {
         /** */
         private String fieldOne;
 
@@ -131,7 +131,7 @@ public abstract class GridBinaryDuplicateIndexObjectsAbstractSelfTest extends Gr
         /**
          *
          */
-        private TestPortable() {
+        private TestBinary() {
             // No-op.
         }
 
@@ -139,7 +139,7 @@ public abstract class GridBinaryDuplicateIndexObjectsAbstractSelfTest extends Gr
          * @param fieldOne Field one.
          * @param fieldTwo Field two.
          */
-        private TestPortable(String fieldOne, int fieldTwo) {
+        private TestBinary(String fieldOne, int fieldTwo) {
             this.fieldOne = fieldOne;
             this.fieldTwo = fieldTwo;
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractDataStreamerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractDataStreamerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractDataStreamerSelfTest.java
index 5840149..beb76d1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractDataStreamerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractDataStreamerSelfTest.java
@@ -43,7 +43,7 @@ import org.jsr166.LongAdder8;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC;
 
 /**
- * Test for portable objects stored in cache.
+ * Test for binary objects stored in cache.
  */
 public abstract class GridCacheBinaryObjectsAbstractDataStreamerSelfTest extends GridCommonAbstractTest {
     /** */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractMultiThreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractMultiThreadedSelfTest.java
index 043f24f..0f73b53 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractMultiThreadedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractMultiThreadedSelfTest.java
@@ -49,7 +49,7 @@ import org.jsr166.LongAdder8;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC;
 
 /**
- * Test for portable objects stored in cache.
+ * Test for binary objects stored in cache.
  */
 public abstract class GridCacheBinaryObjectsAbstractMultiThreadedSelfTest extends GridCommonAbstractTest {
     /** */
@@ -146,11 +146,11 @@ public abstract class GridCacheBinaryObjectsAbstractMultiThreadedSelfTest extend
 
                         switch (threadId) {
                             case 0:
-                                // Put/get/remove portable -> portable.
+                                // Put/get/remove binary -> binary.
 
                                 c.put(new TestObject(rnd.nextInt(10000)), new TestObject(rnd.nextInt(10000)));
 
-                                IgniteCache<Object, Object> p2 = ((IgniteCacheProxy<Object, Object>)c).keepPortable();
+                                IgniteCache<Object, Object> p2 = ((IgniteCacheProxy<Object, Object>)c).keepBinary();
 
                                 BinaryObject v = (BinaryObject)p2.get(new TestObject(rnd.nextInt(10000)));
 
@@ -162,10 +162,10 @@ public abstract class GridCacheBinaryObjectsAbstractMultiThreadedSelfTest extend
                                 break;
 
                             case 1:
-                                // Put/get int -> portable.
+                                // Put/get int -> binary.
                                 c.put(rnd.nextInt(10000), new TestObject(rnd.nextInt(10000)));
 
-                                IgniteCache<Integer, BinaryObject> p4 = ((IgniteCacheProxy<Object, Object>)c).keepPortable();
+                                IgniteCache<Integer, BinaryObject> p4 = ((IgniteCacheProxy<Object, Object>)c).keepBinary();
 
                                 BinaryObject v1 = p4.get(rnd.nextInt(10000));
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
index d24e1e4..2da781b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectsAbstractSelfTest.java
@@ -68,7 +68,7 @@ import static org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED
 import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
 
 /**
- * Test for portable objects stored in cache.
+ * Test for binary objects stored in cache.
  */
 public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonAbstractTest {
     /** */
@@ -184,7 +184,7 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
      */
     @SuppressWarnings("unchecked")
     public void testCircularReference() throws Exception {
-        IgniteCache c = keepPortableCache();
+        IgniteCache c = keepBinaryCache();
 
         TestReferenceObject obj1 = new TestReferenceObject();
 
@@ -229,7 +229,7 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
             assertEquals(i, obj.val);
         }
 
-        IgniteCache<Integer, BinaryObject> kpc = keepPortableCache();
+        IgniteCache<Integer, BinaryObject> kpc = keepBinaryCache();
 
         for (int i = 0; i < ENTRY_CNT; i++) {
             BinaryObject po = kpc.get(i);
@@ -254,7 +254,7 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
             entries.put(i, val);
         }
 
-        IgniteCache<Integer, BinaryObject> prj = ((IgniteCacheProxy)c).keepPortable();
+        IgniteCache<Integer, BinaryObject> prj = ((IgniteCacheProxy)c).keepBinary();
 
         Iterator<Cache.Entry<Integer, BinaryObject>> it = prj.iterator();
 
@@ -306,7 +306,7 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
             }
         }
 
-        IgniteCache<Integer, Collection<BinaryObject>> kpc = keepPortableCache();
+        IgniteCache<Integer, Collection<BinaryObject>> kpc = keepBinaryCache();
 
         for (int i = 0; i < ENTRY_CNT; i++) {
             Collection<BinaryObject> col = kpc.get(i);
@@ -353,7 +353,7 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
             }
         }
 
-        IgniteCache<Integer, Map<Integer, BinaryObject>> kpc = keepPortableCache();
+        IgniteCache<Integer, Map<Integer, BinaryObject>> kpc = keepBinaryCache();
 
         for (int i = 0; i < ENTRY_CNT; i++) {
             Map<Integer, BinaryObject> map = kpc.get(i);
@@ -389,14 +389,14 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
             assertEquals(i, obj.val);
         }
 
-        IgniteCache<Integer, BinaryObject> kpc = keepPortableCache();
+        IgniteCache<Integer, BinaryObject> kpc = keepBinaryCache();
 
-        IgniteCache<Integer, BinaryObject> cachePortableAsync = kpc.withAsync();
+        IgniteCache<Integer, BinaryObject> cacheBinaryAsync = kpc.withAsync();
 
         for (int i = 0; i < ENTRY_CNT; i++) {
-            cachePortableAsync.get(i);
+            cacheBinaryAsync.get(i);
 
-            BinaryObject po = cachePortableAsync.<BinaryObject>future().get();
+            BinaryObject po = cacheBinaryAsync.<BinaryObject>future().get();
 
             assertEquals(i, (int)po.field("val"));
         }
@@ -434,7 +434,7 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
             }
         }
 
-        IgniteCache<Integer, BinaryObject> kpc = keepPortableCache();
+        IgniteCache<Integer, BinaryObject> kpc = keepBinaryCache();
 
         for (int i = 0; i < ENTRY_CNT; i++) {
             try (Transaction tx = grid(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
@@ -483,14 +483,14 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
             }
         }
 
-        IgniteCache<Integer, BinaryObject> kpc = keepPortableCache();
-        IgniteCache<Integer, BinaryObject> cachePortableAsync = kpc.withAsync();
+        IgniteCache<Integer, BinaryObject> kpc = keepBinaryCache();
+        IgniteCache<Integer, BinaryObject> cacheBinaryAsync = kpc.withAsync();
 
         for (int i = 0; i < ENTRY_CNT; i++) {
             try (Transaction tx = grid(0).transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) {
-                cachePortableAsync.get(i);
+                cacheBinaryAsync.get(i);
 
-                BinaryObject po = cachePortableAsync.<BinaryObject>future().get();
+                BinaryObject po = cacheBinaryAsync.<BinaryObject>future().get();
 
                 assertEquals(i, (int)po.field("val"));
 
@@ -522,7 +522,7 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
                 assertEquals(e.getKey().intValue(), e.getValue().val);
         }
 
-        IgniteCache<Integer, BinaryObject> kpc = keepPortableCache();
+        IgniteCache<Integer, BinaryObject> kpc = keepBinaryCache();
 
         for (int i = 0; i < ENTRY_CNT; ) {
             Set<Integer> keys = new HashSet<>();
@@ -566,8 +566,8 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
                 assertEquals(e.getKey().intValue(), e.getValue().val);
         }
 
-        IgniteCache<Integer, BinaryObject> kpc = keepPortableCache();
-        IgniteCache<Integer, BinaryObject> cachePortableAsync = kpc.withAsync();
+        IgniteCache<Integer, BinaryObject> kpc = keepBinaryCache();
+        IgniteCache<Integer, BinaryObject> cacheBinaryAsync = kpc.withAsync();
 
         for (int i = 0; i < ENTRY_CNT; ) {
             Set<Integer> keys = new HashSet<>();
@@ -576,9 +576,9 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
                 keys.add(i++);
 
 
-            cachePortableAsync.getAll(keys);
+            cacheBinaryAsync.getAll(keys);
 
-            Map<Integer, BinaryObject> objs = cachePortableAsync.<Map<Integer, BinaryObject>>future().get();
+            Map<Integer, BinaryObject> objs = cacheBinaryAsync.<Map<Integer, BinaryObject>>future().get();
 
             assertEquals(10, objs.size());
 
@@ -628,7 +628,7 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
             }
         }
 
-        IgniteCache<Integer, BinaryObject> kpc = keepPortableCache();
+        IgniteCache<Integer, BinaryObject> kpc = keepBinaryCache();
 
         for (int i = 0; i < ENTRY_CNT; ) {
             Set<Integer> keys = new HashSet<>();
@@ -693,7 +693,7 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
             }
         }
 
-        IgniteCache<Integer, BinaryObject> cache = keepPortableCache();
+        IgniteCache<Integer, BinaryObject> cache = keepBinaryCache();
 
         for (int i = 0; i < ENTRY_CNT; ) {
             Set<Integer> keys = new HashSet<>();
@@ -785,7 +785,7 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
      * @throws Exception If failed.
      */
     public void testTransform() throws Exception {
-        IgniteCache<Integer, BinaryObject> c = keepPortableCache();
+        IgniteCache<Integer, BinaryObject> c = keepBinaryCache();
 
         checkTransform(primaryKey(c));
 
@@ -798,9 +798,9 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
     }
 
     /**
-     * @return Cache with keep portable flag.
+     * @return Cache with keep binary flag.
      */
-    private <K, V> IgniteCache<K, V> keepPortableCache() {
+    private <K, V> IgniteCache<K, V> keepBinaryCache() {
         return ignite(0).cache(null).withKeepBinary();
     }
 
@@ -811,7 +811,7 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
     private void checkTransform(Integer key) throws Exception {
         log.info("Transform: " + key);
 
-        IgniteCache<Integer, BinaryObject> c = keepPortableCache();
+        IgniteCache<Integer, BinaryObject> c = keepBinaryCache();
 
         try {
             c.invoke(key, new EntryProcessor<Integer, BinaryObject, Void>() {
@@ -836,9 +836,9 @@ public abstract class GridCacheBinaryObjectsAbstractSelfTest extends GridCommonA
 
                     Ignite ignite = e.unwrap(Ignite.class);
 
-                    IgniteBinary portables = ignite.binary();
+                    IgniteBinary binaries = ignite.binary();
 
-                    BinaryObjectBuilder builder = portables.builder(val);
+                    BinaryObjectBuilder builder = binaries.builder(val);
 
                     builder.setField("val", 2);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java
index 058dc0b..4f478f7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java
@@ -62,7 +62,7 @@ public abstract class GridCacheBinaryStoreAbstractSelfTest extends GridCommonAbs
         CacheConfiguration cacheCfg = new CacheConfiguration();
 
         cacheCfg.setCacheStoreFactory(singletonFactory(STORE));
-        cacheCfg.setKeepBinaryInStore(keepPortableInStore());
+        cacheCfg.setKeepBinaryInStore(keepBinaryInStore());
         cacheCfg.setReadThrough(true);
         cacheCfg.setWriteThrough(true);
         cacheCfg.setLoadPreviousValue(true);
@@ -81,7 +81,7 @@ public abstract class GridCacheBinaryStoreAbstractSelfTest extends GridCommonAbs
     /**
      * @return Keep binary in store flag.
      */
-    protected abstract boolean keepPortableInStore();
+    protected abstract boolean keepBinaryInStore();
 
     /** {@inheritDoc} */
     @Override protected void beforeTestsStarted() throws Exception {

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreBinariesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreBinariesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreBinariesSelfTest.java
index 55f2da0..4d163b3 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreBinariesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreBinariesSelfTest.java
@@ -24,7 +24,7 @@ import org.apache.ignite.binary.BinaryObject;
  */
 public class GridCacheBinaryStoreBinariesSelfTest extends GridCacheBinaryStoreAbstractSelfTest {
     /** {@inheritDoc} */
-    @Override protected boolean keepPortableInStore() {
+    @Override protected boolean keepBinaryInStore() {
         return true;
     }
 
@@ -34,7 +34,7 @@ public class GridCacheBinaryStoreBinariesSelfTest extends GridCacheBinaryStoreAb
         assert idxs != null;
 
         for (int idx : idxs)
-            map.put(portable(new Key(idx)), portable(new Value(idx)));
+            map.put(binary(new Key(idx)), binary(new Value(idx)));
     }
 
     /** {@inheritDoc} */
@@ -45,7 +45,7 @@ public class GridCacheBinaryStoreBinariesSelfTest extends GridCacheBinaryStoreAb
         assertEquals(idxs.length, map.size());
 
         for (int idx : idxs) {
-            Object val = map.get(portable(new Key(idx)));
+            Object val = map.get(binary(new Key(idx)));
 
             assertTrue(String.valueOf(val), val instanceof BinaryObject);
 
@@ -58,9 +58,9 @@ public class GridCacheBinaryStoreBinariesSelfTest extends GridCacheBinaryStoreAb
 
     /**
      * @param obj Object.
-     * @return Portable object.
+     * @return Binary object.
      */
-    private Object portable(Object obj) {
+    private Object binary(Object obj) {
         return grid().binary().toBinary(obj);
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreObjectsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreObjectsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreObjectsSelfTest.java
index a4d08ec..1096c15 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreObjectsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreObjectsSelfTest.java
@@ -24,7 +24,7 @@ import java.util.Map;
  */
 public class GridCacheBinaryStoreObjectsSelfTest extends GridCacheBinaryStoreAbstractSelfTest {
     /** {@inheritDoc} */
-    @Override protected boolean keepPortableInStore() {
+    @Override protected boolean keepBinaryInStore() {
         return false;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheClientNodeBinaryObjectMetadataMultinodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheClientNodeBinaryObjectMetadataMultinodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheClientNodeBinaryObjectMetadataMultinodeTest.java
index 004494e..fee302b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheClientNodeBinaryObjectMetadataMultinodeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheClientNodeBinaryObjectMetadataMultinodeTest.java
@@ -96,10 +96,10 @@ public class GridCacheClientNodeBinaryObjectMetadataMultinodeTest extends GridCo
         IgniteInternalFuture<?> fut;
 
         try {
-            // Update portable metadata concurrently with client nodes start.
+            // Update binary metadata concurrently with client nodes start.
             fut = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
                 @Override public Object call() throws Exception {
-                    IgniteBinary portables = ignite(0).binary();
+                    IgniteBinary binaries = ignite(0).binary();
 
                     IgniteCache<Object, Object> cache = ignite(0).cache(null).withKeepBinary();
 
@@ -108,12 +108,12 @@ public class GridCacheClientNodeBinaryObjectMetadataMultinodeTest extends GridCo
                     for (int i = 0; i < 1000; i++) {
                         log.info("Iteration: " + i);
 
-                        String type = "portable-type-" + i;
+                        String type = "binary-type-" + i;
 
                         allTypes.add(type);
 
                         for (int f = 0; f < 10; f++) {
-                            BinaryObjectBuilder builder = portables.builder(type);
+                            BinaryObjectBuilder builder = binaries.builder(type);
 
                             String fieldName = "f" + f;
 
@@ -145,7 +145,7 @@ public class GridCacheClientNodeBinaryObjectMetadataMultinodeTest extends GridCo
 
         assertFalse(allTypes.isEmpty());
 
-        log.info("Expected portable types: " + allTypes.size());
+        log.info("Expected binary types: " + allTypes.size());
 
         assertEquals(7, ignite(0).cluster().nodes().size());
 
@@ -156,9 +156,9 @@ public class GridCacheClientNodeBinaryObjectMetadataMultinodeTest extends GridCo
 
             assertEquals((Object)client, ignite(i).configuration().isClientMode());
 
-            IgniteBinary portables = ignite(i).binary();
+            IgniteBinary binaries = ignite(i).binary();
 
-            Collection<BinaryType> metaCol = portables.types();
+            Collection<BinaryType> metaCol = binaries.types();
 
             assertEquals(allTypes.size(), metaCol.size());
 
@@ -182,12 +182,12 @@ public class GridCacheClientNodeBinaryObjectMetadataMultinodeTest extends GridCo
     public void testFailoverOnStart() throws Exception {
         startGrids(4);
 
-        IgniteBinary portables = ignite(0).binary();
+        IgniteBinary binaries = ignite(0).binary();
 
         IgniteCache<Object, Object> cache = ignite(0).cache(null).withKeepBinary();
 
         for (int i = 0; i < 1000; i++) {
-            BinaryObjectBuilder builder = portables.builder("type-" + i);
+            BinaryObjectBuilder builder = binaries.builder("type-" + i);
 
             builder.setField("f0", i);
 
@@ -232,9 +232,9 @@ public class GridCacheClientNodeBinaryObjectMetadataMultinodeTest extends GridCo
 
             assertEquals((Object) client, ignite(i).configuration().isClientMode());
 
-            portables = ignite(i).binary();
+            binaries = ignite(i).binary();
 
-            final IgniteBinary p0 = portables;
+            final IgniteBinary p0 = binaries;
 
             GridTestUtils.waitForCondition(new GridAbsPredicate() {
                 @Override public boolean apply() {
@@ -244,7 +244,7 @@ public class GridCacheClientNodeBinaryObjectMetadataMultinodeTest extends GridCo
                 }
             }, getTestTimeout());
 
-            Collection<BinaryType> metaCol = portables.types();
+            Collection<BinaryType> metaCol = binaries.types();
 
             assertEquals(1000, metaCol.size());
 
@@ -278,12 +278,12 @@ public class GridCacheClientNodeBinaryObjectMetadataMultinodeTest extends GridCo
 
         assertFalse(ignite1.configuration().isClientMode());
 
-        IgniteBinary portables = ignite(1).binary();
+        IgniteBinary binaries = ignite(1).binary();
 
         IgniteCache<Object, Object> cache = ignite(1).cache(null).withKeepBinary();
 
         for (int i = 0; i < 100; i++) {
-            BinaryObjectBuilder builder = portables.builder("type-" + i);
+            BinaryObjectBuilder builder = binaries.builder("type-" + i);
 
             builder.setField("f0", i);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheClientNodeBinaryObjectMetadataTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheClientNodeBinaryObjectMetadataTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheClientNodeBinaryObjectMetadataTest.java
index 2a71748..b91b088 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheClientNodeBinaryObjectMetadataTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheClientNodeBinaryObjectMetadataTest.java
@@ -94,7 +94,7 @@ public class GridCacheClientNodeBinaryObjectMetadataTest extends GridCacheAbstra
     /**
      * @throws Exception If failed.
      */
-    public void testPortableMetadataOnClient() throws Exception {
+    public void testBinaryMetadataOnClient() throws Exception {
         Ignite ignite0 = ignite(gridCount() - 1);
 
         assertTrue(ignite0.configuration().isClientMode());

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/GridDataStreamerImplSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/GridDataStreamerImplSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/GridDataStreamerImplSelfTest.java
index 125a055..4caa5fb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/GridDataStreamerImplSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/datastreaming/GridDataStreamerImplSelfTest.java
@@ -55,7 +55,7 @@ public class GridDataStreamerImplSelfTest extends GridCommonAbstractTest {
     private static final int KEYS_COUNT = 1000;
 
     /** Flag indicating should be cache configured with binary or not.  */
-    private static boolean portables;
+    private static boolean binaries;
 
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
@@ -66,7 +66,7 @@ public class GridDataStreamerImplSelfTest extends GridCommonAbstractTest {
 
         cfg.setDiscoverySpi(discoSpi);
 
-        if (portables) {
+        if (binaries) {
             BinaryMarshaller marsh = new BinaryMarshaller();
 
             cfg.setMarshaller(marsh);
@@ -101,7 +101,7 @@ public class GridDataStreamerImplSelfTest extends GridCommonAbstractTest {
      */
     public void testAddDataFromMap() throws Exception {
         try {
-            portables = false;
+            binaries = false;
 
             startGrids(2);
 
@@ -143,13 +143,13 @@ public class GridDataStreamerImplSelfTest extends GridCommonAbstractTest {
     }
 
     /**
-     * Data streamer should add portable object that weren't registered explicitly.
+     * Data streamer should add binary object that weren't registered explicitly.
      *
      * @throws Exception If failed.
      */
-    public void testAddMissingPortable() throws Exception {
+    public void testAddMissingBinary() throws Exception {
         try {
-            portables = true;
+            binaries = true;
 
             startGrids(2);
 
@@ -177,14 +177,14 @@ public class GridDataStreamerImplSelfTest extends GridCommonAbstractTest {
     }
 
     /**
-     * Data streamer should correctly load portable entries from HashMap in case of grids with more than one node
+     * Data streamer should correctly load binary entries from HashMap in case of grids with more than one node
      *  and with GridOptimizedMarshaller that requires serializable.
      *
      * @throws Exception If failed.
      */
-    public void testAddPortableDataFromMap() throws Exception {
+    public void testAddBinaryDataFromMap() throws Exception {
         try {
-            portables = true;
+            binaries = true;
 
             startGrids(2);
 
@@ -220,8 +220,8 @@ public class GridDataStreamerImplSelfTest extends GridCommonAbstractTest {
                 assertEquals(k, v.val());
             }
 
-            // Read random keys. Take values as PortableObject.
-            IgniteCache<Integer, BinaryObject> c2 = ((IgniteCacheProxy)c).keepPortable();
+            // Read random keys. Take values as BinaryObject.
+            IgniteCache<Integer, BinaryObject> c2 = ((IgniteCacheProxy)c).keepBinary();
 
             for (int i = 0; i < 100; i ++) {
                 Integer k = rnd.nextInt(KEYS_COUNT);

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsAtomicNearDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsAtomicNearDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsAtomicNearDisabledSelfTest.java
index 0199217..db57cf9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsAtomicNearDisabledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsAtomicNearDisabledSelfTest.java
@@ -26,7 +26,7 @@ import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 
 /**
- * Test for portable objects stored in cache.
+ * Test for binary objects stored in cache.
  */
 public class GridCacheBinaryObjectsAtomicNearDisabledSelfTest extends GridCacheBinaryObjectsAbstractSelfTest {
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsAtomicSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsAtomicSelfTest.java
index fcdd184..7501abc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsAtomicSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsAtomicSelfTest.java
@@ -26,7 +26,7 @@ import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 
 /**
- * Test for portable objects stored in cache.
+ * Test for binary objects stored in cache.
  */
 public class GridCacheBinaryObjectsAtomicSelfTest extends GridCacheBinaryObjectsAbstractSelfTest {
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsPartitionedNearDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsPartitionedNearDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsPartitionedNearDisabledSelfTest.java
index dc439d7..a512bdf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsPartitionedNearDisabledSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsPartitionedNearDisabledSelfTest.java
@@ -26,7 +26,7 @@ import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 
 /**
- * Test for portable objects stored in cache.
+ * Test for binary objects stored in cache.
  */
 public class GridCacheBinaryObjectsPartitionedNearDisabledSelfTest extends GridCacheBinaryObjectsAbstractSelfTest {
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsPartitionedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsPartitionedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsPartitionedSelfTest.java
index 550ae3f..341b571 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsPartitionedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheBinaryObjectsPartitionedSelfTest.java
@@ -26,7 +26,7 @@ import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 
 /**
- * Test for portable objects stored in cache.
+ * Test for binary objects stored in cache.
  */
 public class GridCacheBinaryObjectsPartitionedSelfTest extends GridCacheBinaryObjectsAbstractSelfTest {
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredAtomicBinarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredAtomicBinarySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredAtomicBinarySelfTest.java
index 3494b5c..d9b4663 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredAtomicBinarySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredAtomicBinarySelfTest.java
@@ -28,7 +28,7 @@ import org.apache.ignite.internal.binary.BinaryMarshaller;
  */
 public class GridCacheOffHeapTieredAtomicBinarySelfTest extends GridCacheOffHeapTieredAtomicSelfTest {
     /** {@inheritDoc} */
-    @Override protected boolean portableEnabled() {
+    @Override protected boolean binaryEnabled() {
         return true;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredBinarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredBinarySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredBinarySelfTest.java
index 7cde9e7..abfc739 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredBinarySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredBinarySelfTest.java
@@ -28,7 +28,7 @@ import org.apache.ignite.internal.binary.BinaryMarshaller;
  */
 public class GridCacheOffHeapTieredBinarySelfTest extends GridCacheOffHeapTieredSelfTest {
     /** {@inheritDoc} */
-    @Override protected boolean portableEnabled() {
+    @Override protected boolean binaryEnabled() {
         return true;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionAtomicBinarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionAtomicBinarySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionAtomicBinarySelfTest.java
index 79fe8d3..aec896a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionAtomicBinarySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionAtomicBinarySelfTest.java
@@ -44,24 +44,24 @@ public class GridCacheOffHeapTieredEvictionAtomicBinarySelfTest extends GridCach
 
     /** {@inheritDoc} */
     @Override protected TestPredicate testPredicate(String expVal, boolean acceptNull) {
-        return new PortableValuePredicate(expVal, acceptNull);
+        return new BinaryValuePredicate(expVal, acceptNull);
     }
 
     /** {@inheritDoc} */
     @Override protected TestProcessor testClosure(String expVal, boolean acceptNull) {
-        return new PortableValueClosure(expVal, acceptNull);
+        return new BinaryValueClosure(expVal, acceptNull);
     }
 
     /**
      *
      */
     @SuppressWarnings("PackageVisibleInnerClass")
-    static class PortableValuePredicate extends TestPredicate {
+    static class BinaryValuePredicate extends TestPredicate {
         /**
          * @param expVal Expected value.
          * @param acceptNull If {@code true} value can be null;
          */
-        PortableValuePredicate(String expVal, boolean acceptNull) {
+        BinaryValuePredicate(String expVal, boolean acceptNull) {
             super(expVal, acceptNull);
         }
 
@@ -77,12 +77,12 @@ public class GridCacheOffHeapTieredEvictionAtomicBinarySelfTest extends GridCach
      *
      */
     @SuppressWarnings("PackageVisibleInnerClass")
-    static class PortableValueClosure extends TestProcessor {
+    static class BinaryValueClosure extends TestProcessor {
         /**
          * @param expVal Expected value.
          * @param acceptNull If {@code true} value can be null;
          */
-        PortableValueClosure(String expVal, boolean acceptNull) {
+        BinaryValueClosure(String expVal, boolean acceptNull) {
             super(expVal, acceptNull);
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionBinarySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionBinarySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionBinarySelfTest.java
index 9a47e4f..3138eb7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionBinarySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/dht/GridCacheOffHeapTieredEvictionBinarySelfTest.java
@@ -44,24 +44,24 @@ public class GridCacheOffHeapTieredEvictionBinarySelfTest extends GridCacheOffHe
 
     /** {@inheritDoc} */
     @Override protected TestPredicate testPredicate(String expVal, boolean acceptNull) {
-        return new PortableValuePredicate(expVal, acceptNull);
+        return new BinaryValuePredicate(expVal, acceptNull);
     }
 
     /** {@inheritDoc} */
     @Override protected TestProcessor testClosure(String expVal, boolean acceptNull) {
-        return new PortableValueClosure(expVal, acceptNull);
+        return new BinaryValueClosure(expVal, acceptNull);
     }
 
     /**
      *
      */
     @SuppressWarnings("PackageVisibleInnerClass")
-    static class PortableValuePredicate extends TestPredicate {
+    static class BinaryValuePredicate extends TestPredicate {
         /**
          * @param expVal Expected value.
          * @param acceptNull If {@code true} value can be null;
          */
-        PortableValuePredicate(String expVal, boolean acceptNull) {
+        BinaryValuePredicate(String expVal, boolean acceptNull) {
             super(expVal, acceptNull);
         }
 
@@ -77,12 +77,12 @@ public class GridCacheOffHeapTieredEvictionBinarySelfTest extends GridCacheOffHe
      *
      */
     @SuppressWarnings("PackageVisibleInnerClass")
-    static class PortableValueClosure extends TestProcessor {
+    static class BinaryValueClosure extends TestProcessor {
         /**
          * @param expVal Expected value.
          * @param acceptNull If {@code true} value can be null;
          */
-        PortableValueClosure(String expVal, boolean acceptNull) {
+        BinaryValueClosure(String expVal, boolean acceptNull) {
             super(expVal, acceptNull);
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/replicated/GridCacheBinaryObjectsReplicatedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/replicated/GridCacheBinaryObjectsReplicatedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/replicated/GridCacheBinaryObjectsReplicatedSelfTest.java
index 90f060f..719c564 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/replicated/GridCacheBinaryObjectsReplicatedSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/distributed/replicated/GridCacheBinaryObjectsReplicatedSelfTest.java
@@ -26,7 +26,7 @@ import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheMode.REPLICATED;
 
 /**
- * Test for portable objects stored in cache.
+ * Test for binary objects stored in cache.
  */
 public class GridCacheBinaryObjectsReplicatedSelfTest extends GridCacheBinaryObjectsAbstractSelfTest {
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/local/GridCacheBinaryObjectsLocalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/local/GridCacheBinaryObjectsLocalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/local/GridCacheBinaryObjectsLocalSelfTest.java
index fc38561..2712181 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/local/GridCacheBinaryObjectsLocalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/local/GridCacheBinaryObjectsLocalSelfTest.java
@@ -26,7 +26,7 @@ import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheMode.LOCAL;
 
 /**
- * Test for portable objects stored in cache.
+ * Test for binary objects stored in cache.
  */
 public class GridCacheBinaryObjectsLocalSelfTest extends GridCacheBinaryObjectsAbstractSelfTest {
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java
index a284883..03ab998 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformComputeEchoTask.java
@@ -74,17 +74,17 @@ public class PlatformComputeEchoTask extends ComputeTaskAdapter<Integer, Object>
     /** Type: map. */
     private static final int TYPE_MAP = 11;
 
-    /** Type: portable object which exists in all platforms. */
-    private static final int TYPE_PORTABLE = 12;
+    /** Type: binary object which exists in all platforms. */
+    private static final int TYPE_BINARY = 12;
 
-    /** Type: portable object which exists only in Java. */
-    private static final int TYPE_PORTABLE_JAVA = 13;
+    /** Type: binary object which exists only in Java. */
+    private static final int TYPE_BINARY_JAVA = 13;
 
     /** Type: object array. */
     private static final int TYPE_OBJ_ARRAY = 14;
 
-    /** Type: portable object array. */
-    private static final int TYPE_PORTABLE_ARRAY = 15;
+    /** Type: binary object array. */
+    private static final int TYPE_BINARY_ARRAY = 15;
 
     /** Type: enum. */
     private static final int TYPE_ENUM = 16;
@@ -165,16 +165,16 @@ public class PlatformComputeEchoTask extends ComputeTaskAdapter<Integer, Object>
                 case TYPE_MAP:
                     return Collections.singletonMap(1, 1);
 
-                case TYPE_PORTABLE:
+                case TYPE_BINARY:
                     return new PlatformComputeBinarizable(1);
 
-                case TYPE_PORTABLE_JAVA:
+                case TYPE_BINARY_JAVA:
                     return new PlatformComputeJavaBinarizable(1);
 
                 case TYPE_OBJ_ARRAY:
                     return new String[] { "foo", "bar", "baz" };
 
-                case TYPE_PORTABLE_ARRAY:
+                case TYPE_BINARY_ARRAY:
                     return new PlatformComputeBinarizable[] {
                         new PlatformComputeBinarizable(1),
                         new PlatformComputeBinarizable(2),
@@ -203,4 +203,4 @@ public class PlatformComputeEchoTask extends ComputeTaskAdapter<Integer, Object>
             }
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/session/GridSessionCheckpointSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/session/GridSessionCheckpointSelfTest.java b/modules/core/src/test/java/org/apache/ignite/session/GridSessionCheckpointSelfTest.java
index f3374c4..3038cba 100644
--- a/modules/core/src/test/java/org/apache/ignite/session/GridSessionCheckpointSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/session/GridSessionCheckpointSelfTest.java
@@ -102,7 +102,7 @@ public class GridSessionCheckpointSelfTest extends GridSessionCheckpointAbstract
 
             marsh.setContext(new MarshallerContextTestImpl(null));
 
-            IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", ctx, cfg);
+            IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, cfg);
         }
 
         GridSessionCheckpointSelfTest.spi = spi;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
index 67a4f20..4e3f326 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/IgniteTestResources.java
@@ -266,7 +266,7 @@ public class IgniteTestResources {
         if (marsh instanceof BinaryMarshaller) {
             BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration());
 
-            IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", ctx, new IgniteConfiguration());
+            IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setBinaryContext", ctx, new IgniteConfiguration());
         }
 
         return marsh;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheFullApiTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheFullApiTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheFullApiTestSuite.java
index 3dc78cc..e891d35 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheFullApiTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheFullApiTestSuite.java
@@ -22,7 +22,7 @@ import org.apache.ignite.internal.binary.BinaryMarshaller;
 import org.apache.ignite.testframework.config.GridTestProperties;
 
 /**
- * Cache full API suite with portable marshaller.
+ * Cache full API suite with binary marshaller.
  */
 public class IgniteBinaryCacheFullApiTestSuite extends TestSuite {
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheTestSuite.java
index 729bebe..982bd4c 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheTestSuite.java
@@ -47,7 +47,7 @@ import org.apache.ignite.internal.processors.datastreamer.DataStreamProcessorSel
 import org.apache.ignite.testframework.config.GridTestProperties;
 
 /**
- * Cache suite with portable marshaller.
+ * Cache suite with binary marshaller.
  */
 public class IgniteBinaryCacheTestSuite extends TestSuite {
     /**
@@ -57,11 +57,11 @@ public class IgniteBinaryCacheTestSuite extends TestSuite {
     public static TestSuite suite() throws Exception {
         GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
 
-        TestSuite suite = new TestSuite("Portable Cache Test Suite");
+        TestSuite suite = new TestSuite("Binary Cache Test Suite");
 
         HashSet<Class> ignoredTests = new HashSet<>();
 
-        // Tests below have a special version for Portable Marshaller
+        // Tests below have a special version for Binary Marshaller
         ignoredTests.add(DataStreamProcessorSelfTest.class);
         ignoredTests.add(GridCacheOffHeapTieredEvictionAtomicSelfTest.class);
         ignoredTests.add(GridCacheOffHeapTieredEvictionSelfTest.class);
@@ -71,7 +71,7 @@ public class IgniteBinaryCacheTestSuite extends TestSuite {
         ignoredTests.add(IgniteCacheAtomicLocalExpiryPolicyTest.class);
         ignoredTests.add(GridCacheEntryMemorySizeSelfTest.class);
 
-        // Tests that are not ready to be used with PortableMarshaller
+        // Tests that are not ready to be used with BinaryMarshaller
         ignoredTests.add(GridCacheMvccSelfTest.class);
 
         suite.addTest(IgniteCacheTestSuite.suite(ignoredTests));

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsCacheTestSuite3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsCacheTestSuite3.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsCacheTestSuite3.java
index 7a6a0a6..d80478b 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsCacheTestSuite3.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsCacheTestSuite3.java
@@ -34,7 +34,7 @@ public class IgniteBinaryObjectsCacheTestSuite3 {
     public static TestSuite suite() throws Exception {
         GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
         GridTestProperties.setProperty(GridTestProperties.ENTRY_PROCESSOR_CLASS_NAME,
-            "org.apache.ignite.tests.p2p.CacheDeploymentPortableEntryProcessor");
+            "org.apache.ignite.tests.p2p.CacheDeploymentBinaryEntryProcessor");
 
         TestSuite suite = IgniteCacheTestSuite3.suite();
 


[44/50] [abbrv] ignite git commit: ignite-1.5 Fixed CacheContinuousQueryFailoverAbstractSelfTest to do not hang in case of errors.

Posted by vo...@apache.org.
ignite-1.5 Fixed CacheContinuousQueryFailoverAbstractSelfTest to do not hang in case of errors.


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

Branch: refs/heads/ignite-2100
Commit: 4291edca326be4eafde331001238a9181333fbfc
Parents: 72e5b9a
Author: sboikov <sb...@gridgain.com>
Authored: Mon Dec 14 12:01:51 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Dec 14 12:01:51 2015 +0300

----------------------------------------------------------------------
 ...ContinuousQueryFailoverAbstractSelfTest.java | 186 ++++++++++---------
 1 file changed, 100 insertions(+), 86 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4291edca/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java
index 08e8adb..5a4ba14 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractSelfTest.java
@@ -333,7 +333,7 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
             List<Integer> keys = testKeys(grid(0).cache(null), 10);
 
             for (Integer key : keys) {
-                IgniteCache cache = null;
+                IgniteCache<Object, Object> cache = null;
 
                 if (rnd.nextBoolean())
                     cache = qryClient.cache(null);
@@ -462,7 +462,7 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
 
             assert lsnr.evts.isEmpty();
 
-            QueryCursor<Cache.Entry<Object, Object>> query = clnCache.query(qry);
+            QueryCursor<Cache.Entry<Object, Object>> qryCur = clnCache.query(qry);
 
             Map<Object, T2<Object, Object>> updates = new HashMap<>();
 
@@ -505,7 +505,7 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
 
             checkEvents(expEvts, lsnr, false);
 
-            query.close();
+            qryCur.close();
         }
     }
 
@@ -538,7 +538,7 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
 
         IgniteCache<Object, Object> clnCache = qryClient.cache(null);
 
-        QueryCursor<Cache.Entry<Object, Object>> query = clnCache.query(qry);
+        QueryCursor<Cache.Entry<Object, Object>> qryCur = clnCache.query(qry);
 
         Ignite igniteSrv = ignite(0);
 
@@ -663,7 +663,7 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
 
         checkEvents(expEvts, lsnr, false);
 
-        query.close();
+        qryCur.close();
     }
 
     /**
@@ -992,8 +992,10 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
      * @param expEvts Expected events.
      * @param lsnr Listener.
      * @param lostAllow If {@code true} than won't assert on lost events.
+     * @throws Exception If failed.
      */
-    private void checkEvents(final List<T3<Object, Object, Object>> expEvts, final CacheEventListener2 lsnr,
+    private void checkEvents(final List<T3<Object, Object, Object>> expEvts,
+        final CacheEventListener2 lsnr,
         boolean lostAllow) throws Exception {
         checkEvents(expEvts, lsnr, lostAllow, true);
     }
@@ -1002,6 +1004,8 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
      * @param expEvts Expected events.
      * @param lsnr Listener.
      * @param lostAllow If {@code true} than won't assert on lost events.
+     * @param wait Wait flag.
+     * @throws Exception If failed.
      */
     private void checkEvents(final List<T3<Object, Object, Object>> expEvts, final CacheEventListener2 lsnr,
         boolean lostAllow, boolean wait) throws Exception {
@@ -1017,7 +1021,7 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
         for (Map.Entry<Integer, List<CacheEntryEvent<?, ?>>> e : lsnr.evts.entrySet())
             prevMap.put(e.getKey(), new ArrayList<>(e.getValue()));
 
-        List<T3<Object, Object, Object>> lostEvents = new ArrayList<>();
+        List<T3<Object, Object, Object>> lostEvts = new ArrayList<>();
 
         for (T3<Object, Object, Object> exp : expEvts) {
             List<CacheEntryEvent<?, ?>> rcvdEvts = lsnr.evts.get(exp.get1());
@@ -1026,7 +1030,7 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
                 continue;
 
             if (rcvdEvts == null || rcvdEvts.isEmpty()) {
-                lostEvents.add(exp);
+                lostEvts.add(exp);
 
                 continue;
             }
@@ -1050,7 +1054,7 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
 
             // Lost event is acceptable.
             if (!found)
-                lostEvents.add(exp);
+                lostEvts.add(exp);
         }
 
         boolean dup = false;
@@ -1062,11 +1066,11 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
                     for (CacheEntryEvent<?, ?> e : evts) {
                         boolean found = false;
 
-                        for (T3<Object, Object, Object> lostEvt : lostEvents) {
+                        for (T3<Object, Object, Object> lostEvt : lostEvts) {
                             if (e.getKey().equals(lostEvt.get1()) && e.getValue().equals(lostEvt.get2())) {
                                 found = true;
 
-                                lostEvents.remove(lostEvt);
+                                lostEvts.remove(lostEvt);
 
                                 break;
                             }
@@ -1091,16 +1095,16 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
             }
         }
 
-        if (!lostAllow && lostEvents.size() > 100) {
-            log.error("Lost event cnt: " + lostEvents.size());
+        if (!lostAllow && lostEvts.size() > 100) {
+            log.error("Lost event cnt: " + lostEvts.size());
 
-            for (T3<Object, Object, Object> e : lostEvents)
+            for (T3<Object, Object, Object> e : lostEvts)
                 log.error("Lost event: " + e);
 
             fail("Lose events, see log for details.");
         }
 
-        log.error("Lost event cnt: " + lostEvents.size());
+        log.error("Lost event cnt: " + lostEvts.size());
 
         expEvts.clear();
 
@@ -1126,8 +1130,8 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
      * @param lsnr Listener.
      */
     private void checkEvents(final List<T3<Object, Object, Object>> expEvts, final CacheEventListener3 lsnr,
-        boolean allowLoseEvent) throws Exception {
-        if (!allowLoseEvent)
+        boolean allowLoseEvt) throws Exception {
+        if (!allowLoseEvt)
             assert GridTestUtils.waitForCondition(new PA() {
                 @Override public boolean apply() {
                     return lsnr.evts.size() == expEvts.size();
@@ -1140,11 +1144,11 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
             assertNotNull("No event for key: " + exp.get1(), e);
             assertEquals("Unexpected value: " + e, exp.get2(), e.getValue());
 
-            if (allowLoseEvent)
+            if (allowLoseEvt)
                 lsnr.evts.remove(exp.get1());
         }
 
-        if (allowLoseEvent)
+        if (allowLoseEvt)
             assert lsnr.evts.isEmpty();
 
         expEvts.clear();
@@ -1385,17 +1389,17 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
 
             awaitPartitionMapExchange();
 
-            List<T3<Object, Object, Object>> afterRestEvents = new ArrayList<>();
+            List<T3<Object, Object, Object>> afterRestEvts = new ArrayList<>();
 
             for (int j = 0; j < aff.partitions(); j++) {
                 Integer oldVal = (Integer)qryClnCache.get(j);
 
                 qryClnCache.put(j, i);
 
-                afterRestEvents.add(new T3<>((Object)j, (Object)i, (Object)oldVal));
+                afterRestEvts.add(new T3<>((Object)j, (Object)i, (Object)oldVal));
             }
 
-            checkEvents(new ArrayList<>(afterRestEvents), lsnr, false);
+            checkEvents(new ArrayList<>(afterRestEvts), lsnr, false);
 
             log.info("Start node: " + idx);
 
@@ -1406,9 +1410,10 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
     }
 
     /**
+     * @param backups Number of backups.
      * @throws Exception If failed.
      */
-    public void failoverStartStopFilter(int backups) throws Exception {
+    private void failoverStartStopFilter(int backups) throws Exception {
         this.backups = backups;
 
         final int SRV_NODES = 4;
@@ -1629,22 +1634,22 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
             dinLsnr.vals.clear();
         }
 
-        List<T3<Object, Object, Object>> afterRestEvents = new ArrayList<>();
+        List<T3<Object, Object, Object>> afterRestEvts = new ArrayList<>();
 
         for (int i = 0; i < qryClient.affinity(null).partitions(); i++) {
             Integer oldVal = (Integer)qryClnCache.get(i);
 
             qryClnCache.put(i, i);
 
-            afterRestEvents.add(new T3<>((Object)i, (Object)i, (Object)oldVal));
+            afterRestEvts.add(new T3<>((Object)i, (Object)i, (Object)oldVal));
         }
 
-        checkEvents(new ArrayList<>(afterRestEvents), lsnr, false);
+        checkEvents(new ArrayList<>(afterRestEvts), lsnr, false);
 
         cur.close();
 
         if (dinQry != null) {
-            checkEvents(new ArrayList<>(afterRestEvents), dinLsnr, false);
+            checkEvents(new ArrayList<>(afterRestEvts), dinLsnr, false);
 
             dinQry.close();
         }
@@ -1695,81 +1700,90 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
 
         IgniteInternalFuture<?> restartFut = GridTestUtils.runAsync(new Callable<Void>() {
             @Override public Void call() throws Exception {
-                while (!stop.get() && !err) {
-                    final int idx = rnd.nextInt(SRV_NODES);
-
-                    log.info("Stop node: " + idx);
-
-                    stopGrid(idx);
-
-                    Thread.sleep(300);
-
-                    GridTestUtils.waitForCondition(new PA() {
-                        @Override public boolean apply() {
-                            return qryCln.cluster().nodes().size() == SRV_NODES;
-                        }
-                    }, 5000L);
+                try {
+                    while (!stop.get() && !err) {
+                        final int idx = rnd.nextInt(SRV_NODES);
 
-                    try {
-                        log.info("Start node: " + idx);
+                        log.info("Stop node: " + idx);
 
-                        startGrid(idx);
+                        stopGrid(idx);
 
                         Thread.sleep(300);
 
                         GridTestUtils.waitForCondition(new PA() {
                             @Override public boolean apply() {
-                                return qryCln.cluster().nodes().size() == SRV_NODES + 1;
+                                return qryCln.cluster().nodes().size() == SRV_NODES;
                             }
                         }, 5000L);
-                    }
-                    catch (Exception e) {
-                        log.warning("Failed to stop nodes.", e);
-                    }
 
-                    CyclicBarrier bar = new CyclicBarrier(THREAD + 1 /* plus start/stop thread */, new Runnable() {
-                        @Override public void run() {
-                            try {
-                                int size0 = 0;
+                        try {
+                            log.info("Start node: " + idx);
 
-                                for (List<T3<Object, Object, Object>> evt : expEvts)
-                                    size0 += evt.size();
+                            startGrid(idx);
 
-                                final int size = size0;
+                            Thread.sleep(300);
 
-                                GridTestUtils.waitForCondition(new PA() {
-                                    @Override public boolean apply() {
-                                        return lsnr.size() <= size;
-                                    }
-                                }, 2000L);
+                            GridTestUtils.waitForCondition(new PA() {
+                                @Override public boolean apply() {
+                                    return qryCln.cluster().nodes().size() == SRV_NODES + 1;
+                                }
+                            }, 5000L);
+                        }
+                        catch (Exception e) {
+                            log.warning("Failed to stop nodes.", e);
+                        }
 
-                                List<T3<Object, Object, Object>> expEvts0 = new ArrayList<>();
+                        CyclicBarrier bar = new CyclicBarrier(THREAD + 1 /* plus start/stop thread */, new Runnable() {
+                            @Override public void run() {
+                                try {
+                                    int size0 = 0;
 
-                                for (List<T3<Object, Object, Object>> evt : expEvts)
-                                    expEvts0.addAll(evt);
+                                    for (List<T3<Object, Object, Object>> evt : expEvts)
+                                        size0 += evt.size();
 
-                                checkEvents(expEvts0, lsnr, false, false);
+                                    final int size = size0;
 
-                                for (List<T3<Object, Object, Object>> evt : expEvts)
-                                    evt.clear();
-                            }
-                            catch (Exception e) {
-                                log.error("Failed.", e);
+                                    GridTestUtils.waitForCondition(new PA() {
+                                        @Override public boolean apply() {
+                                            return lsnr.size() <= size;
+                                        }
+                                    }, 2000L);
 
-                                err = true;
+                                    List<T3<Object, Object, Object>> expEvts0 = new ArrayList<>();
 
-                                stop.set(true);
-                            }
-                            finally {
-                                checkBarrier.set(null);
+                                    for (List<T3<Object, Object, Object>> evt : expEvts)
+                                        expEvts0.addAll(evt);
+
+                                    checkEvents(expEvts0, lsnr, false, false);
+
+                                    for (List<T3<Object, Object, Object>> evt : expEvts)
+                                        evt.clear();
+                                }
+                                catch (Exception e) {
+                                    log.error("Failed.", e);
+
+                                    err = true;
+
+                                    stop.set(true);
+                                }
+                                finally {
+                                    checkBarrier.set(null);
+                                }
                             }
-                        }
-                    });
+                        });
 
-                    assertTrue(checkBarrier.compareAndSet(null, bar));
+                        assertTrue(checkBarrier.compareAndSet(null, bar));
+
+                        if (!stop.get() && !err)
+                            bar.await(1, MINUTES);
+                    }
+                }
+                catch (Throwable e) {
+                    log.error("Unexpected error: " + e, e);
+
+                    err = true;
 
-                    if (!stop.get() && !err)
-                        bar.await(1, MINUTES);
+                    throw e;
                 }
 
                 return null;
@@ -1803,7 +1817,7 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
                         CyclicBarrier bar = checkBarrier.get();
 
                         if (bar != null)
-                            bar.await();
+                            bar.await(1, MINUTES);
                     }
                 }
                 catch (Exception e){
@@ -2159,13 +2173,13 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
         private final ConcurrentHashMap<Object, CacheEntryEvent<?, ?>> evts = new ConcurrentHashMap<>();
 
         /** {@inheritDoc} */
-        @Override public void onUpdated(Iterable<CacheEntryEvent<?, ?>> events) throws CacheEntryListenerException {
-            for (CacheEntryEvent<?, ?> e : events) {
+        @Override public void onUpdated(Iterable<CacheEntryEvent<?, ?>> evts) throws CacheEntryListenerException {
+            for (CacheEntryEvent<?, ?> e : evts) {
                 Integer key = (Integer)e.getKey();
 
                 keys.add(key);
 
-                assert evts.put(key, e) == null;
+                assert this.evts.put(key, e) == null;
             }
         }
 
@@ -2180,8 +2194,8 @@ public abstract class CacheContinuousQueryFailoverAbstractSelfTest extends GridC
      */
     public static class CacheEventFilter implements CacheEntryEventSerializableFilter<Object, Object> {
         /** {@inheritDoc} */
-        @Override public boolean evaluate(CacheEntryEvent<?, ?> event) throws CacheEntryListenerException {
-            return ((Integer)event.getValue()) >= 0;
+        @Override public boolean evaluate(CacheEntryEvent<?, ?> evt) throws CacheEntryListenerException {
+            return ((Integer)evt.getValue()) >= 0;
         }
     }
 


[07/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary"

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientPortableMetaData.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientPortableMetaData.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientPortableMetaData.java
deleted file mode 100644
index 5522095..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientPortableMetaData.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.processors.rest.client.message;
-
-import java.util.Map;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Portable meta data sent from client.
- */
-public class GridClientPortableMetaData {
-    /** */
-    private int typeId;
-
-    /** */
-    private String typeName;
-
-    /** */
-    private Map<String, Integer> fields;
-
-    /** */
-    private String affKeyFieldName;
-
-    /**
-     * @return Type ID.
-     */
-    public int typeId() {
-        return typeId;
-    }
-
-    /**
-     * @return Type name.
-     */
-    public String typeName() {
-        return typeName;
-    }
-
-    /**
-     * @return Fields.
-     */
-    public Map<String, Integer> fields() {
-        return fields;
-    }
-
-    /**
-     * @return Affinity key field name.
-     */
-    public String affinityKeyFieldName() {
-        return affKeyFieldName;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridClientPortableMetaData.class, this);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsAbstractSelfTest.java
index f12bb92..7d53705 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFieldsAbstractSelfTest.java
@@ -47,7 +47,7 @@ public abstract class BinaryFieldsAbstractSelfTest extends GridCommonAbstractTes
      * @throws Exception If failed.
      */
     protected BinaryMarshaller createMarshaller() throws Exception {
-        PortableContext ctx = new PortableContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration());
+        BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration());
 
         BinaryMarshaller marsh = new BinaryMarshaller();
 
@@ -85,8 +85,8 @@ public abstract class BinaryFieldsAbstractSelfTest extends GridCommonAbstractTes
      * @param marsh Marshaller.
      * @return Portable context.
      */
-    protected static PortableContext portableContext(BinaryMarshaller marsh) {
-        GridPortableMarshaller impl = U.field(marsh, "impl");
+    protected static BinaryContext portableContext(BinaryMarshaller marsh) {
+        GridBinaryMarshaller impl = U.field(marsh, "impl");
 
         return impl.context();
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsAbstractSelfTest.java
index 1e0f375..43609b8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryFooterOffsetsAbstractSelfTest.java
@@ -40,13 +40,13 @@ public abstract class BinaryFooterOffsetsAbstractSelfTest extends GridCommonAbst
     protected BinaryMarshaller marsh;
 
     /** Portable context. */
-    protected PortableContext ctx;
+    protected BinaryContext ctx;
 
     /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
         super.beforeTest();
 
-        ctx = new PortableContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration());
+        ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), new IgniteConfiguration());
 
         marsh = new BinaryMarshaller();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
index d4f3acf..52fecbf 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryMarshallerSelfTest.java
@@ -84,7 +84,7 @@ import org.jetbrains.annotations.Nullable;
 import org.jsr166.ConcurrentHashMap8;
 import sun.misc.Unsafe;
 
-import static org.apache.ignite.internal.binary.streams.PortableMemoryAllocator.INSTANCE;
+import static org.apache.ignite.internal.binary.streams.BinaryMemoryAllocator.INSTANCE;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertNotEquals;
 
@@ -1244,7 +1244,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
                 String typeName;
 
                 try {
-                    Method mtd = PortableContext.class.getDeclaredMethod("typeName", String.class);
+                    Method mtd = BinaryContext.class.getDeclaredMethod("typeName", String.class);
 
                     mtd.setAccessible(true);
 
@@ -1343,7 +1343,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
             customType4
         ));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         assertEquals("notconfiguredclass".hashCode(), ctx.typeId("NotConfiguredClass"));
         assertEquals("key".hashCode(), ctx.typeId("Key"));
@@ -1406,7 +1406,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
             customType1,
             customType2));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         assertEquals("val".hashCode(), ctx.fieldId("key".hashCode(), "val"));
         assertEquals("val".hashCode(), ctx.fieldId("nonexistentclass2".hashCode(), "val"));
@@ -1942,7 +1942,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     public void testOffheapPortable() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(new BinaryTypeConfiguration(SimpleObject.class.getName())));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         SimpleObject simpleObj = simpleObject();
 
@@ -2273,7 +2273,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     public void testPredefinedTypeIds() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller();
 
-        PortableContext pCtx = portableContext(marsh);
+        BinaryContext pCtx = portableContext(marsh);
 
         Field field = pCtx.getClass().getDeclaredField("predefinedTypeNames");
 
@@ -2286,10 +2286,10 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
         for (Map.Entry<String, Integer> entry : map.entrySet()) {
             int id = entry.getValue();
 
-            if (id == GridPortableMarshaller.UNREGISTERED_TYPE_ID)
+            if (id == GridBinaryMarshaller.UNREGISTERED_TYPE_ID)
                 continue;
 
-            PortableClassDescriptor desc = pCtx.descriptorForTypeId(false, entry.getValue(), null, false);
+            BinaryClassDescriptor desc = pCtx.descriptorForTypeId(false, entry.getValue(), null, false);
 
             assertEquals(desc.typeId(), pCtx.typeId(desc.describedClass().getName()));
             assertEquals(desc.typeId(), pCtx.typeId(pCtx.typeName(desc.describedClass().getName())));
@@ -2652,7 +2652,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
     private <T> BinaryObjectImpl marshal(T obj, BinaryMarshaller marsh) throws IgniteCheckedException {
         byte[] bytes = marsh.marshal(obj);
 
-        return new BinaryObjectImpl(U.<GridPortableMarshaller>field(marsh, "impl").context(),
+        return new BinaryObjectImpl(U.<GridBinaryMarshaller>field(marsh, "impl").context(),
             bytes, 0);
     }
 
@@ -2667,8 +2667,8 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
      * @param marsh Marshaller.
      * @return Portable context.
      */
-    protected PortableContext portableContext(BinaryMarshaller marsh) {
-        GridPortableMarshaller impl = U.field(marsh, "impl");
+    protected BinaryContext portableContext(BinaryMarshaller marsh) {
+        GridBinaryMarshaller impl = U.field(marsh, "impl");
 
         return impl.context();
     }
@@ -2725,7 +2725,7 @@ public class BinaryMarshallerSelfTest extends GridCommonAbstractTest {
 
         iCfg.setBinaryConfiguration(bCfg);
 
-        PortableContext ctx = new PortableContext(BinaryCachingMetadataHandler.create(), iCfg);
+        BinaryContext ctx = new BinaryContext(BinaryCachingMetadataHandler.create(), iCfg);
 
         BinaryMarshaller marsh = new BinaryMarshaller();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
index 50f74eb..bf329a5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderAdditionalSelfTest.java
@@ -32,7 +32,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.binary.mutabletest.GridPortableTestClasses;
 import org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl;
-import org.apache.ignite.internal.binary.builder.PortableBuilderEnum;
+import org.apache.ignite.internal.binary.builder.BinaryBuilderEnum;
 import org.apache.ignite.internal.binary.mutabletest.GridBinaryMarshalerAwareTestClass;
 import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
 import org.apache.ignite.internal.processors.cache.binary.IgniteBinaryImpl;
@@ -128,11 +128,11 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
             switch (field.getName()) {
                 case "anEnum":
-                    assertEquals(((PortableBuilderEnum)actVal).getOrdinal(), ((Enum)expVal).ordinal());
+                    assertEquals(((BinaryBuilderEnum)actVal).getOrdinal(), ((Enum)expVal).ordinal());
                     break;
 
                 case "enumArr": {
-                    PortableBuilderEnum[] actArr = (PortableBuilderEnum[])actVal;
+                    BinaryBuilderEnum[] actArr = (BinaryBuilderEnum[])actVal;
                     Enum[] expArr = (Enum[])expVal;
 
                     assertEquals(expArr.length, actArr.length);
@@ -847,8 +847,8 @@ public class BinaryObjectBuilderAdditionalSelfTest extends GridCommonAbstractTes
 
         BinaryObjectBuilderImpl mutObj = wrap(obj);
 
-        PortableBuilderEnum[] arr = mutObj.getField("enumArr");
-        arr[0] = new PortableBuilderEnum(mutObj.typeId(), GridPortableTestClasses.TestObjectEnum.B);
+        BinaryBuilderEnum[] arr = mutObj.getField("enumArr");
+        arr[0] = new BinaryBuilderEnum(mutObj.typeId(), GridPortableTestClasses.TestObjectEnum.B);
 
         GridPortableTestClasses.TestObjectAllTypes res = mutObj.build().deserialize();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryAffinityKeySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryAffinityKeySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryAffinityKeySelfTest.java
new file mode 100644
index 0000000..2528f17
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryAffinityKeySelfTest.java
@@ -0,0 +1,234 @@
+/*
+ * 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.binary;
+
+import java.util.Collections;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicReference;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.binary.BinaryObjectBuilder;
+import org.apache.ignite.cache.CacheKeyConfiguration;
+import org.apache.ignite.cache.affinity.Affinity;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteKernal;
+import org.apache.ignite.internal.processors.affinity.GridAffinityProcessor;
+import org.apache.ignite.internal.processors.cache.CacheObject;
+import org.apache.ignite.internal.processors.cache.CacheObjectContext;
+import org.apache.ignite.internal.processors.cacheobject.IgniteCacheObjectProcessor;
+import org.apache.ignite.lang.IgniteCallable;
+import org.apache.ignite.lang.IgniteRunnable;
+import org.apache.ignite.binary.BinaryTypeConfiguration;
+import org.apache.ignite.resources.IgniteInstanceResource;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
+
+/**
+ * Test for portable object affinity key.
+ */
+public class GridBinaryAffinityKeySelfTest extends GridCommonAbstractTest {
+    /** */
+    private static final AtomicReference<UUID> nodeId = new AtomicReference<>();
+
+    /** VM ip finder for TCP discovery. */
+    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    private static int GRID_CNT = 5;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();
+
+        typeCfg.setTypeName(TestObject.class.getName());
+
+        BinaryConfiguration bCfg = new BinaryConfiguration();
+
+        bCfg.setTypeConfigurations(Collections.singleton(typeCfg));
+
+        cfg.setBinaryConfiguration(bCfg);
+
+        CacheKeyConfiguration keyCfg = new CacheKeyConfiguration(TestObject.class.getName(), "affKey");
+        CacheKeyConfiguration keyCfg2 = new CacheKeyConfiguration("TestObject2", "affKey");
+
+        cfg.setCacheKeyConfiguration(keyCfg, keyCfg2);
+
+        cfg.setMarshaller(new BinaryMarshaller());
+
+        if (!gridName.equals(getTestGridName(GRID_CNT))) {
+            CacheConfiguration cacheCfg = new CacheConfiguration();
+
+            cacheCfg.setCacheMode(PARTITIONED);
+
+            cfg.setCacheConfiguration(cacheCfg);
+        }
+
+        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        startGridsMultiThreaded(GRID_CNT);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testAffinity() throws Exception {
+        checkAffinity(grid(0));
+
+        try (Ignite igniteNoCache = startGrid(GRID_CNT)) {
+            try {
+                igniteNoCache.cache(null);
+            }
+            catch (IllegalArgumentException ignore) {
+                // Expected error.
+            }
+
+            checkAffinity(igniteNoCache);
+        }
+    }
+
+    /**
+     * @param ignite Ignite.
+     * @throws Exception If failed.
+     */
+    private void checkAffinity(Ignite ignite) throws Exception {
+        Affinity<Object> aff = ignite.affinity(null);
+
+        GridAffinityProcessor affProc = ((IgniteKernal)ignite).context().affinity();
+
+        IgniteCacheObjectProcessor cacheObjProc = ((IgniteKernal)ignite).context().cacheObjects();
+
+        CacheObjectContext cacheObjCtx = cacheObjProc.contextForCache(
+            ignite.cache(null).getConfiguration(CacheConfiguration.class));
+
+        for (int i = 0; i < 1000; i++) {
+            assertEquals(i, aff.affinityKey(i));
+
+            assertEquals(i, aff.affinityKey(new TestObject(i)));
+
+            assertEquals(i, aff.affinityKey(ignite.binary().toBinary(new TestObject(i))));
+
+            BinaryObjectBuilder bldr = ignite.binary().builder("TestObject2");
+
+            bldr.setField("affKey", i);
+
+            assertEquals(i, aff.affinityKey(bldr.build()));
+
+            CacheObject cacheObj = cacheObjProc.toCacheObject(cacheObjCtx, new TestObject(i), true);
+
+            assertEquals(i, aff.affinityKey(cacheObj));
+
+            assertEquals(aff.mapKeyToNode(i), aff.mapKeyToNode(new TestObject(i)));
+
+            assertEquals(aff.mapKeyToNode(i), aff.mapKeyToNode(cacheObj));
+
+            assertEquals(i, affProc.affinityKey(null, i));
+
+            assertEquals(i, affProc.affinityKey(null, new TestObject(i)));
+
+            assertEquals(i, affProc.affinityKey(null, cacheObj));
+
+            assertEquals(affProc.mapKeyToNode(null, i), affProc.mapKeyToNode(null, new TestObject(i)));
+
+            assertEquals(affProc.mapKeyToNode(null, i), affProc.mapKeyToNode(null, cacheObj));
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testAffinityRun() throws Exception {
+        Affinity<Object> aff = grid(0).affinity(null);
+
+        for (int i = 0; i < 1000; i++) {
+            nodeId.set(null);
+
+            grid(0).compute().affinityRun(null, new TestObject(i), new IgniteRunnable() {
+                @IgniteInstanceResource
+                private Ignite ignite;
+
+                @Override public void run() {
+                    nodeId.set(ignite.configuration().getNodeId());
+                }
+            });
+
+            assertEquals(aff.mapKeyToNode(i).id(), nodeId.get());
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testAffinityCall() throws Exception {
+        Affinity<Object> aff = grid(0).affinity(null);
+
+        for (int i = 0; i < 1000; i++) {
+            nodeId.set(null);
+
+            grid(0).compute().affinityCall(null, new TestObject(i), new IgniteCallable<Object>() {
+                @IgniteInstanceResource
+                private Ignite ignite;
+
+                @Override public Object call() {
+                    nodeId.set(ignite.configuration().getNodeId());
+
+                    return null;
+                }
+            });
+
+            assertEquals(aff.mapKeyToNode(i).id(), nodeId.get());
+        }
+    }
+
+    /**
+     */
+    private static class TestObject {
+        /** */
+        @SuppressWarnings("UnusedDeclaration")
+        private int affKey;
+
+        /**
+         */
+        private TestObject() {
+            // No-op.
+        }
+
+        /**
+         * @param affKey Affinity key.
+         */
+        private TestObject(int affKey) {
+            this.affKey = affKey;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java
new file mode 100644
index 0000000..c48b056
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryMarshallerCtxDisabledSelfTest.java
@@ -0,0 +1,247 @@
+/*
+ * 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.binary;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.MarshallerContextAdapter;
+import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.Arrays;
+
+/**
+ *
+ */
+public class GridBinaryMarshallerCtxDisabledSelfTest extends GridCommonAbstractTest {
+    /**
+     * @throws Exception If failed.
+     */
+    public void testObjectExchange() throws Exception {
+        BinaryMarshaller marsh = new BinaryMarshaller();
+        marsh.setContext(new MarshallerContextWithNoStorage());
+
+        IgniteConfiguration cfg = new IgniteConfiguration();
+
+        BinaryContext context = new BinaryContext(BinaryCachingMetadataHandler.create(), cfg);
+
+        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", context, cfg);
+
+        SimpleObject simpleObj = new SimpleObject();
+
+        simpleObj.b = 2;
+        simpleObj.bArr = new byte[] {2, 3, 4, 5, 5};
+        simpleObj.c = 'A';
+        simpleObj.enumVal = TestEnum.D;
+        simpleObj.objArr = new Object[] {"hello", "world", "from", "me"};
+        simpleObj.enumArr = new TestEnum[] {TestEnum.C, TestEnum.B};
+
+        SimpleObject otherObj = new SimpleObject();
+
+        otherObj.b = 3;
+        otherObj.bArr = new byte[] {5, 3, 4};
+
+        simpleObj.otherObj = otherObj;
+
+        assertEquals(simpleObj, marsh.unmarshal(marsh.marshal(simpleObj), null));
+
+        SimpleBinary simplePortable = new SimpleBinary();
+
+        simplePortable.str = "portable";
+        simplePortable.arr = new long[] {100, 200, 300};
+
+        assertEquals(simplePortable, marsh.unmarshal(marsh.marshal(simplePortable), null));
+
+        SimpleExternalizable simpleExtr = new SimpleExternalizable();
+
+        simpleExtr.str = "externalizable";
+        simpleExtr.arr = new long[] {20000, 300000, 400000};
+
+        assertEquals(simpleExtr, marsh.unmarshal(marsh.marshal(simpleExtr), null));
+    }
+
+    /**
+     * Marshaller context with no storage. Platform has to work in such environment as well by marshalling class name of
+     * a portable object.
+     */
+    private static class MarshallerContextWithNoStorage extends MarshallerContextAdapter {
+        /** */
+        public MarshallerContextWithNoStorage() {
+            super(null);
+        }
+
+        /** {@inheritDoc} */
+        @Override protected boolean registerClassName(int id, String clsName) throws IgniteCheckedException {
+            return false;
+        }
+
+        /** {@inheritDoc} */
+        @Override protected String className(int id) throws IgniteCheckedException {
+            return null;
+        }
+    }
+
+    /**
+     */
+    private enum TestEnum {
+        A, B, C, D, E
+    }
+
+    /**
+     */
+    private static class SimpleObject {
+        /** */
+        private byte b;
+
+        /** */
+        private char c;
+
+        /** */
+        private byte[] bArr;
+
+        /** */
+        private Object[] objArr;
+
+        /** */
+        private TestEnum enumVal;
+
+        /** */
+        private TestEnum[] enumArr;
+
+        private SimpleObject otherObj;
+
+        /** {@inheritDoc} */
+        @Override public boolean equals(Object o) {
+            if (this == o)
+                return true;
+
+            if (o == null || getClass() != o.getClass())
+                return false;
+
+            SimpleObject object = (SimpleObject)o;
+
+            if (b != object.b)
+                return false;
+
+            if (c != object.c)
+                return false;
+
+            if (!Arrays.equals(bArr, object.bArr))
+                return false;
+
+            // Probably incorrect - comparing Object[] arrays with Arrays.equals
+            if (!Arrays.equals(objArr, object.objArr))
+                return false;
+
+            if (enumVal != object.enumVal)
+                return false;
+
+            // Probably incorrect - comparing Object[] arrays with Arrays.equals
+            if (!Arrays.equals(enumArr, object.enumArr))
+                return false;
+
+            return !(otherObj != null ? !otherObj.equals(object.otherObj) : object.otherObj != null);
+        }
+    }
+
+    /**
+     *
+     */
+    private static class SimpleBinary implements Binarylizable {
+        /** */
+        private String str;
+
+        /** */
+        private long[] arr;
+
+        /** {@inheritDoc} */
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            writer.writeString("str", str);
+            writer.writeLongArray("longArr", arr);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            str = reader.readString("str");
+            arr = reader.readLongArray("longArr");
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean equals(Object o) {
+            if (this == o)
+                return true;
+
+            if (o == null || getClass() != o.getClass())
+                return false;
+
+            SimpleBinary that = (SimpleBinary)o;
+
+            if (str != null ? !str.equals(that.str) : that.str != null)
+                return false;
+
+            return Arrays.equals(arr, that.arr);
+        }
+    }
+
+    /**
+     *
+     */
+    private static class SimpleExternalizable implements Externalizable {
+        /** */
+        private String str;
+
+        /** */
+        private long[] arr;
+
+        /** {@inheritDoc} */
+        @Override public void writeExternal(ObjectOutput out) throws IOException {
+            out.writeUTF(str);
+            out.writeObject(arr);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+            str = in.readUTF();
+            arr = (long[])in.readObject();
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean equals(Object o) {
+            if (this == o)
+                return true;
+
+            if (o == null || getClass() != o.getClass())
+                return false;
+
+            SimpleExternalizable that = (SimpleExternalizable)o;
+
+            if (str != null ? !str.equals(that.str) : that.str != null)
+                return false;
+
+            return Arrays.equals(arr, that.arr);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableAffinityKeySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableAffinityKeySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableAffinityKeySelfTest.java
deleted file mode 100644
index 74941d0..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableAffinityKeySelfTest.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * 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.binary;
-
-import java.util.Collections;
-import java.util.UUID;
-import java.util.concurrent.atomic.AtomicReference;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.binary.BinaryObjectBuilder;
-import org.apache.ignite.cache.CacheKeyConfiguration;
-import org.apache.ignite.cache.affinity.Affinity;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteKernal;
-import org.apache.ignite.internal.processors.affinity.GridAffinityProcessor;
-import org.apache.ignite.internal.processors.cache.CacheObject;
-import org.apache.ignite.internal.processors.cache.CacheObjectContext;
-import org.apache.ignite.internal.processors.cacheobject.IgniteCacheObjectProcessor;
-import org.apache.ignite.lang.IgniteCallable;
-import org.apache.ignite.lang.IgniteRunnable;
-import org.apache.ignite.binary.BinaryTypeConfiguration;
-import org.apache.ignite.resources.IgniteInstanceResource;
-import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-import static org.apache.ignite.cache.CacheMode.PARTITIONED;
-
-/**
- * Test for portable object affinity key.
- */
-public class GridPortableAffinityKeySelfTest extends GridCommonAbstractTest {
-    /** */
-    private static final AtomicReference<UUID> nodeId = new AtomicReference<>();
-
-    /** VM ip finder for TCP discovery. */
-    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
-    /** */
-    private static int GRID_CNT = 5;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();
-
-        typeCfg.setTypeName(TestObject.class.getName());
-
-        BinaryConfiguration bCfg = new BinaryConfiguration();
-
-        bCfg.setTypeConfigurations(Collections.singleton(typeCfg));
-
-        cfg.setBinaryConfiguration(bCfg);
-
-        CacheKeyConfiguration keyCfg = new CacheKeyConfiguration(TestObject.class.getName(), "affKey");
-        CacheKeyConfiguration keyCfg2 = new CacheKeyConfiguration("TestObject2", "affKey");
-
-        cfg.setCacheKeyConfiguration(keyCfg, keyCfg2);
-
-        cfg.setMarshaller(new BinaryMarshaller());
-
-        if (!gridName.equals(getTestGridName(GRID_CNT))) {
-            CacheConfiguration cacheCfg = new CacheConfiguration();
-
-            cacheCfg.setCacheMode(PARTITIONED);
-
-            cfg.setCacheConfiguration(cacheCfg);
-        }
-
-        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTestsStarted() throws Exception {
-        startGridsMultiThreaded(GRID_CNT);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        stopAllGrids();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testAffinity() throws Exception {
-        checkAffinity(grid(0));
-
-        try (Ignite igniteNoCache = startGrid(GRID_CNT)) {
-            try {
-                igniteNoCache.cache(null);
-            }
-            catch (IllegalArgumentException ignore) {
-                // Expected error.
-            }
-
-            checkAffinity(igniteNoCache);
-        }
-    }
-
-    /**
-     * @param ignite Ignite.
-     * @throws Exception If failed.
-     */
-    private void checkAffinity(Ignite ignite) throws Exception {
-        Affinity<Object> aff = ignite.affinity(null);
-
-        GridAffinityProcessor affProc = ((IgniteKernal)ignite).context().affinity();
-
-        IgniteCacheObjectProcessor cacheObjProc = ((IgniteKernal)ignite).context().cacheObjects();
-
-        CacheObjectContext cacheObjCtx = cacheObjProc.contextForCache(
-            ignite.cache(null).getConfiguration(CacheConfiguration.class));
-
-        for (int i = 0; i < 1000; i++) {
-            assertEquals(i, aff.affinityKey(i));
-
-            assertEquals(i, aff.affinityKey(new TestObject(i)));
-
-            assertEquals(i, aff.affinityKey(ignite.binary().toBinary(new TestObject(i))));
-
-            BinaryObjectBuilder bldr = ignite.binary().builder("TestObject2");
-
-            bldr.setField("affKey", i);
-
-            assertEquals(i, aff.affinityKey(bldr.build()));
-
-            CacheObject cacheObj = cacheObjProc.toCacheObject(cacheObjCtx, new TestObject(i), true);
-
-            assertEquals(i, aff.affinityKey(cacheObj));
-
-            assertEquals(aff.mapKeyToNode(i), aff.mapKeyToNode(new TestObject(i)));
-
-            assertEquals(aff.mapKeyToNode(i), aff.mapKeyToNode(cacheObj));
-
-            assertEquals(i, affProc.affinityKey(null, i));
-
-            assertEquals(i, affProc.affinityKey(null, new TestObject(i)));
-
-            assertEquals(i, affProc.affinityKey(null, cacheObj));
-
-            assertEquals(affProc.mapKeyToNode(null, i), affProc.mapKeyToNode(null, new TestObject(i)));
-
-            assertEquals(affProc.mapKeyToNode(null, i), affProc.mapKeyToNode(null, cacheObj));
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testAffinityRun() throws Exception {
-        Affinity<Object> aff = grid(0).affinity(null);
-
-        for (int i = 0; i < 1000; i++) {
-            nodeId.set(null);
-
-            grid(0).compute().affinityRun(null, new TestObject(i), new IgniteRunnable() {
-                @IgniteInstanceResource
-                private Ignite ignite;
-
-                @Override public void run() {
-                    nodeId.set(ignite.configuration().getNodeId());
-                }
-            });
-
-            assertEquals(aff.mapKeyToNode(i).id(), nodeId.get());
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testAffinityCall() throws Exception {
-        Affinity<Object> aff = grid(0).affinity(null);
-
-        for (int i = 0; i < 1000; i++) {
-            nodeId.set(null);
-
-            grid(0).compute().affinityCall(null, new TestObject(i), new IgniteCallable<Object>() {
-                @IgniteInstanceResource
-                private Ignite ignite;
-
-                @Override public Object call() {
-                    nodeId.set(ignite.configuration().getNodeId());
-
-                    return null;
-                }
-            });
-
-            assertEquals(aff.mapKeyToNode(i).id(), nodeId.get());
-        }
-    }
-
-    /**
-     */
-    private static class TestObject {
-        /** */
-        @SuppressWarnings("UnusedDeclaration")
-        private int affKey;
-
-        /**
-         */
-        private TestObject() {
-            // No-op.
-        }
-
-        /**
-         * @param affKey Affinity key.
-         */
-        private TestObject(int affKey) {
-            this.affKey = affKey;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableMarshallerCtxDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableMarshallerCtxDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableMarshallerCtxDisabledSelfTest.java
deleted file mode 100644
index a30d09f..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableMarshallerCtxDisabledSelfTest.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * 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.binary;
-
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.BinaryReader;
-import org.apache.ignite.binary.BinaryWriter;
-import org.apache.ignite.binary.Binarylizable;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.MarshallerContextAdapter;
-import org.apache.ignite.internal.util.IgniteUtils;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.Arrays;
-
-/**
- *
- */
-public class GridPortableMarshallerCtxDisabledSelfTest extends GridCommonAbstractTest {
-    /**
-     * @throws Exception If failed.
-     */
-    public void testObjectExchange() throws Exception {
-        BinaryMarshaller marsh = new BinaryMarshaller();
-        marsh.setContext(new MarshallerContextWithNoStorage());
-
-        IgniteConfiguration cfg = new IgniteConfiguration();
-
-        PortableContext context = new PortableContext(BinaryCachingMetadataHandler.create(), cfg);
-
-        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", context, cfg);
-
-        SimpleObject simpleObj = new SimpleObject();
-
-        simpleObj.b = 2;
-        simpleObj.bArr = new byte[] {2, 3, 4, 5, 5};
-        simpleObj.c = 'A';
-        simpleObj.enumVal = TestEnum.D;
-        simpleObj.objArr = new Object[] {"hello", "world", "from", "me"};
-        simpleObj.enumArr = new TestEnum[] {TestEnum.C, TestEnum.B};
-
-        SimpleObject otherObj = new SimpleObject();
-
-        otherObj.b = 3;
-        otherObj.bArr = new byte[] {5, 3, 4};
-
-        simpleObj.otherObj = otherObj;
-
-        assertEquals(simpleObj, marsh.unmarshal(marsh.marshal(simpleObj), null));
-
-        SimpleBinary simplePortable = new SimpleBinary();
-
-        simplePortable.str = "portable";
-        simplePortable.arr = new long[] {100, 200, 300};
-
-        assertEquals(simplePortable, marsh.unmarshal(marsh.marshal(simplePortable), null));
-
-        SimpleExternalizable simpleExtr = new SimpleExternalizable();
-
-        simpleExtr.str = "externalizable";
-        simpleExtr.arr = new long[] {20000, 300000, 400000};
-
-        assertEquals(simpleExtr, marsh.unmarshal(marsh.marshal(simpleExtr), null));
-    }
-
-    /**
-     * Marshaller context with no storage. Platform has to work in such environment as well by marshalling class name of
-     * a portable object.
-     */
-    private static class MarshallerContextWithNoStorage extends MarshallerContextAdapter {
-        /** */
-        public MarshallerContextWithNoStorage() {
-            super(null);
-        }
-
-        /** {@inheritDoc} */
-        @Override protected boolean registerClassName(int id, String clsName) throws IgniteCheckedException {
-            return false;
-        }
-
-        /** {@inheritDoc} */
-        @Override protected String className(int id) throws IgniteCheckedException {
-            return null;
-        }
-    }
-
-    /**
-     */
-    private enum TestEnum {
-        A, B, C, D, E
-    }
-
-    /**
-     */
-    private static class SimpleObject {
-        /** */
-        private byte b;
-
-        /** */
-        private char c;
-
-        /** */
-        private byte[] bArr;
-
-        /** */
-        private Object[] objArr;
-
-        /** */
-        private TestEnum enumVal;
-
-        /** */
-        private TestEnum[] enumArr;
-
-        private SimpleObject otherObj;
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            SimpleObject object = (SimpleObject)o;
-
-            if (b != object.b)
-                return false;
-
-            if (c != object.c)
-                return false;
-
-            if (!Arrays.equals(bArr, object.bArr))
-                return false;
-
-            // Probably incorrect - comparing Object[] arrays with Arrays.equals
-            if (!Arrays.equals(objArr, object.objArr))
-                return false;
-
-            if (enumVal != object.enumVal)
-                return false;
-
-            // Probably incorrect - comparing Object[] arrays with Arrays.equals
-            if (!Arrays.equals(enumArr, object.enumArr))
-                return false;
-
-            return !(otherObj != null ? !otherObj.equals(object.otherObj) : object.otherObj != null);
-        }
-    }
-
-    /**
-     *
-     */
-    private static class SimpleBinary implements Binarylizable {
-        /** */
-        private String str;
-
-        /** */
-        private long[] arr;
-
-        /** {@inheritDoc} */
-        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
-            writer.writeString("str", str);
-            writer.writeLongArray("longArr", arr);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
-            str = reader.readString("str");
-            arr = reader.readLongArray("longArr");
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            SimpleBinary that = (SimpleBinary)o;
-
-            if (str != null ? !str.equals(that.str) : that.str != null)
-                return false;
-
-            return Arrays.equals(arr, that.arr);
-        }
-    }
-
-    /**
-     *
-     */
-    private static class SimpleExternalizable implements Externalizable {
-        /** */
-        private String str;
-
-        /** */
-        private long[] arr;
-
-        /** {@inheritDoc} */
-        @Override public void writeExternal(ObjectOutput out) throws IOException {
-            out.writeUTF(str);
-            out.writeObject(arr);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-            str = in.readUTF();
-            arr = (long[])in.readObject();
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            SimpleExternalizable that = (SimpleExternalizable)o;
-
-            if (str != null ? !str.equals(that.str) : that.str != null)
-                return false;
-
-            return Arrays.equals(arr, that.arr);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableWildcardsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableWildcardsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableWildcardsSelfTest.java
index a91e350..9226272 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableWildcardsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableWildcardsSelfTest.java
@@ -45,7 +45,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
 
@@ -81,7 +81,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
@@ -101,7 +101,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
 
@@ -137,7 +137,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
@@ -173,7 +173,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
@@ -205,7 +205,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
             typeCfg));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
 
@@ -229,7 +229,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
 
@@ -262,7 +262,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
@@ -281,7 +281,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
 
@@ -314,7 +314,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
@@ -347,7 +347,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("unknown.*")
         ));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
@@ -378,7 +378,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
             new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
             typeCfg));
 
-        PortableContext ctx = portableContext(marsh);
+        BinaryContext ctx = portableContext(marsh);
 
         Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
 
@@ -397,8 +397,8 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
      * @param marsh Marshaller.
      * @return Portable context.
      */
-    protected PortableContext portableContext(BinaryMarshaller marsh) {
-        GridPortableMarshaller impl = U.field(marsh, "impl");
+    protected BinaryContext portableContext(BinaryMarshaller marsh) {
+        GridBinaryMarshaller impl = U.field(marsh, "impl");
 
         return impl.context();
     }
@@ -451,7 +451,7 @@ public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
 
         iCfg.setBinaryConfiguration(bCfg);
 
-        PortableContext ctx = new PortableContext(BinaryNoopMetadataHandler.instance(), iCfg);
+        BinaryContext ctx = new BinaryContext(BinaryNoopMetadataHandler.instance(), iCfg);
 
         BinaryMarshaller marsh = new BinaryMarshaller();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryCacheEntryMemorySizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryCacheEntryMemorySizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryCacheEntryMemorySizeSelfTest.java
new file mode 100644
index 0000000..128e316
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryCacheEntryMemorySizeSelfTest.java
@@ -0,0 +1,48 @@
+/*
+ * 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.processors.cache.binary;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.binary.BinaryNoopMetadataHandler;
+import org.apache.ignite.internal.binary.BinaryContext;
+import org.apache.ignite.internal.processors.cache.GridCacheEntryMemorySizeSelfTest;
+import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.marshaller.Marshaller;
+import org.apache.ignite.marshaller.MarshallerContextTestImpl;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+
+/**
+ *
+ */
+public class GridBinaryCacheEntryMemorySizeSelfTest extends GridCacheEntryMemorySizeSelfTest {
+    /** {@inheritDoc} */
+    @Override protected Marshaller createMarshaller() throws IgniteCheckedException {
+        BinaryMarshaller marsh = new BinaryMarshaller();
+
+        marsh.setContext(new MarshallerContextTestImpl(null));
+
+        IgniteConfiguration iCfg = new IgniteConfiguration();
+
+        BinaryContext pCtx = new BinaryContext(BinaryNoopMetadataHandler.instance(), iCfg);
+
+        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", pCtx, iCfg);
+
+        return marsh;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java
new file mode 100644
index 0000000..9306958
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridBinaryDuplicateIndexObjectsAbstractSelfTest.java
@@ -0,0 +1,161 @@
+/*
+ * 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.processors.cache.binary;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cache.CacheTypeMetadata;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.binary.BinaryObject;
+
+/**
+ * Tests that portable object is the same in cache entry and in index.
+ */
+public abstract class GridBinaryDuplicateIndexObjectsAbstractSelfTest extends GridCacheAbstractSelfTest {
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return 1;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        BinaryConfiguration bCfg = new BinaryConfiguration();
+
+        bCfg.setClassNames(Collections.singletonList(TestPortable.class.getName()));
+
+        cfg.setBinaryConfiguration(bCfg);
+
+        cfg.setMarshaller(new BinaryMarshaller());
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
+        CacheConfiguration ccfg = super.cacheConfiguration(gridName);
+
+        ccfg.setCopyOnRead(false);
+
+        CacheTypeMetadata meta = new CacheTypeMetadata();
+
+        meta.setKeyType(Integer.class);
+        meta.setValueType(TestPortable.class.getName());
+
+        Map<String, Class<?>> idx = new HashMap<>();
+
+        idx.put("fieldOne", String.class);
+        idx.put("fieldTwo", Integer.class);
+
+        meta.setAscendingFields(idx);
+
+        ccfg.setTypeMetadata(Collections.singletonList(meta));
+
+        return ccfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override public abstract CacheAtomicityMode atomicityMode();
+
+    /** {@inheritDoc} */
+    @Override public abstract CacheMode cacheMode();
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testIndexReferences() throws Exception {
+        IgniteCache<Integer, TestPortable> cache = grid(0).cache(null);
+
+        String fieldOneVal = "123";
+        int fieldTwoVal = 123;
+        int key = 0;
+
+        cache.put(key, new TestPortable(fieldOneVal, fieldTwoVal));
+
+        IgniteCache<Integer, BinaryObject> prj = grid(0).cache(null).withKeepBinary();
+
+        BinaryObject cacheVal = prj.get(key);
+
+        assertEquals(fieldOneVal, cacheVal.field("fieldOne"));
+        assertEquals(new Integer(fieldTwoVal), cacheVal.field("fieldTwo"));
+
+        List<?> row = F.first(prj.query(new SqlFieldsQuery("select _val from " +
+            "TestPortable where _key = ?").setArgs(key)).getAll());
+
+        assertEquals(1, row.size());
+
+        BinaryObject qryVal = (BinaryObject)row.get(0);
+
+        assertEquals(fieldOneVal, qryVal.field("fieldOne"));
+        assertEquals(new Integer(fieldTwoVal), qryVal.field("fieldTwo"));
+        assertSame(cacheVal, qryVal);
+    }
+
+    /**
+     * Test portable object.
+     */
+    private static class TestPortable {
+        /** */
+        private String fieldOne;
+
+        /** */
+        private int fieldTwo;
+
+        /**
+         *
+         */
+        private TestPortable() {
+            // No-op.
+        }
+
+        /**
+         * @param fieldOne Field one.
+         * @param fieldTwo Field two.
+         */
+        private TestPortable(String fieldOne, int fieldTwo) {
+            this.fieldOne = fieldOne;
+            this.fieldTwo = fieldTwo;
+        }
+
+        /**
+         * @return Field one.
+         */
+        public String fieldOne() {
+            return fieldOne;
+        }
+
+        /**
+         * @return Field two.
+         */
+        public int fieldTwo() {
+            return fieldTwo;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java
new file mode 100644
index 0000000..058dc0b
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreAbstractSelfTest.java
@@ -0,0 +1,300 @@
+/*
+ * 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.processors.cache.binary;
+
+import com.google.common.collect.ImmutableSet;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import javax.cache.Cache;
+import org.apache.ignite.cache.store.CacheStoreAdapter;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.jetbrains.annotations.Nullable;
+import org.jsr166.ConcurrentHashMap8;
+
+/**
+ * Tests for cache store with binary.
+ */
+public abstract class GridCacheBinaryStoreAbstractSelfTest extends GridCommonAbstractTest {
+    /** */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    private static final TestStore STORE = new TestStore();
+
+    /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        BinaryConfiguration bCfg = new BinaryConfiguration();
+
+        bCfg.setClassNames(Arrays.asList(Key.class.getName(), Value.class.getName()));
+
+        cfg.setBinaryConfiguration(bCfg);
+
+        cfg.setMarshaller(new BinaryMarshaller());
+
+        CacheConfiguration cacheCfg = new CacheConfiguration();
+
+        cacheCfg.setCacheStoreFactory(singletonFactory(STORE));
+        cacheCfg.setKeepBinaryInStore(keepPortableInStore());
+        cacheCfg.setReadThrough(true);
+        cacheCfg.setWriteThrough(true);
+        cacheCfg.setLoadPreviousValue(true);
+
+        cfg.setCacheConfiguration(cacheCfg);
+
+        TcpDiscoverySpi disco = new TcpDiscoverySpi();
+
+        disco.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(disco);
+
+        return cfg;
+    }
+
+    /**
+     * @return Keep binary in store flag.
+     */
+    protected abstract boolean keepPortableInStore();
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        startGrid();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopGrid();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        STORE.map().clear();
+
+        jcache().clear();
+
+        assert jcache().size() == 0;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPut() throws Exception {
+        jcache().put(new Key(1), new Value(1));
+
+        checkMap(STORE.map(), 1);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPutAll() throws Exception {
+        Map<Object, Object> map = new HashMap<>();
+
+        for (int i = 1; i <= 3; i++)
+            map.put(new Key(i), new Value(i));
+
+        jcache().putAll(map);
+
+        checkMap(STORE.map(), 1, 2, 3);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testLoad() throws Exception {
+        populateMap(STORE.map(), 1);
+
+        Object val = jcache().get(new Key(1));
+
+        assertTrue(String.valueOf(val), val instanceof Value);
+
+        assertEquals(1, ((Value)val).index());
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testLoadAll() throws Exception {
+        populateMap(STORE.map(), 1, 2, 3);
+
+        Set<Object> keys = new HashSet<>();
+
+        for (int i = 1; i <= 3; i++)
+            keys.add(new Key(i));
+
+        Map<Object, Object> res = jcache().getAll(keys);
+
+        assertEquals(3, res.size());
+
+        for (int i = 1; i <= 3; i++) {
+            Object val = res.get(new Key(i));
+
+            assertTrue(String.valueOf(val), val instanceof Value);
+
+            assertEquals(i, ((Value)val).index());
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testRemove() throws Exception {
+        for (int i = 1; i <= 3; i++)
+            jcache().put(new Key(i), new Value(i));
+
+        jcache().remove(new Key(1));
+
+        checkMap(STORE.map(), 2, 3);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testRemoveAll() throws Exception {
+        for (int i = 1; i <= 3; i++)
+            jcache().put(new Key(i), new Value(i));
+
+        jcache().removeAll(ImmutableSet.of(new Key(1), new Key(2)));
+
+        checkMap(STORE.map(), 3);
+    }
+
+    /**
+     * @param map Map.
+     * @param idxs Indexes.
+     */
+    protected abstract void populateMap(Map<Object, Object> map, int... idxs);
+
+    /**
+     * @param map Map.
+     * @param idxs Indexes.
+     */
+    protected abstract void checkMap(Map<Object, Object> map, int... idxs);
+
+    /**
+     */
+    protected static class Key {
+        /** */
+        private int idx;
+
+        /**
+         * @param idx Index.
+         */
+        public Key(int idx) {
+            this.idx = idx;
+        }
+
+        /**
+         * @return Index.
+         */
+        int index() {
+            return idx;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean equals(Object o) {
+            if (this == o)
+                return true;
+
+            if (o == null || getClass() != o.getClass())
+                return false;
+
+            Key key = (Key)o;
+
+            return idx == key.idx;
+        }
+
+        /** {@inheritDoc} */
+        @Override public int hashCode() {
+            return idx;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return "Key [idx=" + idx + ']';
+        }
+    }
+
+    /**
+     */
+    protected static class Value {
+        /** */
+        private int idx;
+
+        /**
+         * @param idx Index.
+         */
+        public Value(int idx) {
+            this.idx = idx;
+        }
+
+        /**
+         * @return Index.
+         */
+        int index() {
+            return idx;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return "Value [idx=" + idx + ']';
+        }
+    }
+
+    /**
+     *
+     */
+    private static class TestStore extends CacheStoreAdapter<Object, Object> {
+        /** */
+        private final Map<Object, Object> map = new ConcurrentHashMap8<>();
+
+        /** {@inheritDoc} */
+        @Nullable @Override public Object load(Object key) {
+            return map.get(key);
+        }
+
+        /** {@inheritDoc} */
+        @Override public void write(Cache.Entry<?, ?> e) {
+            map.put(e.getKey(), e.getValue());
+        }
+
+        /** {@inheritDoc} */
+        @Override public void delete(Object key) {
+            map.remove(key);
+        }
+
+        /**
+         * @return Map.
+         */
+        Map<Object, Object> map() {
+            return map;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreObjectsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreObjectsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreObjectsSelfTest.java
new file mode 100644
index 0000000..a4d08ec
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreObjectsSelfTest.java
@@ -0,0 +1,55 @@
+/*
+ * 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.processors.cache.binary;
+
+import java.util.Map;
+
+/**
+ * Tests for cache store with binary.
+ */
+public class GridCacheBinaryStoreObjectsSelfTest extends GridCacheBinaryStoreAbstractSelfTest {
+    /** {@inheritDoc} */
+    @Override protected boolean keepPortableInStore() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void populateMap(Map<Object, Object> map, int... idxs) {
+        assert map != null;
+        assert idxs != null;
+
+        for (int idx : idxs)
+            map.put(new Key(idx), new Value(idx));
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void checkMap(Map<Object, Object> map, int... idxs) {
+        assert map != null;
+        assert idxs != null;
+
+        assertEquals(idxs.length, map.size());
+
+        for (int idx : idxs) {
+            Object val = map.get(new Key(idx));
+
+            assertTrue(String.valueOf(val), val instanceof Value);
+
+            assertEquals(idx, ((Value)val).index());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStorePortablesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStorePortablesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStorePortablesSelfTest.java
new file mode 100644
index 0000000..db15f08
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStorePortablesSelfTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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.processors.cache.binary;
+
+import java.util.Map;
+import org.apache.ignite.binary.BinaryObject;
+
+/**
+ * Tests for cache store with binary.
+ */
+public class GridCacheBinaryStorePortablesSelfTest extends GridCacheBinaryStoreAbstractSelfTest {
+    /** {@inheritDoc} */
+    @Override protected boolean keepPortableInStore() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void populateMap(Map<Object, Object> map, int... idxs) {
+        assert map != null;
+        assert idxs != null;
+
+        for (int idx : idxs)
+            map.put(portable(new Key(idx)), portable(new Value(idx)));
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void checkMap(Map<Object, Object> map, int... idxs) {
+        assert map != null;
+        assert idxs != null;
+
+        assertEquals(idxs.length, map.size());
+
+        for (int idx : idxs) {
+            Object val = map.get(portable(new Key(idx)));
+
+            assertTrue(String.valueOf(val), val instanceof BinaryObject);
+
+            BinaryObject po = (BinaryObject)val;
+
+            assertEquals("Value", po.type().typeName());
+            assertEquals(new Integer(idx), po.field("idx"));
+        }
+    }
+
+    /**
+     * @param obj Object.
+     * @return Portable object.
+     */
+    private Object portable(Object obj) {
+        return grid().binary().toBinary(obj);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCachePortableStoreAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCachePortableStoreAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCachePortableStoreAbstractSelfTest.java
deleted file mode 100644
index b9d7b5d..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCachePortableStoreAbstractSelfTest.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * 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.processors.cache.binary;
-
-import com.google.common.collect.ImmutableSet;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import javax.cache.Cache;
-import org.apache.ignite.cache.store.CacheStoreAdapter;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.binary.BinaryMarshaller;
-import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.jetbrains.annotations.Nullable;
-import org.jsr166.ConcurrentHashMap8;
-
-/**
- * Tests for cache store with binary.
- */
-public abstract class GridCachePortableStoreAbstractSelfTest extends GridCommonAbstractTest {
-    /** */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** */
-    private static final TestStore STORE = new TestStore();
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        BinaryConfiguration bCfg = new BinaryConfiguration();
-
-        bCfg.setClassNames(Arrays.asList(Key.class.getName(), Value.class.getName()));
-
-        cfg.setBinaryConfiguration(bCfg);
-
-        cfg.setMarshaller(new BinaryMarshaller());
-
-        CacheConfiguration cacheCfg = new CacheConfiguration();
-
-        cacheCfg.setCacheStoreFactory(singletonFactory(STORE));
-        cacheCfg.setKeepBinaryInStore(keepPortableInStore());
-        cacheCfg.setReadThrough(true);
-        cacheCfg.setWriteThrough(true);
-        cacheCfg.setLoadPreviousValue(true);
-
-        cfg.setCacheConfiguration(cacheCfg);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(disco);
-
-        return cfg;
-    }
-
-    /**
-     * @return Keep binary in store flag.
-     */
-    protected abstract boolean keepPortableInStore();
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTestsStarted() throws Exception {
-        startGrid();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        stopGrid();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        STORE.map().clear();
-
-        jcache().clear();
-
-        assert jcache().size() == 0;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPut() throws Exception {
-        jcache().put(new Key(1), new Value(1));
-
-        checkMap(STORE.map(), 1);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPutAll() throws Exception {
-        Map<Object, Object> map = new HashMap<>();
-
-        for (int i = 1; i <= 3; i++)
-            map.put(new Key(i), new Value(i));
-
-        jcache().putAll(map);
-
-        checkMap(STORE.map(), 1, 2, 3);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLoad() throws Exception {
-        populateMap(STORE.map(), 1);
-
-        Object val = jcache().get(new Key(1));
-
-        assertTrue(String.valueOf(val), val instanceof Value);
-
-        assertEquals(1, ((Value)val).index());
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLoadAll() throws Exception {
-        populateMap(STORE.map(), 1, 2, 3);
-
-        Set<Object> keys = new HashSet<>();
-
-        for (int i = 1; i <= 3; i++)
-            keys.add(new Key(i));
-
-        Map<Object, Object> res = jcache().getAll(keys);
-
-        assertEquals(3, res.size());
-
-        for (int i = 1; i <= 3; i++) {
-            Object val = res.get(new Key(i));
-
-            assertTrue(String.valueOf(val), val instanceof Value);
-
-            assertEquals(i, ((Value)val).index());
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testRemove() throws Exception {
-        for (int i = 1; i <= 3; i++)
-            jcache().put(new Key(i), new Value(i));
-
-        jcache().remove(new Key(1));
-
-        checkMap(STORE.map(), 2, 3);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testRemoveAll() throws Exception {
-        for (int i = 1; i <= 3; i++)
-            jcache().put(new Key(i), new Value(i));
-
-        jcache().removeAll(ImmutableSet.of(new Key(1), new Key(2)));
-
-        checkMap(STORE.map(), 3);
-    }
-
-    /**
-     * @param map Map.
-     * @param idxs Indexes.
-     */
-    protected abstract void populateMap(Map<Object, Object> map, int... idxs);
-
-    /**
-     * @param map Map.
-     * @param idxs Indexes.
-     */
-    protected abstract void checkMap(Map<Object, Object> map, int... idxs);
-
-    /**
-     */
-    protected static class Key {
-        /** */
-        private int idx;
-
-        /**
-         * @param idx Index.
-         */
-        public Key(int idx) {
-            this.idx = idx;
-        }
-
-        /**
-         * @return Index.
-         */
-        int index() {
-            return idx;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            Key key = (Key)o;
-
-            return idx == key.idx;
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            return idx;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return "Key [idx=" + idx + ']';
-        }
-    }
-
-    /**
-     */
-    protected static class Value {
-        /** */
-        private int idx;
-
-        /**
-         * @param idx Index.
-         */
-        public Value(int idx) {
-            this.idx = idx;
-        }
-
-        /**
-         * @return Index.
-         */
-        int index() {
-            return idx;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return "Value [idx=" + idx + ']';
-        }
-    }
-
-    /**
-     *
-     */
-    private static class TestStore extends CacheStoreAdapter<Object, Object> {
-        /** */
-        private final Map<Object, Object> map = new ConcurrentHashMap8<>();
-
-        /** {@inheritDoc} */
-        @Nullable @Override public Object load(Object key) {
-            return map.get(key);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void write(Cache.Entry<?, ?> e) {
-            map.put(e.getKey(), e.getValue());
-        }
-
-        /** {@inheritDoc} */
-        @Override public void delete(Object key) {
-            map.remove(key);
-        }
-
-        /**
-         * @return Map.
-         */
-        Map<Object, Object> map() {
-            return map;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCachePortableStoreObjectsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCachePortableStoreObjectsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCachePortableStoreObjectsSelfTest.java
deleted file mode 100644
index 00d1ae4..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCachePortableStoreObjectsSelfTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.processors.cache.binary;
-
-import java.util.Map;
-
-/**
- * Tests for cache store with binary.
- */
-public class GridCachePortableStoreObjectsSelfTest extends GridCachePortableStoreAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected boolean keepPortableInStore() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void populateMap(Map<Object, Object> map, int... idxs) {
-        assert map != null;
-        assert idxs != null;
-
-        for (int idx : idxs)
-            map.put(new Key(idx), new Value(idx));
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void checkMap(Map<Object, Object> map, int... idxs) {
-        assert map != null;
-        assert idxs != null;
-
-        assertEquals(idxs.length, map.size());
-
-        for (int idx : idxs) {
-            Object val = map.get(new Key(idx));
-
-            assertTrue(String.valueOf(val), val instanceof Value);
-
-            assertEquals(idx, ((Value)val).index());
-        }
-    }
-}


[35/50] [abbrv] ignite git commit: Fixed failure in BinaryObjectBuilderSelfTest.testSetBinaryObject.

Posted by vo...@apache.org.
Fixed failure in BinaryObjectBuilderSelfTest.testSetBinaryObject.


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

Branch: refs/heads/ignite-2100
Commit: 3db14482091d01e96e1ae40a15cb903c3adcddbd
Parents: ed27fbd
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Dec 14 10:19:24 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Dec 14 10:19:24 2015 +0300

----------------------------------------------------------------------
 .../internal/binary/BinaryObjectBuilderSelfTest.java      | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3db14482/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java
index 2424fe8..3b6d0b0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/BinaryObjectBuilderSelfTest.java
@@ -909,11 +909,19 @@ public class BinaryObjectBuilderSelfTest extends GridCommonAbstractTest {
      *
      */
     public void testSetBinaryObject() {
+        // Prepare marshaller context.
+        CacheObjectBinaryProcessorImpl proc = ((CacheObjectBinaryProcessorImpl)(grid(0)).context().cacheObjects());
+
+        proc.marshal(new GridBinaryTestClasses.TestObjectContainer());
+        proc.marshal(new GridBinaryTestClasses.TestObjectAllTypes());
+
+        // Actual test.
         BinaryObject binaryObj = builder(GridBinaryTestClasses.TestObjectContainer.class.getName())
             .setField("foo", toBinary(new GridBinaryTestClasses.TestObjectAllTypes()))
             .build();
 
-        assertTrue(binaryObj.<GridBinaryTestClasses.TestObjectContainer>deserialize().foo instanceof GridBinaryTestClasses.TestObjectAllTypes);
+        assertTrue(binaryObj.<GridBinaryTestClasses.TestObjectContainer>deserialize().foo instanceof
+            GridBinaryTestClasses.TestObjectAllTypes);
     }
 
     /**


[13/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary"

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableContext.java
deleted file mode 100644
index f7375a4..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableContext.java
+++ /dev/null
@@ -1,1102 +0,0 @@
-/*
- * 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.binary;
-
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.binary.BinaryIdMapper;
-import org.apache.ignite.binary.BinaryInvalidTypeException;
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.BinarySerializer;
-import org.apache.ignite.binary.BinaryType;
-import org.apache.ignite.binary.BinaryTypeConfiguration;
-import org.apache.ignite.cache.CacheKeyConfiguration;
-import org.apache.ignite.cache.affinity.AffinityKeyMapped;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.IgniteKernal;
-import org.apache.ignite.internal.IgnitionEx;
-import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
-import org.apache.ignite.internal.processors.datastructures.CollocatedQueueItemKey;
-import org.apache.ignite.internal.processors.datastructures.CollocatedSetItemKey;
-import org.apache.ignite.internal.util.IgniteUtils;
-import org.apache.ignite.internal.util.lang.GridMapEntry;
-import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.T2;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteBiTuple;
-import org.apache.ignite.marshaller.MarshallerContext;
-import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
-import org.jetbrains.annotations.Nullable;
-import org.jsr166.ConcurrentHashMap8;
-
-import java.io.Externalizable;
-import java.io.File;
-import java.io.IOException;
-import java.io.InvalidObjectException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.io.ObjectStreamException;
-import java.lang.reflect.Field;
-import java.math.BigDecimal;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentMap;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-/**
- * Portable context.
- */
-public class PortableContext implements Externalizable {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private static final ClassLoader dfltLdr = U.gridClassLoader();
-
-    /** */
-    private final ConcurrentMap<Class<?>, PortableClassDescriptor> descByCls = new ConcurrentHashMap8<>();
-
-    /** Holds classes loaded by default class loader only. */
-    private final ConcurrentMap<Integer, PortableClassDescriptor> userTypes = new ConcurrentHashMap8<>();
-
-    /** */
-    private final Map<Integer, PortableClassDescriptor> predefinedTypes = new HashMap<>();
-
-    /** */
-    private final Map<String, Integer> predefinedTypeNames = new HashMap<>();
-
-    /** */
-    private final Map<Class<? extends Collection>, Byte> colTypes = new HashMap<>();
-
-    /** */
-    private final Map<Class<? extends Map>, Byte> mapTypes = new HashMap<>();
-
-    /** */
-    private final ConcurrentMap<Integer, BinaryIdMapper> mappers = new ConcurrentHashMap8<>(0);
-
-    /** Affinity key field names. */
-    private final ConcurrentMap<Integer, String> affKeyFieldNames = new ConcurrentHashMap8<>(0);
-
-    /** */
-    private final Map<String, BinaryIdMapper> typeMappers = new ConcurrentHashMap8<>(0);
-
-    /** */
-    private BinaryMetadataHandler metaHnd;
-
-    /** Actual marshaller. */
-    private BinaryMarshaller marsh;
-
-    /** */
-    private MarshallerContext marshCtx;
-
-    /** */
-    private String gridName;
-
-    /** */
-    private IgniteConfiguration igniteCfg;
-
-    /** */
-    private final OptimizedMarshaller optmMarsh = new OptimizedMarshaller();
-
-    /** Compact footer flag. */
-    private boolean compactFooter;
-
-    /** Object schemas. */
-    private volatile Map<Integer, PortableSchemaRegistry> schemas;
-
-    /**
-     * For {@link Externalizable}.
-     */
-    public PortableContext() {
-        // No-op.
-    }
-
-    /**
-     * @param metaHnd Meta data handler.
-     * @param igniteCfg Ignite configuration.
-     */
-    public PortableContext(BinaryMetadataHandler metaHnd, IgniteConfiguration igniteCfg) {
-        assert metaHnd != null;
-        assert igniteCfg != null;
-
-        this.metaHnd = metaHnd;
-        this.igniteCfg = igniteCfg;
-
-        gridName = igniteCfg.getGridName();
-
-        colTypes.put(ArrayList.class, GridPortableMarshaller.ARR_LIST);
-        colTypes.put(LinkedList.class, GridPortableMarshaller.LINKED_LIST);
-        colTypes.put(HashSet.class, GridPortableMarshaller.HASH_SET);
-        colTypes.put(LinkedHashSet.class, GridPortableMarshaller.LINKED_HASH_SET);
-
-        mapTypes.put(HashMap.class, GridPortableMarshaller.HASH_MAP);
-        mapTypes.put(LinkedHashMap.class, GridPortableMarshaller.LINKED_HASH_MAP);
-
-        // IDs range from [0..200] is used by Java SDK API and GridGain legacy API
-
-        registerPredefinedType(Byte.class, GridPortableMarshaller.BYTE);
-        registerPredefinedType(Boolean.class, GridPortableMarshaller.BOOLEAN);
-        registerPredefinedType(Short.class, GridPortableMarshaller.SHORT);
-        registerPredefinedType(Character.class, GridPortableMarshaller.CHAR);
-        registerPredefinedType(Integer.class, GridPortableMarshaller.INT);
-        registerPredefinedType(Long.class, GridPortableMarshaller.LONG);
-        registerPredefinedType(Float.class, GridPortableMarshaller.FLOAT);
-        registerPredefinedType(Double.class, GridPortableMarshaller.DOUBLE);
-        registerPredefinedType(String.class, GridPortableMarshaller.STRING);
-        registerPredefinedType(BigDecimal.class, GridPortableMarshaller.DECIMAL);
-        registerPredefinedType(Date.class, GridPortableMarshaller.DATE);
-        registerPredefinedType(Timestamp.class, GridPortableMarshaller.TIMESTAMP);
-        registerPredefinedType(UUID.class, GridPortableMarshaller.UUID);
-
-        registerPredefinedType(byte[].class, GridPortableMarshaller.BYTE_ARR);
-        registerPredefinedType(short[].class, GridPortableMarshaller.SHORT_ARR);
-        registerPredefinedType(int[].class, GridPortableMarshaller.INT_ARR);
-        registerPredefinedType(long[].class, GridPortableMarshaller.LONG_ARR);
-        registerPredefinedType(float[].class, GridPortableMarshaller.FLOAT_ARR);
-        registerPredefinedType(double[].class, GridPortableMarshaller.DOUBLE_ARR);
-        registerPredefinedType(char[].class, GridPortableMarshaller.CHAR_ARR);
-        registerPredefinedType(boolean[].class, GridPortableMarshaller.BOOLEAN_ARR);
-        registerPredefinedType(BigDecimal[].class, GridPortableMarshaller.DECIMAL_ARR);
-        registerPredefinedType(String[].class, GridPortableMarshaller.STRING_ARR);
-        registerPredefinedType(UUID[].class, GridPortableMarshaller.UUID_ARR);
-        registerPredefinedType(Date[].class, GridPortableMarshaller.DATE_ARR);
-        registerPredefinedType(Timestamp[].class, GridPortableMarshaller.TIMESTAMP_ARR);
-        registerPredefinedType(Object[].class, GridPortableMarshaller.OBJ_ARR);
-
-        registerPredefinedType(ArrayList.class, 0);
-        registerPredefinedType(LinkedList.class, 0);
-        registerPredefinedType(HashSet.class, 0);
-        registerPredefinedType(LinkedHashSet.class, 0);
-
-        registerPredefinedType(HashMap.class, 0);
-        registerPredefinedType(LinkedHashMap.class, 0);
-
-        registerPredefinedType(GridMapEntry.class, 60);
-        registerPredefinedType(IgniteBiTuple.class, 61);
-        registerPredefinedType(T2.class, 62);
-
-        // IDs range [200..1000] is used by Ignite internal APIs.
-    }
-
-    /**
-     * @return Marshaller.
-     */
-    public BinaryMarshaller marshaller() {
-        return marsh;
-    }
-
-    /**
-     * @return Ignite configuration.
-     */
-    public IgniteConfiguration configuration(){
-        return igniteCfg;
-    }
-
-    /**
-     * @param marsh Portable marshaller.
-     * @param cfg Configuration.
-     * @throws BinaryObjectException In case of error.
-     */
-    public void configure(BinaryMarshaller marsh, IgniteConfiguration cfg) throws BinaryObjectException {
-        if (marsh == null)
-            return;
-
-        this.marsh = marsh;
-
-        marshCtx = marsh.getContext();
-
-        BinaryConfiguration binaryCfg = cfg.getBinaryConfiguration();
-
-        if (binaryCfg == null)
-            binaryCfg = new BinaryConfiguration();
-
-        assert marshCtx != null;
-
-        optmMarsh.setContext(marshCtx);
-
-        configure(
-            binaryCfg.getIdMapper(),
-            binaryCfg.getSerializer(),
-            binaryCfg.getTypeConfigurations()
-        );
-
-        compactFooter = binaryCfg.isCompactFooter();
-    }
-
-    /**
-     * @param globalIdMapper ID mapper.
-     * @param globalSerializer Serializer.
-     * @param typeCfgs Type configurations.
-     * @throws BinaryObjectException In case of error.
-     */
-    private void configure(
-        BinaryIdMapper globalIdMapper,
-        BinarySerializer globalSerializer,
-        Collection<BinaryTypeConfiguration> typeCfgs
-    ) throws BinaryObjectException {
-        TypeDescriptors descs = new TypeDescriptors();
-
-        Map<String, String> affFields = new HashMap<>();
-
-        if (!F.isEmpty(igniteCfg.getCacheKeyConfiguration())) {
-            for (CacheKeyConfiguration keyCfg : igniteCfg.getCacheKeyConfiguration())
-                affFields.put(keyCfg.getTypeName(), keyCfg.getAffinityKeyFieldName());
-        }
-
-        if (typeCfgs != null) {
-            for (BinaryTypeConfiguration typeCfg : typeCfgs) {
-                String clsName = typeCfg.getTypeName();
-
-                if (clsName == null)
-                    throw new BinaryObjectException("Class name is required for portable type configuration.");
-
-                BinaryIdMapper idMapper = globalIdMapper;
-
-                if (typeCfg.getIdMapper() != null)
-                    idMapper = typeCfg.getIdMapper();
-
-                idMapper = BinaryInternalIdMapper.create(idMapper);
-
-                BinarySerializer serializer = globalSerializer;
-
-                if (typeCfg.getSerializer() != null)
-                    serializer = typeCfg.getSerializer();
-
-                if (clsName.endsWith(".*")) {
-                    String pkgName = clsName.substring(0, clsName.length() - 2);
-
-                    for (String clsName0 : classesInPackage(pkgName))
-                        descs.add(clsName0, idMapper, serializer, affFields.get(clsName0),
-                            typeCfg.isEnum(), true);
-                }
-                else
-                    descs.add(clsName, idMapper, serializer, affFields.get(clsName),
-                        typeCfg.isEnum(), false);
-            }
-        }
-
-        for (TypeDescriptor desc : descs.descriptors())
-            registerUserType(desc.clsName, desc.idMapper, desc.serializer, desc.affKeyFieldName, desc.isEnum);
-
-        BinaryInternalIdMapper dfltMapper = BinaryInternalIdMapper.create(globalIdMapper);
-
-        // Put affinity field names for unconfigured types.
-        for (Map.Entry<String, String> entry : affFields.entrySet()) {
-            String typeName = entry.getKey();
-
-            int typeId = dfltMapper.typeId(typeName);
-
-            affKeyFieldNames.putIfAbsent(typeId, entry.getValue());
-        }
-
-        addSystemClassAffinityKey(CollocatedSetItemKey.class);
-        addSystemClassAffinityKey(CollocatedQueueItemKey.class);
-    }
-
-    /**
-     * @param cls Class.
-     */
-    private void addSystemClassAffinityKey(Class<?> cls) {
-        String fieldName = affinityFieldName(cls);
-
-        assert fieldName != null : cls;
-
-        affKeyFieldNames.putIfAbsent(cls.getName().hashCode(), affinityFieldName(cls));
-    }
-
-    /**
-     * @param pkgName Package name.
-     * @return Class names.
-     */
-    @SuppressWarnings("ConstantConditions")
-    private static Iterable<String> classesInPackage(String pkgName) {
-        assert pkgName != null;
-
-        Collection<String> clsNames = new ArrayList<>();
-
-        ClassLoader ldr = U.gridClassLoader();
-
-        if (ldr instanceof URLClassLoader) {
-            String pkgPath = pkgName.replaceAll("\\.", "/");
-
-            URL[] urls = ((URLClassLoader)ldr).getURLs();
-
-            for (URL url : urls) {
-                String proto = url.getProtocol().toLowerCase();
-
-                if ("file".equals(proto)) {
-                    try {
-                        File cpElement = new File(url.toURI());
-
-                        if (cpElement.isDirectory()) {
-                            File pkgDir = new File(cpElement, pkgPath);
-
-                            if (pkgDir.isDirectory()) {
-                                for (File file : pkgDir.listFiles()) {
-                                    String fileName = file.getName();
-
-                                    if (file.isFile() && fileName.toLowerCase().endsWith(".class"))
-                                        clsNames.add(pkgName + '.' + fileName.substring(0, fileName.length() - 6));
-                                }
-                            }
-                        }
-                        else if (cpElement.isFile()) {
-                            try {
-                                JarFile jar = new JarFile(cpElement);
-
-                                Enumeration<JarEntry> entries = jar.entries();
-
-                                while (entries.hasMoreElements()) {
-                                    String entry = entries.nextElement().getName();
-
-                                    if (entry.startsWith(pkgPath) && entry.endsWith(".class")) {
-                                        String clsName = entry.substring(pkgPath.length() + 1, entry.length() - 6);
-
-                                        if (!clsName.contains("/") && !clsName.contains("\\"))
-                                            clsNames.add(pkgName + '.' + clsName);
-                                    }
-                                }
-                            }
-                            catch (IOException ignored) {
-                                // No-op.
-                            }
-                        }
-                    }
-                    catch (URISyntaxException ignored) {
-                        // No-op.
-                    }
-                }
-            }
-        }
-
-        return clsNames;
-    }
-
-    /**
-     * @param cls Class.
-     * @return Class descriptor.
-     * @throws BinaryObjectException In case of error.
-     */
-    public PortableClassDescriptor descriptorForClass(Class<?> cls, boolean deserialize)
-        throws BinaryObjectException {
-        assert cls != null;
-
-        PortableClassDescriptor desc = descByCls.get(cls);
-
-        if (desc == null || !desc.registered())
-            desc = registerClassDescriptor(cls, deserialize);
-
-        return desc;
-    }
-
-    /**
-     * @param userType User type or not.
-     * @param typeId Type ID.
-     * @param ldr Class loader.
-     * @return Class descriptor.
-     */
-    public PortableClassDescriptor descriptorForTypeId(
-        boolean userType,
-        int typeId,
-        ClassLoader ldr,
-        boolean deserialize
-    ) {
-        assert typeId != GridPortableMarshaller.UNREGISTERED_TYPE_ID;
-
-        //TODO: As a workaround for IGNITE-1358 we always check the predefined map before without checking 'userType'
-        PortableClassDescriptor desc = predefinedTypes.get(typeId);
-
-        if (desc != null)
-            return desc;
-
-        if (ldr == null)
-            ldr = dfltLdr;
-
-        // If the type hasn't been loaded by default class loader then we mustn't return the descriptor from here
-        // giving a chance to a custom class loader to reload type's class.
-        if (userType && ldr.equals(dfltLdr)) {
-            desc = userTypes.get(typeId);
-
-            if (desc != null)
-                return desc;
-        }
-
-        Class cls;
-
-        try {
-            cls = marshCtx.getClass(typeId, ldr);
-
-            desc = descByCls.get(cls);
-        }
-        catch (ClassNotFoundException e) {
-            // Class might have been loaded by default class loader.
-            if (userType && !ldr.equals(dfltLdr) && (desc = descriptorForTypeId(true, typeId, dfltLdr, deserialize)) != null)
-                return desc;
-
-            throw new BinaryInvalidTypeException(e);
-        }
-        catch (IgniteCheckedException e) {
-            // Class might have been loaded by default class loader.
-            if (userType && !ldr.equals(dfltLdr) && (desc = descriptorForTypeId(true, typeId, dfltLdr, deserialize)) != null)
-                return desc;
-
-            throw new BinaryObjectException("Failed resolve class for ID: " + typeId, e);
-        }
-
-        if (desc == null) {
-            desc = registerClassDescriptor(cls, deserialize);
-
-            assert desc.typeId() == typeId;
-        }
-
-        return desc;
-    }
-
-    /**
-     * Creates and registers {@link PortableClassDescriptor} for the given {@code class}.
-     *
-     * @param cls Class.
-     * @return Class descriptor.
-     */
-    private PortableClassDescriptor registerClassDescriptor(Class<?> cls, boolean deserialize) {
-        PortableClassDescriptor desc;
-
-        String clsName = cls.getName();
-
-        if (marshCtx.isSystemType(clsName)) {
-            desc = new PortableClassDescriptor(this,
-                cls,
-                false,
-                clsName.hashCode(),
-                clsName,
-                null,
-                BinaryInternalIdMapper.defaultInstance(),
-                null,
-                false,
-                true, /* registered */
-                false /* predefined */
-            );
-
-            PortableClassDescriptor old = descByCls.putIfAbsent(cls, desc);
-
-            if (old != null)
-                desc = old;
-        }
-        else
-            desc = registerUserClassDescriptor(cls, deserialize);
-
-        return desc;
-    }
-
-    /**
-     * Creates and registers {@link PortableClassDescriptor} for the given user {@code class}.
-     *
-     * @param cls Class.
-     * @return Class descriptor.
-     */
-    private PortableClassDescriptor registerUserClassDescriptor(Class<?> cls, boolean deserialize) {
-        boolean registered;
-
-        String typeName = typeName(cls.getName());
-
-        BinaryIdMapper idMapper = userTypeIdMapper(typeName);
-
-        int typeId = idMapper.typeId(typeName);
-
-        try {
-            registered = marshCtx.registerClass(typeId, cls);
-        }
-        catch (IgniteCheckedException e) {
-            throw new BinaryObjectException("Failed to register class.", e);
-        }
-
-        String affFieldName = affinityFieldName(cls);
-
-        PortableClassDescriptor desc = new PortableClassDescriptor(this,
-            cls,
-            true,
-            typeId,
-            typeName,
-            affFieldName,
-            idMapper,
-            null,
-            true,
-            registered,
-            false /* predefined */
-        );
-
-        if (!deserialize) {
-            Collection<PortableSchema> schemas = desc.schema() != null ? Collections.singleton(desc.schema()) : null;
-
-            metaHnd.addMeta(typeId,
-                new BinaryMetadata(typeId, typeName, desc.fieldsMeta(), affFieldName, schemas, desc.isEnum()).wrap(this));
-        }
-
-        // perform put() instead of putIfAbsent() because "registered" flag might have been changed or class loader
-        // might have reloaded described class.
-        if (IgniteUtils.detectClassLoader(cls).equals(dfltLdr))
-            userTypes.put(typeId, desc);
-
-        descByCls.put(cls, desc);
-
-        mappers.putIfAbsent(typeId, idMapper);
-
-        return desc;
-    }
-
-    /**
-     * @param cls Collection class.
-     * @return Collection type ID.
-     */
-    public byte collectionType(Class<? extends Collection> cls) {
-        assert cls != null;
-
-        Byte type = colTypes.get(cls);
-
-        if (type != null)
-            return type;
-
-        return Set.class.isAssignableFrom(cls) ? GridPortableMarshaller.USER_SET : GridPortableMarshaller.USER_COL;
-    }
-
-    /**
-     * @param cls Map class.
-     * @return Map type ID.
-     */
-    public byte mapType(Class<? extends Map> cls) {
-        assert cls != null;
-
-        Byte type = mapTypes.get(cls);
-
-        return type != null ? type : GridPortableMarshaller.USER_COL;
-    }
-
-    /**
-     * @param typeName Type name.
-     * @return Type ID.
-     */
-    public int typeId(String typeName) {
-        String typeName0 = typeName(typeName);
-
-        Integer id = predefinedTypeNames.get(typeName0);
-
-        if (id != null)
-            return id;
-
-        if (marshCtx.isSystemType(typeName))
-            return typeName.hashCode();
-
-        return userTypeIdMapper(typeName0).typeId(typeName0);
-    }
-
-    /**
-     * @param typeId Type ID.
-     * @param fieldName Field name.
-     * @return Field ID.
-     */
-    public int fieldId(int typeId, String fieldName) {
-        return userTypeIdMapper(typeId).fieldId(typeId, fieldName);
-    }
-
-    /**
-     * @param typeId Type ID.
-     * @return Instance of ID mapper.
-     */
-    public BinaryIdMapper userTypeIdMapper(int typeId) {
-        BinaryIdMapper idMapper = mappers.get(typeId);
-
-        return idMapper != null ? idMapper : BinaryInternalIdMapper.defaultInstance();
-    }
-
-    /**
-     * @param typeName Type name.
-     * @return Instance of ID mapper.
-     */
-    private BinaryIdMapper userTypeIdMapper(String typeName) {
-        BinaryIdMapper idMapper = typeMappers.get(typeName);
-
-        return idMapper != null ? idMapper : BinaryInternalIdMapper.defaultInstance();
-    }
-
-    /**
-     * @param cls Class to get affinity field for.
-     * @return Affinity field name or {@code null} if field name was not found.
-     */
-    private String affinityFieldName(Class cls) {
-        for (; cls != Object.class && cls != null; cls = cls.getSuperclass()) {
-            for (Field f : cls.getDeclaredFields()) {
-                if (f.getAnnotation(AffinityKeyMapped.class) != null)
-                    return f.getName();
-            }
-        }
-
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        U.writeString(out, igniteCfg.getGridName());
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        gridName = U.readString(in);
-    }
-
-    /**
-     * @return Portable context.
-     * @throws ObjectStreamException In case of error.
-     */
-    protected Object readResolve() throws ObjectStreamException {
-        try {
-            IgniteKernal g = IgnitionEx.gridx(gridName);
-
-            if (g == null)
-                throw new IllegalStateException("Failed to find grid for name: " + gridName);
-
-            return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).portableContext();
-        }
-        catch (IllegalStateException e) {
-            throw U.withCause(new InvalidObjectException(e.getMessage()), e);
-        }
-    }
-
-    /**
-     * @param cls Class.
-     * @param id Type ID.
-     * @return GridPortableClassDescriptor.
-     */
-    public PortableClassDescriptor registerPredefinedType(Class<?> cls, int id) {
-        String typeName = typeName(cls.getName());
-
-        PortableClassDescriptor desc = new PortableClassDescriptor(
-            this,
-            cls,
-            false,
-            id,
-            typeName,
-            null,
-            BinaryInternalIdMapper.defaultInstance(),
-            null,
-            false,
-            true, /* registered */
-            true /* predefined */
-        );
-
-        predefinedTypeNames.put(typeName, id);
-        predefinedTypes.put(id, desc);
-
-        descByCls.put(cls, desc);
-
-        return desc;
-    }
-
-    /**
-     * @param clsName Class name.
-     * @param idMapper ID mapper.
-     * @param serializer Serializer.
-     * @param affKeyFieldName Affinity key field name.
-     * @param isEnum If enum.
-     * @throws BinaryObjectException In case of error.
-     */
-    @SuppressWarnings("ErrorNotRethrown")
-    public void registerUserType(String clsName,
-        BinaryIdMapper idMapper,
-        @Nullable BinarySerializer serializer,
-        @Nullable String affKeyFieldName,
-        boolean isEnum)
-        throws BinaryObjectException {
-        assert idMapper != null;
-
-        Class<?> cls = null;
-
-        try {
-            cls = Class.forName(clsName);
-        }
-        catch (ClassNotFoundException | NoClassDefFoundError ignored) {
-            // No-op.
-        }
-
-        String typeName = typeName(clsName);
-
-        int id = idMapper.typeId(typeName);
-
-        //Workaround for IGNITE-1358
-        if (predefinedTypes.get(id) != null)
-            throw new BinaryObjectException("Duplicate type ID [clsName=" + clsName + ", id=" + id + ']');
-
-        if (mappers.put(id, idMapper) != null)
-            throw new BinaryObjectException("Duplicate type ID [clsName=" + clsName + ", id=" + id + ']');
-
-        if (affKeyFieldName != null) {
-            if (affKeyFieldNames.put(id, affKeyFieldName) != null)
-                throw new BinaryObjectException("Duplicate type ID [clsName=" + clsName + ", id=" + id + ']');
-        }
-
-        typeMappers.put(typeName, idMapper);
-
-        Map<String, Integer> fieldsMeta = null;
-        Collection<PortableSchema> schemas = null;
-
-        if (cls != null) {
-            PortableClassDescriptor desc = new PortableClassDescriptor(
-                this,
-                cls,
-                true,
-                id,
-                typeName,
-                affKeyFieldName,
-                idMapper,
-                serializer,
-                true,
-                true, /* registered */
-                false /* predefined */
-            );
-
-            fieldsMeta = desc.fieldsMeta();
-            schemas = desc.schema() != null ? Collections.singleton(desc.schema()) : null;
-
-            if (IgniteUtils.detectClassLoader(cls).equals(dfltLdr))
-                userTypes.put(id, desc);
-
-            descByCls.put(cls, desc);
-        }
-
-        metaHnd.addMeta(id, new BinaryMetadata(id, typeName, fieldsMeta, affKeyFieldName, schemas, isEnum).wrap(this));
-    }
-
-    /**
-     * Create binary field.
-     *
-     * @param typeId Type ID.
-     * @param fieldName Field name.
-     * @return Binary field.
-     */
-    public BinaryFieldImpl createField(int typeId, String fieldName) {
-        PortableSchemaRegistry schemaReg = schemaRegistry(typeId);
-
-        int fieldId = userTypeIdMapper(typeId).fieldId(typeId, fieldName);
-
-        return new BinaryFieldImpl(typeId, schemaReg, fieldName, fieldId);
-    }
-
-    /**
-     * @param typeId Type ID.
-     * @return Meta data.
-     * @throws BinaryObjectException In case of error.
-     */
-    @Nullable public BinaryType metadata(int typeId) throws BinaryObjectException {
-        return metaHnd != null ? metaHnd.metadata(typeId) : null;
-    }
-
-    /**
-     * @param typeId Type ID.
-     * @return Affinity key field name.
-     */
-    public String affinityKeyFieldName(int typeId) {
-        return affKeyFieldNames.get(typeId);
-    }
-
-    /**
-     * @param typeId Type ID.
-     * @param meta Meta data.
-     * @throws BinaryObjectException In case of error.
-     */
-    public void updateMetadata(int typeId, BinaryMetadata meta) throws BinaryObjectException {
-        metaHnd.addMeta(typeId, meta.wrap(this));
-    }
-
-    /**
-     * @return Whether field IDs should be skipped in footer or not.
-     */
-    public boolean isCompactFooter() {
-        return compactFooter;
-    }
-
-    /**
-     * Get schema registry for type ID.
-     *
-     * @param typeId Type ID.
-     * @return Schema registry for type ID.
-     */
-    public PortableSchemaRegistry schemaRegistry(int typeId) {
-        Map<Integer, PortableSchemaRegistry> schemas0 = schemas;
-
-        if (schemas0 == null) {
-            synchronized (this) {
-                schemas0 = schemas;
-
-                if (schemas0 == null) {
-                    schemas0 = new HashMap<>();
-
-                    PortableSchemaRegistry reg = new PortableSchemaRegistry();
-
-                    schemas0.put(typeId, reg);
-
-                    schemas = schemas0;
-
-                    return reg;
-                }
-            }
-        }
-
-        PortableSchemaRegistry reg = schemas0.get(typeId);
-
-        if (reg == null) {
-            synchronized (this) {
-                reg = schemas.get(typeId);
-
-                if (reg == null) {
-                    reg = new PortableSchemaRegistry();
-
-                    schemas0 = new HashMap<>(schemas);
-
-                    schemas0.put(typeId, reg);
-
-                    schemas = schemas0;
-                }
-            }
-        }
-
-        return reg;
-    }
-
-    /**
-     * Returns instance of {@link OptimizedMarshaller}.
-     *
-     * @return Optimized marshaller.
-     */
-    OptimizedMarshaller optimizedMarsh() {
-        return optmMarsh;
-    }
-
-    /**
-     * @param clsName Class name.
-     * @return Type name.
-     */
-    @SuppressWarnings("ResultOfMethodCallIgnored")
-    public static String typeName(String clsName) {
-        assert clsName != null;
-
-        int idx = clsName.lastIndexOf('$');
-
-        if (idx == clsName.length() - 1)
-            // This is a regular (not inner) class name that ends with '$'. Common use case for Scala classes.
-            idx = -1;
-        else if (idx >= 0) {
-            String typeName = clsName.substring(idx + 1);
-
-            try {
-                Integer.parseInt(typeName);
-
-                // This is an anonymous class. Don't cut off enclosing class name for it.
-                idx = -1;
-            }
-            catch (NumberFormatException ignore) {
-                // This is a lambda class.
-                if (clsName.indexOf("$$Lambda$") > 0)
-                    idx = -1;
-                else
-                    return typeName;
-            }
-        }
-
-        if (idx < 0)
-            idx = clsName.lastIndexOf('.');
-
-        return idx >= 0 ? clsName.substring(idx + 1) : clsName;
-    }
-
-    /**
-     * Undeployment callback invoked when class loader is being undeployed.
-     *
-     * Some marshallers may want to clean their internal state that uses the undeployed class loader somehow.
-     *
-     * @param ldr Class loader being undeployed.
-     */
-    public void onUndeploy(ClassLoader ldr) {
-        for (Class<?> cls : descByCls.keySet()) {
-            if (ldr.equals(cls.getClassLoader()))
-                descByCls.remove(cls);
-        }
-
-        U.clearClassCache(ldr);
-    }
-
-    /**
-     * Type descriptors.
-     */
-    private static class TypeDescriptors {
-        /** Descriptors map. */
-        private final Map<String, TypeDescriptor> descs = new LinkedHashMap<>();
-
-        /**
-         * Add type descriptor.
-         *
-         * @param clsName Class name.
-         * @param idMapper ID mapper.
-         * @param serializer Serializer.
-         * @param affKeyFieldName Affinity key field name.
-         * @param isEnum Enum flag.
-         * @param canOverride Whether this descriptor can be override.
-         * @throws BinaryObjectException If failed.
-         */
-        private void add(String clsName,
-            BinaryIdMapper idMapper,
-            BinarySerializer serializer,
-            String affKeyFieldName,
-            boolean isEnum,
-            boolean canOverride)
-            throws BinaryObjectException {
-            TypeDescriptor desc = new TypeDescriptor(clsName,
-                idMapper,
-                serializer,
-                affKeyFieldName,
-                isEnum,
-                canOverride);
-
-            TypeDescriptor oldDesc = descs.get(clsName);
-
-            if (oldDesc == null)
-                descs.put(clsName, desc);
-            else
-                oldDesc.override(desc);
-        }
-
-        /**
-         * Get all collected descriptors.
-         *
-         * @return Descriptors.
-         */
-        private Iterable<TypeDescriptor> descriptors() {
-            return descs.values();
-        }
-    }
-
-    /**
-     * Type descriptor.
-     */
-    private static class TypeDescriptor {
-        /** Class name. */
-        private final String clsName;
-
-        /** ID mapper. */
-        private BinaryIdMapper idMapper;
-
-        /** Serializer. */
-        private BinarySerializer serializer;
-
-        /** Affinity key field name. */
-        private String affKeyFieldName;
-
-        /** Enum flag. */
-        private boolean isEnum;
-
-        /** Whether this descriptor can be override. */
-        private boolean canOverride;
-
-        /**
-         * Constructor.
-         *
-         * @param clsName Class name.
-         * @param idMapper ID mapper.
-         * @param serializer Serializer.
-         * @param affKeyFieldName Affinity key field name.
-         * @param isEnum Enum type.
-         * @param canOverride Whether this descriptor can be override.
-         */
-        private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer serializer,
-            String affKeyFieldName, boolean isEnum, boolean canOverride) {
-            this.clsName = clsName;
-            this.idMapper = idMapper;
-            this.serializer = serializer;
-            this.affKeyFieldName = affKeyFieldName;
-            this.isEnum = isEnum;
-            this.canOverride = canOverride;
-        }
-
-        /**
-         * Override portable class descriptor.
-         *
-         * @param other Other descriptor.
-         * @throws BinaryObjectException If failed.
-         */
-        private void override(TypeDescriptor other) throws BinaryObjectException {
-            assert clsName.equals(other.clsName);
-
-            if (canOverride) {
-                idMapper = other.idMapper;
-                serializer = other.serializer;
-                affKeyFieldName = other.affKeyFieldName;
-                canOverride = other.canOverride;
-            }
-            else if (!other.canOverride)
-                throw new BinaryObjectException("Duplicate explicit class definition in configuration: " + clsName);
-        }
-    }
-
-    /**
-     * Type id wrapper.
-     */
-    static class Type {
-        /** Type id */
-        private final int id;
-
-        /** Whether the following type is registered in a cache or not */
-        private final boolean registered;
-
-        /**
-         * @param id Id.
-         * @param registered Registered.
-         */
-        public Type(int id, boolean registered) {
-            this.id = id;
-            this.registered = registered;
-        }
-
-        /**
-         * @return Type ID.
-         */
-        public int id() {
-            return id;
-        }
-
-        /**
-         * @return Registered flag value.
-         */
-        public boolean registered() {
-            return registered;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/PortablePositionReadable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortablePositionReadable.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/PortablePositionReadable.java
deleted file mode 100644
index 8db6384..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortablePositionReadable.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.binary;
-
-/**
- * Interface allowing for positioned read.
- */
-public interface PortablePositionReadable {
-    /**
-     * Read byte at the given position.
-     *
-     * @param pos Position.
-     * @return Value.
-     */
-    public byte readBytePositioned(int pos);
-
-    /**
-     * Read short at the given position.
-     *
-     * @param pos Position.
-     * @return Value.
-     */
-    public short readShortPositioned(int pos);
-
-    /**
-     * 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/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/PortablePrimitives.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortablePrimitives.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/PortablePrimitives.java
deleted file mode 100644
index e5ff494..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortablePrimitives.java
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * 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.binary;
-
-import org.apache.ignite.internal.util.GridUnsafe;
-import sun.misc.Unsafe;
-
-import java.nio.ByteOrder;
-
-/**
- * Primitives writer.
- */
-public abstract class PortablePrimitives {
-    /** */
-    private static final Unsafe UNSAFE = GridUnsafe.unsafe();
-
-    /** */
-    private static final long BYTE_ARR_OFF = UNSAFE.arrayBaseOffset(byte[].class);
-
-    /** */
-    private static final long CHAR_ARR_OFF = UNSAFE.arrayBaseOffset(char[].class);
-
-    /** Whether little endian is set. */
-    private static final boolean BIG_ENDIAN = ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN;
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public static void writeByte(byte[] arr, int off, byte val) {
-        UNSAFE.putByte(arr, BYTE_ARR_OFF + off, val);
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static byte readByte(byte[] arr, int off) {
-        return UNSAFE.getByte(arr, BYTE_ARR_OFF + off);
-    }
-
-    /**
-     * @param ptr Pointer.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static byte readByte(long ptr, int off) {
-        return UNSAFE.getByte(ptr + off);
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static byte[] readByteArray(byte[] arr, int off, int len) {
-        byte[] arr0 = new byte[len];
-
-        UNSAFE.copyMemory(arr, BYTE_ARR_OFF + off, arr0, BYTE_ARR_OFF, len);
-
-        return arr0;
-    }
-
-    /**
-     * @param ptr Pointer.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static byte[] readByteArray(long ptr, int off, int len) {
-        byte[] arr0 = new byte[len];
-
-        UNSAFE.copyMemory(null, ptr + off, arr0, BYTE_ARR_OFF, len);
-
-        return arr0;
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public static void writeBoolean(byte[] arr, int off, boolean val) {
-        writeByte(arr, off, val ? (byte)1 : (byte)0);
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static boolean readBoolean(byte[] arr, int off) {
-        return readByte(arr, off) == 1;
-    }
-
-    /**
-     * @param ptr Pointer.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static boolean readBoolean(long ptr, int off) {
-        return readByte(ptr, off) == 1;
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public static void writeShort(byte[] arr, int off, short val) {
-        if (BIG_ENDIAN)
-            val = Short.reverseBytes(val);
-
-        UNSAFE.putShort(arr, BYTE_ARR_OFF + off, val);
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static short readShort(byte[] arr, int off) {
-        short val = UNSAFE.getShort(arr, BYTE_ARR_OFF + off);
-
-        if (BIG_ENDIAN)
-            val = Short.reverseBytes(val);
-
-        return val;
-    }
-
-    /**
-     * @param ptr Pointer.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static short readShort(long ptr, int off) {
-        short val = UNSAFE.getShort(ptr + off);
-
-        if (BIG_ENDIAN)
-            val = Short.reverseBytes(val);
-
-        return val;
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public static void writeChar(byte[] arr, int off, char val) {
-        if (BIG_ENDIAN)
-            val = Character.reverseBytes(val);
-
-        UNSAFE.putChar(arr, BYTE_ARR_OFF + off, val);
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static char readChar(byte[] arr, int off) {
-        char val = UNSAFE.getChar(arr, BYTE_ARR_OFF + off);
-
-        if (BIG_ENDIAN)
-            val = Character.reverseBytes(val);
-
-        return val;
-    }
-
-    /**
-     * @param ptr Pointer.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static char readChar(long ptr, int off) {
-        char val = UNSAFE.getChar(ptr + off);
-
-        if (BIG_ENDIAN)
-            val = Character.reverseBytes(val);
-
-        return val;
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static char[] readCharArray(byte[] arr, int off, int len) {
-        char[] arr0 = new char[len];
-
-        UNSAFE.copyMemory(arr, BYTE_ARR_OFF + off, arr0, CHAR_ARR_OFF, len << 1);
-
-        if (BIG_ENDIAN) {
-            for (int i = 0; i < len; i++)
-                arr0[i] = Character.reverseBytes(arr0[i]);
-        }
-
-        return arr0;
-    }
-
-    /**
-     * @param ptr Pointer.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static char[] readCharArray(long ptr, int off, int len) {
-        char[] arr0 = new char[len];
-
-        UNSAFE.copyMemory(null, ptr + off, arr0, CHAR_ARR_OFF, len << 1);
-
-        if (BIG_ENDIAN) {
-            for (int i = 0; i < len; i++)
-                arr0[i] = Character.reverseBytes(arr0[i]);
-        }
-
-        return arr0;
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public static void writeInt(byte[] arr, int off, int val) {
-        if (BIG_ENDIAN)
-            val = Integer.reverseBytes(val);
-
-        UNSAFE.putInt(arr, BYTE_ARR_OFF + off, val);
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static int readInt(byte[] arr, int off) {
-        int val = UNSAFE.getInt(arr, BYTE_ARR_OFF + off);
-
-        if (BIG_ENDIAN)
-            val = Integer.reverseBytes(val);
-
-        return val;
-    }
-
-    /**
-     * @param ptr Pointer.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static int readInt(long ptr, int off) {
-        int val = UNSAFE.getInt(ptr + off);
-
-        if (BIG_ENDIAN)
-            val = Integer.reverseBytes(val);
-
-        return val;
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public static void writeLong(byte[] arr, int off, long val) {
-        if (BIG_ENDIAN)
-            val = Long.reverseBytes(val);
-
-        UNSAFE.putLong(arr, BYTE_ARR_OFF + off, val);
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static long readLong(byte[] arr, int off) {
-        long val = UNSAFE.getLong(arr, BYTE_ARR_OFF + off);
-
-        if (BIG_ENDIAN)
-            val = Long.reverseBytes(val);
-
-        return val;
-    }
-
-    /**
-     * @param ptr Pointer.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static long readLong(long ptr, int off) {
-        long val = UNSAFE.getLong(ptr + off);
-
-        if (BIG_ENDIAN)
-            val = Long.reverseBytes(val);
-
-        return val;
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public static void writeFloat(byte[] arr, int off, float val) {
-        int val0 = Float.floatToIntBits(val);
-
-        writeInt(arr, off, val0);
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static float readFloat(byte[] arr, int off) {
-        int val = readInt(arr, off);
-
-        return Float.intBitsToFloat(val);
-    }
-
-    /**
-     * @param ptr Pointer.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static float readFloat(long ptr, int off) {
-        int val = readInt(ptr, off);
-
-        return Float.intBitsToFloat(val);
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @param val Value.
-     */
-    public static void writeDouble(byte[] arr, int off, double val) {
-        long val0 = Double.doubleToLongBits(val);
-
-        writeLong(arr, off, val0);
-    }
-
-    /**
-     * @param arr Array.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static double readDouble(byte[] arr, int off) {
-        long val = readLong(arr, off);
-
-        return Double.longBitsToDouble(val);
-    }
-
-    /**
-     * @param ptr Pointer.
-     * @param off Offset.
-     * @return Value.
-     */
-    public static double readDouble(long ptr, int off) {
-        long val = readLong(ptr, off);
-
-        return Double.longBitsToDouble(val);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableSchema.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableSchema.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableSchema.java
deleted file mode 100644
index 61b5d45..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableSchema.java
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * 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.binary;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Schema describing portable object content. We rely on the following assumptions:
- * - When amount of fields in the object is low, it is better to inline these values into int fields thus allowing
- * for quick comparisons performed within already fetched L1 cache line.
- * - When there are more fields, we store them inside a hash map.
- */
-public class PortableSchema implements Externalizable {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** Order returned if field is not found. */
-    public static final int ORDER_NOT_FOUND = -1;
-
-    /** Minimum sensible size. */
-    private static final int MAP_MIN_SIZE = 32;
-
-    /** Empty cell. */
-    private static final int MAP_EMPTY = 0;
-
-    /** Schema ID. */
-    private int schemaId;
-
-    /** IDs depending on order. */
-    private int[] ids;
-
-    /** Interned names of associated fields. */
-    private String[] names;
-
-    /** ID-to-order data. */
-    private int[] idToOrderData;
-
-    /** ID-to-order mask. */
-    private int idToOrderMask;
-
-    /** ID 1. */
-    private int id0;
-
-    /** ID 2. */
-    private int id1;
-
-    /** ID 3. */
-    private int id2;
-
-    /** ID 4. */
-    private int id3;
-
-    /**
-     * {@link Externalizable} support.
-     */
-    public PortableSchema() {
-        // No-op.
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param schemaId Schema ID.
-     * @param fieldIds Field IDs.
-     */
-    private PortableSchema(int schemaId, List<Integer> fieldIds) {
-        assert fieldIds != null;
-
-        this.schemaId = schemaId;
-
-        initialize(fieldIds);
-    }
-
-    /**
-     * @return Schema ID.
-     */
-    public int schemaId() {
-        return schemaId;
-    }
-
-    /**
-     * Try speculatively confirming order for the given field name.
-     *
-     * @param expOrder Expected order.
-     * @param expName Expected name.
-     * @return Field ID.
-     */
-    @SuppressWarnings("StringEquality")
-    public Confirmation confirmOrder(int expOrder, String expName) {
-        assert expName != null;
-
-        if (expOrder < names.length) {
-            String name = names[expOrder];
-
-            // Note that we use only reference equality assuming that field names are interned literals.
-            if (name == expName)
-                return Confirmation.CONFIRMED;
-
-            if (name == null)
-                return Confirmation.CLARIFY;
-        }
-
-        return Confirmation.REJECTED;
-    }
-
-    /**
-     * Add field name.
-     *
-     * @param order Order.
-     * @param name Name.
-     */
-    public void clarifyFieldName(int order, String name) {
-        assert name != null;
-        assert order < names.length;
-
-        names[order] = name.intern();
-    }
-
-    /**
-     * Get field ID by order in footer.
-     *
-     * @param order Order.
-     * @return Field ID.
-     */
-    public int fieldId(int order) {
-        return order < ids.length ? ids[order] : 0;
-    }
-
-    /**
-     * Get field order in footer by field ID.
-     *
-     * @param id Field ID.
-     * @return Offset or {@code 0} if there is no such field.
-     */
-    public int order(int id) {
-        if (idToOrderData == null) {
-            if (id == id0)
-                return 0;
-
-            if (id == id1)
-                return 1;
-
-            if (id == id2)
-                return 2;
-
-            if (id == id3)
-                return 3;
-
-            return ORDER_NOT_FOUND;
-        }
-        else {
-            int idx = (id & idToOrderMask) << 1;
-
-            int curId = idToOrderData[idx];
-
-            if (id == curId) // Hit!
-                return idToOrderData[idx + 1];
-            else if (curId == MAP_EMPTY) // No such ID!
-                return ORDER_NOT_FOUND;
-            else {
-                // Unlikely collision scenario.
-                for (int i = 2; i < idToOrderData.length; i += 2) {
-                    int newIdx = (idx + i) % idToOrderData.length;
-
-                    assert newIdx < idToOrderData.length - 1;
-
-                    curId = idToOrderData[newIdx];
-
-                    if (id == curId)
-                        return idToOrderData[newIdx + 1];
-                    else if (curId == MAP_EMPTY)
-                        return ORDER_NOT_FOUND;
-                }
-
-                return ORDER_NOT_FOUND;
-            }
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public int hashCode() {
-        return schemaId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean equals(Object o) {
-        return o != null && o instanceof PortableSchema && schemaId == ((PortableSchema)o).schemaId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeInt(schemaId);
-
-        out.writeInt(ids.length);
-
-        for (Integer id : ids)
-            out.writeInt(id);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        schemaId = in.readInt();
-
-        int idsCnt = in.readInt();
-
-        List<Integer> fieldIds = new ArrayList<>(idsCnt);
-
-        for (int i = 0; i < idsCnt; i++)
-            fieldIds.add(in.readInt());
-
-        initialize(fieldIds);
-    }
-
-    /**
-     * Parse values.
-     *
-     * @param vals Values.
-     * @param size Proposed result size.
-     * @return Parse result.
-     */
-    private static ParseResult parse(int[] vals, int size) {
-        int mask = maskForPowerOfTwo(size);
-
-        int totalSize = size * 2;
-
-        int[] data = new int[totalSize];
-        int collisions = 0;
-
-        for (int order = 0; order < vals.length; order++) {
-            int id = vals[order];
-
-            assert id != 0;
-
-            int idIdx = (id & mask) << 1;
-
-            if (data[idIdx] == 0) {
-                // Found empty slot.
-                data[idIdx] = id;
-                data[idIdx + 1] = order;
-            }
-            else {
-                // Collision!
-                collisions++;
-
-                boolean placeFound = false;
-
-                for (int i = 2; i < totalSize; i += 2) {
-                    int newIdIdx = (idIdx + i) % totalSize;
-
-                    if (data[newIdIdx] == 0) {
-                        data[newIdIdx] = id;
-                        data[newIdIdx + 1] = order;
-
-                        placeFound = true;
-
-                        break;
-                    }
-                }
-
-                assert placeFound : "Should always have a place for entry!";
-            }
-        }
-
-        return new ParseResult(data, collisions);
-    }
-
-    /**
-     * Get next power of two which greater or equal to the given number.
-     * This implementation is not meant to be very efficient, so it is expected to be used relatively rare.
-     *
-     * @param val Number
-     * @return Nearest pow2.
-     */
-    private static int nextPowerOfTwo(int val) {
-        int res = 1;
-
-        while (res < val)
-            res = res << 1;
-
-        if (res < 0)
-            throw new IllegalArgumentException("Value is too big to find positive pow2: " + val);
-
-        return res;
-    }
-
-    /**
-     * Calculate mask for the given value which is a power of two.
-     *
-     * @param val Value.
-     * @return Mask.
-     */
-    private static int maskForPowerOfTwo(int val) {
-        int mask = 0;
-        int comparand = 1;
-
-        while (comparand < val) {
-            mask |= comparand;
-
-            comparand <<= 1;
-        }
-
-        return mask;
-    }
-
-    /**
-     * 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.
-     */
-    private void initializeMap(int[] vals) {
-        int size = Math.max(nextPowerOfTwo(vals.length) << 2, MAP_MIN_SIZE);
-
-        assert size > 0;
-
-        ParseResult finalRes;
-
-        ParseResult res1 = parse(vals, size);
-
-        if (res1.collisions == 0)
-            finalRes = res1;
-        else {
-            ParseResult res2 = parse(vals, size * 2);
-
-            // Failed to decrease aom
-            if (res2.collisions == 0)
-                finalRes = res2;
-            else
-                finalRes = parse(vals, size * 4);
-        }
-
-        idToOrderData = finalRes.data;
-        idToOrderMask = maskForPowerOfTwo(idToOrderData.length / 2);
-    }
-
-    /**
-     * Schema builder.
-     */
-    public static class Builder {
-        /** Schema ID. */
-        private int schemaId = PortableUtils.schemaInitialId();
-
-        /** Fields. */
-        private final ArrayList<Integer> fields = new ArrayList<>();
-
-        /**
-         * Create new schema builder.
-         *
-         * @return Schema builder.
-         */
-        public static Builder newBuilder() {
-            return new Builder();
-        }
-
-        /**
-         * Private constructor.
-         */
-        private Builder() {
-            // No-op.
-        }
-
-        /**
-         * Add field.
-         *
-         * @param fieldId Field ID.
-         */
-        public void addField(int fieldId) {
-            fields.add(fieldId);
-
-            schemaId = PortableUtils.updateSchemaId(schemaId, fieldId);
-        }
-
-        /**
-         * Build schema.
-         *
-         * @return Schema.
-         */
-        public PortableSchema build() {
-            return new PortableSchema(schemaId, fields);
-        }
-    }
-
-    /**
-     * Order confirmation result.
-     */
-    public enum Confirmation {
-        /** Confirmed. */
-        CONFIRMED,
-
-        /** Denied. */
-        REJECTED,
-
-        /** Field name clarification is needed. */
-        CLARIFY
-    }
-
-    /**
-     * Result of map parsing.
-     */
-    private static class ParseResult {
-        /** Data. */
-        private int[] data;
-
-        /** Collisions. */
-        private int collisions;
-
-        /**
-         * Constructor.
-         *
-         * @param data Data.
-         * @param collisions Collisions.
-         */
-        private ParseResult(int[] data, int collisions) {
-            this.data = data;
-            this.collisions = collisions;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableSchemaRegistry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableSchemaRegistry.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableSchemaRegistry.java
deleted file mode 100644
index f3f92ee..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableSchemaRegistry.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * 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.binary;
-
-import org.jetbrains.annotations.Nullable;
-
-import java.util.HashMap;
-
-/**
- * Portable schema registry. Contains all well-known object schemas.
- * <p>
- * We rely on the fact that usually object has only few different schemas. For this reason we inline several
- * of them with optional fallback to normal hash map lookup.
- *
- */
-public class PortableSchemaRegistry {
-    /** Empty schema ID. */
-    private static final int EMPTY = 0;
-
-    /** Whether registry still works in inline mode. */
-    private volatile boolean inline = true;
-
-    /** First schema ID. */
-    private int schemaId1;
-
-    /** Second schema ID. */
-    private int schemaId2;
-
-    /** Third schema ID. */
-    private int schemaId3;
-
-    /** Fourth schema ID. */
-    private int schemaId4;
-
-    /** First schema. */
-    private PortableSchema schema1;
-
-    /** Second schema. */
-    private PortableSchema schema2;
-
-    /** Third schema. */
-    private PortableSchema schema3;
-
-    /** Fourth schema. */
-    private PortableSchema schema4;
-
-    /** Schemas with COW semantics. */
-    private volatile HashMap<Integer, PortableSchema> schemas;
-
-    /**
-     * Get schema for the given ID. We rely on very relaxed memory semantics here assuming that it is not critical
-     * to return false-positive {@code null} values.
-     *
-     * @param schemaId Schema ID.
-     * @return Schema or {@code null}.
-     */
-    @Nullable public PortableSchema schema(int schemaId) {
-        if (inline) {
-            if (schemaId == schemaId1)
-                return schema1;
-            else if (schemaId == schemaId2)
-                return schema2;
-            else if (schemaId == schemaId3)
-                return schema3;
-            else if (schemaId == schemaId4)
-                return schema4;
-        }
-        else {
-            HashMap<Integer, PortableSchema> schemas0 = schemas;
-
-            // Null can be observed here due to either data race or race condition when switching to non-inlined mode.
-            // Both of them are benign for us because they lead only to unnecessary schema re-calc.
-            if (schemas0 != null)
-                return schemas0.get(schemaId);
-        }
-
-        return null;
-    }
-
-    /**
-     * Add schema.
-     *
-     * @param schemaId Schema ID.
-     * @param schema Schema.
-     */
-    public void addSchema(int schemaId, PortableSchema schema) {
-        synchronized (this) {
-            if (inline) {
-                // Check if this is already known schema.
-                if (schemaId == schemaId1 || schemaId == schemaId2 || schemaId == schemaId3 || schemaId == schemaId4)
-                    return;
-
-                // Try positioning new schema in inline mode.
-                if (schemaId1 == EMPTY) {
-                    schemaId1 = schemaId;
-
-                    schema1 = schema;
-
-                    inline = true; // Forcing HB edge just in case.
-
-                    return;
-                }
-
-                if (schemaId2 == EMPTY) {
-                    schemaId2 = schemaId;
-
-                    schema2 = schema;
-
-                    inline = true; // Forcing HB edge just in case.
-
-                    return;
-                }
-
-                if (schemaId3 == EMPTY) {
-                    schemaId3 = schemaId;
-
-                    schema3 = schema;
-
-                    inline = true; // Forcing HB edge just in case.
-
-                    return;
-                }
-
-                if (schemaId4 == EMPTY) {
-                    schemaId4 = schemaId;
-
-                    schema4 = schema;
-
-                    inline = true; // Forcing HB edge just in case.
-
-                    return;
-                }
-
-                // No luck, switching to hash map mode.
-                HashMap<Integer, PortableSchema> newSchemas = new HashMap<>();
-
-                newSchemas.put(schemaId1, schema1);
-                newSchemas.put(schemaId2, schema2);
-                newSchemas.put(schemaId3, schema3);
-                newSchemas.put(schemaId4, schema4);
-
-                newSchemas.put(schemaId, schema);
-
-                schemas = newSchemas;
-
-                inline = false;
-            }
-            else {
-                HashMap<Integer, PortableSchema> newSchemas = new HashMap<>(schemas);
-
-                newSchemas.put(schemaId, schema);
-
-                schemas = newSchemas;
-            }
-        }
-    }
-}


[14/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary"

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java
index a20b5ed..9a37bdb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriteMode.java
@@ -22,142 +22,142 @@ package org.apache.ignite.internal.binary;
  */
 public enum BinaryWriteMode {
     /** Primitive byte. */
-    P_BYTE(GridPortableMarshaller.BYTE),
+    P_BYTE(GridBinaryMarshaller.BYTE),
 
     /** Primitive boolean. */
-    P_BOOLEAN(GridPortableMarshaller.BOOLEAN),
+    P_BOOLEAN(GridBinaryMarshaller.BOOLEAN),
 
     /** Primitive short. */
-    P_SHORT(GridPortableMarshaller.SHORT),
+    P_SHORT(GridBinaryMarshaller.SHORT),
 
     /** Primitive char. */
-    P_CHAR(GridPortableMarshaller.CHAR),
+    P_CHAR(GridBinaryMarshaller.CHAR),
 
     /** Primitive int. */
-    P_INT(GridPortableMarshaller.INT),
+    P_INT(GridBinaryMarshaller.INT),
 
     /** Primitive long. */
-    P_LONG(GridPortableMarshaller.LONG),
+    P_LONG(GridBinaryMarshaller.LONG),
 
     /** Primitive float. */
-    P_FLOAT(GridPortableMarshaller.FLOAT),
+    P_FLOAT(GridBinaryMarshaller.FLOAT),
 
     /** Primitive int. */
-    P_DOUBLE(GridPortableMarshaller.DOUBLE),
+    P_DOUBLE(GridBinaryMarshaller.DOUBLE),
 
     /** */
-    BYTE(GridPortableMarshaller.BYTE),
+    BYTE(GridBinaryMarshaller.BYTE),
 
     /** */
-    SHORT(GridPortableMarshaller.SHORT),
+    SHORT(GridBinaryMarshaller.SHORT),
 
     /** */
-    INT(GridPortableMarshaller.INT),
+    INT(GridBinaryMarshaller.INT),
 
     /** */
-    LONG(GridPortableMarshaller.LONG),
+    LONG(GridBinaryMarshaller.LONG),
 
     /** */
-    FLOAT(GridPortableMarshaller.FLOAT),
+    FLOAT(GridBinaryMarshaller.FLOAT),
 
     /** */
-    DOUBLE(GridPortableMarshaller.DOUBLE),
+    DOUBLE(GridBinaryMarshaller.DOUBLE),
 
     /** */
-    CHAR(GridPortableMarshaller.CHAR),
+    CHAR(GridBinaryMarshaller.CHAR),
 
     /** */
-    BOOLEAN(GridPortableMarshaller.BOOLEAN),
+    BOOLEAN(GridBinaryMarshaller.BOOLEAN),
 
     /** */
-    DECIMAL(GridPortableMarshaller.DECIMAL),
+    DECIMAL(GridBinaryMarshaller.DECIMAL),
 
     /** */
-    STRING(GridPortableMarshaller.STRING),
+    STRING(GridBinaryMarshaller.STRING),
 
     /** */
-    UUID(GridPortableMarshaller.UUID),
+    UUID(GridBinaryMarshaller.UUID),
 
     /** */
-    DATE(GridPortableMarshaller.DATE),
+    DATE(GridBinaryMarshaller.DATE),
 
     /** */
-    TIMESTAMP(GridPortableMarshaller.TIMESTAMP),
+    TIMESTAMP(GridBinaryMarshaller.TIMESTAMP),
 
     /** */
-    BYTE_ARR(GridPortableMarshaller.BYTE_ARR),
+    BYTE_ARR(GridBinaryMarshaller.BYTE_ARR),
 
     /** */
-    SHORT_ARR(GridPortableMarshaller.SHORT_ARR),
+    SHORT_ARR(GridBinaryMarshaller.SHORT_ARR),
 
     /** */
-    INT_ARR(GridPortableMarshaller.INT_ARR),
+    INT_ARR(GridBinaryMarshaller.INT_ARR),
 
     /** */
-    LONG_ARR(GridPortableMarshaller.LONG_ARR),
+    LONG_ARR(GridBinaryMarshaller.LONG_ARR),
 
     /** */
-    FLOAT_ARR(GridPortableMarshaller.FLOAT_ARR),
+    FLOAT_ARR(GridBinaryMarshaller.FLOAT_ARR),
 
     /** */
-    DOUBLE_ARR(GridPortableMarshaller.DOUBLE_ARR),
+    DOUBLE_ARR(GridBinaryMarshaller.DOUBLE_ARR),
 
     /** */
-    CHAR_ARR(GridPortableMarshaller.CHAR_ARR),
+    CHAR_ARR(GridBinaryMarshaller.CHAR_ARR),
 
     /** */
-    BOOLEAN_ARR(GridPortableMarshaller.BOOLEAN_ARR),
+    BOOLEAN_ARR(GridBinaryMarshaller.BOOLEAN_ARR),
 
     /** */
-    DECIMAL_ARR(GridPortableMarshaller.DECIMAL_ARR),
+    DECIMAL_ARR(GridBinaryMarshaller.DECIMAL_ARR),
 
     /** */
-    STRING_ARR(GridPortableMarshaller.STRING_ARR),
+    STRING_ARR(GridBinaryMarshaller.STRING_ARR),
 
     /** */
-    UUID_ARR(GridPortableMarshaller.UUID_ARR),
+    UUID_ARR(GridBinaryMarshaller.UUID_ARR),
 
     /** */
-    DATE_ARR(GridPortableMarshaller.DATE_ARR),
+    DATE_ARR(GridBinaryMarshaller.DATE_ARR),
 
     /** */
-    TIMESTAMP_ARR(GridPortableMarshaller.TIMESTAMP_ARR),
+    TIMESTAMP_ARR(GridBinaryMarshaller.TIMESTAMP_ARR),
 
     /** */
-    OBJECT_ARR(GridPortableMarshaller.OBJ_ARR),
+    OBJECT_ARR(GridBinaryMarshaller.OBJ_ARR),
 
     /** */
-    COL(GridPortableMarshaller.COL),
+    COL(GridBinaryMarshaller.COL),
 
     /** */
-    MAP(GridPortableMarshaller.MAP),
+    MAP(GridBinaryMarshaller.MAP),
 
     /** */
-    PORTABLE_OBJ(GridPortableMarshaller.OBJ),
+    PORTABLE_OBJ(GridBinaryMarshaller.OBJ),
 
     /** */
-    ENUM(GridPortableMarshaller.ENUM),
+    ENUM(GridBinaryMarshaller.ENUM),
 
     /** Portable enum. */
-    PORTABLE_ENUM(GridPortableMarshaller.ENUM),
+    PORTABLE_ENUM(GridBinaryMarshaller.ENUM),
 
     /** */
-    ENUM_ARR(GridPortableMarshaller.ENUM_ARR),
+    ENUM_ARR(GridBinaryMarshaller.ENUM_ARR),
 
     /** */
-    CLASS(GridPortableMarshaller.CLASS),
+    CLASS(GridBinaryMarshaller.CLASS),
 
     /** */
-    PORTABLE(GridPortableMarshaller.PORTABLE_OBJ),
+    PORTABLE(GridBinaryMarshaller.PORTABLE_OBJ),
 
     /** */
-    EXTERNALIZABLE(GridPortableMarshaller.OBJ),
+    EXTERNALIZABLE(GridBinaryMarshaller.OBJ),
 
     /** */
-    OBJECT(GridPortableMarshaller.OBJ),
+    OBJECT(GridBinaryMarshaller.OBJ),
 
     /** */
-    EXCLUSION(GridPortableMarshaller.OBJ);
+    EXCLUSION(GridBinaryMarshaller.OBJ);
 
     /** Type ID. */
     private final int typeId;

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
index 25f4d70..f073dd0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterExImpl.java
@@ -22,9 +22,8 @@ import org.apache.ignite.binary.BinaryIdMapper;
 import org.apache.ignite.binary.BinaryObjectException;
 import org.apache.ignite.binary.BinaryRawWriter;
 import org.apache.ignite.binary.BinaryWriter;
-import org.apache.ignite.internal.binary.streams.PortableOutputStream;
-import org.apache.ignite.internal.binary.streams.PortableHeapOutputStream;
-import org.apache.ignite.internal.binary.streams.PortableOutputStream;
+import org.apache.ignite.internal.binary.streams.BinaryOutputStream;
+import org.apache.ignite.internal.binary.streams.BinaryHeapOutputStream;
 import org.apache.ignite.internal.util.typedef.internal.A;
 import org.jetbrains.annotations.Nullable;
 
@@ -40,45 +39,6 @@ import java.util.Map;
 import java.util.UUID;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BOOLEAN;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BOOLEAN_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BYTE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BYTE_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.CHAR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.CHAR_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.CLASS;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.COL;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DATE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DATE_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DECIMAL;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DECIMAL_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DFLT_HDR_LEN;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DOUBLE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DOUBLE_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.ENUM;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.ENUM_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.FLOAT;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.FLOAT_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.INT;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.INT_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.LONG;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.LONG_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.MAP;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.NULL;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.OBJ;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.OBJ_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.OPTM_MARSH;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.PORTABLE_OBJ;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.PROTO_VER;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.SHORT;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.SHORT_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.STRING;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.STRING_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.TIMESTAMP;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.TIMESTAMP_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.UNREGISTERED_TYPE_ID;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.UUID;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.UUID_ARR;
 
 /**
  * Portable writer implementation.
@@ -91,10 +51,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     private static final int INIT_CAP = 1024;
 
     /** */
-    private final PortableContext ctx;
+    private final BinaryContext ctx;
 
     /** Output stream. */
-    private final PortableOutputStream out;
+    private final BinaryOutputStream out;
 
     /** Schema. */
     private final BinaryWriterSchemaHolder schema;
@@ -112,7 +72,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     private BinaryWriterHandles handles;
 
     /** Schema ID. */
-    private int schemaId = PortableUtils.schemaInitialId();
+    private int schemaId = BinaryUtils.schemaInitialId();
 
     /** Amount of written fields. */
     private int fieldCnt;
@@ -123,7 +83,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     /**
      * @param ctx Context.
      */
-    public BinaryWriterExImpl(PortableContext ctx) {
+    public BinaryWriterExImpl(BinaryContext ctx) {
         this(ctx, BinaryThreadLocalContext.get());
     }
 
@@ -131,8 +91,8 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      * @param ctx Context.
      * @param tlsCtx TLS context.
      */
-    public BinaryWriterExImpl(PortableContext ctx, BinaryThreadLocalContext tlsCtx) {
-        this(ctx, new PortableHeapOutputStream(INIT_CAP, tlsCtx.chunk()), tlsCtx.schemaHolder(), null);
+    public BinaryWriterExImpl(BinaryContext ctx, BinaryThreadLocalContext tlsCtx) {
+        this(ctx, new BinaryHeapOutputStream(INIT_CAP, tlsCtx.chunk()), tlsCtx.schemaHolder(), null);
     }
 
     /**
@@ -140,7 +100,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      * @param out Output stream.
      * @param handles Handles.
      */
-    public BinaryWriterExImpl(PortableContext ctx, PortableOutputStream out, BinaryWriterSchemaHolder schema,
+    public BinaryWriterExImpl(BinaryContext ctx, BinaryOutputStream out, BinaryWriterSchemaHolder schema,
         BinaryWriterHandles handles) {
         this.ctx = ctx;
         this.out = out;
@@ -182,19 +142,19 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
 
         Class<?> cls = obj.getClass();
 
-        PortableClassDescriptor desc = ctx.descriptorForClass(cls, false);
+        BinaryClassDescriptor desc = ctx.descriptorForClass(cls, false);
 
         if (desc == null)
             throw new BinaryObjectException("Object is not portable: [class=" + cls + ']');
 
         if (desc.excluded()) {
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
 
             return;
         }
 
         if (desc.useOptimizedMarshaller()) {
-            out.writeByte(GridPortableMarshaller.OPTM_MARSH);
+            out.writeByte(GridBinaryMarshaller.OPTM_MARSH);
 
             try {
                 byte[] arr = ctx.optimizedMarsh().marshal(obj);
@@ -227,7 +187,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
             }
 
             if (replacedObj == null) {
-                out.writeByte(GridPortableMarshaller.NULL);
+                out.writeByte(GridBinaryMarshaller.NULL);
 
                 return;
             }
@@ -269,7 +229,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      * @param clsName Class name (optional).
      */
     public void preWrite(@Nullable String clsName) {
-        out.position(out.position() + GridPortableMarshaller.DFLT_HDR_LEN);
+        out.position(out.position() + GridBinaryMarshaller.DFLT_HDR_LEN);
 
         if (clsName != null)
             doWriteString(clsName);
@@ -288,11 +248,11 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
 
         if (userType) {
             if (ctx.isCompactFooter()) {
-                flags = PortableUtils.FLAG_USR_TYP | PortableUtils.FLAG_COMPACT_FOOTER;
+                flags = BinaryUtils.FLAG_USR_TYP | BinaryUtils.FLAG_COMPACT_FOOTER;
                 useCompactFooter = true;
             }
             else {
-                flags = PortableUtils.FLAG_USR_TYP;
+                flags = BinaryUtils.FLAG_USR_TYP;
                 useCompactFooter = false;
             }
         }
@@ -309,18 +269,18 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
             offset = out.position() - start;
 
             // Write the schema.
-            flags |= PortableUtils.FLAG_HAS_SCHEMA;
+            flags |= BinaryUtils.FLAG_HAS_SCHEMA;
 
             int offsetByteCnt = schema.write(out, fieldCnt, useCompactFooter);
 
-            if (offsetByteCnt == PortableUtils.OFFSET_1)
-                flags |= PortableUtils.FLAG_OFFSET_ONE_BYTE;
-            else if (offsetByteCnt == PortableUtils.OFFSET_2)
-                flags |= PortableUtils.FLAG_OFFSET_TWO_BYTES;
+            if (offsetByteCnt == BinaryUtils.OFFSET_1)
+                flags |= BinaryUtils.FLAG_OFFSET_ONE_BYTE;
+            else if (offsetByteCnt == BinaryUtils.OFFSET_2)
+                flags |= BinaryUtils.FLAG_OFFSET_TWO_BYTES;
 
             // Write raw offset if needed.
             if (rawOffPos != 0) {
-                flags |= PortableUtils.FLAG_HAS_RAW;
+                flags |= BinaryUtils.FLAG_HAS_RAW;
 
                 out.writeInt(rawOffPos - start);
             }
@@ -331,7 +291,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
                 offset = rawOffPos - start;
 
                 // If there is no schema, we are free to write raw offset to schema offset.
-                flags |= PortableUtils.FLAG_HAS_RAW;
+                flags |= BinaryUtils.FLAG_HAS_RAW;
             }
             else {
                 finalSchemaId = 0;
@@ -344,10 +304,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
 
         out.unsafePosition(start);
 
-        out.unsafeWriteByte(GridPortableMarshaller.OBJ);
-        out.unsafeWriteByte(GridPortableMarshaller.PROTO_VER);
+        out.unsafeWriteByte(GridBinaryMarshaller.OBJ);
+        out.unsafeWriteByte(GridBinaryMarshaller.PROTO_VER);
         out.unsafeWriteShort(flags);
-        out.unsafeWriteInt(registered ? typeId : GridPortableMarshaller.UNREGISTERED_TYPE_ID);
+        out.unsafeWriteInt(registered ? typeId : GridBinaryMarshaller.UNREGISTERED_TYPE_ID);
         out.unsafeWriteInt(hashCode);
         out.unsafeWriteInt(retPos - start);
         out.unsafeWriteInt(finalSchemaId);
@@ -389,11 +349,11 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     public void doWriteDecimal(@Nullable BigDecimal val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 4 + 4);
 
-            out.unsafeWriteByte(GridPortableMarshaller.DECIMAL);
+            out.unsafeWriteByte(GridBinaryMarshaller.DECIMAL);
 
             BigInteger intVal = val.unscaledValue();
 
@@ -417,12 +377,12 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     public void doWriteString(@Nullable String val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             byte[] strArr = val.getBytes(UTF_8);
 
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.STRING);
+            out.unsafeWriteByte(GridBinaryMarshaller.STRING);
             out.unsafeWriteInt(strArr.length);
 
             out.writeByteArray(strArr);
@@ -434,10 +394,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     public void doWriteUuid(@Nullable UUID uuid) {
         if (uuid == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 8 + 8);
-            out.unsafeWriteByte(GridPortableMarshaller.UUID);
+            out.unsafeWriteByte(GridBinaryMarshaller.UUID);
             out.unsafeWriteLong(uuid.getMostSignificantBits());
             out.unsafeWriteLong(uuid.getLeastSignificantBits());
         }
@@ -448,10 +408,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     public void doWriteDate(@Nullable Date date) {
         if (date == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 8);
-            out.unsafeWriteByte(GridPortableMarshaller.DATE);
+            out.unsafeWriteByte(GridBinaryMarshaller.DATE);
             out.unsafeWriteLong(date.getTime());
         }
     }
@@ -461,10 +421,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     public void doWriteTimestamp(@Nullable Timestamp ts) {
         if (ts== null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 8 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.TIMESTAMP);
+            out.unsafeWriteByte(GridBinaryMarshaller.TIMESTAMP);
             out.unsafeWriteLong(ts.getTime());
             out.unsafeWriteInt(ts.getNanos() % 1000000);
         }
@@ -478,7 +438,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     public void doWriteObject(@Nullable Object obj) throws BinaryObjectException {
         if (obj == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             BinaryWriterExImpl writer = new BinaryWriterExImpl(ctx, out, schema, handles());
 
@@ -491,10 +451,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteByteArray(@Nullable byte[] val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.BYTE_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.BYTE_ARR);
             out.unsafeWriteInt(val.length);
 
             out.writeByteArray(val);
@@ -506,10 +466,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteShortArray(@Nullable short[] val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.SHORT_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.SHORT_ARR);
             out.unsafeWriteInt(val.length);
 
             out.writeShortArray(val);
@@ -521,10 +481,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteIntArray(@Nullable int[] val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.INT_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.INT_ARR);
             out.unsafeWriteInt(val.length);
 
             out.writeIntArray(val);
@@ -536,10 +496,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteLongArray(@Nullable long[] val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.LONG_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.LONG_ARR);
             out.unsafeWriteInt(val.length);
 
             out.writeLongArray(val);
@@ -551,10 +511,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteFloatArray(@Nullable float[] val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.FLOAT_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.FLOAT_ARR);
             out.unsafeWriteInt(val.length);
 
             out.writeFloatArray(val);
@@ -566,10 +526,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteDoubleArray(@Nullable double[] val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.DOUBLE_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.DOUBLE_ARR);
             out.unsafeWriteInt(val.length);
 
             out.writeDoubleArray(val);
@@ -581,10 +541,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteCharArray(@Nullable char[] val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.CHAR_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.CHAR_ARR);
             out.unsafeWriteInt(val.length);
 
             out.writeCharArray(val);
@@ -596,10 +556,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteBooleanArray(@Nullable boolean[] val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.BOOLEAN_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.BOOLEAN_ARR);
             out.unsafeWriteInt(val.length);
 
             out.writeBooleanArray(val);
@@ -611,10 +571,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteDecimalArray(@Nullable BigDecimal[] val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.DECIMAL_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.DECIMAL_ARR);
             out.unsafeWriteInt(val.length);
 
             for (BigDecimal str : val)
@@ -627,10 +587,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteStringArray(@Nullable String[] val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.STRING_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.STRING_ARR);
             out.unsafeWriteInt(val.length);
 
             for (String str : val)
@@ -643,10 +603,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteUuidArray(@Nullable UUID[] val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.UUID_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.UUID_ARR);
             out.unsafeWriteInt(val.length);
 
             for (UUID uuid : val)
@@ -659,10 +619,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteDateArray(@Nullable Date[] val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.DATE_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.DATE_ARR);
             out.unsafeWriteInt(val.length);
 
             for (Date date : val)
@@ -675,10 +635,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
       */
      void doWriteTimestampArray(@Nullable Timestamp[] val) {
          if (val == null)
-             out.writeByte(GridPortableMarshaller.NULL);
+             out.writeByte(GridBinaryMarshaller.NULL);
          else {
              out.unsafeEnsure(1 + 4);
-             out.unsafeWriteByte(GridPortableMarshaller.TIMESTAMP_ARR);
+             out.unsafeWriteByte(GridBinaryMarshaller.TIMESTAMP_ARR);
              out.unsafeWriteInt(val.length);
 
              for (Timestamp ts : val)
@@ -692,20 +652,20 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteObjectArray(@Nullable Object[] val) throws BinaryObjectException {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             if (tryWriteAsHandle(val))
                 return;
 
-            PortableClassDescriptor desc = ctx.descriptorForClass(val.getClass().getComponentType(), false);
+            BinaryClassDescriptor desc = ctx.descriptorForClass(val.getClass().getComponentType(), false);
 
             out.unsafeEnsure(1 + 4);
-            out.unsafeWriteByte(GridPortableMarshaller.OBJ_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.OBJ_ARR);
 
             if (desc.registered())
                 out.unsafeWriteInt(desc.typeId());
             else {
-                out.unsafeWriteInt(GridPortableMarshaller.UNREGISTERED_TYPE_ID);
+                out.unsafeWriteInt(GridBinaryMarshaller.UNREGISTERED_TYPE_ID);
 
                 doWriteString(val.getClass().getComponentType().getName());
             }
@@ -723,13 +683,13 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteCollection(@Nullable Collection<?> col) throws BinaryObjectException {
         if (col == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             if (tryWriteAsHandle(col))
                 return;
 
             out.unsafeEnsure(1 + 4 + 1);
-            out.unsafeWriteByte(GridPortableMarshaller.COL);
+            out.unsafeWriteByte(GridBinaryMarshaller.COL);
             out.unsafeWriteInt(col.size());
             out.unsafeWriteByte(ctx.collectionType(col.getClass()));
 
@@ -744,13 +704,13 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteMap(@Nullable Map<?, ?> map) throws BinaryObjectException {
         if (map == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             if (tryWriteAsHandle(map))
                 return;
 
             out.unsafeEnsure(1 + 4 + 1);
-            out.unsafeWriteByte(GridPortableMarshaller.MAP);
+            out.unsafeWriteByte(GridBinaryMarshaller.MAP);
             out.unsafeWriteInt(map.size());
             out.unsafeWriteByte(ctx.mapType(map.getClass()));
 
@@ -766,18 +726,18 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteEnum(@Nullable Enum<?> val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
-            PortableClassDescriptor desc = ctx.descriptorForClass(val.getClass(), false);
+            BinaryClassDescriptor desc = ctx.descriptorForClass(val.getClass(), false);
 
             out.unsafeEnsure(1 + 4);
 
-            out.unsafeWriteByte(GridPortableMarshaller.ENUM);
+            out.unsafeWriteByte(GridBinaryMarshaller.ENUM);
 
             if (desc.registered())
                 out.unsafeWriteInt(desc.typeId());
             else {
-                out.unsafeWriteInt(GridPortableMarshaller.UNREGISTERED_TYPE_ID);
+                out.unsafeWriteInt(GridBinaryMarshaller.UNREGISTERED_TYPE_ID);
                 doWriteString(val.getClass().getName());
             }
 
@@ -795,10 +755,10 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
 
         out.unsafeEnsure(1 + 4);
 
-        out.unsafeWriteByte(GridPortableMarshaller.ENUM);
+        out.unsafeWriteByte(GridBinaryMarshaller.ENUM);
         out.unsafeWriteInt(typeId);
 
-        if (typeId == GridPortableMarshaller.UNREGISTERED_TYPE_ID)
+        if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID)
             doWriteString(val.className());
 
         out.writeInt(val.enumOrdinal());
@@ -811,18 +771,18 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
         assert val == null || val.getClass().getComponentType().isEnum();
 
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
-            PortableClassDescriptor desc = ctx.descriptorForClass(val.getClass().getComponentType(), false);
+            BinaryClassDescriptor desc = ctx.descriptorForClass(val.getClass().getComponentType(), false);
 
             out.unsafeEnsure(1 + 4);
 
-            out.unsafeWriteByte(GridPortableMarshaller.ENUM_ARR);
+            out.unsafeWriteByte(GridBinaryMarshaller.ENUM_ARR);
 
             if (desc.registered())
                 out.unsafeWriteInt(desc.typeId());
             else {
-                out.unsafeWriteInt(GridPortableMarshaller.UNREGISTERED_TYPE_ID);
+                out.unsafeWriteInt(GridBinaryMarshaller.UNREGISTERED_TYPE_ID);
 
                 doWriteString(val.getClass().getComponentType().getName());
             }
@@ -840,18 +800,18 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void doWriteClass(@Nullable Class val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
-            PortableClassDescriptor desc = ctx.descriptorForClass(val, false);
+            BinaryClassDescriptor desc = ctx.descriptorForClass(val, false);
 
             out.unsafeEnsure(1 + 4);
 
-            out.unsafeWriteByte(GridPortableMarshaller.CLASS);
+            out.unsafeWriteByte(GridBinaryMarshaller.CLASS);
 
             if (desc.registered())
                 out.unsafeWriteInt(desc.typeId());
             else {
-                out.unsafeWriteInt(GridPortableMarshaller.UNREGISTERED_TYPE_ID);
+                out.unsafeWriteInt(GridBinaryMarshaller.UNREGISTERED_TYPE_ID);
 
                 doWriteString(val.getClass().getName());
             }
@@ -863,13 +823,13 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     public void doWritePortableObject(@Nullable BinaryObjectImpl po) {
         if (po == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             byte[] poArr = po.array();
 
             out.unsafeEnsure(1 + 4 + poArr.length + 4);
 
-            out.unsafeWriteByte(GridPortableMarshaller.PORTABLE_OBJ);
+            out.unsafeWriteByte(GridBinaryMarshaller.PORTABLE_OBJ);
             out.unsafeWriteInt(poArr.length);
             out.writeByteArray(poArr);
             out.unsafeWriteInt(po.start());
@@ -882,7 +842,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     void writeByteFieldPrimitive(byte val) {
         out.unsafeEnsure(1 + 1);
 
-        out.unsafeWriteByte(GridPortableMarshaller.BYTE);
+        out.unsafeWriteByte(GridBinaryMarshaller.BYTE);
         out.unsafeWriteByte(val);
     }
 
@@ -891,7 +851,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void writeByteField(@Nullable Byte val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else
             writeByteFieldPrimitive(val);
     }
@@ -909,7 +869,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     void writeShortFieldPrimitive(short val) {
         out.unsafeEnsure(1 + 2);
 
-        out.unsafeWriteByte(GridPortableMarshaller.SHORT);
+        out.unsafeWriteByte(GridBinaryMarshaller.SHORT);
         out.unsafeWriteShort(val);
     }
 
@@ -918,7 +878,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void writeShortField(@Nullable Short val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else
             writeShortFieldPrimitive(val);
     }
@@ -929,7 +889,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     void writeIntFieldPrimitive(int val) {
         out.unsafeEnsure(1 + 4);
 
-        out.unsafeWriteByte(GridPortableMarshaller.INT);
+        out.unsafeWriteByte(GridBinaryMarshaller.INT);
         out.unsafeWriteInt(val);
     }
 
@@ -938,7 +898,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void writeIntField(@Nullable Integer val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else
             writeIntFieldPrimitive(val);
     }
@@ -949,7 +909,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     void writeLongFieldPrimitive(long val) {
         out.unsafeEnsure(1 + 8);
 
-        out.unsafeWriteByte(GridPortableMarshaller.LONG);
+        out.unsafeWriteByte(GridBinaryMarshaller.LONG);
         out.unsafeWriteLong(val);
     }
 
@@ -958,7 +918,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void writeLongField(@Nullable Long val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else
             writeLongFieldPrimitive(val);
     }
@@ -969,7 +929,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     void writeFloatFieldPrimitive(float val) {
         out.unsafeEnsure(1 + 4);
 
-        out.unsafeWriteByte(GridPortableMarshaller.FLOAT);
+        out.unsafeWriteByte(GridBinaryMarshaller.FLOAT);
         out.unsafeWriteFloat(val);
     }
 
@@ -978,7 +938,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void writeFloatField(@Nullable Float val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else
             writeFloatFieldPrimitive(val);
     }
@@ -989,7 +949,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     void writeDoubleFieldPrimitive(double val) {
         out.unsafeEnsure(1 + 8);
 
-        out.unsafeWriteByte(GridPortableMarshaller.DOUBLE);
+        out.unsafeWriteByte(GridBinaryMarshaller.DOUBLE);
         out.unsafeWriteDouble(val);
     }
 
@@ -998,7 +958,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void writeDoubleField(@Nullable Double val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else
             writeDoubleFieldPrimitive(val);
     }
@@ -1009,7 +969,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     void writeCharFieldPrimitive(char val) {
         out.unsafeEnsure(1 + 2);
 
-        out.unsafeWriteByte(GridPortableMarshaller.CHAR);
+        out.unsafeWriteByte(GridBinaryMarshaller.CHAR);
         out.unsafeWriteChar(val);
     }
 
@@ -1018,7 +978,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void writeCharField(@Nullable Character val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else
             writeCharFieldPrimitive(val);
     }
@@ -1029,7 +989,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     void writeBooleanFieldPrimitive(boolean val) {
         out.unsafeEnsure(1 + 1);
 
-        out.unsafeWriteByte(GridPortableMarshaller.BOOLEAN);
+        out.unsafeWriteByte(GridBinaryMarshaller.BOOLEAN);
         out.unsafeWriteBoolean(val);
     }
 
@@ -1038,7 +998,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
      */
     void writeBooleanField(@Nullable Boolean val) {
         if (val == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else
             writeBooleanFieldPrimitive(val);
     }
@@ -1380,7 +1340,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     /** {@inheritDoc} */
     @Override public void writeObjectDetached(@Nullable Object obj) throws BinaryObjectException {
         if (obj == null)
-            out.writeByte(GridPortableMarshaller.NULL);
+            out.writeByte(GridBinaryMarshaller.NULL);
         else {
             BinaryWriterExImpl writer = new BinaryWriterExImpl(ctx, out, schema, null);
 
@@ -1601,7 +1561,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     }
 
     /** {@inheritDoc} */
-    @Override public PortableOutputStream out() {
+    @Override public BinaryOutputStream out() {
         return out;
     }
 
@@ -1698,7 +1658,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
         int fieldOff = out.position() - start;
 
         // Advance schema hash.
-        schemaId = PortableUtils.updateSchemaId(schemaId, fieldId);
+        schemaId = BinaryUtils.updateSchemaId(schemaId, fieldId);
 
         schema.push(fieldId, fieldOff);
 
@@ -1736,8 +1696,8 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     /**
      * @return Current writer's schema.
      */
-    public PortableSchema currentSchema() {
-        PortableSchema.Builder builder = PortableSchema.Builder.newBuilder();
+    public BinarySchema currentSchema() {
+        BinarySchema.Builder builder = BinarySchema.Builder.newBuilder();
 
         if (schema != null)
             schema.build(builder, fieldCnt);
@@ -1778,7 +1738,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
         else {
             out.unsafeEnsure(1 + 4);
 
-            out.unsafeWriteByte(GridPortableMarshaller.HANDLE);
+            out.unsafeWriteByte(GridBinaryMarshaller.HANDLE);
             out.unsafeWriteInt(pos - old);
 
             return true;
@@ -1802,7 +1762,7 @@ public class BinaryWriterExImpl implements BinaryWriter, BinaryRawWriterEx, Obje
     /**
      * @return Portable context.
      */
-    public PortableContext context() {
+    public BinaryContext context() {
         return ctx;
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterSchemaHolder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterSchemaHolder.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterSchemaHolder.java
index 7fd6442..22ae8e3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterSchemaHolder.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryWriterSchemaHolder.java
@@ -17,8 +17,7 @@
 
 package org.apache.ignite.internal.binary;
 
-import org.apache.ignite.internal.binary.streams.PortableOutputStream;
-import org.apache.ignite.internal.binary.streams.PortableOutputStream;
+import org.apache.ignite.internal.binary.streams.BinaryOutputStream;
 
 /**
  * Binary writer schema holder.
@@ -66,7 +65,7 @@ public class BinaryWriterSchemaHolder {
      * @param builder Builder.
      * @param fieldCnt Fields count.
      */
-    public void build(PortableSchema.Builder builder, int fieldCnt) {
+    public void build(BinarySchema.Builder builder, int fieldCnt) {
         for (int curIdx = idx - fieldCnt * 2; curIdx < idx; curIdx += 2)
             builder.addField(data[curIdx]);
     }
@@ -79,7 +78,7 @@ public class BinaryWriterSchemaHolder {
      * @param compactFooter Whether footer should be written in compact form.
      * @return Amount of bytes dedicated to each field offset. Could be 1, 2 or 4.
      */
-    public int write(PortableOutputStream out, int fieldCnt, boolean compactFooter) {
+    public int write(BinaryOutputStream out, int fieldCnt, boolean compactFooter) {
         int startIdx = idx - fieldCnt * 2;
         assert startIdx >= 0;
 
@@ -95,19 +94,19 @@ public class BinaryWriterSchemaHolder {
                 for (int curIdx = startIdx + 1; curIdx < idx; curIdx += 2)
                     out.unsafeWriteByte((byte)data[curIdx]);
 
-                res = PortableUtils.OFFSET_1;
+                res = BinaryUtils.OFFSET_1;
             }
             else if (lastOffset < MAX_OFFSET_2) {
                 for (int curIdx = startIdx + 1; curIdx < idx; curIdx += 2)
                     out.unsafeWriteShort((short) data[curIdx]);
 
-                res = PortableUtils.OFFSET_2;
+                res = BinaryUtils.OFFSET_2;
             }
             else {
                 for (int curIdx = startIdx + 1; curIdx < idx; curIdx += 2)
                     out.unsafeWriteInt(data[curIdx]);
 
-                res = PortableUtils.OFFSET_4;
+                res = BinaryUtils.OFFSET_4;
             }
         }
         else {
@@ -117,7 +116,7 @@ public class BinaryWriterSchemaHolder {
                     out.unsafeWriteByte((byte) data[curIdx++]);
                 }
 
-                res = PortableUtils.OFFSET_1;
+                res = BinaryUtils.OFFSET_1;
             }
             else if (lastOffset < MAX_OFFSET_2) {
                 for (int curIdx = startIdx; curIdx < idx;) {
@@ -125,7 +124,7 @@ public class BinaryWriterSchemaHolder {
                     out.unsafeWriteShort((short) data[curIdx++]);
                 }
 
-                res = PortableUtils.OFFSET_2;
+                res = BinaryUtils.OFFSET_2;
             }
             else {
                 for (int curIdx = startIdx; curIdx < idx;) {
@@ -133,7 +132,7 @@ public class BinaryWriterSchemaHolder {
                     out.unsafeWriteInt(data[curIdx++]);
                 }
 
-                res = PortableUtils.OFFSET_4;
+                res = BinaryUtils.OFFSET_4;
             }
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java
new file mode 100644
index 0000000..277abd0
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridBinaryMarshaller.java
@@ -0,0 +1,286 @@
+/*
+ * 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.binary;
+
+import org.apache.ignite.internal.binary.streams.BinaryHeapInputStream;
+import org.apache.ignite.internal.binary.streams.BinaryInputStream;
+import org.apache.ignite.internal.binary.streams.BinaryOutputStream;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Portable objects marshaller.
+ */
+public class GridBinaryMarshaller {
+    /** */
+    public static final ThreadLocal<Boolean> KEEP_PORTABLES = new ThreadLocal<Boolean>() {
+        @Override protected Boolean initialValue() {
+            return true;
+        }
+    };
+
+    /** */
+    static final byte OPTM_MARSH = -2;
+
+    /** */
+    public static final byte BYTE = 1;
+
+    /** */
+    public static final byte SHORT = 2;
+
+    /** */
+    public static final byte INT = 3;
+
+    /** */
+    public static final byte LONG = 4;
+
+    /** */
+    public static final byte FLOAT = 5;
+
+    /** */
+    public static final byte DOUBLE = 6;
+
+    /** */
+    public static final byte CHAR = 7;
+
+    /** */
+    public static final byte BOOLEAN = 8;
+
+    /** */
+    public static final byte DECIMAL = 30;
+
+    /** */
+    public static final byte STRING = 9;
+
+    /** */
+    public static final byte UUID = 10;
+
+    /** */
+    public static final byte DATE = 11;
+
+    /** */
+    public static final byte BYTE_ARR = 12;
+
+    /** */
+    public static final byte SHORT_ARR = 13;
+
+    /** */
+    public static final byte INT_ARR = 14;
+
+    /** */
+    public static final byte LONG_ARR = 15;
+
+    /** */
+    public static final byte FLOAT_ARR = 16;
+
+    /** */
+    public static final byte DOUBLE_ARR = 17;
+
+    /** */
+    public static final byte CHAR_ARR = 18;
+
+    /** */
+    public static final byte BOOLEAN_ARR = 19;
+
+    /** */
+    public static final byte DECIMAL_ARR = 31;
+
+    /** */
+    public static final byte STRING_ARR = 20;
+
+    /** */
+    public static final byte UUID_ARR = 21;
+
+    /** */
+    public static final byte DATE_ARR = 22;
+
+    /** */
+    public static final byte OBJ_ARR = 23;
+
+    /** */
+    public static final byte COL = 24;
+
+    /** */
+    public static final byte MAP = 25;
+
+    /** */
+    public static final byte PORTABLE_OBJ = 27;
+
+    /** */
+    public static final byte ENUM = 28;
+
+    /** */
+    public static final byte ENUM_ARR = 29;
+
+    /** */
+    public static final byte CLASS = 32;
+
+    /** Timestamp. */
+    public static final byte TIMESTAMP = 33;
+
+    /** Timestamp array. */
+    public static final byte TIMESTAMP_ARR = 34;
+
+    /** */
+    public static final byte NULL = (byte)101;
+
+    /** */
+    public static final byte HANDLE = (byte)102;
+
+    /** */
+    public static final byte OBJ = (byte)103;
+
+    /** */
+    public static final byte USER_SET = -1;
+
+    /** */
+    public static final byte USER_COL = 0;
+
+    /** */
+    public static final byte ARR_LIST = 1;
+
+    /** */
+    public static final byte LINKED_LIST = 2;
+
+    /** */
+    public static final byte HASH_SET = 3;
+
+    /** */
+    public static final byte LINKED_HASH_SET = 4;
+
+    /** */
+    public static final byte HASH_MAP = 1;
+
+    /** */
+    public static final byte LINKED_HASH_MAP = 2;
+
+    /** */
+    public static final int OBJECT_TYPE_ID = -1;
+
+    /** */
+    public static final int UNREGISTERED_TYPE_ID = 0;
+
+    /** Protocol version. */
+    public static final byte PROTO_VER = 1;
+
+    /** Protocol version position. */
+    public static final int PROTO_VER_POS = 1;
+
+    /** Flags position in header. */
+    public static final int FLAGS_POS = 2;
+
+    /** */
+    public static final int TYPE_ID_POS = 4;
+
+    /** */
+    public static final int HASH_CODE_POS = 8;
+
+    /** */
+    public static final int TOTAL_LEN_POS = 12;
+
+    /** */
+    public static final int SCHEMA_ID_POS = 16;
+
+    /** Schema or raw offset position. */
+    public static final int SCHEMA_OR_RAW_OFF_POS = 20;
+
+    /** */
+    public static final byte DFLT_HDR_LEN = 24;
+
+    /** */
+    private final BinaryContext ctx;
+
+    /**
+     * @param ctx Context.
+     */
+    public GridBinaryMarshaller(BinaryContext ctx) {
+        this.ctx = ctx;
+    }
+
+    /**
+     * @param obj Object to marshal.
+     * @return Byte array.
+     * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
+     */
+    public byte[] marshal(@Nullable Object obj) throws BinaryObjectException {
+        if (obj == null)
+            return new byte[] { NULL };
+
+        try (BinaryWriterExImpl writer = new BinaryWriterExImpl(ctx)) {
+            writer.marshal(obj);
+
+            return writer.array();
+        }
+    }
+
+    /**
+     * @param bytes Bytes array.
+     * @return Portable object.
+     * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
+     */
+    @SuppressWarnings("unchecked")
+    @Nullable public <T> T unmarshal(byte[] bytes, @Nullable ClassLoader clsLdr) throws BinaryObjectException {
+        assert bytes != null;
+
+        return (T)BinaryUtils.unmarshal(BinaryHeapInputStream.create(bytes, 0), ctx, clsLdr);
+    }
+
+    /**
+     * @param in Input stream.
+     * @return Portable object.
+     * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
+     */
+    @SuppressWarnings("unchecked")
+    @Nullable public <T> T unmarshal(BinaryInputStream in) throws BinaryObjectException {
+        return (T)BinaryUtils.unmarshal(in, ctx, null);
+    }
+
+    /**
+     * @param arr Byte array.
+     * @param ldr Class loader.
+     * @return Deserialized object.
+     * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
+     */
+    @SuppressWarnings("unchecked")
+    @Nullable public <T> T deserialize(byte[] arr, @Nullable ClassLoader ldr) throws BinaryObjectException {
+        assert arr != null;
+        assert arr.length > 0;
+
+        if (arr[0] == NULL)
+            return null;
+
+        return (T)new BinaryReaderExImpl(ctx, BinaryHeapInputStream.create(arr, 0), ldr).deserialize();
+    }
+
+    /**
+     * Gets writer for the given output stream.
+     *
+     * @param out Output stream.
+     * @return Writer.
+     */
+    public BinaryWriterExImpl writer(BinaryOutputStream out) {
+        return new BinaryWriterExImpl(ctx, out, BinaryThreadLocalContext.get().schemaHolder(), null);
+    }
+
+    /**
+     * @return Context.
+     */
+    public BinaryContext context() {
+        return ctx;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/GridPortableMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridPortableMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/GridPortableMarshaller.java
deleted file mode 100644
index a57bb55..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/GridPortableMarshaller.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * 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.binary;
-
-import org.apache.ignite.internal.binary.streams.PortableHeapInputStream;
-import org.apache.ignite.internal.binary.streams.PortableInputStream;
-import org.apache.ignite.internal.binary.streams.PortableOutputStream;
-import org.apache.ignite.internal.binary.streams.PortableHeapInputStream;
-import org.apache.ignite.internal.binary.streams.PortableInputStream;
-import org.apache.ignite.internal.binary.streams.PortableOutputStream;
-import org.apache.ignite.binary.BinaryObjectException;
-import org.jetbrains.annotations.Nullable;
-
-/**
- * Portable objects marshaller.
- */
-public class GridPortableMarshaller {
-    /** */
-    public static final ThreadLocal<Boolean> KEEP_PORTABLES = new ThreadLocal<Boolean>() {
-        @Override protected Boolean initialValue() {
-            return true;
-        }
-    };
-
-    /** */
-    static final byte OPTM_MARSH = -2;
-
-    /** */
-    public static final byte BYTE = 1;
-
-    /** */
-    public static final byte SHORT = 2;
-
-    /** */
-    public static final byte INT = 3;
-
-    /** */
-    public static final byte LONG = 4;
-
-    /** */
-    public static final byte FLOAT = 5;
-
-    /** */
-    public static final byte DOUBLE = 6;
-
-    /** */
-    public static final byte CHAR = 7;
-
-    /** */
-    public static final byte BOOLEAN = 8;
-
-    /** */
-    public static final byte DECIMAL = 30;
-
-    /** */
-    public static final byte STRING = 9;
-
-    /** */
-    public static final byte UUID = 10;
-
-    /** */
-    public static final byte DATE = 11;
-
-    /** */
-    public static final byte BYTE_ARR = 12;
-
-    /** */
-    public static final byte SHORT_ARR = 13;
-
-    /** */
-    public static final byte INT_ARR = 14;
-
-    /** */
-    public static final byte LONG_ARR = 15;
-
-    /** */
-    public static final byte FLOAT_ARR = 16;
-
-    /** */
-    public static final byte DOUBLE_ARR = 17;
-
-    /** */
-    public static final byte CHAR_ARR = 18;
-
-    /** */
-    public static final byte BOOLEAN_ARR = 19;
-
-    /** */
-    public static final byte DECIMAL_ARR = 31;
-
-    /** */
-    public static final byte STRING_ARR = 20;
-
-    /** */
-    public static final byte UUID_ARR = 21;
-
-    /** */
-    public static final byte DATE_ARR = 22;
-
-    /** */
-    public static final byte OBJ_ARR = 23;
-
-    /** */
-    public static final byte COL = 24;
-
-    /** */
-    public static final byte MAP = 25;
-
-    /** */
-    public static final byte PORTABLE_OBJ = 27;
-
-    /** */
-    public static final byte ENUM = 28;
-
-    /** */
-    public static final byte ENUM_ARR = 29;
-
-    /** */
-    public static final byte CLASS = 32;
-
-    /** Timestamp. */
-    public static final byte TIMESTAMP = 33;
-
-    /** Timestamp array. */
-    public static final byte TIMESTAMP_ARR = 34;
-
-    /** */
-    public static final byte NULL = (byte)101;
-
-    /** */
-    public static final byte HANDLE = (byte)102;
-
-    /** */
-    public static final byte OBJ = (byte)103;
-
-    /** */
-    public static final byte USER_SET = -1;
-
-    /** */
-    public static final byte USER_COL = 0;
-
-    /** */
-    public static final byte ARR_LIST = 1;
-
-    /** */
-    public static final byte LINKED_LIST = 2;
-
-    /** */
-    public static final byte HASH_SET = 3;
-
-    /** */
-    public static final byte LINKED_HASH_SET = 4;
-
-    /** */
-    public static final byte HASH_MAP = 1;
-
-    /** */
-    public static final byte LINKED_HASH_MAP = 2;
-
-    /** */
-    public static final int OBJECT_TYPE_ID = -1;
-
-    /** */
-    public static final int UNREGISTERED_TYPE_ID = 0;
-
-    /** Protocol version. */
-    public static final byte PROTO_VER = 1;
-
-    /** Protocol version position. */
-    public static final int PROTO_VER_POS = 1;
-
-    /** Flags position in header. */
-    public static final int FLAGS_POS = 2;
-
-    /** */
-    public static final int TYPE_ID_POS = 4;
-
-    /** */
-    public static final int HASH_CODE_POS = 8;
-
-    /** */
-    public static final int TOTAL_LEN_POS = 12;
-
-    /** */
-    public static final int SCHEMA_ID_POS = 16;
-
-    /** Schema or raw offset position. */
-    public static final int SCHEMA_OR_RAW_OFF_POS = 20;
-
-    /** */
-    public static final byte DFLT_HDR_LEN = 24;
-
-    /** */
-    private final PortableContext ctx;
-
-    /**
-     * @param ctx Context.
-     */
-    public GridPortableMarshaller(PortableContext ctx) {
-        this.ctx = ctx;
-    }
-
-    /**
-     * @param obj Object to marshal.
-     * @return Byte array.
-     * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
-     */
-    public byte[] marshal(@Nullable Object obj) throws BinaryObjectException {
-        if (obj == null)
-            return new byte[] { NULL };
-
-        try (BinaryWriterExImpl writer = new BinaryWriterExImpl(ctx)) {
-            writer.marshal(obj);
-
-            return writer.array();
-        }
-    }
-
-    /**
-     * @param bytes Bytes array.
-     * @return Portable object.
-     * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
-     */
-    @SuppressWarnings("unchecked")
-    @Nullable public <T> T unmarshal(byte[] bytes, @Nullable ClassLoader clsLdr) throws BinaryObjectException {
-        assert bytes != null;
-
-        return (T)PortableUtils.unmarshal(PortableHeapInputStream.create(bytes, 0), ctx, clsLdr);
-    }
-
-    /**
-     * @param in Input stream.
-     * @return Portable object.
-     * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
-     */
-    @SuppressWarnings("unchecked")
-    @Nullable public <T> T unmarshal(PortableInputStream in) throws BinaryObjectException {
-        return (T)PortableUtils.unmarshal(in, ctx, null);
-    }
-
-    /**
-     * @param arr Byte array.
-     * @param ldr Class loader.
-     * @return Deserialized object.
-     * @throws org.apache.ignite.binary.BinaryObjectException In case of error.
-     */
-    @SuppressWarnings("unchecked")
-    @Nullable public <T> T deserialize(byte[] arr, @Nullable ClassLoader ldr) throws BinaryObjectException {
-        assert arr != null;
-        assert arr.length > 0;
-
-        if (arr[0] == NULL)
-            return null;
-
-        return (T)new BinaryReaderExImpl(ctx, PortableHeapInputStream.create(arr, 0), ldr).deserialize();
-    }
-
-    /**
-     * Gets writer for the given output stream.
-     *
-     * @param out Output stream.
-     * @return Writer.
-     */
-    public BinaryWriterExImpl writer(PortableOutputStream out) {
-        return new BinaryWriterExImpl(ctx, out, BinaryThreadLocalContext.get().schemaHolder(), null);
-    }
-
-    /**
-     * @return Context.
-     */
-    public PortableContext context() {
-        return ctx;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableClassDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableClassDescriptor.java
deleted file mode 100644
index 9b4d444..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/PortableClassDescriptor.java
+++ /dev/null
@@ -1,813 +0,0 @@
-/*
- * 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.binary;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.math.BigDecimal;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.UUID;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.binary.BinaryIdMapper;
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.BinarySerializer;
-import org.apache.ignite.binary.Binarylizable;
-import org.apache.ignite.internal.processors.cache.CacheObjectImpl;
-import org.apache.ignite.internal.util.GridUnsafe;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.marshaller.MarshallerExclusions;
-import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
-import org.jetbrains.annotations.Nullable;
-import sun.misc.Unsafe;
-
-import static java.lang.reflect.Modifier.isStatic;
-import static java.lang.reflect.Modifier.isTransient;
-
-/**
- * Portable class descriptor.
- */
-public class PortableClassDescriptor {
-    /** */
-    public static final Unsafe UNSAFE = GridUnsafe.unsafe();
-
-    /** */
-    private final PortableContext ctx;
-
-    /** */
-    private final Class<?> cls;
-
-    /** */
-    private final BinarySerializer serializer;
-
-    /** ID mapper. */
-    private final BinaryIdMapper idMapper;
-
-    /** */
-    private final BinaryWriteMode mode;
-
-    /** */
-    private final boolean userType;
-
-    /** */
-    private final int typeId;
-
-    /** */
-    private final String typeName;
-
-    /** Affinity key field name. */
-    private final String affKeyFieldName;
-
-    /** */
-    private final Constructor<?> ctor;
-
-    /** */
-    private final BinaryFieldAccessor[] fields;
-
-    /** */
-    private final Method writeReplaceMtd;
-
-    /** */
-    private final Method readResolveMtd;
-
-    /** */
-    private final Map<String, Integer> stableFieldsMeta;
-
-    /** Object schemas. Initialized only for serializable classes and contains only 1 entry. */
-    private final PortableSchema stableSchema;
-
-    /** Schema registry. */
-    private final PortableSchemaRegistry schemaReg;
-
-    /** */
-    private final boolean registered;
-
-    /** */
-    private final boolean useOptMarshaller;
-
-    /** */
-    private final boolean excluded;
-
-    /**
-     * @param ctx Context.
-     * @param cls Class.
-     * @param userType User type flag.
-     * @param typeId Type ID.
-     * @param typeName Type name.
-     * @param affKeyFieldName Affinity key field name.
-     * @param idMapper ID mapper.
-     * @param serializer Serializer.
-     * @param metaDataEnabled Metadata enabled flag.
-     * @param registered Whether typeId has been successfully registered by MarshallerContext or not.
-     * @param predefined Whether the class is predefined or not.
-     * @throws BinaryObjectException In case of error.
-     */
-    PortableClassDescriptor(
-        PortableContext ctx,
-        Class<?> cls,
-        boolean userType,
-        int typeId,
-        String typeName,
-        @Nullable String affKeyFieldName,
-        @Nullable BinaryIdMapper idMapper,
-        @Nullable BinarySerializer serializer,
-        boolean metaDataEnabled,
-        boolean registered,
-        boolean predefined
-    ) throws BinaryObjectException {
-        assert ctx != null;
-        assert cls != null;
-        assert idMapper != null;
-
-        this.ctx = ctx;
-        this.cls = cls;
-        this.typeId = typeId;
-        this.userType = userType;
-        this.typeName = typeName;
-        this.affKeyFieldName = affKeyFieldName;
-        this.serializer = serializer;
-        this.idMapper = idMapper;
-        this.registered = registered;
-
-        schemaReg = ctx.schemaRegistry(typeId);
-
-        excluded = MarshallerExclusions.isExcluded(cls);
-
-        useOptMarshaller = !predefined && initUseOptimizedMarshallerFlag();
-
-        if (excluded)
-            mode = BinaryWriteMode.EXCLUSION;
-        else {
-            if (cls == BinaryEnumObjectImpl.class)
-                mode = BinaryWriteMode.PORTABLE_ENUM;
-            else
-                mode = serializer != null ? BinaryWriteMode.PORTABLE : PortableUtils.mode(cls);
-        }
-
-        switch (mode) {
-            case P_BYTE:
-            case P_BOOLEAN:
-            case P_SHORT:
-            case P_CHAR:
-            case P_INT:
-            case P_LONG:
-            case P_FLOAT:
-            case P_DOUBLE:
-            case BYTE:
-            case SHORT:
-            case INT:
-            case LONG:
-            case FLOAT:
-            case DOUBLE:
-            case CHAR:
-            case BOOLEAN:
-            case DECIMAL:
-            case STRING:
-            case UUID:
-            case DATE:
-            case TIMESTAMP:
-            case BYTE_ARR:
-            case SHORT_ARR:
-            case INT_ARR:
-            case LONG_ARR:
-            case FLOAT_ARR:
-            case DOUBLE_ARR:
-            case CHAR_ARR:
-            case BOOLEAN_ARR:
-            case DECIMAL_ARR:
-            case STRING_ARR:
-            case UUID_ARR:
-            case DATE_ARR:
-            case TIMESTAMP_ARR:
-            case OBJECT_ARR:
-            case COL:
-            case MAP:
-            case PORTABLE_OBJ:
-            case ENUM:
-            case PORTABLE_ENUM:
-            case ENUM_ARR:
-            case CLASS:
-            case EXCLUSION:
-                ctor = null;
-                fields = null;
-                stableFieldsMeta = null;
-                stableSchema = null;
-
-                break;
-
-            case PORTABLE:
-            case EXTERNALIZABLE:
-                ctor = constructor(cls);
-                fields = null;
-                stableFieldsMeta = null;
-                stableSchema = null;
-
-                break;
-
-            case OBJECT:
-                // Must not use constructor to honor transient fields semantics.
-                ctor = null;
-                ArrayList<BinaryFieldAccessor> fields0 = new ArrayList<>();
-                stableFieldsMeta = metaDataEnabled ? new HashMap<String, Integer>() : null;
-
-                PortableSchema.Builder schemaBuilder = PortableSchema.Builder.newBuilder();
-
-                Collection<String> names = new HashSet<>();
-                Collection<Integer> ids = new HashSet<>();
-
-                for (Class<?> c = cls; c != null && !c.equals(Object.class); c = c.getSuperclass()) {
-                    for (Field f : c.getDeclaredFields()) {
-                        int mod = f.getModifiers();
-
-                        if (!isStatic(mod) && !isTransient(mod)) {
-                            f.setAccessible(true);
-
-                            String name = f.getName();
-
-                            if (!names.add(name))
-                                throw new BinaryObjectException("Duplicate field name [fieldName=" + name +
-                                    ", cls=" + cls.getName() + ']');
-
-                            int fieldId = idMapper.fieldId(typeId, name);
-
-                            if (!ids.add(fieldId))
-                                throw new BinaryObjectException("Duplicate field ID: " + name);
-
-                            BinaryFieldAccessor fieldInfo = BinaryFieldAccessor.create(f, fieldId);
-
-                            fields0.add(fieldInfo);
-
-                            schemaBuilder.addField(fieldId);
-
-                            if (metaDataEnabled)
-                                stableFieldsMeta.put(name, fieldInfo.mode().typeId());
-                        }
-                    }
-                }
-
-                fields = fields0.toArray(new BinaryFieldAccessor[fields0.size()]);
-
-                stableSchema = schemaBuilder.build();
-
-                break;
-
-            default:
-                // Should never happen.
-                throw new BinaryObjectException("Invalid mode: " + mode);
-        }
-
-        if (mode == BinaryWriteMode.PORTABLE || mode == BinaryWriteMode.EXTERNALIZABLE ||
-            mode == BinaryWriteMode.OBJECT) {
-            readResolveMtd = U.findNonPublicMethod(cls, "readResolve");
-            writeReplaceMtd = U.findNonPublicMethod(cls, "writeReplace");
-        }
-        else {
-            readResolveMtd = null;
-            writeReplaceMtd = null;
-        }
-    }
-
-    /**
-     * @return {@code True} if enum.
-     */
-    boolean isEnum() {
-        return mode == BinaryWriteMode.ENUM;
-    }
-
-    /**
-     * @return Described class.
-     */
-    Class<?> describedClass() {
-        return cls;
-    }
-
-    /**
-     * @return Type ID.
-     */
-    public int typeId() {
-        return typeId;
-    }
-
-    /**
-     * @return User type flag.
-     */
-    public boolean userType() {
-        return userType;
-    }
-
-    /**
-     * @return Fields meta data.
-     */
-    Map<String, Integer> fieldsMeta() {
-        return stableFieldsMeta;
-    }
-
-    /**
-     * @return Schema.
-     */
-    PortableSchema schema() {
-        return stableSchema;
-    }
-
-    /**
-     * @return Whether typeId has been successfully registered by MarshallerContext or not.
-     */
-    public boolean registered() {
-        return registered;
-    }
-
-    /**
-     * @return {@code true} if {@link OptimizedMarshaller} must be used instead of {@link BinaryMarshaller}
-     * for object serialization and deserialization.
-     */
-    public boolean useOptimizedMarshaller() {
-        return useOptMarshaller;
-    }
-
-    /**
-     * Checks whether the class values are explicitly excluded from marshalling.
-     *
-     * @return {@code true} if excluded, {@code false} otherwise.
-     */
-    public boolean excluded() {
-        return excluded;
-    }
-
-    /**
-     * @return portableWriteReplace() method
-     */
-    @Nullable Method getWriteReplaceMethod() {
-        return writeReplaceMtd;
-    }
-
-    /**
-     * @return portableReadResolve() method
-     */
-    @SuppressWarnings("UnusedDeclaration")
-    @Nullable Method getReadResolveMethod() {
-        return readResolveMtd;
-    }
-
-    /**
-     * @param obj Object.
-     * @param writer Writer.
-     * @throws BinaryObjectException In case of error.
-     */
-    void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException {
-        assert obj != null;
-        assert writer != null;
-
-        writer.typeId(typeId);
-
-        switch (mode) {
-            case P_BYTE:
-            case BYTE:
-                writer.writeByteFieldPrimitive((byte) obj);
-
-                break;
-
-            case P_SHORT:
-            case SHORT:
-                writer.writeShortFieldPrimitive((short)obj);
-
-                break;
-
-            case P_INT:
-            case INT:
-                writer.writeIntFieldPrimitive((int) obj);
-
-                break;
-
-            case P_LONG:
-            case LONG:
-                writer.writeLongFieldPrimitive((long) obj);
-
-                break;
-
-            case P_FLOAT:
-            case FLOAT:
-                writer.writeFloatFieldPrimitive((float) obj);
-
-                break;
-
-            case P_DOUBLE:
-            case DOUBLE:
-                writer.writeDoubleFieldPrimitive((double) obj);
-
-                break;
-
-            case P_CHAR:
-            case CHAR:
-                writer.writeCharFieldPrimitive((char) obj);
-
-                break;
-
-            case P_BOOLEAN:
-            case BOOLEAN:
-                writer.writeBooleanFieldPrimitive((boolean) obj);
-
-                break;
-
-            case DECIMAL:
-                writer.doWriteDecimal((BigDecimal)obj);
-
-                break;
-
-            case STRING:
-                writer.doWriteString((String)obj);
-
-                break;
-
-            case UUID:
-                writer.doWriteUuid((UUID)obj);
-
-                break;
-
-            case DATE:
-                writer.doWriteDate((Date)obj);
-
-                break;
-
-            case TIMESTAMP:
-                writer.doWriteTimestamp((Timestamp)obj);
-
-                break;
-
-            case BYTE_ARR:
-                writer.doWriteByteArray((byte[])obj);
-
-                break;
-
-            case SHORT_ARR:
-                writer.doWriteShortArray((short[]) obj);
-
-                break;
-
-            case INT_ARR:
-                writer.doWriteIntArray((int[]) obj);
-
-                break;
-
-            case LONG_ARR:
-                writer.doWriteLongArray((long[]) obj);
-
-                break;
-
-            case FLOAT_ARR:
-                writer.doWriteFloatArray((float[]) obj);
-
-                break;
-
-            case DOUBLE_ARR:
-                writer.doWriteDoubleArray((double[]) obj);
-
-                break;
-
-            case CHAR_ARR:
-                writer.doWriteCharArray((char[]) obj);
-
-                break;
-
-            case BOOLEAN_ARR:
-                writer.doWriteBooleanArray((boolean[]) obj);
-
-                break;
-
-            case DECIMAL_ARR:
-                writer.doWriteDecimalArray((BigDecimal[]) obj);
-
-                break;
-
-            case STRING_ARR:
-                writer.doWriteStringArray((String[]) obj);
-
-                break;
-
-            case UUID_ARR:
-                writer.doWriteUuidArray((UUID[]) obj);
-
-                break;
-
-            case DATE_ARR:
-                writer.doWriteDateArray((Date[]) obj);
-
-                break;
-
-            case TIMESTAMP_ARR:
-                writer.doWriteTimestampArray((Timestamp[]) obj);
-
-                break;
-
-            case OBJECT_ARR:
-                writer.doWriteObjectArray((Object[])obj);
-
-                break;
-
-            case COL:
-                writer.doWriteCollection((Collection<?>)obj);
-
-                break;
-
-            case MAP:
-                writer.doWriteMap((Map<?, ?>)obj);
-
-                break;
-
-            case ENUM:
-                writer.doWriteEnum((Enum<?>)obj);
-
-                break;
-
-            case PORTABLE_ENUM:
-                writer.doWritePortableEnum((BinaryEnumObjectImpl)obj);
-
-                break;
-
-            case ENUM_ARR:
-                writer.doWriteEnumArray((Object[])obj);
-
-                break;
-
-            case CLASS:
-                writer.doWriteClass((Class)obj);
-
-                break;
-
-            case PORTABLE_OBJ:
-                writer.doWritePortableObject((BinaryObjectImpl)obj);
-
-                break;
-
-            case PORTABLE:
-                if (preWrite(writer, obj)) {
-                    try {
-                        if (serializer != null)
-                            serializer.writeBinary(obj, writer);
-                        else
-                            ((Binarylizable)obj).writeBinary(writer);
-
-                        postWrite(writer, obj);
-
-                        // Check whether we need to update metadata.
-                        if (obj.getClass() != BinaryMetadata.class) {
-                            int schemaId = writer.schemaId();
-
-                            if (schemaReg.schema(schemaId) == null) {
-                                // This is new schema, let's update metadata.
-                                BinaryMetadataCollector collector =
-                                    new BinaryMetadataCollector(typeId, typeName, idMapper);
-
-                                if (serializer != null)
-                                    serializer.writeBinary(obj, collector);
-                                else
-                                    ((Binarylizable)obj).writeBinary(collector);
-
-                                PortableSchema newSchema = collector.schema();
-
-                                BinaryMetadata meta = new BinaryMetadata(typeId, typeName, collector.meta(),
-                                    affKeyFieldName, Collections.singleton(newSchema), false);
-
-                                ctx.updateMetadata(typeId, meta);
-
-                                schemaReg.addSchema(newSchema.schemaId(), newSchema);
-                            }
-                        }
-                    }
-                    finally {
-                        writer.popSchema();
-                    }
-                }
-
-                break;
-
-            case EXTERNALIZABLE:
-                if (preWrite(writer, obj)) {
-                    writer.rawWriter();
-
-                    try {
-                        ((Externalizable)obj).writeExternal(writer);
-
-                        postWrite(writer, obj);
-                    }
-                    catch (IOException e) {
-                        throw new BinaryObjectException("Failed to write Externalizable object: " + obj, e);
-                    }
-                    finally {
-                        writer.popSchema();
-                    }
-                }
-
-                break;
-
-            case OBJECT:
-                if (preWrite(writer, obj)) {
-                    try {
-                        for (BinaryFieldAccessor info : fields)
-                            info.write(obj, writer);
-
-                        writer.schemaId(stableSchema.schemaId());
-
-                        postWrite(writer, obj);
-                    }
-                    finally {
-                        writer.popSchema();
-                    }
-                }
-
-                break;
-
-            default:
-                assert false : "Invalid mode: " + mode;
-        }
-    }
-
-    /**
-     * @param reader Reader.
-     * @return Object.
-     * @throws BinaryObjectException If failed.
-     */
-    Object read(BinaryReaderExImpl reader) throws BinaryObjectException {
-        assert reader != null;
-
-        Object res;
-
-        switch (mode) {
-            case PORTABLE:
-                res = newInstance();
-
-                reader.setHandle(res);
-
-                if (serializer != null)
-                    serializer.readBinary(res, reader);
-                else
-                    ((Binarylizable)res).readBinary(reader);
-
-                break;
-
-            case EXTERNALIZABLE:
-                res = newInstance();
-
-                reader.setHandle(res);
-
-                try {
-                    ((Externalizable)res).readExternal(reader);
-                }
-                catch (IOException | ClassNotFoundException e) {
-                    throw new BinaryObjectException("Failed to read Externalizable object: " +
-                        res.getClass().getName(), e);
-                }
-
-                break;
-
-            case OBJECT:
-                res = newInstance();
-
-                reader.setHandle(res);
-
-                for (BinaryFieldAccessor info : fields)
-                    info.read(res, reader);
-
-                break;
-
-            default:
-                assert false : "Invalid mode: " + mode;
-
-                return null;
-        }
-
-        if (readResolveMtd != null) {
-            try {
-                res = readResolveMtd.invoke(res);
-
-                reader.setHandle(res);
-            }
-            catch (IllegalAccessException e) {
-                throw new RuntimeException(e);
-            }
-            catch (InvocationTargetException e) {
-                if (e.getTargetException() instanceof BinaryObjectException)
-                    throw (BinaryObjectException)e.getTargetException();
-
-                throw new BinaryObjectException("Failed to execute readResolve() method on " + res, e);
-            }
-        }
-
-        return res;
-    }
-
-    /**
-     * Pre-write phase.
-     *
-     * @param writer Writer.
-     * @param obj Object.
-     * @return Whether further write is needed.
-     */
-    private boolean preWrite(BinaryWriterExImpl writer, Object obj) {
-        if (writer.tryWriteAsHandle(obj))
-            return false;
-
-        writer.preWrite(registered ? null : cls.getName());
-
-        return true;
-    }
-
-    /**
-     * Post-write phase.
-     *
-     * @param writer Writer.
-     * @param obj Object.
-     */
-    private void postWrite(BinaryWriterExImpl writer, Object obj) {
-        writer.postWrite(userType, registered, obj instanceof CacheObjectImpl ? 0 : obj.hashCode());
-    }
-
-    /**
-     * @return Instance.
-     * @throws BinaryObjectException In case of error.
-     */
-    private Object newInstance() throws BinaryObjectException {
-        try {
-            return ctor != null ? ctor.newInstance() : UNSAFE.allocateInstance(cls);
-        }
-        catch (InstantiationException | InvocationTargetException | IllegalAccessException e) {
-            throw new BinaryObjectException("Failed to instantiate instance: " + cls, e);
-        }
-    }
-
-    /**
-     * @param cls Class.
-     * @return Constructor.
-     * @throws BinaryObjectException If constructor doesn't exist.
-     */
-    @SuppressWarnings("ConstantConditions")
-    @Nullable private static Constructor<?> constructor(Class<?> cls) throws BinaryObjectException {
-        assert cls != null;
-
-        try {
-            Constructor<?> ctor = U.forceEmptyConstructor(cls);
-
-            if (ctor == null)
-                throw new BinaryObjectException("Failed to find empty constructor for class: " + cls.getName());
-
-            ctor.setAccessible(true);
-
-            return ctor;
-        }
-        catch (IgniteCheckedException e) {
-            throw new BinaryObjectException("Failed to get constructor for class: " + cls.getName(), e);
-        }
-    }
-
-    /**
-     * Determines whether to use {@link OptimizedMarshaller} for serialization or
-     * not.
-     *
-     * @return {@code true} if to use, {@code false} otherwise.
-     */
-    @SuppressWarnings("unchecked")
-    private boolean initUseOptimizedMarshallerFlag() {
-        for (Class c = cls; c != null && !c.equals(Object.class); c = c.getSuperclass()) {
-            try {
-                Method writeObj = c.getDeclaredMethod("writeObject", ObjectOutputStream.class);
-                Method readObj = c.getDeclaredMethod("readObject", ObjectInputStream.class);
-
-                if (!Modifier.isStatic(writeObj.getModifiers()) && !Modifier.isStatic(readObj.getModifiers()) &&
-                    writeObj.getReturnType() == void.class && readObj.getReturnType() == void.class)
-                    return true;
-            }
-            catch (NoSuchMethodException ignored) {
-                // No-op.
-            }
-        }
-
-        return false;
-    }
-}


[21/50] [abbrv] ignite git commit: Ignite-2106

Posted by vo...@apache.org.
Ignite-2106


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

Branch: refs/heads/ignite-2100
Commit: 1f2af31e27c28c66b49a32090a648e3fb4c07a2d
Parents: 469bf6d
Author: Anton Vinogradov <av...@apache.org>
Authored: Fri Dec 11 17:03:01 2015 +0300
Committer: Anton Vinogradov <av...@apache.org>
Committed: Fri Dec 11 19:18:15 2015 +0300

----------------------------------------------------------------------
 .../distributed/near/GridNearCacheEntry.java     |  6 ++++++
 .../cache/GridCacheDeploymentSelfTest.java       | 19 ++++++++++++++-----
 2 files changed, 20 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1f2af31e/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
index 6520f3d..c0a1617 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheEntry.java
@@ -127,6 +127,12 @@ public class GridNearCacheEntry extends GridDistributedCacheEntry {
                 }
             }
 
+            if (cctx.affinity().backup(cctx.localNode(), part, topVer)) {
+                this.topVer = -1L;
+
+                return false;
+            }
+
             this.topVer = topVer.topologyVersion();
 
             return true;

http://git-wip-us.apache.org/repos/asf/ignite/blob/1f2af31e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
index 22e8c36..c18554e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
@@ -222,14 +222,22 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
     /** @throws Exception If failed. */
     @SuppressWarnings("unchecked")
     public void testDeployment4() throws Exception {
+        doDeployment4(false);
+    }
+
+    /** @throws Exception If failed. */
+    @SuppressWarnings("unchecked")
+    public void testDeployment4BackupLeavesGrid() throws Exception {
+        doDeployment4(true);
+    }
+
+    /** @throws Exception If failed. */
+    @SuppressWarnings("unchecked")
+    private void doDeployment4(boolean backupLeavesGrid) throws Exception {
         try {
             depMode = CONTINUOUS;
 
             Ignite g1 = startGrid(1);
-
-            if (g1.configuration().getMarshaller() instanceof BinaryMarshaller)
-                fail("https://issues.apache.org/jira/browse/IGNITE-2106");
-
             Ignite g2 = startGrid(2);
 
             Ignite g0 = startGrid(GRID_NAME);
@@ -248,7 +256,8 @@ public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
             for (int i = 0; i < 1000; i++) {
                 key = "1" + i;
 
-                if (g1.cluster().mapKeyToNode(null, key).id().equals(g2.cluster().localNode().id()))
+                if (g1.cluster().mapKeyToNode(null, key).id().equals(g2.cluster().localNode().id()) &&
+                    g1.affinity(null).isBackup((backupLeavesGrid ? g0 : g1).cluster().localNode(), key))
                     break;
             }
 


[22/50] [abbrv] ignite git commit: ignite-2065: portable -> binary renaming (methods, javadoc and etc.)

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java
index 271ff33..2b0ad63 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java
@@ -56,7 +56,7 @@ import org.apache.ignite.internal.processors.cache.binary.local.GridCacheBinaryO
 import org.apache.ignite.internal.processors.cache.binary.local.GridCacheBinaryObjectsLocalSelfTest;
 
 /**
- * Test for portable objects stored in cache.
+ * Test for binary objects stored in cache.
  */
 public class IgniteBinaryObjectsTestSuite extends TestSuite {
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/portables/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.jar
----------------------------------------------------------------------
diff --git a/modules/core/src/test/portables/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.jar b/modules/core/src/test/portables/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.jar
deleted file mode 100644
index 863350d..0000000
Binary files a/modules/core/src/test/portables/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.jar and /dev/null differ

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/portables/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.pom
----------------------------------------------------------------------
diff --git a/modules/core/src/test/portables/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.pom b/modules/core/src/test/portables/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.pom
deleted file mode 100644
index 533a3c9..0000000
--- a/modules/core/src/test/portables/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.pom
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.ignite.binary</groupId>
-  <artifactId>test1</artifactId>
-  <version>1.1</version>
-  <description>POM was created from install:install-file</description>
-</project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/portables/repo/org/apache/ignite/binary/test1/maven-metadata-local.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/portables/repo/org/apache/ignite/binary/test1/maven-metadata-local.xml b/modules/core/src/test/portables/repo/org/apache/ignite/binary/test1/maven-metadata-local.xml
deleted file mode 100644
index 4ca5d44..0000000
--- a/modules/core/src/test/portables/repo/org/apache/ignite/binary/test1/maven-metadata-local.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
-  <groupId>org.apache.ignite.binary</groupId>
-  <artifactId>test1</artifactId>
-  <versioning>
-    <release>1.1</release>
-    <versions>
-      <version>1.1</version>
-    </versions>
-    <lastUpdated>20140806090184</lastUpdated>
-  </versioning>
-</metadata>

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/portables/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.jar
----------------------------------------------------------------------
diff --git a/modules/core/src/test/portables/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.jar b/modules/core/src/test/portables/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.jar
deleted file mode 100644
index ccf4ea2..0000000
Binary files a/modules/core/src/test/portables/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.jar and /dev/null differ

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/portables/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.pom
----------------------------------------------------------------------
diff --git a/modules/core/src/test/portables/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.pom b/modules/core/src/test/portables/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.pom
deleted file mode 100644
index 2eaaeff..0000000
--- a/modules/core/src/test/portables/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.pom
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.ignite.binary</groupId>
-  <artifactId>test2</artifactId>
-  <version>1.1</version>
-  <description>POM was created from install:install-file</description>
-</project>

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/test/portables/repo/org/apache/ignite/binary/test2/maven-metadata-local.xml
----------------------------------------------------------------------
diff --git a/modules/core/src/test/portables/repo/org/apache/ignite/binary/test2/maven-metadata-local.xml b/modules/core/src/test/portables/repo/org/apache/ignite/binary/test2/maven-metadata-local.xml
deleted file mode 100644
index c45c88f..0000000
--- a/modules/core/src/test/portables/repo/org/apache/ignite/binary/test2/maven-metadata-local.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
-  <groupId>org.apache.ignite.binary</groupId>
-  <artifactId>test2</artifactId>
-  <versioning>
-    <release>1.1</release>
-    <versions>
-      <version>1.1</version>
-    </versions>
-    <lastUpdated>20140806090410</lastUpdated>
-  </versioning>
-</metadata>

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 1437a16..8625be9 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -519,13 +519,13 @@ public class IgniteH2Indexing implements GridQueryIndexing {
 
     /**
      * @param o Object.
-     * @return {@code true} If it is a portable object.
+     * @return {@code true} If it is a binary object.
      */
-    private boolean isPortable(CacheObject o) {
+    private boolean isBinary(CacheObject o) {
         if (ctx == null)
             return false;
 
-        return ctx.cacheObjects().isPortableObject(o);
+        return ctx.cacheObjects().isBinaryObject(o);
     }
 
     /**
@@ -534,7 +534,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
      * @return Object class.
      */
     private Class<?> getClass(CacheObjectContext coctx, CacheObject o) {
-        return isPortable(o) ?
+        return isBinary(o) ?
             Object.class :
             o.value(coctx, false).getClass();
     }
@@ -1045,7 +1045,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
 
         twoStepQry.pageSize(qry.getPageSize());
 
-        QueryCursorImpl<List<?>> cursor = new QueryCursorImpl<>(queryTwoStep(cctx, twoStepQry, cctx.keepPortable()));
+        QueryCursorImpl<List<?>> cursor = new QueryCursorImpl<>(queryTwoStep(cctx, twoStepQry, cctx.keepBinary()));
 
         cursor.fieldsMeta(meta);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index 1d4fa30..828d9bd 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -448,10 +448,10 @@ public class GridReduceQueryExecutor {
     /**
      * @param cctx Cache context.
      * @param qry Query.
-     * @param keepPortable Keep portable.
+     * @param keepBinary Keep binary.
      * @return Cursor.
      */
-    public Iterator<List<?>> query(GridCacheContext<?,?> cctx, GridCacheTwoStepQuery qry, boolean keepPortable) {
+    public Iterator<List<?>> query(GridCacheContext<?,?> cctx, GridCacheTwoStepQuery qry, boolean keepBinary) {
         for (int attempt = 0;; attempt++) {
             if (attempt != 0) {
                 try {
@@ -652,7 +652,7 @@ public class GridReduceQueryExecutor {
                     continue;
                 }
 
-                return new GridQueryCacheObjectsIterator(resIter, cctx, keepPortable);
+                return new GridQueryCacheObjectsIterator(resIter, cctx, keepBinary);
             }
             catch (IgniteCheckedException | RuntimeException e) {
                 U.closeQuiet(r.conn);
@@ -1240,4 +1240,4 @@ public class GridReduceQueryExecutor {
             return res;
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
index a92451f..64a1115 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingQueryErrorTest.java
@@ -54,10 +54,10 @@ public class IgniteCacheP2pUnmarshallingQueryErrorTest extends IgniteCacheP2pUnm
         try {
             jcache(0).query(new SqlQuery<TestKey, String>(String.class, "field like '" + key + "'")).getAll();
 
-            assertTrue("p2p marshalling failed, but error response was not sent", portableMarshaller());
+            assertTrue("p2p marshalling failed, but error response was not sent", binaryMarshaller());
         }
         catch (CacheException e) {
-            assertFalse("Unexpected exception: " + e, portableMarshaller());
+            assertFalse("Unexpected exception: " + e, binaryMarshaller());
         }
     }
 
@@ -78,20 +78,20 @@ public class IgniteCacheP2pUnmarshallingQueryErrorTest extends IgniteCacheP2pUnm
                 }
             })).getAll();
 
-            assertTrue("Request unmarshalling failed, but error response was not sent.", portableMarshaller());
+            assertTrue("Request unmarshalling failed, but error response was not sent.", binaryMarshaller());
         }
         catch (Exception e) {
-            assertFalse("Unexpected exception: " + e, portableMarshaller());
+            assertFalse("Unexpected exception: " + e, binaryMarshaller());
         }
     }
 
     /**
-     * @return {@code True} if portable marshaller is configured.
+     * @return {@code True} if binary marshaller is configured.
      */
-    private boolean portableMarshaller() {
+    private boolean binaryMarshaller() {
         IgniteEx kernal = (IgniteEx)ignite(0);
 
         return !OptimizedMarshaller.class.getSimpleName().equals(kernal.context().config().getMarshaller().getClass()
             .getSimpleName());
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
index daf9c45..786b5b8 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/testsuites/IgniteBinaryCacheQueryTestSuite.java
@@ -51,7 +51,7 @@ import org.apache.ignite.spi.communication.tcp.GridOrderedMessageCancelSelfTest;
 import org.apache.ignite.testframework.config.GridTestProperties;
 
 /**
- * Cache query suite with portable marshaller.
+ * Cache query suite with binary marshaller.
  */
 public class IgniteBinaryCacheQueryTestSuite extends TestSuite {
     /**
@@ -61,7 +61,7 @@ public class IgniteBinaryCacheQueryTestSuite extends TestSuite {
     public static TestSuite suite() throws Exception {
         GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName());
 
-        TestSuite suite = new TestSuite("Grid Cache Query Test Suite using PortableMarshaller");
+        TestSuite suite = new TestSuite("Grid Cache Query Test Suite using BinaryMarshaller");
 
         // Parsing
         suite.addTestSuite(GridQueryParsingTest.class);
@@ -92,8 +92,8 @@ public class IgniteBinaryCacheQueryTestSuite extends TestSuite {
 
         suite.addTestSuite(GridCacheQueryIndexingDisabledSelfTest.class);
 
-        //Should be adjusted. Not ready to be used with PortableMarshaller.
-        //suite.addTestSuite(GridCachePortableSwapScanQuerySelfTest.class);
+        //Should be adjusted. Not ready to be used with BinaryMarshaller.
+        //suite.addTestSuite(GridCacheBinarySwapScanQuerySelfTest.class);
 
         suite.addTestSuite(GridOrderedMessageCancelSelfTest.class);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 0f2d363..486fc0d 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -846,10 +846,10 @@
                                         <exclude>dev-tools/.gradle/**/*</exclude>
                                         <exclude>dev-tools/gradle/wrapper/**/*</exclude>
                                         <exclude>dev-tools/gradlew</exclude>
-                                        <exclude>src/test/portables/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.pom</exclude>
-                                        <exclude>src/test/portables/repo/org/apache/ignite/binary/test2/maven-metadata-local.xml</exclude>
-                                        <exclude>src/test/portables/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.pom</exclude>
-                                        <exclude>src/test/portables/repo/org/apache/ignite/binary/test1/maven-metadata-local.xml</exclude>
+                                        <exclude>src/test/binaries/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.pom</exclude>
+                                        <exclude>src/test/binaries/repo/org/apache/ignite/binary/test2/maven-metadata-local.xml</exclude>
+                                        <exclude>src/test/binaries/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.pom</exclude>
+                                        <exclude>src/test/binaries/repo/org/apache/ignite/binary/test1/maven-metadata-local.xml</exclude>
                                         <!--shmem-->
                                         <exclude>ipc/shmem/**/Makefile.in</exclude><!--auto generated files-->
                                         <exclude>ipc/shmem/**/Makefile</exclude><!--auto generated files-->
@@ -875,8 +875,8 @@
                                         <!--platforms-->
                                         <exclude>src/main/java/META-INF/services/org.apache.ignite.internal.processors.platform.PlatformBootstrapFactory</exclude>
                                         <exclude>src/main/resources/META-INF/services/org.apache.ignite.internal.processors.platform.PlatformBootstrapFactory</exclude>
-                                        <exclude>src/test/portables/repo/org/apache/ignite/portable/test1/1.1/test1-1.1.jar</exclude>
-                                        <exclude>src/test/portables/repo/org/apache/ignite/portable/test2/1.1/test2-1.1.jar</exclude>
+                                        <exclude>src/test/binaries/repo/org/apache/ignite/binary/test1/1.1/test1-1.1.jar</exclude>
+                                        <exclude>src/test/binaries/repo/org/apache/ignite/binary/test2/1.1/test2-1.1.jar</exclude>
                                         <exclude>**/META-INF/services/*.PlatformBootstrapFactory</exclude>
                                         <exclude>**/Makefile.am</exclude>
                                         <exclude>**/configure.ac</exclude>


[16/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary"

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java
index 36fde02..7f51631 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldImpl.java
@@ -32,7 +32,7 @@ public class BinaryFieldImpl implements BinaryField {
 
     /** Well-known object schemas. */
     @GridToStringExclude
-    private final PortableSchemaRegistry schemas;
+    private final BinarySchemaRegistry schemas;
 
     /** Field name. */
     private final String fieldName;
@@ -47,7 +47,7 @@ public class BinaryFieldImpl implements BinaryField {
      * @param fieldName Field name.
      * @param fieldId Field ID.
      */
-    public BinaryFieldImpl(int typeId, PortableSchemaRegistry schemas, String fieldName, int fieldId) {
+    public BinaryFieldImpl(int typeId, BinarySchemaRegistry schemas, String fieldName, int fieldId) {
         assert typeId != 0;
         assert schemas != null;
         assert fieldName != null;
@@ -68,7 +68,7 @@ public class BinaryFieldImpl implements BinaryField {
     @Override public boolean exists(BinaryObject obj) {
         BinaryObjectExImpl obj0 = (BinaryObjectExImpl)obj;
 
-        return fieldOrder(obj0) != PortableSchema.ORDER_NOT_FOUND;
+        return fieldOrder(obj0) != BinarySchema.ORDER_NOT_FOUND;
     }
 
     /** {@inheritDoc} */
@@ -78,7 +78,7 @@ public class BinaryFieldImpl implements BinaryField {
 
         int order = fieldOrder(obj0);
 
-        return order != PortableSchema.ORDER_NOT_FOUND ? (T)obj0.fieldByOrder(order) : null;
+        return order != BinarySchema.ORDER_NOT_FOUND ? (T)obj0.fieldByOrder(order) : null;
     }
 
     /**
@@ -96,7 +96,7 @@ public class BinaryFieldImpl implements BinaryField {
 
         int schemaId = obj.schemaId();
 
-        PortableSchema schema = schemas.schema(schemaId);
+        BinarySchema schema = schemas.schema(schemaId);
 
         if (schema == null) {
             schema = obj.createSchema();

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java
index 13435e6..03bf9f9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMarshaller.java
@@ -36,7 +36,7 @@ import sun.misc.Unsafe;
  */
 public class BinaryMarshaller extends AbstractMarshaller {
     /** */
-    private GridPortableMarshaller impl;
+    private GridBinaryMarshaller impl;
 
     /**
      * Checks whether {@code BinaryMarshaller} is able to work on the current JVM.
@@ -79,15 +79,15 @@ public class BinaryMarshaller extends AbstractMarshaller {
     }
 
     /**
-     * Sets {@link PortableContext}.
+     * Sets {@link BinaryContext}.
      * <p/>
      * @param ctx Portable context.
      */
     @SuppressWarnings("UnusedDeclaration")
-    private void setPortableContext(PortableContext ctx, IgniteConfiguration cfg) {
+    private void setPortableContext(BinaryContext ctx, IgniteConfiguration cfg) {
         ctx.configure(this, cfg);
 
-        impl = new GridPortableMarshaller(ctx);
+        impl = new GridBinaryMarshaller(ctx);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java
index cefad9e..a8ff140 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadata.java
@@ -50,7 +50,7 @@ public class BinaryMetadata implements Externalizable {
     private String affKeyFieldName;
 
     /** Schemas associated with type. */
-    private Collection<PortableSchema> schemas;
+    private Collection<BinarySchema> schemas;
 
     /** Whether this is enum type. */
     private boolean isEnum;
@@ -73,7 +73,7 @@ public class BinaryMetadata implements Externalizable {
      * @param isEnum Enum flag.
      */
     public BinaryMetadata(int typeId, String typeName, @Nullable Map<String, Integer> fields,
-        @Nullable String affKeyFieldName, @Nullable Collection<PortableSchema> schemas, boolean isEnum) {
+        @Nullable String affKeyFieldName, @Nullable Collection<BinarySchema> schemas, boolean isEnum) {
         assert typeName != null;
 
         this.typeId = typeId;
@@ -119,7 +119,7 @@ public class BinaryMetadata implements Externalizable {
     @Nullable public String fieldTypeName(String fieldName) {
         Integer typeId = fields != null ? fields.get(fieldName) : null;
 
-        return typeId != null ? PortableUtils.fieldTypeName(typeId) : null;
+        return typeId != null ? BinaryUtils.fieldTypeName(typeId) : null;
     }
 
     /**
@@ -132,8 +132,8 @@ public class BinaryMetadata implements Externalizable {
     /**
      * @return Schemas.
      */
-    public Collection<PortableSchema> schemas() {
-        return schemas != null ? schemas : Collections.<PortableSchema>emptyList();
+    public Collection<BinarySchema> schemas() {
+        return schemas != null ? schemas : Collections.<BinarySchema>emptyList();
     }
 
     /**
@@ -149,7 +149,7 @@ public class BinaryMetadata implements Externalizable {
      * @param ctx Portable context.
      * @return Binary type.
      */
-    public BinaryTypeImpl wrap(PortableContext ctx) {
+    public BinaryTypeImpl wrap(BinaryContext ctx) {
         return new BinaryTypeImpl(ctx, this);
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataCollector.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataCollector.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataCollector.java
index af99cce..54f2b13 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataCollector.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryMetadataCollector.java
@@ -51,7 +51,7 @@ class BinaryMetadataCollector implements BinaryWriter {
     private final Map<String, Integer> meta = new HashMap<>();
 
     /** Schema builder. */
-    private PortableSchema.Builder schemaBuilder = PortableSchema.Builder.newBuilder();
+    private BinarySchema.Builder schemaBuilder = BinarySchema.Builder.newBuilder();
 
     /**
      * Constructor.
@@ -76,7 +76,7 @@ class BinaryMetadataCollector implements BinaryWriter {
     /**
      * @return Schemas.
      */
-    PortableSchema schema() {
+    BinarySchema schema() {
         return schemaBuilder.build();
     }
 
@@ -267,8 +267,8 @@ class BinaryMetadataCollector implements BinaryWriter {
         if (oldFieldTypeId != null && !oldFieldTypeId.equals(fieldTypeId)) {
             throw new BinaryObjectException(
                 "Field is written twice with different types [" + "typeName=" + typeName + ", fieldName=" + name +
-                ", fieldTypeName1=" + PortableUtils.fieldTypeName(oldFieldTypeId) +
-                ", fieldTypeName2=" + PortableUtils.fieldTypeName(fieldTypeId) + ']'
+                ", fieldTypeName1=" + BinaryUtils.fieldTypeName(oldFieldTypeId) +
+                ", fieldTypeName2=" + BinaryUtils.fieldTypeName(fieldTypeId) + ']'
             );
         }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/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 d09bc28..252c495 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
@@ -98,7 +98,7 @@ public abstract class BinaryObjectExImpl implements BinaryObjectEx {
      *
      * @return Schema.
      */
-    protected abstract PortableSchema createSchema();
+    protected abstract BinarySchema createSchema();
 
     /** {@inheritDoc} */
     @Override public BinaryObject clone() throws CloneNotSupportedException {

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/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 18adbc1..9fd5901 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
@@ -33,7 +33,7 @@ import org.apache.ignite.binary.BinaryObjectException;
 import org.apache.ignite.binary.BinaryType;
 import org.apache.ignite.internal.GridDirectTransient;
 import org.apache.ignite.internal.IgniteCodeGeneratingFail;
-import org.apache.ignite.internal.binary.streams.PortableHeapInputStream;
+import org.apache.ignite.internal.binary.streams.BinaryHeapInputStream;
 import org.apache.ignite.internal.processors.cache.CacheObject;
 import org.apache.ignite.internal.processors.cache.CacheObjectContext;
 import org.apache.ignite.internal.processors.cache.KeyCacheObject;
@@ -55,7 +55,7 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
 
     /** */
     @GridDirectTransient
-    private PortableContext ctx;
+    private BinaryContext ctx;
 
     /** */
     private byte[] arr;
@@ -83,7 +83,7 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
      * @param arr Array.
      * @param start Start.
      */
-    public BinaryObjectImpl(PortableContext ctx, byte[] arr, int start) {
+    public BinaryObjectImpl(BinaryContext ctx, byte[] arr, int start) {
         assert ctx != null;
         assert arr != null;
 
@@ -152,7 +152,7 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
 
     /** {@inheritDoc} */
     @Override public int length() {
-        return PortablePrimitives.readInt(arr, start + GridPortableMarshaller.TOTAL_LEN_POS);
+        return BinaryPrimitives.readInt(arr, start + GridBinaryMarshaller.TOTAL_LEN_POS);
     }
 
     /**
@@ -188,14 +188,14 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
     /**
      * @return Context.
      */
-    public PortableContext context() {
+    public BinaryContext context() {
         return ctx;
     }
 
     /**
      * @param ctx Context.
      */
-    public void context(PortableContext ctx) {
+    public void context(BinaryContext ctx) {
         this.ctx = ctx;
     }
 
@@ -221,7 +221,7 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
 
     /** {@inheritDoc} */
     @Override public int typeId() {
-        return PortablePrimitives.readInt(arr, start + GridPortableMarshaller.TYPE_ID_POS);
+        return BinaryPrimitives.readInt(arr, start + GridBinaryMarshaller.TYPE_ID_POS);
     }
 
     /** {@inheritDoc} */
@@ -250,87 +250,87 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
         Object val;
 
         // Calculate field position.
-        int schemaOffset = PortablePrimitives.readInt(arr, start + GridPortableMarshaller.SCHEMA_OR_RAW_OFF_POS);
+        int schemaOffset = BinaryPrimitives.readInt(arr, start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS);
 
-        short flags = PortablePrimitives.readShort(arr, start + GridPortableMarshaller.FLAGS_POS);
+        short flags = BinaryPrimitives.readShort(arr, start + GridBinaryMarshaller.FLAGS_POS);
 
-        int fieldIdLen = PortableUtils.isCompactFooter(flags) ? 0 : PortableUtils.FIELD_ID_LEN;
-        int fieldOffsetLen = PortableUtils.fieldOffsetLength(flags);
+        int fieldIdLen = BinaryUtils.isCompactFooter(flags) ? 0 : BinaryUtils.FIELD_ID_LEN;
+        int fieldOffsetLen = BinaryUtils.fieldOffsetLength(flags);
 
         int fieldOffsetPos = start + schemaOffset + order * (fieldIdLen + fieldOffsetLen) + fieldIdLen;
 
         int fieldPos;
 
-        if (fieldOffsetLen == PortableUtils.OFFSET_1)
-            fieldPos = start + ((int)PortablePrimitives.readByte(arr, fieldOffsetPos) & 0xFF);
-        else if (fieldOffsetLen == PortableUtils.OFFSET_2)
-            fieldPos = start + ((int)PortablePrimitives.readShort(arr, fieldOffsetPos) & 0xFFFF);
+        if (fieldOffsetLen == BinaryUtils.OFFSET_1)
+            fieldPos = start + ((int)BinaryPrimitives.readByte(arr, fieldOffsetPos) & 0xFF);
+        else if (fieldOffsetLen == BinaryUtils.OFFSET_2)
+            fieldPos = start + ((int)BinaryPrimitives.readShort(arr, fieldOffsetPos) & 0xFFFF);
         else
-            fieldPos = start + PortablePrimitives.readInt(arr, fieldOffsetPos);
+            fieldPos = start + BinaryPrimitives.readInt(arr, fieldOffsetPos);
 
         // Read header and try performing fast lookup for well-known types (the most common types go first).
-        byte hdr = PortablePrimitives.readByte(arr, fieldPos);
+        byte hdr = BinaryPrimitives.readByte(arr, fieldPos);
 
         switch (hdr) {
-            case GridPortableMarshaller.INT:
-                val = PortablePrimitives.readInt(arr, fieldPos + 1);
+            case GridBinaryMarshaller.INT:
+                val = BinaryPrimitives.readInt(arr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.LONG:
-                val = PortablePrimitives.readLong(arr, fieldPos + 1);
+            case GridBinaryMarshaller.LONG:
+                val = BinaryPrimitives.readLong(arr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.BOOLEAN:
-                val = PortablePrimitives.readBoolean(arr, fieldPos + 1);
+            case GridBinaryMarshaller.BOOLEAN:
+                val = BinaryPrimitives.readBoolean(arr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.SHORT:
-                val = PortablePrimitives.readShort(arr, fieldPos + 1);
+            case GridBinaryMarshaller.SHORT:
+                val = BinaryPrimitives.readShort(arr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.BYTE:
-                val = PortablePrimitives.readByte(arr, fieldPos + 1);
+            case GridBinaryMarshaller.BYTE:
+                val = BinaryPrimitives.readByte(arr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.CHAR:
-                val = PortablePrimitives.readChar(arr, fieldPos + 1);
+            case GridBinaryMarshaller.CHAR:
+                val = BinaryPrimitives.readChar(arr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.FLOAT:
-                val = PortablePrimitives.readFloat(arr, fieldPos + 1);
+            case GridBinaryMarshaller.FLOAT:
+                val = BinaryPrimitives.readFloat(arr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.DOUBLE:
-                val = PortablePrimitives.readDouble(arr, fieldPos + 1);
+            case GridBinaryMarshaller.DOUBLE:
+                val = BinaryPrimitives.readDouble(arr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.STRING: {
-                int dataLen = PortablePrimitives.readInt(arr, fieldPos + 1);
+            case GridBinaryMarshaller.STRING: {
+                int dataLen = BinaryPrimitives.readInt(arr, fieldPos + 1);
 
                 val = new String(arr, fieldPos + 5, dataLen, UTF_8);
 
                 break;
             }
 
-            case GridPortableMarshaller.DATE: {
-                long time = PortablePrimitives.readLong(arr, fieldPos + 1);
+            case GridBinaryMarshaller.DATE: {
+                long time = BinaryPrimitives.readLong(arr, fieldPos + 1);
 
                 val = new Date(time);
 
                 break;
             }
 
-            case GridPortableMarshaller.TIMESTAMP: {
-                long time = PortablePrimitives.readLong(arr, fieldPos + 1);
-                int nanos = PortablePrimitives.readInt(arr, fieldPos + 1 + 8);
+            case GridBinaryMarshaller.TIMESTAMP: {
+                long time = BinaryPrimitives.readLong(arr, fieldPos + 1);
+                int nanos = BinaryPrimitives.readInt(arr, fieldPos + 1 + 8);
 
                 Timestamp ts = new Timestamp(time);
 
@@ -341,20 +341,20 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
                 break;
             }
 
-            case GridPortableMarshaller.UUID: {
-                long most = PortablePrimitives.readLong(arr, fieldPos + 1);
-                long least = PortablePrimitives.readLong(arr, fieldPos + 1 + 8);
+            case GridBinaryMarshaller.UUID: {
+                long most = BinaryPrimitives.readLong(arr, fieldPos + 1);
+                long least = BinaryPrimitives.readLong(arr, fieldPos + 1 + 8);
 
                 val = new UUID(most, least);
 
                 break;
             }
 
-            case GridPortableMarshaller.DECIMAL: {
-                int scale = PortablePrimitives.readInt(arr, fieldPos + 1);
+            case GridBinaryMarshaller.DECIMAL: {
+                int scale = BinaryPrimitives.readInt(arr, fieldPos + 1);
 
-                int dataLen = PortablePrimitives.readInt(arr, fieldPos + 5);
-                byte[] data = PortablePrimitives.readByteArray(arr, fieldPos + 9, dataLen);
+                int dataLen = BinaryPrimitives.readInt(arr, fieldPos + 5);
+                byte[] data = BinaryPrimitives.readByteArray(arr, fieldPos + 9, dataLen);
 
                 BigInteger intVal = new BigInteger(data);
 
@@ -369,13 +369,13 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
                 break;
             }
 
-            case GridPortableMarshaller.NULL:
+            case GridBinaryMarshaller.NULL:
                 val = null;
 
                 break;
 
             default:
-                val = PortableUtils.unmarshal(PortableHeapInputStream.create(arr, fieldPos), ctx, null);
+                val = BinaryUtils.unmarshal(BinaryHeapInputStream.create(arr, fieldPos), ctx, null);
 
                 break;
         }
@@ -412,16 +412,16 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        return PortablePrimitives.readInt(arr, start + GridPortableMarshaller.HASH_CODE_POS);
+        return BinaryPrimitives.readInt(arr, start + GridBinaryMarshaller.HASH_CODE_POS);
     }
 
     /** {@inheritDoc} */
     @Override protected int schemaId() {
-        return PortablePrimitives.readInt(arr, start + GridPortableMarshaller.SCHEMA_ID_POS);
+        return BinaryPrimitives.readInt(arr, start + GridBinaryMarshaller.SCHEMA_ID_POS);
     }
 
     /** {@inheritDoc} */
-    @Override protected PortableSchema createSchema() {
+    @Override protected BinarySchema createSchema() {
         return reader(null).getOrCreateSchema();
     }
 
@@ -445,7 +445,7 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        ctx = (PortableContext)in.readObject();
+        ctx = (BinaryContext)in.readObject();
 
         arr = new byte[in.readInt()];
 
@@ -536,7 +536,7 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
 
         Object obj0 = reader.deserialize();
 
-        PortableClassDescriptor desc = reader.descriptor();
+        BinaryClassDescriptor desc = reader.descriptor();
 
         assert desc != null;
 
@@ -562,7 +562,7 @@ public final class BinaryObjectImpl extends BinaryObjectExImpl implements Extern
      */
     private BinaryReaderExImpl reader(@Nullable BinaryReaderHandles rCtx) {
         return new BinaryReaderExImpl(ctx,
-            PortableHeapInputStream.create(arr, start),
+            BinaryHeapInputStream.create(arr, start),
             ctx.configuration().getClassLoader(),
             rCtx);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/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 2944099..1206db7 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
@@ -21,8 +21,7 @@ import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.binary.BinaryObject;
 import org.apache.ignite.binary.BinaryObjectException;
 import org.apache.ignite.binary.BinaryType;
-import org.apache.ignite.internal.binary.streams.PortableOffheapInputStream;
-import org.apache.ignite.internal.binary.streams.PortableOffheapInputStream;
+import org.apache.ignite.internal.binary.streams.BinaryOffheapInputStream;
 import org.apache.ignite.internal.processors.cache.CacheObject;
 import org.apache.ignite.internal.processors.cache.CacheObjectContext;
 import org.apache.ignite.internal.util.GridUnsafe;
@@ -44,20 +43,6 @@ import java.util.Date;
 import java.util.UUID;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BOOLEAN;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BYTE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.CHAR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DATE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DECIMAL;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DOUBLE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.FLOAT;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.INT;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.LONG;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.NULL;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.SHORT;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.STRING;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.TIMESTAMP;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.UUID;
 
 /**
  *  Portable object implementation over offheap memory
@@ -70,7 +55,7 @@ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Exter
     private static final Unsafe UNSAFE = GridUnsafe.unsafe();
 
     /** */
-    private final PortableContext ctx;
+    private final BinaryContext ctx;
 
     /** */
     private final long ptr;
@@ -94,7 +79,7 @@ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Exter
      * @param start Object start.
      * @param size Memory size.
      */
-    public BinaryObjectOffheapImpl(PortableContext ctx, long ptr, int start, int size) {
+    public BinaryObjectOffheapImpl(BinaryContext ctx, long ptr, int start, int size) {
         this.ctx = ctx;
         this.ptr = ptr;
         this.start = start;
@@ -110,26 +95,26 @@ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Exter
 
     /** {@inheritDoc} */
     @Override public int typeId() {
-        return UNSAFE.getInt(ptr + start + GridPortableMarshaller.TYPE_ID_POS);
+        return UNSAFE.getInt(ptr + start + GridBinaryMarshaller.TYPE_ID_POS);
     }
 
     /** {@inheritDoc} */
     @Override public int length() {
-        return UNSAFE.getInt(ptr + start + GridPortableMarshaller.TOTAL_LEN_POS);
+        return UNSAFE.getInt(ptr + start + GridBinaryMarshaller.TOTAL_LEN_POS);
     }
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        return UNSAFE.getInt(ptr + start + GridPortableMarshaller.HASH_CODE_POS);
+        return UNSAFE.getInt(ptr + start + GridBinaryMarshaller.HASH_CODE_POS);
     }
 
     /** {@inheritDoc} */
     @Override protected int schemaId() {
-        return UNSAFE.getInt(ptr + start + GridPortableMarshaller.SCHEMA_ID_POS);
+        return UNSAFE.getInt(ptr + start + GridBinaryMarshaller.SCHEMA_ID_POS);
     }
 
     /** {@inheritDoc} */
-    @Override protected PortableSchema createSchema() {
+    @Override protected BinarySchema createSchema() {
         return reader(null).getOrCreateSchema();
     }
 
@@ -179,88 +164,88 @@ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Exter
         Object val;
 
         // Calculate field position.
-        int schemaOffset = PortablePrimitives.readInt(ptr, start + GridPortableMarshaller.SCHEMA_OR_RAW_OFF_POS);
+        int schemaOffset = BinaryPrimitives.readInt(ptr, start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS);
 
-        short flags = PortablePrimitives.readShort(ptr, start + GridPortableMarshaller.FLAGS_POS);
+        short flags = BinaryPrimitives.readShort(ptr, start + GridBinaryMarshaller.FLAGS_POS);
 
-        int fieldIdLen = PortableUtils.isCompactFooter(flags) ? 0 : PortableUtils.FIELD_ID_LEN;
-        int fieldOffsetLen = PortableUtils.fieldOffsetLength(flags);
+        int fieldIdLen = BinaryUtils.isCompactFooter(flags) ? 0 : BinaryUtils.FIELD_ID_LEN;
+        int fieldOffsetLen = BinaryUtils.fieldOffsetLength(flags);
 
         int fieldOffsetPos = start + schemaOffset + order * (fieldIdLen + fieldOffsetLen) + fieldIdLen;
 
         int fieldPos;
 
-        if (fieldOffsetLen == PortableUtils.OFFSET_1)
-            fieldPos = start + ((int)PortablePrimitives.readByte(ptr, fieldOffsetPos) & 0xFF);
-        else if (fieldOffsetLen == PortableUtils.OFFSET_2)
-            fieldPos = start + ((int)PortablePrimitives.readShort(ptr, fieldOffsetPos) & 0xFFFF);
+        if (fieldOffsetLen == BinaryUtils.OFFSET_1)
+            fieldPos = start + ((int)BinaryPrimitives.readByte(ptr, fieldOffsetPos) & 0xFF);
+        else if (fieldOffsetLen == BinaryUtils.OFFSET_2)
+            fieldPos = start + ((int)BinaryPrimitives.readShort(ptr, fieldOffsetPos) & 0xFFFF);
         else
-            fieldPos = start + PortablePrimitives.readInt(ptr, fieldOffsetPos);
+            fieldPos = start + BinaryPrimitives.readInt(ptr, fieldOffsetPos);
 
         // Read header and try performing fast lookup for well-known types (the most common types go first).
-        byte hdr = PortablePrimitives.readByte(ptr, fieldPos);
+        byte hdr = BinaryPrimitives.readByte(ptr, fieldPos);
 
         switch (hdr) {
-            case GridPortableMarshaller.INT:
-                val = PortablePrimitives.readInt(ptr, fieldPos + 1);
+            case GridBinaryMarshaller.INT:
+                val = BinaryPrimitives.readInt(ptr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.LONG:
-                val = PortablePrimitives.readLong(ptr, fieldPos + 1);
+            case GridBinaryMarshaller.LONG:
+                val = BinaryPrimitives.readLong(ptr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.BOOLEAN:
-                val = PortablePrimitives.readBoolean(ptr, fieldPos + 1);
+            case GridBinaryMarshaller.BOOLEAN:
+                val = BinaryPrimitives.readBoolean(ptr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.SHORT:
-                val = PortablePrimitives.readShort(ptr, fieldPos + 1);
+            case GridBinaryMarshaller.SHORT:
+                val = BinaryPrimitives.readShort(ptr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.BYTE:
-                val = PortablePrimitives.readByte(ptr, fieldPos + 1);
+            case GridBinaryMarshaller.BYTE:
+                val = BinaryPrimitives.readByte(ptr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.CHAR:
-                val = PortablePrimitives.readChar(ptr, fieldPos + 1);
+            case GridBinaryMarshaller.CHAR:
+                val = BinaryPrimitives.readChar(ptr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.FLOAT:
-                val = PortablePrimitives.readFloat(ptr, fieldPos + 1);
+            case GridBinaryMarshaller.FLOAT:
+                val = BinaryPrimitives.readFloat(ptr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.DOUBLE:
-                val = PortablePrimitives.readDouble(ptr, fieldPos + 1);
+            case GridBinaryMarshaller.DOUBLE:
+                val = BinaryPrimitives.readDouble(ptr, fieldPos + 1);
 
                 break;
 
-            case GridPortableMarshaller.STRING: {
-                int dataLen = PortablePrimitives.readInt(ptr, fieldPos + 1);
-                byte[] data = PortablePrimitives.readByteArray(ptr, fieldPos + 5, dataLen);
+            case GridBinaryMarshaller.STRING: {
+                int dataLen = BinaryPrimitives.readInt(ptr, fieldPos + 1);
+                byte[] data = BinaryPrimitives.readByteArray(ptr, fieldPos + 5, dataLen);
 
                 val = new String(data, UTF_8);
 
                 break;
             }
 
-            case GridPortableMarshaller.DATE: {
-                long time = PortablePrimitives.readLong(ptr, fieldPos + 1);
+            case GridBinaryMarshaller.DATE: {
+                long time = BinaryPrimitives.readLong(ptr, fieldPos + 1);
 
                 val = new Date(time);
 
                 break;
             }
 
-            case GridPortableMarshaller.TIMESTAMP: {
-                long time = PortablePrimitives.readLong(ptr, fieldPos + 1);
-                int nanos = PortablePrimitives.readInt(ptr, fieldPos + 1 + 8);
+            case GridBinaryMarshaller.TIMESTAMP: {
+                long time = BinaryPrimitives.readLong(ptr, fieldPos + 1);
+                int nanos = BinaryPrimitives.readInt(ptr, fieldPos + 1 + 8);
 
                 Timestamp ts = new Timestamp(time);
 
@@ -271,20 +256,20 @@ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Exter
                 break;
             }
 
-            case GridPortableMarshaller.UUID: {
-                long most = PortablePrimitives.readLong(ptr, fieldPos + 1);
-                long least = PortablePrimitives.readLong(ptr, fieldPos + 1 + 8);
+            case GridBinaryMarshaller.UUID: {
+                long most = BinaryPrimitives.readLong(ptr, fieldPos + 1);
+                long least = BinaryPrimitives.readLong(ptr, fieldPos + 1 + 8);
 
                 val = new UUID(most, least);
 
                 break;
             }
 
-            case GridPortableMarshaller.DECIMAL: {
-                int scale = PortablePrimitives.readInt(ptr, fieldPos + 1);
+            case GridBinaryMarshaller.DECIMAL: {
+                int scale = BinaryPrimitives.readInt(ptr, fieldPos + 1);
 
-                int dataLen = PortablePrimitives.readInt(ptr, fieldPos + 5);
-                byte[] data = PortablePrimitives.readByteArray(ptr, fieldPos + 9, dataLen);
+                int dataLen = BinaryPrimitives.readInt(ptr, fieldPos + 5);
+                byte[] data = BinaryPrimitives.readByteArray(ptr, fieldPos + 9, dataLen);
 
                 BigInteger intVal = new BigInteger(data);
 
@@ -299,17 +284,17 @@ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Exter
                 break;
             }
 
-            case GridPortableMarshaller.NULL:
+            case GridBinaryMarshaller.NULL:
                 val = null;
 
                 break;
 
             default:
-                PortableOffheapInputStream stream = new PortableOffheapInputStream(ptr, size, false);
+                BinaryOffheapInputStream stream = new BinaryOffheapInputStream(ptr, size, false);
 
                 stream.position(fieldPos);
 
-                val = PortableUtils.unmarshal(stream, ctx, null);
+                val = BinaryUtils.unmarshal(stream, ctx, null);
 
                 break;
         }
@@ -420,7 +405,7 @@ public class BinaryObjectOffheapImpl extends BinaryObjectExImpl implements Exter
      * @return Reader.
      */
     private BinaryReaderExImpl reader(@Nullable BinaryReaderHandles rCtx) {
-        PortableOffheapInputStream stream = new PortableOffheapInputStream(ptr, size, false);
+        BinaryOffheapInputStream stream = new BinaryOffheapInputStream(ptr, size, false);
 
         stream.position(start);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryPositionReadable.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryPositionReadable.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryPositionReadable.java
new file mode 100644
index 0000000..c85bb19
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryPositionReadable.java
@@ -0,0 +1,47 @@
+/*
+ * 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.binary;
+
+/**
+ * Interface allowing for positioned read.
+ */
+public interface BinaryPositionReadable {
+    /**
+     * Read byte at the given position.
+     *
+     * @param pos Position.
+     * @return Value.
+     */
+    public byte readBytePositioned(int pos);
+
+    /**
+     * Read short at the given position.
+     *
+     * @param pos Position.
+     * @return Value.
+     */
+    public short readShortPositioned(int pos);
+
+    /**
+     * 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/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryPrimitives.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryPrimitives.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryPrimitives.java
new file mode 100644
index 0000000..a6a867c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryPrimitives.java
@@ -0,0 +1,382 @@
+/*
+ * 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.binary;
+
+import org.apache.ignite.internal.util.GridUnsafe;
+import sun.misc.Unsafe;
+
+import java.nio.ByteOrder;
+
+/**
+ * Primitives writer.
+ */
+public abstract class BinaryPrimitives {
+    /** */
+    private static final Unsafe UNSAFE = GridUnsafe.unsafe();
+
+    /** */
+    private static final long BYTE_ARR_OFF = UNSAFE.arrayBaseOffset(byte[].class);
+
+    /** */
+    private static final long CHAR_ARR_OFF = UNSAFE.arrayBaseOffset(char[].class);
+
+    /** Whether little endian is set. */
+    private static final boolean BIG_ENDIAN = ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN;
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @param val Value.
+     */
+    public static void writeByte(byte[] arr, int off, byte val) {
+        UNSAFE.putByte(arr, BYTE_ARR_OFF + off, val);
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static byte readByte(byte[] arr, int off) {
+        return UNSAFE.getByte(arr, BYTE_ARR_OFF + off);
+    }
+
+    /**
+     * @param ptr Pointer.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static byte readByte(long ptr, int off) {
+        return UNSAFE.getByte(ptr + off);
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static byte[] readByteArray(byte[] arr, int off, int len) {
+        byte[] arr0 = new byte[len];
+
+        UNSAFE.copyMemory(arr, BYTE_ARR_OFF + off, arr0, BYTE_ARR_OFF, len);
+
+        return arr0;
+    }
+
+    /**
+     * @param ptr Pointer.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static byte[] readByteArray(long ptr, int off, int len) {
+        byte[] arr0 = new byte[len];
+
+        UNSAFE.copyMemory(null, ptr + off, arr0, BYTE_ARR_OFF, len);
+
+        return arr0;
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @param val Value.
+     */
+    public static void writeBoolean(byte[] arr, int off, boolean val) {
+        writeByte(arr, off, val ? (byte)1 : (byte)0);
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static boolean readBoolean(byte[] arr, int off) {
+        return readByte(arr, off) == 1;
+    }
+
+    /**
+     * @param ptr Pointer.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static boolean readBoolean(long ptr, int off) {
+        return readByte(ptr, off) == 1;
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @param val Value.
+     */
+    public static void writeShort(byte[] arr, int off, short val) {
+        if (BIG_ENDIAN)
+            val = Short.reverseBytes(val);
+
+        UNSAFE.putShort(arr, BYTE_ARR_OFF + off, val);
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static short readShort(byte[] arr, int off) {
+        short val = UNSAFE.getShort(arr, BYTE_ARR_OFF + off);
+
+        if (BIG_ENDIAN)
+            val = Short.reverseBytes(val);
+
+        return val;
+    }
+
+    /**
+     * @param ptr Pointer.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static short readShort(long ptr, int off) {
+        short val = UNSAFE.getShort(ptr + off);
+
+        if (BIG_ENDIAN)
+            val = Short.reverseBytes(val);
+
+        return val;
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @param val Value.
+     */
+    public static void writeChar(byte[] arr, int off, char val) {
+        if (BIG_ENDIAN)
+            val = Character.reverseBytes(val);
+
+        UNSAFE.putChar(arr, BYTE_ARR_OFF + off, val);
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static char readChar(byte[] arr, int off) {
+        char val = UNSAFE.getChar(arr, BYTE_ARR_OFF + off);
+
+        if (BIG_ENDIAN)
+            val = Character.reverseBytes(val);
+
+        return val;
+    }
+
+    /**
+     * @param ptr Pointer.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static char readChar(long ptr, int off) {
+        char val = UNSAFE.getChar(ptr + off);
+
+        if (BIG_ENDIAN)
+            val = Character.reverseBytes(val);
+
+        return val;
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static char[] readCharArray(byte[] arr, int off, int len) {
+        char[] arr0 = new char[len];
+
+        UNSAFE.copyMemory(arr, BYTE_ARR_OFF + off, arr0, CHAR_ARR_OFF, len << 1);
+
+        if (BIG_ENDIAN) {
+            for (int i = 0; i < len; i++)
+                arr0[i] = Character.reverseBytes(arr0[i]);
+        }
+
+        return arr0;
+    }
+
+    /**
+     * @param ptr Pointer.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static char[] readCharArray(long ptr, int off, int len) {
+        char[] arr0 = new char[len];
+
+        UNSAFE.copyMemory(null, ptr + off, arr0, CHAR_ARR_OFF, len << 1);
+
+        if (BIG_ENDIAN) {
+            for (int i = 0; i < len; i++)
+                arr0[i] = Character.reverseBytes(arr0[i]);
+        }
+
+        return arr0;
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @param val Value.
+     */
+    public static void writeInt(byte[] arr, int off, int val) {
+        if (BIG_ENDIAN)
+            val = Integer.reverseBytes(val);
+
+        UNSAFE.putInt(arr, BYTE_ARR_OFF + off, val);
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static int readInt(byte[] arr, int off) {
+        int val = UNSAFE.getInt(arr, BYTE_ARR_OFF + off);
+
+        if (BIG_ENDIAN)
+            val = Integer.reverseBytes(val);
+
+        return val;
+    }
+
+    /**
+     * @param ptr Pointer.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static int readInt(long ptr, int off) {
+        int val = UNSAFE.getInt(ptr + off);
+
+        if (BIG_ENDIAN)
+            val = Integer.reverseBytes(val);
+
+        return val;
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @param val Value.
+     */
+    public static void writeLong(byte[] arr, int off, long val) {
+        if (BIG_ENDIAN)
+            val = Long.reverseBytes(val);
+
+        UNSAFE.putLong(arr, BYTE_ARR_OFF + off, val);
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static long readLong(byte[] arr, int off) {
+        long val = UNSAFE.getLong(arr, BYTE_ARR_OFF + off);
+
+        if (BIG_ENDIAN)
+            val = Long.reverseBytes(val);
+
+        return val;
+    }
+
+    /**
+     * @param ptr Pointer.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static long readLong(long ptr, int off) {
+        long val = UNSAFE.getLong(ptr + off);
+
+        if (BIG_ENDIAN)
+            val = Long.reverseBytes(val);
+
+        return val;
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @param val Value.
+     */
+    public static void writeFloat(byte[] arr, int off, float val) {
+        int val0 = Float.floatToIntBits(val);
+
+        writeInt(arr, off, val0);
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static float readFloat(byte[] arr, int off) {
+        int val = readInt(arr, off);
+
+        return Float.intBitsToFloat(val);
+    }
+
+    /**
+     * @param ptr Pointer.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static float readFloat(long ptr, int off) {
+        int val = readInt(ptr, off);
+
+        return Float.intBitsToFloat(val);
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @param val Value.
+     */
+    public static void writeDouble(byte[] arr, int off, double val) {
+        long val0 = Double.doubleToLongBits(val);
+
+        writeLong(arr, off, val0);
+    }
+
+    /**
+     * @param arr Array.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static double readDouble(byte[] arr, int off) {
+        long val = readLong(arr, off);
+
+        return Double.longBitsToDouble(val);
+    }
+
+    /**
+     * @param ptr Pointer.
+     * @param off Offset.
+     * @return Value.
+     */
+    public static double readDouble(long ptr, int off) {
+        long val = readLong(ptr, off);
+
+        return Double.longBitsToDouble(val);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryRawWriterEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryRawWriterEx.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryRawWriterEx.java
index 6e7e0cb..0ba0d90 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryRawWriterEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryRawWriterEx.java
@@ -17,7 +17,7 @@
 
 package org.apache.ignite.internal.binary;
 
-import org.apache.ignite.internal.binary.streams.PortableOutputStream;
+import org.apache.ignite.internal.binary.streams.BinaryOutputStream;
 import org.apache.ignite.binary.BinaryObjectException;
 import org.apache.ignite.binary.BinaryRawWriter;
 import org.jetbrains.annotations.Nullable;
@@ -35,7 +35,7 @@ public interface BinaryRawWriterEx extends BinaryRawWriter, AutoCloseable {
     /**
      * @return Output stream.
      */
-    public PortableOutputStream out();
+    public BinaryOutputStream out();
 
     /**
      * Cleans resources.

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
index bf47d53..b673e27 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryReaderExImpl.java
@@ -35,50 +35,50 @@ import org.apache.ignite.binary.BinaryObject;
 import org.apache.ignite.binary.BinaryObjectException;
 import org.apache.ignite.binary.BinaryRawReader;
 import org.apache.ignite.binary.BinaryReader;
-import org.apache.ignite.internal.binary.streams.PortableInputStream;
+import org.apache.ignite.internal.binary.streams.BinaryInputStream;
 import org.apache.ignite.internal.util.typedef.internal.SB;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BOOLEAN;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BOOLEAN_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BYTE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.BYTE_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.CHAR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.CHAR_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.CLASS;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.COL;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DATE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DATE_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DECIMAL;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DECIMAL_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DFLT_HDR_LEN;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DOUBLE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DOUBLE_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.ENUM;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.ENUM_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.FLOAT;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.FLOAT_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.HANDLE;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.INT;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.INT_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.LONG;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.LONG_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.MAP;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.NULL;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.OBJ;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.OBJ_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.OPTM_MARSH;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.PORTABLE_OBJ;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.SHORT;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.SHORT_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.STRING;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.STRING_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.TIMESTAMP;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.TIMESTAMP_ARR;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.UNREGISTERED_TYPE_ID;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.UUID;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.UUID_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.BOOLEAN;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.BOOLEAN_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.BYTE;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.BYTE_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.CHAR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.CHAR_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.CLASS;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.COL;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.DATE;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.DATE_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.DECIMAL;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.DECIMAL_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.DFLT_HDR_LEN;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.DOUBLE;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.DOUBLE_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.ENUM;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.ENUM_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.FLOAT;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.FLOAT_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.HANDLE;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.INT;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.INT_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.LONG;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.LONG_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.MAP;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.NULL;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OBJ_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.OPTM_MARSH;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.PORTABLE_OBJ;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.SHORT_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.STRING;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.STRING_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.TIMESTAMP;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.TIMESTAMP_ARR;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.UNREGISTERED_TYPE_ID;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.UUID;
+import static org.apache.ignite.internal.binary.GridBinaryMarshaller.UUID_ARR;
 
 /**
  * Portable reader implementation.
@@ -86,10 +86,10 @@ import static org.apache.ignite.internal.binary.GridPortableMarshaller.UUID_ARR;
 @SuppressWarnings("unchecked")
 public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, BinaryReaderHandlesHolder, ObjectInput {
     /** Portable context. */
-    private final PortableContext ctx;
+    private final BinaryContext ctx;
 
     /** Input stream. */
-    private final PortableInputStream in;
+    private final BinaryInputStream in;
 
     /** Class loaded. */
     private final ClassLoader ldr;
@@ -131,7 +131,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     private final int fieldOffsetLen;
 
     /** Object schema. */
-    private final PortableSchema schema;
+    private final BinarySchema schema;
 
     /** Whether passed IDs matches schema order. Reset to false as soon as a single mismatch detected. */
     private boolean matching = true;
@@ -149,7 +149,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
      * @param in Input stream.
      * @param ldr Class loader.
      */
-    public BinaryReaderExImpl(PortableContext ctx, PortableInputStream in, ClassLoader ldr) {
+    public BinaryReaderExImpl(BinaryContext ctx, BinaryInputStream in, ClassLoader ldr) {
         this(ctx, in, ldr, null);
     }
 
@@ -161,7 +161,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
      * @param ldr Class loader.
      * @param hnds Context.
      */
-    public BinaryReaderExImpl(PortableContext ctx, PortableInputStream in, ClassLoader ldr,
+    public BinaryReaderExImpl(BinaryContext ctx, BinaryInputStream in, ClassLoader ldr,
         @Nullable BinaryReaderHandles hnds) {
         this(ctx, in, ldr, hnds, false);
     }
@@ -175,7 +175,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
      * @param hnds Context.
      * @param skipHdrCheck Whether to skip header check.
      */
-    public BinaryReaderExImpl(PortableContext ctx, PortableInputStream in, ClassLoader ldr,
+    public BinaryReaderExImpl(BinaryContext ctx, BinaryInputStream in, ClassLoader ldr,
         @Nullable BinaryReaderHandles hnds, boolean skipHdrCheck) {
         // Initialize base members.
         this.ctx = ctx;
@@ -186,9 +186,9 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
         start = in.position();
 
         // Perform full header parsing in case of portable object.
-        if (!skipHdrCheck && (in.readByte() == GridPortableMarshaller.OBJ)) {
+        if (!skipHdrCheck && (in.readByte() == GridBinaryMarshaller.OBJ)) {
             // Ensure protocol is fine.
-            PortableUtils.checkProtocolVersion(in.readByte());
+            BinaryUtils.checkProtocolVersion(in.readByte());
 
             // Read header content.
             short flags = in.readShort();
@@ -201,16 +201,16 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
             int offset = in.readInt();
 
             // Get trivial flag values.
-            userType = PortableUtils.isUserType(flags);
-            fieldIdLen = PortableUtils.fieldIdLength(flags);
-            fieldOffsetLen = PortableUtils.fieldOffsetLength(flags);
+            userType = BinaryUtils.isUserType(flags);
+            fieldIdLen = BinaryUtils.fieldIdLength(flags);
+            fieldOffsetLen = BinaryUtils.fieldOffsetLength(flags);
 
             // Calculate footer borders and raw offset.
-            if (PortableUtils.hasSchema(flags)) {
+            if (BinaryUtils.hasSchema(flags)) {
                 // Schema exists.
                 footerStart = start + offset;
 
-                if (PortableUtils.hasRaw(flags)) {
+                if (BinaryUtils.hasRaw(flags)) {
                     footerLen = len - offset - 4;
                     rawOff = start + in.readIntPositioned(start + len - 4);
                 }
@@ -224,7 +224,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
                 footerStart = start + len;
                 footerLen = 0;
 
-                if (PortableUtils.hasRaw(flags))
+                if (BinaryUtils.hasRaw(flags))
                     rawOff = start + offset;
                 else
                     rawOff = start + len;
@@ -235,7 +235,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
                 int off = in.position();
 
                 // Registers class by type ID, at least locally if the cache is not ready yet.
-                typeId = ctx.descriptorForClass(PortableUtils.doReadClass(in, ctx, ldr, typeId0), false).typeId();
+                typeId = ctx.descriptorForClass(BinaryUtils.doReadClass(in, ctx, ldr, typeId0), false).typeId();
 
                 int clsNameLen = in.position() - off;
 
@@ -248,7 +248,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
             }
 
             idMapper = userType ? ctx.userTypeIdMapper(typeId) : BinaryInternalIdMapper.defaultInstance();
-            schema = PortableUtils.hasSchema(flags) ? getOrCreateSchema() : null;
+            schema = BinaryUtils.hasSchema(flags) ? getOrCreateSchema() : null;
         }
         else {
             dataStart = 0;
@@ -270,14 +270,14 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     /**
      * @return Input stream.
      */
-    public PortableInputStream in() {
+    public BinaryInputStream in() {
         return in;
     }
 
     /**
      * @return Descriptor.
      */
-    PortableClassDescriptor descriptor() {
+    BinaryClassDescriptor descriptor() {
         return ctx.descriptorForTypeId(userType, typeId, ldr, true);
     }
 
@@ -289,7 +289,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     public Object unmarshal(int offset) throws BinaryObjectException {
         streamPosition(offset);
 
-        return in.position() >= 0 ? PortableUtils.unmarshal(in, ctx, ldr, this) : null;
+        return in.position() >= 0 ? BinaryUtils.unmarshal(in, ctx, ldr, this) : null;
     }
 
     /**
@@ -298,7 +298,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
      * @throws BinaryObjectException In case of error.
      */
     @Nullable Object unmarshalField(String fieldName) throws BinaryObjectException {
-        return findFieldByName(fieldName) ? PortableUtils.unmarshal(in, ctx, ldr, this) : null;
+        return findFieldByName(fieldName) ? BinaryUtils.unmarshal(in, ctx, ldr, this) : null;
     }
 
     /**
@@ -307,7 +307,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
      * @throws BinaryObjectException In case of error.
      */
     @Nullable Object unmarshalField(int fieldId) throws BinaryObjectException {
-        return findFieldById(fieldId) ? PortableUtils.unmarshal(in, ctx, ldr, this) : null;
+        return findFieldById(fieldId) ? BinaryUtils.unmarshal(in, ctx, ldr, this) : null;
     }
 
     /**
@@ -320,7 +320,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
             if (checkFlag(PORTABLE_OBJ) == Flag.NULL)
                 return null;
 
-            return new BinaryObjectImpl(ctx, PortableUtils.doReadByteArray(in), in.readInt());
+            return new BinaryObjectImpl(ctx, BinaryUtils.doReadByteArray(in), in.readInt());
         }
         else
             return null;
@@ -336,7 +336,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
             if (checkFlag(CLASS) == Flag.NULL)
                 return null;
 
-            return PortableUtils.doReadClass(in, ctx, ldr);
+            return BinaryUtils.doReadClass(in, ctx, ldr);
         }
 
         return null;
@@ -374,7 +374,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
      * @return Field.
      */
     private <T> T readHandleField() {
-        int handlePos = PortableUtils.positionForHandle(in) - in.readInt();
+        int handlePos = BinaryUtils.positionForHandle(in) - in.readInt();
 
         Object obj = getHandle(handlePos);
 
@@ -383,7 +383,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
 
             streamPosition(handlePos);
 
-            obj = PortableUtils.doReadObject(in, ctx, ldr, this);
+            obj = BinaryUtils.doReadObject(in, ctx, ldr, this);
 
             streamPosition(retPos);
         }
@@ -436,7 +436,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Nullable @Override public byte[] readByteArray() throws BinaryObjectException {
         switch (checkFlag(BYTE_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadByteArray(in);
+                return BinaryUtils.doReadByteArray(in);
 
             case HANDLE:
                 return readHandleField();
@@ -492,7 +492,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Nullable @Override public boolean[] readBooleanArray() throws BinaryObjectException {
         switch (checkFlag(BOOLEAN_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadBooleanArray(in);
+                return BinaryUtils.doReadBooleanArray(in);
 
             case HANDLE:
                 return readHandleField();
@@ -548,7 +548,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Nullable @Override public short[] readShortArray() throws BinaryObjectException {
         switch (checkFlag(SHORT_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadShortArray(in);
+                return BinaryUtils.doReadShortArray(in);
 
             case HANDLE:
                 return readHandleField();
@@ -604,7 +604,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Nullable @Override public char[] readCharArray() throws BinaryObjectException {
         switch (checkFlag(CHAR_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadCharArray(in);
+                return BinaryUtils.doReadCharArray(in);
 
             case HANDLE:
                 return readHandleField();
@@ -660,7 +660,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Nullable @Override public int[] readIntArray() throws BinaryObjectException {
         switch (checkFlag(INT_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadIntArray(in);
+                return BinaryUtils.doReadIntArray(in);
 
             case HANDLE:
                 return readHandleField();
@@ -716,7 +716,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Nullable @Override public long[] readLongArray() throws BinaryObjectException {
         switch (checkFlag(LONG_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadLongArray(in);
+                return BinaryUtils.doReadLongArray(in);
 
             case HANDLE:
                 return readHandleField();
@@ -772,7 +772,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Nullable @Override public float[] readFloatArray() throws BinaryObjectException {
         switch (checkFlag(FLOAT_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadFloatArray(in);
+                return BinaryUtils.doReadFloatArray(in);
 
             case HANDLE:
                 return readHandleField();
@@ -828,7 +828,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Nullable @Override public double[] readDoubleArray() throws BinaryObjectException {
         switch (checkFlag(DOUBLE_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadDoubleArray(in);
+                return BinaryUtils.doReadDoubleArray(in);
 
             case HANDLE:
                 return readHandleField();
@@ -854,7 +854,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
 
     /** {@inheritDoc} */
     @Override @Nullable public BigDecimal readDecimal() throws BinaryObjectException {
-        return checkFlagNoHandles(DECIMAL) == Flag.NORMAL ? PortableUtils.doReadDecimal(in) : null;
+        return checkFlagNoHandles(DECIMAL) == Flag.NORMAL ? BinaryUtils.doReadDecimal(in) : null;
     }
 
     /** {@inheritDoc} */
@@ -875,7 +875,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Override @Nullable public BigDecimal[] readDecimalArray() throws BinaryObjectException {
         switch (checkFlag(DECIMAL_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadDecimalArray(in);
+                return BinaryUtils.doReadDecimalArray(in);
 
             case HANDLE:
                 return readHandleField();
@@ -901,7 +901,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
 
     /** {@inheritDoc} */
     @Override @Nullable public String readString() throws BinaryObjectException {
-        return checkFlagNoHandles(STRING) == Flag.NORMAL ? PortableUtils.doReadString(in) : null;
+        return checkFlagNoHandles(STRING) == Flag.NORMAL ? BinaryUtils.doReadString(in) : null;
     }
 
     /** {@inheritDoc} */
@@ -922,7 +922,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Override @Nullable public String[] readStringArray() throws BinaryObjectException {
         switch (checkFlag(STRING_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadStringArray(in);
+                return BinaryUtils.doReadStringArray(in);
 
             case HANDLE:
                 return readHandleField();
@@ -948,7 +948,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
 
     /** {@inheritDoc} */
     @Override @Nullable public UUID readUuid() throws BinaryObjectException {
-        return checkFlagNoHandles(UUID) == Flag.NORMAL ? PortableUtils.doReadUuid(in) : null;
+        return checkFlagNoHandles(UUID) == Flag.NORMAL ? BinaryUtils.doReadUuid(in) : null;
     }
 
     /** {@inheritDoc} */
@@ -969,7 +969,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Override @Nullable public UUID[] readUuidArray() throws BinaryObjectException {
         switch (checkFlag(UUID_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadUuidArray(in);
+                return BinaryUtils.doReadUuidArray(in);
 
             case HANDLE:
                 return readHandleField();
@@ -995,7 +995,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
 
     /** {@inheritDoc} */
     @Override @Nullable public Date readDate() throws BinaryObjectException {
-        return checkFlagNoHandles(DATE) == Flag.NORMAL ? PortableUtils.doReadDate(in) : null;
+        return checkFlagNoHandles(DATE) == Flag.NORMAL ? BinaryUtils.doReadDate(in) : null;
     }
 
     /** {@inheritDoc} */
@@ -1016,7 +1016,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Override @Nullable public Date[] readDateArray() throws BinaryObjectException {
         switch (checkFlag(DATE_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadDateArray(in);
+                return BinaryUtils.doReadDateArray(in);
 
             case HANDLE:
                 return readHandleField();
@@ -1042,7 +1042,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
 
     /** {@inheritDoc} */
     @Override @Nullable public Timestamp readTimestamp() throws BinaryObjectException {
-        return checkFlagNoHandles(TIMESTAMP) == Flag.NORMAL ? PortableUtils.doReadTimestamp(in) : null;
+        return checkFlagNoHandles(TIMESTAMP) == Flag.NORMAL ? BinaryUtils.doReadTimestamp(in) : null;
     }
 
     /** {@inheritDoc} */
@@ -1063,7 +1063,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Override @Nullable public Timestamp[] readTimestampArray() throws BinaryObjectException {
         switch (checkFlag(TIMESTAMP_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadTimestampArray(in);
+                return BinaryUtils.doReadTimestampArray(in);
 
             case HANDLE:
                 return readHandleField();
@@ -1076,7 +1076,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Nullable @Override public <T> T readObject(String fieldName) throws BinaryObjectException {
-        return findFieldByName(fieldName) ? (T)PortableUtils.doReadObject(in, ctx, ldr, this) : null;
+        return findFieldByName(fieldName) ? (T)BinaryUtils.doReadObject(in, ctx, ldr, this) : null;
     }
 
     /**
@@ -1085,17 +1085,17 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
      * @throws BinaryObjectException In case of error.
      */
     @Nullable Object readObject(int fieldId) throws BinaryObjectException {
-        return findFieldById(fieldId) ? PortableUtils.doReadObject(in, ctx, ldr, this) : null;
+        return findFieldById(fieldId) ? BinaryUtils.doReadObject(in, ctx, ldr, this) : null;
     }
 
     /** {@inheritDoc} */
     @Override public Object readObject() throws BinaryObjectException {
-        return PortableUtils.doReadObject(in, ctx, ldr, this);
+        return BinaryUtils.doReadObject(in, ctx, ldr, this);
     }
 
     /** {@inheritDoc} */
     @Nullable @Override public Object readObjectDetached() throws BinaryObjectException {
-        return PortableUtils.unmarshal(in, ctx, ldr, this, true);
+        return BinaryUtils.unmarshal(in, ctx, ldr, this, true);
     }
 
     /** {@inheritDoc} */
@@ -1116,7 +1116,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     @Nullable @Override public Object[] readObjectArray() throws BinaryObjectException {
         switch (checkFlag(OBJ_ARR)) {
             case NORMAL:
-                return PortableUtils.doReadObjectArray(in, ctx, ldr, this, true);
+                return BinaryUtils.doReadObjectArray(in, ctx, ldr, this, true);
 
             case HANDLE:
                 return readHandleField();
@@ -1156,12 +1156,12 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     private Enum<?> readEnum0(@Nullable Class<?> cls) throws BinaryObjectException {
         if (checkFlagNoHandles(ENUM) == Flag.NORMAL) {
             // Read class even if we know it in advance to set correct stream position.
-            Class<?> cls0 = PortableUtils.doReadClass(in, ctx, ldr);
+            Class<?> cls0 = BinaryUtils.doReadClass(in, ctx, ldr);
 
             if (cls == null)
                 cls = cls0;
 
-            return PortableUtils.doReadEnum(in, cls);
+            return BinaryUtils.doReadEnum(in, cls);
         }
         else
             return null;
@@ -1199,12 +1199,12 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
         switch (checkFlag(ENUM_ARR)) {
             case NORMAL:
                 // Read class even if we know it in advance to set correct stream position.
-                Class<?> cls0 = PortableUtils.doReadClass(in, ctx, ldr);
+                Class<?> cls0 = BinaryUtils.doReadClass(in, ctx, ldr);
 
                 if (cls == null)
                     cls = cls0;
 
-                return PortableUtils.doReadEnumArray(in, ctx, ldr, cls);
+                return BinaryUtils.doReadEnumArray(in, ctx, ldr, cls);
 
             case HANDLE:
                 return readHandleField();
@@ -1258,10 +1258,10 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
         throws BinaryObjectException {
         switch (checkFlag(COL)) {
             case NORMAL:
-                return (Collection)PortableUtils.doReadCollection(in, ctx, ldr, this, true, factory);
+                return (Collection)BinaryUtils.doReadCollection(in, ctx, ldr, this, true, factory);
 
             case HANDLE: {
-                int handlePos = PortableUtils.positionForHandle(in) - in.readInt();
+                int handlePos = BinaryUtils.positionForHandle(in) - in.readInt();
 
                 Object obj = getHandle(handlePos);
 
@@ -1325,10 +1325,10 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
     private Map readMap0(@Nullable BinaryMapFactory factory) throws BinaryObjectException {
         switch (checkFlag(MAP)) {
             case NORMAL:
-                return (Map)PortableUtils.doReadMap(in, ctx, ldr, this, true, factory);
+                return (Map)BinaryUtils.doReadMap(in, ctx, ldr, this, true, factory);
 
             case HANDLE: {
-                int handlePos = PortableUtils.positionForHandle(in) - in.readInt();
+                int handlePos = BinaryUtils.positionForHandle(in) - in.readInt();
 
                 Object obj = getHandle(handlePos);
 
@@ -1367,7 +1367,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
         else if (flag == HANDLE)
             return Flag.HANDLE;
 
-        int pos = PortableUtils.positionForHandle(in);
+        int pos = BinaryUtils.positionForHandle(in);
 
         throw new BinaryObjectException("Unexpected flag value [pos=" + pos + ", expected=" + expFlag +
             ", actual=" + flag + ']');
@@ -1388,7 +1388,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
         else if (flag == NULL)
             return Flag.NULL;
 
-        int pos = PortableUtils.positionForHandle(in);
+        int pos = BinaryUtils.positionForHandle(in);
 
         throw new BinaryObjectException("Unexpected flag value [pos=" + pos + ", expected=" + expFlag +
             ", actual=" + flag + ']');
@@ -1432,7 +1432,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
 
                     streamPosition(handlePos);
 
-                    obj = PortableUtils.doReadObject(in, ctx, ldr, this);
+                    obj = BinaryUtils.doReadObject(in, ctx, ldr, this);
 
                     streamPosition(retPos);
                 }
@@ -1440,7 +1440,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
                 break;
 
             case OBJ:
-                PortableClassDescriptor desc = ctx.descriptorForTypeId(userType, typeId, ldr, true);
+                BinaryClassDescriptor desc = ctx.descriptorForTypeId(userType, typeId, ldr, true);
 
                 streamPosition(dataStart);
 
@@ -1494,137 +1494,137 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
                 break;
 
             case DECIMAL:
-                obj = PortableUtils.doReadDecimal(in);
+                obj = BinaryUtils.doReadDecimal(in);
 
                 break;
 
             case STRING:
-                obj = PortableUtils.doReadString(in);
+                obj = BinaryUtils.doReadString(in);
 
                 break;
 
             case UUID:
-                obj = PortableUtils.doReadUuid(in);
+                obj = BinaryUtils.doReadUuid(in);
 
                 break;
 
             case DATE:
-                obj = PortableUtils.doReadDate(in);
+                obj = BinaryUtils.doReadDate(in);
 
                 break;
 
             case TIMESTAMP:
-                obj = PortableUtils.doReadTimestamp(in);
+                obj = BinaryUtils.doReadTimestamp(in);
 
                 break;
 
             case BYTE_ARR:
-                obj = PortableUtils.doReadByteArray(in);
+                obj = BinaryUtils.doReadByteArray(in);
 
                 break;
 
             case SHORT_ARR:
-                obj = PortableUtils.doReadShortArray(in);
+                obj = BinaryUtils.doReadShortArray(in);
 
                 break;
 
             case INT_ARR:
-                obj = PortableUtils.doReadIntArray(in);
+                obj = BinaryUtils.doReadIntArray(in);
 
                 break;
 
             case LONG_ARR:
-                obj = PortableUtils.doReadLongArray(in);
+                obj = BinaryUtils.doReadLongArray(in);
 
                 break;
 
             case FLOAT_ARR:
-                obj = PortableUtils.doReadFloatArray(in);
+                obj = BinaryUtils.doReadFloatArray(in);
 
                 break;
 
             case DOUBLE_ARR:
-                obj = PortableUtils.doReadDoubleArray(in);
+                obj = BinaryUtils.doReadDoubleArray(in);
 
                 break;
 
             case CHAR_ARR:
-                obj = PortableUtils.doReadCharArray(in);
+                obj = BinaryUtils.doReadCharArray(in);
 
                 break;
 
             case BOOLEAN_ARR:
-                obj = PortableUtils.doReadBooleanArray(in);
+                obj = BinaryUtils.doReadBooleanArray(in);
 
                 break;
 
             case DECIMAL_ARR:
-                obj = PortableUtils.doReadDecimalArray(in);
+                obj = BinaryUtils.doReadDecimalArray(in);
 
                 break;
 
             case STRING_ARR:
-                obj = PortableUtils.doReadStringArray(in);
+                obj = BinaryUtils.doReadStringArray(in);
 
                 break;
 
             case UUID_ARR:
-                obj = PortableUtils.doReadUuidArray(in);
+                obj = BinaryUtils.doReadUuidArray(in);
 
                 break;
 
             case DATE_ARR:
-                obj = PortableUtils.doReadDateArray(in);
+                obj = BinaryUtils.doReadDateArray(in);
 
                 break;
 
             case TIMESTAMP_ARR:
-                obj = PortableUtils.doReadTimestampArray(in);
+                obj = BinaryUtils.doReadTimestampArray(in);
 
                 break;
 
             case OBJ_ARR:
-                obj = PortableUtils.doReadObjectArray(in, ctx, ldr, this, true);
+                obj = BinaryUtils.doReadObjectArray(in, ctx, ldr, this, true);
 
                 break;
 
             case COL:
-                obj = PortableUtils.doReadCollection(in, ctx, ldr, this, true, null);
+                obj = BinaryUtils.doReadCollection(in, ctx, ldr, this, true, null);
 
                 break;
 
             case MAP:
-                obj = PortableUtils.doReadMap(in, ctx, ldr, this, true, null);
+                obj = BinaryUtils.doReadMap(in, ctx, ldr, this, true, null);
 
                 break;
 
             case PORTABLE_OBJ:
-                obj = PortableUtils.doReadPortableObject(in, ctx);
+                obj = BinaryUtils.doReadPortableObject(in, ctx);
 
                 ((BinaryObjectImpl)obj).context(ctx);
 
-                if (!GridPortableMarshaller.KEEP_PORTABLES.get())
+                if (!GridBinaryMarshaller.KEEP_PORTABLES.get())
                     obj = ((BinaryObject)obj).deserialize();
 
                 break;
 
             case ENUM:
-                obj = PortableUtils.doReadEnum(in, PortableUtils.doReadClass(in, ctx, ldr));
+                obj = BinaryUtils.doReadEnum(in, BinaryUtils.doReadClass(in, ctx, ldr));
 
                 break;
 
             case ENUM_ARR:
-                obj = PortableUtils.doReadEnumArray(in, ctx, ldr, PortableUtils.doReadClass(in, ctx, ldr));
+                obj = BinaryUtils.doReadEnumArray(in, ctx, ldr, BinaryUtils.doReadClass(in, ctx, ldr));
 
                 break;
 
             case CLASS:
-                obj = PortableUtils.doReadClass(in, ctx, ldr);
+                obj = BinaryUtils.doReadClass(in, ctx, ldr);
 
                 break;
 
             case OPTM_MARSH:
-                obj = PortableUtils.doReadOptimized(in, ctx, ldr);
+                obj = BinaryUtils.doReadOptimized(in, ctx, ldr);
 
                 break;
 
@@ -1661,18 +1661,18 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
      *
      * @return Schema.
      */
-    public PortableSchema getOrCreateSchema() {
-        PortableSchema schema = ctx.schemaRegistry(typeId).schema(schemaId);
+    public BinarySchema getOrCreateSchema() {
+        BinarySchema schema = ctx.schemaRegistry(typeId).schema(schemaId);
 
         if (schema == null) {
-            if (fieldIdLen != PortableUtils.FIELD_ID_LEN) {
+            if (fieldIdLen != BinaryUtils.FIELD_ID_LEN) {
                 BinaryTypeImpl type = (BinaryTypeImpl)ctx.metadata(typeId);
 
                 if (type == null || type.metadata() == null)
                     throw new BinaryObjectException("Cannot find metadata for object with compact footer: " +
                         typeId);
 
-                for (PortableSchema typeSchema : type.metadata().schemas()) {
+                for (BinarySchema typeSchema : type.metadata().schemas()) {
                     if (schemaId == typeSchema.schemaId()) {
                         schema = typeSchema;
 
@@ -1700,10 +1700,10 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
      *
      * @return Schema.
      */
-    private PortableSchema createSchema() {
-        assert fieldIdLen == PortableUtils.FIELD_ID_LEN;
+    private BinarySchema createSchema() {
+        assert fieldIdLen == BinaryUtils.FIELD_ID_LEN;
 
-        PortableSchema.Builder builder = PortableSchema.Builder.newBuilder();
+        BinarySchema.Builder builder = BinarySchema.Builder.newBuilder();
 
         int searchPos = footerStart;
         int searchEnd = searchPos + footerLen;
@@ -1713,7 +1713,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
 
             builder.addField(fieldId);
 
-            searchPos += PortableUtils.FIELD_ID_LEN + fieldOffsetLen;
+            searchPos += BinaryUtils.FIELD_ID_LEN + fieldOffsetLen;
         }
 
         return builder.build();
@@ -1740,7 +1740,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
             if (matching) {
                 int expOrder = matchingOrder++;
 
-                PortableSchema.Confirmation confirm = schema.confirmOrder(expOrder, name);
+                BinarySchema.Confirmation confirm = schema.confirmOrder(expOrder, name);
 
                 switch (confirm) {
                     case CONFIRMED:
@@ -1761,7 +1761,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
 
                     default:
                         // Field name is not know for this order. Need to calculate ID and repeat speculation.
-                        assert confirm == PortableSchema.Confirmation.CLARIFY;
+                        assert confirm == BinarySchema.Confirmation.CLARIFY;
 
                         int id = fieldId(name);
                         int realId = schema.fieldId(expOrder);
@@ -1846,10 +1846,10 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
      * @return {@code True} if field was found and stream was positioned accordingly.
      */
     private boolean trySetUserFieldPosition(int order) {
-        if (order != PortableSchema.ORDER_NOT_FOUND) {
+        if (order != BinarySchema.ORDER_NOT_FOUND) {
             int offsetPos = footerStart + order * (fieldIdLen + fieldOffsetLen) + fieldIdLen;
 
-            int pos = start + PortableUtils.fieldOffsetRelative(in, offsetPos, fieldOffsetLen);
+            int pos = start + BinaryUtils.fieldOffsetRelative(in, offsetPos, fieldOffsetLen);
 
             streamPosition(pos);
 
@@ -1867,7 +1867,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
      */
     private boolean trySetSystemFieldPosition(int id) {
         // System types are never written with compact footers because they do not have metadata.
-        assert fieldIdLen == PortableUtils.FIELD_ID_LEN;
+        assert fieldIdLen == BinaryUtils.FIELD_ID_LEN;
 
         int searchPos = footerStart;
         int searchTail = searchPos + footerLen;
@@ -1879,7 +1879,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
             int id0 = in.readIntPositioned(searchPos);
 
             if (id0 == id) {
-                int pos = start + PortableUtils.fieldOffsetRelative(in, searchPos + PortableUtils.FIELD_ID_LEN,
+                int pos = start + BinaryUtils.fieldOffsetRelative(in, searchPos + BinaryUtils.FIELD_ID_LEN,
                     fieldOffsetLen);
 
                 streamPosition(pos);
@@ -1887,7 +1887,7 @@ public class BinaryReaderExImpl implements BinaryReader, BinaryRawReaderEx, Bina
                 return true;
             }
 
-            searchPos += PortableUtils.FIELD_ID_LEN + fieldOffsetLen;
+            searchPos += BinaryUtils.FIELD_ID_LEN + fieldOffsetLen;
         }
     }
 


[17/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary"

Posted by vo...@apache.org.
ignite-2065: rename "portable" classes to "binary"


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

Branch: refs/heads/ignite-2100
Commit: 71ad9ceadee77cf6729db6582980038564ef2dea
Parents: 2b3c93e
Author: ashutak <as...@gridgain.com>
Authored: Fri Dec 11 17:40:51 2015 +0300
Committer: ashutak <as...@gridgain.com>
Committed: Fri Dec 11 17:40:51 2015 +0300

----------------------------------------------------------------------
 .../examples/CacheClientBinaryExampleTest.java  |   46 +
 .../CacheClientPortableExampleTest.java         |   46 -
 .../ComputeClientBinaryExampleTest.java         |   37 +
 .../ComputeClientPortableExampleTest.java       |   37 -
 .../testsuites/IgniteExamplesSelfTestSuite.java |   13 +-
 .../binary/BinaryCachingMetadataHandler.java    |    2 +-
 .../internal/binary/BinaryClassDescriptor.java  |  813 ++++++++
 .../ignite/internal/binary/BinaryContext.java   | 1102 ++++++++++
 .../internal/binary/BinaryEnumObjectImpl.java   |   10 +-
 .../internal/binary/BinaryFieldAccessor.java    |    4 +-
 .../ignite/internal/binary/BinaryFieldImpl.java |   10 +-
 .../internal/binary/BinaryMarshaller.java       |    8 +-
 .../ignite/internal/binary/BinaryMetadata.java  |   12 +-
 .../binary/BinaryMetadataCollector.java         |    8 +-
 .../internal/binary/BinaryObjectExImpl.java     |    2 +-
 .../internal/binary/BinaryObjectImpl.java       |  110 +-
 .../binary/BinaryObjectOffheapImpl.java         |  121 +-
 .../internal/binary/BinaryPositionReadable.java |   47 +
 .../internal/binary/BinaryPrimitives.java       |  382 ++++
 .../internal/binary/BinaryRawWriterEx.java      |    4 +-
 .../internal/binary/BinaryReaderExImpl.java     |  284 +--
 .../ignite/internal/binary/BinarySchema.java    |  466 +++++
 .../internal/binary/BinarySchemaRegistry.java   |  172 ++
 .../binary/BinaryThreadLocalContext.java        |    9 +-
 .../ignite/internal/binary/BinaryTypeImpl.java  |    6 +-
 .../ignite/internal/binary/BinaryUtils.java     | 1859 +++++++++++++++++
 .../ignite/internal/binary/BinaryWriteMode.java |   92 +-
 .../internal/binary/BinaryWriterExImpl.java     |  260 +--
 .../binary/BinaryWriterSchemaHolder.java        |   19 +-
 .../internal/binary/GridBinaryMarshaller.java   |  286 +++
 .../internal/binary/GridPortableMarshaller.java |  289 ---
 .../binary/PortableClassDescriptor.java         |  813 --------
 .../ignite/internal/binary/PortableContext.java | 1102 ----------
 .../binary/PortablePositionReadable.java        |   47 -
 .../internal/binary/PortablePrimitives.java     |  382 ----
 .../ignite/internal/binary/PortableSchema.java  |  466 -----
 .../internal/binary/PortableSchemaRegistry.java |  172 --
 .../ignite/internal/binary/PortableUtils.java   | 1909 ------------------
 .../binary/builder/BinaryAbstractLazyValue.java |   57 +
 .../binary/builder/BinaryBuilderEnum.java       |  115 ++
 .../binary/builder/BinaryBuilderReader.java     |  846 ++++++++
 .../BinaryBuilderSerializationAware.java        |   31 +
 .../binary/builder/BinaryBuilderSerializer.java |  217 ++
 .../builder/BinaryEnumArrayLazyValue.java       |  113 ++
 .../binary/builder/BinaryLazyArrayList.java     |  167 ++
 .../binary/builder/BinaryLazyLinkedList.java    |  218 ++
 .../internal/binary/builder/BinaryLazyMap.java  |  221 ++
 .../internal/binary/builder/BinaryLazySet.java  |   92 +
 .../binary/builder/BinaryLazyValue.java         |   28 +
 .../builder/BinaryModifiableLazyValue.java      |   52 +
 .../builder/BinaryObjectArrayLazyValue.java     |   90 +
 .../binary/builder/BinaryObjectBuilderImpl.java |  120 +-
 .../binary/builder/BinaryPlainBinaryObject.java |   53 +
 .../binary/builder/BinaryPlainLazyValue.java    |   49 +
 .../binary/builder/BinaryValueWithType.java     |   76 +
 .../builder/PortableAbstractLazyValue.java      |   57 -
 .../binary/builder/PortableBuilderEnum.java     |  115 --
 .../binary/builder/PortableBuilderReader.java   |  857 --------
 .../PortableBuilderSerializationAware.java      |   31 -
 .../builder/PortableBuilderSerializer.java      |  217 --
 .../builder/PortableEnumArrayLazyValue.java     |  115 --
 .../binary/builder/PortableLazyArrayList.java   |  167 --
 .../binary/builder/PortableLazyLinkedList.java  |  218 --
 .../binary/builder/PortableLazyMap.java         |  221 --
 .../binary/builder/PortableLazySet.java         |   94 -
 .../binary/builder/PortableLazyValue.java       |   28 -
 .../builder/PortableModifiableLazyValue.java    |   52 -
 .../builder/PortableObjectArrayLazyValue.java   |   90 -
 .../binary/builder/PortablePlainLazyValue.java  |   49 -
 .../builder/PortablePlainPortableObject.java    |   56 -
 .../binary/builder/PortableValueWithType.java   |   77 -
 .../streams/BinaryAbstractInputStream.java      |  379 ++++
 .../streams/BinaryAbstractOutputStream.java     |  347 ++++
 .../binary/streams/BinaryAbstractStream.java    |   80 +
 .../binary/streams/BinaryHeapInputStream.java   |  166 ++
 .../binary/streams/BinaryHeapOutputStream.java  |  176 ++
 .../binary/streams/BinaryInputStream.java       |  162 ++
 .../binary/streams/BinaryMemoryAllocator.java   |   57 +
 .../streams/BinaryMemoryAllocatorChunk.java     |  117 ++
 .../streams/BinaryOffheapInputStream.java       |  144 ++
 .../streams/BinaryOffheapOutputStream.java      |  222 ++
 .../binary/streams/BinaryOutputStream.java      |  259 +++
 .../internal/binary/streams/BinaryStream.java   |   53 +
 .../streams/PortableAbstractInputStream.java    |  379 ----
 .../streams/PortableAbstractOutputStream.java   |  347 ----
 .../binary/streams/PortableAbstractStream.java  |   80 -
 .../binary/streams/PortableHeapInputStream.java |  166 --
 .../streams/PortableHeapOutputStream.java       |  176 --
 .../binary/streams/PortableInputStream.java     |  163 --
 .../binary/streams/PortableMemoryAllocator.java |   57 -
 .../streams/PortableMemoryAllocatorChunk.java   |  117 --
 .../streams/PortableOffheapInputStream.java     |  144 --
 .../streams/PortableOffheapOutputStream.java    |  222 --
 .../binary/streams/PortableOutputStream.java    |  259 ---
 .../internal/binary/streams/PortableStream.java |   53 -
 .../processors/cache/CacheObjectContext.java    |    6 +-
 .../cache/binary/BinaryMetadataKey.java         |   82 +
 .../CacheDefaultBinaryAffinityKeyMapper.java    |   51 +
 .../CacheDefaultPortableAffinityKeyMapper.java  |   51 -
 .../cache/binary/CacheObjectBinaryContext.java  |   56 +
 .../binary/CacheObjectBinaryProcessorImpl.java  |  104 +-
 .../binary/CacheObjectPortableContext.java      |   56 -
 .../cache/binary/PortableMetadataKey.java       |   82 -
 .../platform/PlatformContextImpl.java           |    4 +-
 .../PlatformDotNetConfigurationClosure.java     |   10 +-
 .../platform/memory/PlatformInputStream.java    |    4 +-
 .../platform/memory/PlatformOutputStream.java   |    4 +-
 .../message/GridClientBinaryMetaData.java       |   71 +
 .../message/GridClientPortableMetaData.java     |   71 -
 .../binary/BinaryFieldsAbstractSelfTest.java    |    6 +-
 .../BinaryFooterOffsetsAbstractSelfTest.java    |    4 +-
 .../binary/BinaryMarshallerSelfTest.java        |   24 +-
 .../BinaryObjectBuilderAdditionalSelfTest.java  |   10 +-
 .../binary/GridBinaryAffinityKeySelfTest.java   |  234 +++
 ...GridBinaryMarshallerCtxDisabledSelfTest.java |  247 +++
 .../binary/GridPortableAffinityKeySelfTest.java |  234 ---
 ...idPortableMarshallerCtxDisabledSelfTest.java |  247 ---
 .../binary/GridPortableWildcardsSelfTest.java   |   30 +-
 .../GridBinaryCacheEntryMemorySizeSelfTest.java |   48 +
 ...ryDuplicateIndexObjectsAbstractSelfTest.java |  161 ++
 .../GridCacheBinaryStoreAbstractSelfTest.java   |  300 +++
 .../GridCacheBinaryStoreObjectsSelfTest.java    |   55 +
 .../GridCacheBinaryStorePortablesSelfTest.java  |   66 +
 .../GridCachePortableStoreAbstractSelfTest.java |  300 ---
 .../GridCachePortableStoreObjectsSelfTest.java  |   55 -
 ...GridCachePortableStorePortablesSelfTest.java |   66 -
 ...ridPortableCacheEntryMemorySizeSelfTest.java |   48 -
 ...leDuplicateIndexObjectsAbstractSelfTest.java |  161 --
 .../DataStreamProcessorBinarySelfTest.java      |   71 +
 .../DataStreamProcessorPortableSelfTest.java    |   71 -
 .../GridCacheAffinityRoutingBinarySelfTest.java |   54 +
 ...ridCacheAffinityRoutingPortableSelfTest.java |   54 -
 ...OnlyBinaryDataStreamerMultiNodeSelfTest.java |   29 +
 ...BinaryDataStreamerMultithreadedSelfTest.java |   47 +
 ...cPartitionedOnlyBinaryMultiNodeSelfTest.java |   28 +
 ...titionedOnlyBinaryMultithreadedSelfTest.java |   47 +
 ...lyPortableDataStreamerMultiNodeSelfTest.java |   29 -
 ...rtableDataStreamerMultithreadedSelfTest.java |   47 -
 ...artitionedOnlyPortableMultiNodeSelfTest.java |   28 -
 ...tionedOnlyPortableMultithreadedSelfTest.java |   47 -
 ...sPartitionedOnlyByteArrayValuesSelfTest.java |   42 +
 ...ateIndexObjectPartitionedAtomicSelfTest.java |   38 +
 ...xObjectPartitionedTransactionalSelfTest.java |   41 +
 .../dht/GridCacheMemoryModeBinarySelfTest.java  |   36 +
 .../GridCacheMemoryModePortableSelfTest.java    |   36 -
 ...dCacheOffHeapTieredAtomicBinarySelfTest.java |   48 +
 ...acheOffHeapTieredAtomicPortableSelfTest.java |   48 -
 .../GridCacheOffHeapTieredBinarySelfTest.java   |   48 +
 ...fHeapTieredEvictionAtomicBinarySelfTest.java |   96 +
 ...eapTieredEvictionAtomicPortableSelfTest.java |   96 -
 ...acheOffHeapTieredEvictionBinarySelfTest.java |   96 +
 ...heOffHeapTieredEvictionPortableSelfTest.java |   96 -
 .../GridCacheOffHeapTieredPortableSelfTest.java |   48 -
 ...ateIndexObjectPartitionedAtomicSelfTest.java |   38 -
 ...xObjectPartitionedTransactionalSelfTest.java |   41 -
 ...sPartitionedOnlyByteArrayValuesSelfTest.java |   42 -
 .../session/GridSessionCheckpointSelfTest.java  |    4 +-
 .../ignite/testframework/junits/IgniteMock.java |    6 +-
 .../junits/IgniteTestResources.java             |    4 +-
 .../IgnitePortableCacheTestSuite.java           |   52 +-
 .../IgnitePortableObjectsTestSuite.java         |   16 +-
 .../CacheDeploymentBinaryEntryProcessor.java    |   35 +
 .../CacheDeploymentPortableEntryProcessor.java  |   35 -
 .../IgnitePortableCacheQueryTestSuite.java      |    8 +-
 164 files changed, 12582 insertions(+), 12729 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/examples/src/test/java/org/apache/ignite/examples/CacheClientBinaryExampleTest.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/examples/CacheClientBinaryExampleTest.java b/examples/src/test/java/org/apache/ignite/examples/CacheClientBinaryExampleTest.java
new file mode 100644
index 0000000..d5f8cc0
--- /dev/null
+++ b/examples/src/test/java/org/apache/ignite/examples/CacheClientBinaryExampleTest.java
@@ -0,0 +1,46 @@
+/*
+ * 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.examples;
+
+import org.apache.ignite.examples.binary.datagrid.CacheClientBinaryPutGetExample;
+import org.apache.ignite.examples.binary.datagrid.CacheClientBinaryQueryExample;
+import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest;
+
+/**
+ *
+ */
+public class CacheClientBinaryExampleTest extends GridAbstractExamplesTest {
+    /** {@inheritDoc} */
+    @Override protected String defaultConfig() {
+        return "examples/config/portable/example-ignite-portable.xml";
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPortablePutGetExample() throws Exception {
+        CacheClientBinaryPutGetExample.main(new String[] {});
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPortableQueryExample() throws Exception {
+        CacheClientBinaryQueryExample.main(new String[] {});
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/examples/src/test/java/org/apache/ignite/examples/CacheClientPortableExampleTest.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/examples/CacheClientPortableExampleTest.java b/examples/src/test/java/org/apache/ignite/examples/CacheClientPortableExampleTest.java
deleted file mode 100644
index 22261e2..0000000
--- a/examples/src/test/java/org/apache/ignite/examples/CacheClientPortableExampleTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.examples;
-
-import org.apache.ignite.examples.binary.datagrid.CacheClientBinaryPutGetExample;
-import org.apache.ignite.examples.binary.datagrid.CacheClientBinaryQueryExample;
-import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest;
-
-/**
- *
- */
-public class CacheClientPortableExampleTest extends GridAbstractExamplesTest {
-    /** {@inheritDoc} */
-    @Override protected String defaultConfig() {
-        return "examples/config/portable/example-ignite-portable.xml";
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPortablePutGetExample() throws Exception {
-        CacheClientBinaryPutGetExample.main(new String[] {});
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPortableQueryExample() throws Exception {
-        CacheClientBinaryQueryExample.main(new String[] {});
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/examples/src/test/java/org/apache/ignite/examples/ComputeClientBinaryExampleTest.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/examples/ComputeClientBinaryExampleTest.java b/examples/src/test/java/org/apache/ignite/examples/ComputeClientBinaryExampleTest.java
new file mode 100644
index 0000000..bdba7c3
--- /dev/null
+++ b/examples/src/test/java/org/apache/ignite/examples/ComputeClientBinaryExampleTest.java
@@ -0,0 +1,37 @@
+/*
+ * 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.examples;
+
+import org.apache.ignite.examples.binary.computegrid.ComputeClientBinaryTaskExecutionExample;
+import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest;
+
+/**
+ *
+ */
+public class ComputeClientBinaryExampleTest extends GridAbstractExamplesTest {
+    /** {@inheritDoc} */
+    @Override protected String defaultConfig() {
+        return "examples/config/portable/example-ignite-portable.xml";
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPortableTaskExecutionExample() throws Exception {
+        ComputeClientBinaryTaskExecutionExample.main(new String[] {});
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/examples/src/test/java/org/apache/ignite/examples/ComputeClientPortableExampleTest.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/examples/ComputeClientPortableExampleTest.java b/examples/src/test/java/org/apache/ignite/examples/ComputeClientPortableExampleTest.java
deleted file mode 100644
index 44d8776..0000000
--- a/examples/src/test/java/org/apache/ignite/examples/ComputeClientPortableExampleTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.examples;
-
-import org.apache.ignite.examples.binary.computegrid.ComputeClientBinaryTaskExecutionExample;
-import org.apache.ignite.testframework.junits.common.GridAbstractExamplesTest;
-
-/**
- *
- */
-public class ComputeClientPortableExampleTest extends GridAbstractExamplesTest {
-    /** {@inheritDoc} */
-    @Override protected String defaultConfig() {
-        return "examples/config/portable/example-ignite-portable.xml";
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPortableTaskExecutionExample() throws Exception {
-        ComputeClientBinaryTaskExecutionExample.main(new String[] {});
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java b/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java
index 4412af3..54fa8a3 100644
--- a/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java
+++ b/examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java
@@ -20,12 +20,12 @@ package org.apache.ignite.testsuites;
 import junit.framework.TestSuite;
 import org.apache.ignite.examples.BasicExamplesMultiNodeSelfTest;
 import org.apache.ignite.examples.BasicExamplesSelfTest;
-import org.apache.ignite.examples.CacheClientPortableExampleTest;
+import org.apache.ignite.examples.CacheClientBinaryExampleTest;
 import org.apache.ignite.examples.CacheExamplesMultiNodeSelfTest;
 import org.apache.ignite.examples.CacheExamplesSelfTest;
 import org.apache.ignite.examples.CheckpointExamplesSelfTest;
 import org.apache.ignite.examples.ClusterGroupExampleSelfTest;
-import org.apache.ignite.examples.ComputeClientPortableExampleTest;
+import org.apache.ignite.examples.ComputeClientBinaryExampleTest;
 import org.apache.ignite.examples.ContinuationExamplesMultiNodeSelfTest;
 import org.apache.ignite.examples.ContinuationExamplesSelfTest;
 import org.apache.ignite.examples.ContinuousMapperExamplesMultiNodeSelfTest;
@@ -44,9 +44,6 @@ import org.apache.ignite.examples.MonteCarloExamplesSelfTest;
 import org.apache.ignite.examples.SpringBeanExamplesSelfTest;
 import org.apache.ignite.examples.TaskExamplesMultiNodeSelfTest;
 import org.apache.ignite.examples.TaskExamplesSelfTest;
-import org.apache.ignite.testframework.GridTestUtils;
-
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_OVERRIDE_MCAST_GRP;
 
 /**
  * Examples test suite.
@@ -92,9 +89,9 @@ public class IgniteExamplesSelfTestSuite extends TestSuite {
         suite.addTest(new TestSuite(MonteCarloExamplesMultiNodeSelfTest.class));
 
         // Portable.
-        suite.addTest(new TestSuite(CacheClientPortableExampleTest.class));
-        suite.addTest(new TestSuite(ComputeClientPortableExampleTest.class));
+        suite.addTest(new TestSuite(CacheClientBinaryExampleTest.class));
+        suite.addTest(new TestSuite(ComputeClientBinaryExampleTest.class));
 
         return suite;
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryCachingMetadataHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryCachingMetadataHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryCachingMetadataHandler.java
index 584b683..39189f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryCachingMetadataHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryCachingMetadataHandler.java
@@ -54,7 +54,7 @@ public class BinaryCachingMetadataHandler implements BinaryMetadataHandler {
                 BinaryMetadata oldMeta = ((BinaryTypeImpl)oldType).metadata();
                 BinaryMetadata newMeta = ((BinaryTypeImpl)type).metadata();
 
-                BinaryMetadata mergedMeta = PortableUtils.mergeMetadata(oldMeta, newMeta);
+                BinaryMetadata mergedMeta = BinaryUtils.mergeMetadata(oldMeta, newMeta);
 
                 BinaryType mergedType = mergedMeta.wrap(((BinaryTypeImpl)oldType).context());
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
new file mode 100644
index 0000000..0c3275e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryClassDescriptor.java
@@ -0,0 +1,813 @@
+/*
+ * 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.binary;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.math.BigDecimal;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.UUID;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.binary.BinaryIdMapper;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinarySerializer;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.internal.processors.cache.CacheObjectImpl;
+import org.apache.ignite.internal.util.GridUnsafe;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.marshaller.MarshallerExclusions;
+import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
+import org.jetbrains.annotations.Nullable;
+import sun.misc.Unsafe;
+
+import static java.lang.reflect.Modifier.isStatic;
+import static java.lang.reflect.Modifier.isTransient;
+
+/**
+ * Portable class descriptor.
+ */
+public class BinaryClassDescriptor {
+    /** */
+    public static final Unsafe UNSAFE = GridUnsafe.unsafe();
+
+    /** */
+    private final BinaryContext ctx;
+
+    /** */
+    private final Class<?> cls;
+
+    /** */
+    private final BinarySerializer serializer;
+
+    /** ID mapper. */
+    private final BinaryIdMapper idMapper;
+
+    /** */
+    private final BinaryWriteMode mode;
+
+    /** */
+    private final boolean userType;
+
+    /** */
+    private final int typeId;
+
+    /** */
+    private final String typeName;
+
+    /** Affinity key field name. */
+    private final String affKeyFieldName;
+
+    /** */
+    private final Constructor<?> ctor;
+
+    /** */
+    private final BinaryFieldAccessor[] fields;
+
+    /** */
+    private final Method writeReplaceMtd;
+
+    /** */
+    private final Method readResolveMtd;
+
+    /** */
+    private final Map<String, Integer> stableFieldsMeta;
+
+    /** Object schemas. Initialized only for serializable classes and contains only 1 entry. */
+    private final BinarySchema stableSchema;
+
+    /** Schema registry. */
+    private final BinarySchemaRegistry schemaReg;
+
+    /** */
+    private final boolean registered;
+
+    /** */
+    private final boolean useOptMarshaller;
+
+    /** */
+    private final boolean excluded;
+
+    /**
+     * @param ctx Context.
+     * @param cls Class.
+     * @param userType User type flag.
+     * @param typeId Type ID.
+     * @param typeName Type name.
+     * @param affKeyFieldName Affinity key field name.
+     * @param idMapper ID mapper.
+     * @param serializer Serializer.
+     * @param metaDataEnabled Metadata enabled flag.
+     * @param registered Whether typeId has been successfully registered by MarshallerContext or not.
+     * @param predefined Whether the class is predefined or not.
+     * @throws BinaryObjectException In case of error.
+     */
+    BinaryClassDescriptor(
+        BinaryContext ctx,
+        Class<?> cls,
+        boolean userType,
+        int typeId,
+        String typeName,
+        @Nullable String affKeyFieldName,
+        @Nullable BinaryIdMapper idMapper,
+        @Nullable BinarySerializer serializer,
+        boolean metaDataEnabled,
+        boolean registered,
+        boolean predefined
+    ) throws BinaryObjectException {
+        assert ctx != null;
+        assert cls != null;
+        assert idMapper != null;
+
+        this.ctx = ctx;
+        this.cls = cls;
+        this.typeId = typeId;
+        this.userType = userType;
+        this.typeName = typeName;
+        this.affKeyFieldName = affKeyFieldName;
+        this.serializer = serializer;
+        this.idMapper = idMapper;
+        this.registered = registered;
+
+        schemaReg = ctx.schemaRegistry(typeId);
+
+        excluded = MarshallerExclusions.isExcluded(cls);
+
+        useOptMarshaller = !predefined && initUseOptimizedMarshallerFlag();
+
+        if (excluded)
+            mode = BinaryWriteMode.EXCLUSION;
+        else {
+            if (cls == BinaryEnumObjectImpl.class)
+                mode = BinaryWriteMode.PORTABLE_ENUM;
+            else
+                mode = serializer != null ? BinaryWriteMode.PORTABLE : BinaryUtils.mode(cls);
+        }
+
+        switch (mode) {
+            case P_BYTE:
+            case P_BOOLEAN:
+            case P_SHORT:
+            case P_CHAR:
+            case P_INT:
+            case P_LONG:
+            case P_FLOAT:
+            case P_DOUBLE:
+            case BYTE:
+            case SHORT:
+            case INT:
+            case LONG:
+            case FLOAT:
+            case DOUBLE:
+            case CHAR:
+            case BOOLEAN:
+            case DECIMAL:
+            case STRING:
+            case UUID:
+            case DATE:
+            case TIMESTAMP:
+            case BYTE_ARR:
+            case SHORT_ARR:
+            case INT_ARR:
+            case LONG_ARR:
+            case FLOAT_ARR:
+            case DOUBLE_ARR:
+            case CHAR_ARR:
+            case BOOLEAN_ARR:
+            case DECIMAL_ARR:
+            case STRING_ARR:
+            case UUID_ARR:
+            case DATE_ARR:
+            case TIMESTAMP_ARR:
+            case OBJECT_ARR:
+            case COL:
+            case MAP:
+            case PORTABLE_OBJ:
+            case ENUM:
+            case PORTABLE_ENUM:
+            case ENUM_ARR:
+            case CLASS:
+            case EXCLUSION:
+                ctor = null;
+                fields = null;
+                stableFieldsMeta = null;
+                stableSchema = null;
+
+                break;
+
+            case PORTABLE:
+            case EXTERNALIZABLE:
+                ctor = constructor(cls);
+                fields = null;
+                stableFieldsMeta = null;
+                stableSchema = null;
+
+                break;
+
+            case OBJECT:
+                // Must not use constructor to honor transient fields semantics.
+                ctor = null;
+                ArrayList<BinaryFieldAccessor> fields0 = new ArrayList<>();
+                stableFieldsMeta = metaDataEnabled ? new HashMap<String, Integer>() : null;
+
+                BinarySchema.Builder schemaBuilder = BinarySchema.Builder.newBuilder();
+
+                Collection<String> names = new HashSet<>();
+                Collection<Integer> ids = new HashSet<>();
+
+                for (Class<?> c = cls; c != null && !c.equals(Object.class); c = c.getSuperclass()) {
+                    for (Field f : c.getDeclaredFields()) {
+                        int mod = f.getModifiers();
+
+                        if (!isStatic(mod) && !isTransient(mod)) {
+                            f.setAccessible(true);
+
+                            String name = f.getName();
+
+                            if (!names.add(name))
+                                throw new BinaryObjectException("Duplicate field name [fieldName=" + name +
+                                    ", cls=" + cls.getName() + ']');
+
+                            int fieldId = idMapper.fieldId(typeId, name);
+
+                            if (!ids.add(fieldId))
+                                throw new BinaryObjectException("Duplicate field ID: " + name);
+
+                            BinaryFieldAccessor fieldInfo = BinaryFieldAccessor.create(f, fieldId);
+
+                            fields0.add(fieldInfo);
+
+                            schemaBuilder.addField(fieldId);
+
+                            if (metaDataEnabled)
+                                stableFieldsMeta.put(name, fieldInfo.mode().typeId());
+                        }
+                    }
+                }
+
+                fields = fields0.toArray(new BinaryFieldAccessor[fields0.size()]);
+
+                stableSchema = schemaBuilder.build();
+
+                break;
+
+            default:
+                // Should never happen.
+                throw new BinaryObjectException("Invalid mode: " + mode);
+        }
+
+        if (mode == BinaryWriteMode.PORTABLE || mode == BinaryWriteMode.EXTERNALIZABLE ||
+            mode == BinaryWriteMode.OBJECT) {
+            readResolveMtd = U.findNonPublicMethod(cls, "readResolve");
+            writeReplaceMtd = U.findNonPublicMethod(cls, "writeReplace");
+        }
+        else {
+            readResolveMtd = null;
+            writeReplaceMtd = null;
+        }
+    }
+
+    /**
+     * @return {@code True} if enum.
+     */
+    boolean isEnum() {
+        return mode == BinaryWriteMode.ENUM;
+    }
+
+    /**
+     * @return Described class.
+     */
+    Class<?> describedClass() {
+        return cls;
+    }
+
+    /**
+     * @return Type ID.
+     */
+    public int typeId() {
+        return typeId;
+    }
+
+    /**
+     * @return User type flag.
+     */
+    public boolean userType() {
+        return userType;
+    }
+
+    /**
+     * @return Fields meta data.
+     */
+    Map<String, Integer> fieldsMeta() {
+        return stableFieldsMeta;
+    }
+
+    /**
+     * @return Schema.
+     */
+    BinarySchema schema() {
+        return stableSchema;
+    }
+
+    /**
+     * @return Whether typeId has been successfully registered by MarshallerContext or not.
+     */
+    public boolean registered() {
+        return registered;
+    }
+
+    /**
+     * @return {@code true} if {@link OptimizedMarshaller} must be used instead of {@link BinaryMarshaller}
+     * for object serialization and deserialization.
+     */
+    public boolean useOptimizedMarshaller() {
+        return useOptMarshaller;
+    }
+
+    /**
+     * Checks whether the class values are explicitly excluded from marshalling.
+     *
+     * @return {@code true} if excluded, {@code false} otherwise.
+     */
+    public boolean excluded() {
+        return excluded;
+    }
+
+    /**
+     * @return portableWriteReplace() method
+     */
+    @Nullable Method getWriteReplaceMethod() {
+        return writeReplaceMtd;
+    }
+
+    /**
+     * @return portableReadResolve() method
+     */
+    @SuppressWarnings("UnusedDeclaration")
+    @Nullable Method getReadResolveMethod() {
+        return readResolveMtd;
+    }
+
+    /**
+     * @param obj Object.
+     * @param writer Writer.
+     * @throws BinaryObjectException In case of error.
+     */
+    void write(Object obj, BinaryWriterExImpl writer) throws BinaryObjectException {
+        assert obj != null;
+        assert writer != null;
+
+        writer.typeId(typeId);
+
+        switch (mode) {
+            case P_BYTE:
+            case BYTE:
+                writer.writeByteFieldPrimitive((byte) obj);
+
+                break;
+
+            case P_SHORT:
+            case SHORT:
+                writer.writeShortFieldPrimitive((short)obj);
+
+                break;
+
+            case P_INT:
+            case INT:
+                writer.writeIntFieldPrimitive((int) obj);
+
+                break;
+
+            case P_LONG:
+            case LONG:
+                writer.writeLongFieldPrimitive((long) obj);
+
+                break;
+
+            case P_FLOAT:
+            case FLOAT:
+                writer.writeFloatFieldPrimitive((float) obj);
+
+                break;
+
+            case P_DOUBLE:
+            case DOUBLE:
+                writer.writeDoubleFieldPrimitive((double) obj);
+
+                break;
+
+            case P_CHAR:
+            case CHAR:
+                writer.writeCharFieldPrimitive((char) obj);
+
+                break;
+
+            case P_BOOLEAN:
+            case BOOLEAN:
+                writer.writeBooleanFieldPrimitive((boolean) obj);
+
+                break;
+
+            case DECIMAL:
+                writer.doWriteDecimal((BigDecimal)obj);
+
+                break;
+
+            case STRING:
+                writer.doWriteString((String)obj);
+
+                break;
+
+            case UUID:
+                writer.doWriteUuid((UUID)obj);
+
+                break;
+
+            case DATE:
+                writer.doWriteDate((Date)obj);
+
+                break;
+
+            case TIMESTAMP:
+                writer.doWriteTimestamp((Timestamp)obj);
+
+                break;
+
+            case BYTE_ARR:
+                writer.doWriteByteArray((byte[])obj);
+
+                break;
+
+            case SHORT_ARR:
+                writer.doWriteShortArray((short[]) obj);
+
+                break;
+
+            case INT_ARR:
+                writer.doWriteIntArray((int[]) obj);
+
+                break;
+
+            case LONG_ARR:
+                writer.doWriteLongArray((long[]) obj);
+
+                break;
+
+            case FLOAT_ARR:
+                writer.doWriteFloatArray((float[]) obj);
+
+                break;
+
+            case DOUBLE_ARR:
+                writer.doWriteDoubleArray((double[]) obj);
+
+                break;
+
+            case CHAR_ARR:
+                writer.doWriteCharArray((char[]) obj);
+
+                break;
+
+            case BOOLEAN_ARR:
+                writer.doWriteBooleanArray((boolean[]) obj);
+
+                break;
+
+            case DECIMAL_ARR:
+                writer.doWriteDecimalArray((BigDecimal[]) obj);
+
+                break;
+
+            case STRING_ARR:
+                writer.doWriteStringArray((String[]) obj);
+
+                break;
+
+            case UUID_ARR:
+                writer.doWriteUuidArray((UUID[]) obj);
+
+                break;
+
+            case DATE_ARR:
+                writer.doWriteDateArray((Date[]) obj);
+
+                break;
+
+            case TIMESTAMP_ARR:
+                writer.doWriteTimestampArray((Timestamp[]) obj);
+
+                break;
+
+            case OBJECT_ARR:
+                writer.doWriteObjectArray((Object[])obj);
+
+                break;
+
+            case COL:
+                writer.doWriteCollection((Collection<?>)obj);
+
+                break;
+
+            case MAP:
+                writer.doWriteMap((Map<?, ?>)obj);
+
+                break;
+
+            case ENUM:
+                writer.doWriteEnum((Enum<?>)obj);
+
+                break;
+
+            case PORTABLE_ENUM:
+                writer.doWritePortableEnum((BinaryEnumObjectImpl)obj);
+
+                break;
+
+            case ENUM_ARR:
+                writer.doWriteEnumArray((Object[])obj);
+
+                break;
+
+            case CLASS:
+                writer.doWriteClass((Class)obj);
+
+                break;
+
+            case PORTABLE_OBJ:
+                writer.doWritePortableObject((BinaryObjectImpl)obj);
+
+                break;
+
+            case PORTABLE:
+                if (preWrite(writer, obj)) {
+                    try {
+                        if (serializer != null)
+                            serializer.writeBinary(obj, writer);
+                        else
+                            ((Binarylizable)obj).writeBinary(writer);
+
+                        postWrite(writer, obj);
+
+                        // Check whether we need to update metadata.
+                        if (obj.getClass() != BinaryMetadata.class) {
+                            int schemaId = writer.schemaId();
+
+                            if (schemaReg.schema(schemaId) == null) {
+                                // This is new schema, let's update metadata.
+                                BinaryMetadataCollector collector =
+                                    new BinaryMetadataCollector(typeId, typeName, idMapper);
+
+                                if (serializer != null)
+                                    serializer.writeBinary(obj, collector);
+                                else
+                                    ((Binarylizable)obj).writeBinary(collector);
+
+                                BinarySchema newSchema = collector.schema();
+
+                                BinaryMetadata meta = new BinaryMetadata(typeId, typeName, collector.meta(),
+                                    affKeyFieldName, Collections.singleton(newSchema), false);
+
+                                ctx.updateMetadata(typeId, meta);
+
+                                schemaReg.addSchema(newSchema.schemaId(), newSchema);
+                            }
+                        }
+                    }
+                    finally {
+                        writer.popSchema();
+                    }
+                }
+
+                break;
+
+            case EXTERNALIZABLE:
+                if (preWrite(writer, obj)) {
+                    writer.rawWriter();
+
+                    try {
+                        ((Externalizable)obj).writeExternal(writer);
+
+                        postWrite(writer, obj);
+                    }
+                    catch (IOException e) {
+                        throw new BinaryObjectException("Failed to write Externalizable object: " + obj, e);
+                    }
+                    finally {
+                        writer.popSchema();
+                    }
+                }
+
+                break;
+
+            case OBJECT:
+                if (preWrite(writer, obj)) {
+                    try {
+                        for (BinaryFieldAccessor info : fields)
+                            info.write(obj, writer);
+
+                        writer.schemaId(stableSchema.schemaId());
+
+                        postWrite(writer, obj);
+                    }
+                    finally {
+                        writer.popSchema();
+                    }
+                }
+
+                break;
+
+            default:
+                assert false : "Invalid mode: " + mode;
+        }
+    }
+
+    /**
+     * @param reader Reader.
+     * @return Object.
+     * @throws BinaryObjectException If failed.
+     */
+    Object read(BinaryReaderExImpl reader) throws BinaryObjectException {
+        assert reader != null;
+
+        Object res;
+
+        switch (mode) {
+            case PORTABLE:
+                res = newInstance();
+
+                reader.setHandle(res);
+
+                if (serializer != null)
+                    serializer.readBinary(res, reader);
+                else
+                    ((Binarylizable)res).readBinary(reader);
+
+                break;
+
+            case EXTERNALIZABLE:
+                res = newInstance();
+
+                reader.setHandle(res);
+
+                try {
+                    ((Externalizable)res).readExternal(reader);
+                }
+                catch (IOException | ClassNotFoundException e) {
+                    throw new BinaryObjectException("Failed to read Externalizable object: " +
+                        res.getClass().getName(), e);
+                }
+
+                break;
+
+            case OBJECT:
+                res = newInstance();
+
+                reader.setHandle(res);
+
+                for (BinaryFieldAccessor info : fields)
+                    info.read(res, reader);
+
+                break;
+
+            default:
+                assert false : "Invalid mode: " + mode;
+
+                return null;
+        }
+
+        if (readResolveMtd != null) {
+            try {
+                res = readResolveMtd.invoke(res);
+
+                reader.setHandle(res);
+            }
+            catch (IllegalAccessException e) {
+                throw new RuntimeException(e);
+            }
+            catch (InvocationTargetException e) {
+                if (e.getTargetException() instanceof BinaryObjectException)
+                    throw (BinaryObjectException)e.getTargetException();
+
+                throw new BinaryObjectException("Failed to execute readResolve() method on " + res, e);
+            }
+        }
+
+        return res;
+    }
+
+    /**
+     * Pre-write phase.
+     *
+     * @param writer Writer.
+     * @param obj Object.
+     * @return Whether further write is needed.
+     */
+    private boolean preWrite(BinaryWriterExImpl writer, Object obj) {
+        if (writer.tryWriteAsHandle(obj))
+            return false;
+
+        writer.preWrite(registered ? null : cls.getName());
+
+        return true;
+    }
+
+    /**
+     * Post-write phase.
+     *
+     * @param writer Writer.
+     * @param obj Object.
+     */
+    private void postWrite(BinaryWriterExImpl writer, Object obj) {
+        writer.postWrite(userType, registered, obj instanceof CacheObjectImpl ? 0 : obj.hashCode());
+    }
+
+    /**
+     * @return Instance.
+     * @throws BinaryObjectException In case of error.
+     */
+    private Object newInstance() throws BinaryObjectException {
+        try {
+            return ctor != null ? ctor.newInstance() : UNSAFE.allocateInstance(cls);
+        }
+        catch (InstantiationException | InvocationTargetException | IllegalAccessException e) {
+            throw new BinaryObjectException("Failed to instantiate instance: " + cls, e);
+        }
+    }
+
+    /**
+     * @param cls Class.
+     * @return Constructor.
+     * @throws BinaryObjectException If constructor doesn't exist.
+     */
+    @SuppressWarnings("ConstantConditions")
+    @Nullable private static Constructor<?> constructor(Class<?> cls) throws BinaryObjectException {
+        assert cls != null;
+
+        try {
+            Constructor<?> ctor = U.forceEmptyConstructor(cls);
+
+            if (ctor == null)
+                throw new BinaryObjectException("Failed to find empty constructor for class: " + cls.getName());
+
+            ctor.setAccessible(true);
+
+            return ctor;
+        }
+        catch (IgniteCheckedException e) {
+            throw new BinaryObjectException("Failed to get constructor for class: " + cls.getName(), e);
+        }
+    }
+
+    /**
+     * Determines whether to use {@link OptimizedMarshaller} for serialization or
+     * not.
+     *
+     * @return {@code true} if to use, {@code false} otherwise.
+     */
+    @SuppressWarnings("unchecked")
+    private boolean initUseOptimizedMarshallerFlag() {
+        for (Class c = cls; c != null && !c.equals(Object.class); c = c.getSuperclass()) {
+            try {
+                Method writeObj = c.getDeclaredMethod("writeObject", ObjectOutputStream.class);
+                Method readObj = c.getDeclaredMethod("readObject", ObjectInputStream.class);
+
+                if (!Modifier.isStatic(writeObj.getModifiers()) && !Modifier.isStatic(readObj.getModifiers()) &&
+                    writeObj.getReturnType() == void.class && readObj.getReturnType() == void.class)
+                    return true;
+            }
+            catch (NoSuchMethodException ignored) {
+                // No-op.
+            }
+        }
+
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
new file mode 100644
index 0000000..6293cfe
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java
@@ -0,0 +1,1102 @@
+/*
+ * 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.binary;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.binary.BinaryIdMapper;
+import org.apache.ignite.binary.BinaryInvalidTypeException;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinarySerializer;
+import org.apache.ignite.binary.BinaryType;
+import org.apache.ignite.binary.BinaryTypeConfiguration;
+import org.apache.ignite.cache.CacheKeyConfiguration;
+import org.apache.ignite.cache.affinity.AffinityKeyMapped;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteKernal;
+import org.apache.ignite.internal.IgnitionEx;
+import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
+import org.apache.ignite.internal.processors.datastructures.CollocatedQueueItemKey;
+import org.apache.ignite.internal.processors.datastructures.CollocatedSetItemKey;
+import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.lang.GridMapEntry;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.T2;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.apache.ignite.marshaller.MarshallerContext;
+import org.apache.ignite.marshaller.optimized.OptimizedMarshaller;
+import org.jetbrains.annotations.Nullable;
+import org.jsr166.ConcurrentHashMap8;
+
+import java.io.Externalizable;
+import java.io.File;
+import java.io.IOException;
+import java.io.InvalidObjectException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.ObjectStreamException;
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentMap;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+/**
+ * Portable context.
+ */
+public class BinaryContext implements Externalizable {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private static final ClassLoader dfltLdr = U.gridClassLoader();
+
+    /** */
+    private final ConcurrentMap<Class<?>, BinaryClassDescriptor> descByCls = new ConcurrentHashMap8<>();
+
+    /** Holds classes loaded by default class loader only. */
+    private final ConcurrentMap<Integer, BinaryClassDescriptor> userTypes = new ConcurrentHashMap8<>();
+
+    /** */
+    private final Map<Integer, BinaryClassDescriptor> predefinedTypes = new HashMap<>();
+
+    /** */
+    private final Map<String, Integer> predefinedTypeNames = new HashMap<>();
+
+    /** */
+    private final Map<Class<? extends Collection>, Byte> colTypes = new HashMap<>();
+
+    /** */
+    private final Map<Class<? extends Map>, Byte> mapTypes = new HashMap<>();
+
+    /** */
+    private final ConcurrentMap<Integer, BinaryIdMapper> mappers = new ConcurrentHashMap8<>(0);
+
+    /** Affinity key field names. */
+    private final ConcurrentMap<Integer, String> affKeyFieldNames = new ConcurrentHashMap8<>(0);
+
+    /** */
+    private final Map<String, BinaryIdMapper> typeMappers = new ConcurrentHashMap8<>(0);
+
+    /** */
+    private BinaryMetadataHandler metaHnd;
+
+    /** Actual marshaller. */
+    private BinaryMarshaller marsh;
+
+    /** */
+    private MarshallerContext marshCtx;
+
+    /** */
+    private String gridName;
+
+    /** */
+    private IgniteConfiguration igniteCfg;
+
+    /** */
+    private final OptimizedMarshaller optmMarsh = new OptimizedMarshaller();
+
+    /** Compact footer flag. */
+    private boolean compactFooter;
+
+    /** Object schemas. */
+    private volatile Map<Integer, BinarySchemaRegistry> schemas;
+
+    /**
+     * For {@link Externalizable}.
+     */
+    public BinaryContext() {
+        // No-op.
+    }
+
+    /**
+     * @param metaHnd Meta data handler.
+     * @param igniteCfg Ignite configuration.
+     */
+    public BinaryContext(BinaryMetadataHandler metaHnd, IgniteConfiguration igniteCfg) {
+        assert metaHnd != null;
+        assert igniteCfg != null;
+
+        this.metaHnd = metaHnd;
+        this.igniteCfg = igniteCfg;
+
+        gridName = igniteCfg.getGridName();
+
+        colTypes.put(ArrayList.class, GridBinaryMarshaller.ARR_LIST);
+        colTypes.put(LinkedList.class, GridBinaryMarshaller.LINKED_LIST);
+        colTypes.put(HashSet.class, GridBinaryMarshaller.HASH_SET);
+        colTypes.put(LinkedHashSet.class, GridBinaryMarshaller.LINKED_HASH_SET);
+
+        mapTypes.put(HashMap.class, GridBinaryMarshaller.HASH_MAP);
+        mapTypes.put(LinkedHashMap.class, GridBinaryMarshaller.LINKED_HASH_MAP);
+
+        // IDs range from [0..200] is used by Java SDK API and GridGain legacy API
+
+        registerPredefinedType(Byte.class, GridBinaryMarshaller.BYTE);
+        registerPredefinedType(Boolean.class, GridBinaryMarshaller.BOOLEAN);
+        registerPredefinedType(Short.class, GridBinaryMarshaller.SHORT);
+        registerPredefinedType(Character.class, GridBinaryMarshaller.CHAR);
+        registerPredefinedType(Integer.class, GridBinaryMarshaller.INT);
+        registerPredefinedType(Long.class, GridBinaryMarshaller.LONG);
+        registerPredefinedType(Float.class, GridBinaryMarshaller.FLOAT);
+        registerPredefinedType(Double.class, GridBinaryMarshaller.DOUBLE);
+        registerPredefinedType(String.class, GridBinaryMarshaller.STRING);
+        registerPredefinedType(BigDecimal.class, GridBinaryMarshaller.DECIMAL);
+        registerPredefinedType(Date.class, GridBinaryMarshaller.DATE);
+        registerPredefinedType(Timestamp.class, GridBinaryMarshaller.TIMESTAMP);
+        registerPredefinedType(UUID.class, GridBinaryMarshaller.UUID);
+
+        registerPredefinedType(byte[].class, GridBinaryMarshaller.BYTE_ARR);
+        registerPredefinedType(short[].class, GridBinaryMarshaller.SHORT_ARR);
+        registerPredefinedType(int[].class, GridBinaryMarshaller.INT_ARR);
+        registerPredefinedType(long[].class, GridBinaryMarshaller.LONG_ARR);
+        registerPredefinedType(float[].class, GridBinaryMarshaller.FLOAT_ARR);
+        registerPredefinedType(double[].class, GridBinaryMarshaller.DOUBLE_ARR);
+        registerPredefinedType(char[].class, GridBinaryMarshaller.CHAR_ARR);
+        registerPredefinedType(boolean[].class, GridBinaryMarshaller.BOOLEAN_ARR);
+        registerPredefinedType(BigDecimal[].class, GridBinaryMarshaller.DECIMAL_ARR);
+        registerPredefinedType(String[].class, GridBinaryMarshaller.STRING_ARR);
+        registerPredefinedType(UUID[].class, GridBinaryMarshaller.UUID_ARR);
+        registerPredefinedType(Date[].class, GridBinaryMarshaller.DATE_ARR);
+        registerPredefinedType(Timestamp[].class, GridBinaryMarshaller.TIMESTAMP_ARR);
+        registerPredefinedType(Object[].class, GridBinaryMarshaller.OBJ_ARR);
+
+        registerPredefinedType(ArrayList.class, 0);
+        registerPredefinedType(LinkedList.class, 0);
+        registerPredefinedType(HashSet.class, 0);
+        registerPredefinedType(LinkedHashSet.class, 0);
+
+        registerPredefinedType(HashMap.class, 0);
+        registerPredefinedType(LinkedHashMap.class, 0);
+
+        registerPredefinedType(GridMapEntry.class, 60);
+        registerPredefinedType(IgniteBiTuple.class, 61);
+        registerPredefinedType(T2.class, 62);
+
+        // IDs range [200..1000] is used by Ignite internal APIs.
+    }
+
+    /**
+     * @return Marshaller.
+     */
+    public BinaryMarshaller marshaller() {
+        return marsh;
+    }
+
+    /**
+     * @return Ignite configuration.
+     */
+    public IgniteConfiguration configuration(){
+        return igniteCfg;
+    }
+
+    /**
+     * @param marsh Portable marshaller.
+     * @param cfg Configuration.
+     * @throws BinaryObjectException In case of error.
+     */
+    public void configure(BinaryMarshaller marsh, IgniteConfiguration cfg) throws BinaryObjectException {
+        if (marsh == null)
+            return;
+
+        this.marsh = marsh;
+
+        marshCtx = marsh.getContext();
+
+        BinaryConfiguration binaryCfg = cfg.getBinaryConfiguration();
+
+        if (binaryCfg == null)
+            binaryCfg = new BinaryConfiguration();
+
+        assert marshCtx != null;
+
+        optmMarsh.setContext(marshCtx);
+
+        configure(
+            binaryCfg.getIdMapper(),
+            binaryCfg.getSerializer(),
+            binaryCfg.getTypeConfigurations()
+        );
+
+        compactFooter = binaryCfg.isCompactFooter();
+    }
+
+    /**
+     * @param globalIdMapper ID mapper.
+     * @param globalSerializer Serializer.
+     * @param typeCfgs Type configurations.
+     * @throws BinaryObjectException In case of error.
+     */
+    private void configure(
+        BinaryIdMapper globalIdMapper,
+        BinarySerializer globalSerializer,
+        Collection<BinaryTypeConfiguration> typeCfgs
+    ) throws BinaryObjectException {
+        TypeDescriptors descs = new TypeDescriptors();
+
+        Map<String, String> affFields = new HashMap<>();
+
+        if (!F.isEmpty(igniteCfg.getCacheKeyConfiguration())) {
+            for (CacheKeyConfiguration keyCfg : igniteCfg.getCacheKeyConfiguration())
+                affFields.put(keyCfg.getTypeName(), keyCfg.getAffinityKeyFieldName());
+        }
+
+        if (typeCfgs != null) {
+            for (BinaryTypeConfiguration typeCfg : typeCfgs) {
+                String clsName = typeCfg.getTypeName();
+
+                if (clsName == null)
+                    throw new BinaryObjectException("Class name is required for portable type configuration.");
+
+                BinaryIdMapper idMapper = globalIdMapper;
+
+                if (typeCfg.getIdMapper() != null)
+                    idMapper = typeCfg.getIdMapper();
+
+                idMapper = BinaryInternalIdMapper.create(idMapper);
+
+                BinarySerializer serializer = globalSerializer;
+
+                if (typeCfg.getSerializer() != null)
+                    serializer = typeCfg.getSerializer();
+
+                if (clsName.endsWith(".*")) {
+                    String pkgName = clsName.substring(0, clsName.length() - 2);
+
+                    for (String clsName0 : classesInPackage(pkgName))
+                        descs.add(clsName0, idMapper, serializer, affFields.get(clsName0),
+                            typeCfg.isEnum(), true);
+                }
+                else
+                    descs.add(clsName, idMapper, serializer, affFields.get(clsName),
+                        typeCfg.isEnum(), false);
+            }
+        }
+
+        for (TypeDescriptor desc : descs.descriptors())
+            registerUserType(desc.clsName, desc.idMapper, desc.serializer, desc.affKeyFieldName, desc.isEnum);
+
+        BinaryInternalIdMapper dfltMapper = BinaryInternalIdMapper.create(globalIdMapper);
+
+        // Put affinity field names for unconfigured types.
+        for (Map.Entry<String, String> entry : affFields.entrySet()) {
+            String typeName = entry.getKey();
+
+            int typeId = dfltMapper.typeId(typeName);
+
+            affKeyFieldNames.putIfAbsent(typeId, entry.getValue());
+        }
+
+        addSystemClassAffinityKey(CollocatedSetItemKey.class);
+        addSystemClassAffinityKey(CollocatedQueueItemKey.class);
+    }
+
+    /**
+     * @param cls Class.
+     */
+    private void addSystemClassAffinityKey(Class<?> cls) {
+        String fieldName = affinityFieldName(cls);
+
+        assert fieldName != null : cls;
+
+        affKeyFieldNames.putIfAbsent(cls.getName().hashCode(), affinityFieldName(cls));
+    }
+
+    /**
+     * @param pkgName Package name.
+     * @return Class names.
+     */
+    @SuppressWarnings("ConstantConditions")
+    private static Iterable<String> classesInPackage(String pkgName) {
+        assert pkgName != null;
+
+        Collection<String> clsNames = new ArrayList<>();
+
+        ClassLoader ldr = U.gridClassLoader();
+
+        if (ldr instanceof URLClassLoader) {
+            String pkgPath = pkgName.replaceAll("\\.", "/");
+
+            URL[] urls = ((URLClassLoader)ldr).getURLs();
+
+            for (URL url : urls) {
+                String proto = url.getProtocol().toLowerCase();
+
+                if ("file".equals(proto)) {
+                    try {
+                        File cpElement = new File(url.toURI());
+
+                        if (cpElement.isDirectory()) {
+                            File pkgDir = new File(cpElement, pkgPath);
+
+                            if (pkgDir.isDirectory()) {
+                                for (File file : pkgDir.listFiles()) {
+                                    String fileName = file.getName();
+
+                                    if (file.isFile() && fileName.toLowerCase().endsWith(".class"))
+                                        clsNames.add(pkgName + '.' + fileName.substring(0, fileName.length() - 6));
+                                }
+                            }
+                        }
+                        else if (cpElement.isFile()) {
+                            try {
+                                JarFile jar = new JarFile(cpElement);
+
+                                Enumeration<JarEntry> entries = jar.entries();
+
+                                while (entries.hasMoreElements()) {
+                                    String entry = entries.nextElement().getName();
+
+                                    if (entry.startsWith(pkgPath) && entry.endsWith(".class")) {
+                                        String clsName = entry.substring(pkgPath.length() + 1, entry.length() - 6);
+
+                                        if (!clsName.contains("/") && !clsName.contains("\\"))
+                                            clsNames.add(pkgName + '.' + clsName);
+                                    }
+                                }
+                            }
+                            catch (IOException ignored) {
+                                // No-op.
+                            }
+                        }
+                    }
+                    catch (URISyntaxException ignored) {
+                        // No-op.
+                    }
+                }
+            }
+        }
+
+        return clsNames;
+    }
+
+    /**
+     * @param cls Class.
+     * @return Class descriptor.
+     * @throws BinaryObjectException In case of error.
+     */
+    public BinaryClassDescriptor descriptorForClass(Class<?> cls, boolean deserialize)
+        throws BinaryObjectException {
+        assert cls != null;
+
+        BinaryClassDescriptor desc = descByCls.get(cls);
+
+        if (desc == null || !desc.registered())
+            desc = registerClassDescriptor(cls, deserialize);
+
+        return desc;
+    }
+
+    /**
+     * @param userType User type or not.
+     * @param typeId Type ID.
+     * @param ldr Class loader.
+     * @return Class descriptor.
+     */
+    public BinaryClassDescriptor descriptorForTypeId(
+        boolean userType,
+        int typeId,
+        ClassLoader ldr,
+        boolean deserialize
+    ) {
+        assert typeId != GridBinaryMarshaller.UNREGISTERED_TYPE_ID;
+
+        //TODO: As a workaround for IGNITE-1358 we always check the predefined map before without checking 'userType'
+        BinaryClassDescriptor desc = predefinedTypes.get(typeId);
+
+        if (desc != null)
+            return desc;
+
+        if (ldr == null)
+            ldr = dfltLdr;
+
+        // If the type hasn't been loaded by default class loader then we mustn't return the descriptor from here
+        // giving a chance to a custom class loader to reload type's class.
+        if (userType && ldr.equals(dfltLdr)) {
+            desc = userTypes.get(typeId);
+
+            if (desc != null)
+                return desc;
+        }
+
+        Class cls;
+
+        try {
+            cls = marshCtx.getClass(typeId, ldr);
+
+            desc = descByCls.get(cls);
+        }
+        catch (ClassNotFoundException e) {
+            // Class might have been loaded by default class loader.
+            if (userType && !ldr.equals(dfltLdr) && (desc = descriptorForTypeId(true, typeId, dfltLdr, deserialize)) != null)
+                return desc;
+
+            throw new BinaryInvalidTypeException(e);
+        }
+        catch (IgniteCheckedException e) {
+            // Class might have been loaded by default class loader.
+            if (userType && !ldr.equals(dfltLdr) && (desc = descriptorForTypeId(true, typeId, dfltLdr, deserialize)) != null)
+                return desc;
+
+            throw new BinaryObjectException("Failed resolve class for ID: " + typeId, e);
+        }
+
+        if (desc == null) {
+            desc = registerClassDescriptor(cls, deserialize);
+
+            assert desc.typeId() == typeId;
+        }
+
+        return desc;
+    }
+
+    /**
+     * Creates and registers {@link BinaryClassDescriptor} for the given {@code class}.
+     *
+     * @param cls Class.
+     * @return Class descriptor.
+     */
+    private BinaryClassDescriptor registerClassDescriptor(Class<?> cls, boolean deserialize) {
+        BinaryClassDescriptor desc;
+
+        String clsName = cls.getName();
+
+        if (marshCtx.isSystemType(clsName)) {
+            desc = new BinaryClassDescriptor(this,
+                cls,
+                false,
+                clsName.hashCode(),
+                clsName,
+                null,
+                BinaryInternalIdMapper.defaultInstance(),
+                null,
+                false,
+                true, /* registered */
+                false /* predefined */
+            );
+
+            BinaryClassDescriptor old = descByCls.putIfAbsent(cls, desc);
+
+            if (old != null)
+                desc = old;
+        }
+        else
+            desc = registerUserClassDescriptor(cls, deserialize);
+
+        return desc;
+    }
+
+    /**
+     * Creates and registers {@link BinaryClassDescriptor} for the given user {@code class}.
+     *
+     * @param cls Class.
+     * @return Class descriptor.
+     */
+    private BinaryClassDescriptor registerUserClassDescriptor(Class<?> cls, boolean deserialize) {
+        boolean registered;
+
+        String typeName = typeName(cls.getName());
+
+        BinaryIdMapper idMapper = userTypeIdMapper(typeName);
+
+        int typeId = idMapper.typeId(typeName);
+
+        try {
+            registered = marshCtx.registerClass(typeId, cls);
+        }
+        catch (IgniteCheckedException e) {
+            throw new BinaryObjectException("Failed to register class.", e);
+        }
+
+        String affFieldName = affinityFieldName(cls);
+
+        BinaryClassDescriptor desc = new BinaryClassDescriptor(this,
+            cls,
+            true,
+            typeId,
+            typeName,
+            affFieldName,
+            idMapper,
+            null,
+            true,
+            registered,
+            false /* predefined */
+        );
+
+        if (!deserialize) {
+            Collection<BinarySchema> schemas = desc.schema() != null ? Collections.singleton(desc.schema()) : null;
+
+            metaHnd.addMeta(typeId,
+                new BinaryMetadata(typeId, typeName, desc.fieldsMeta(), affFieldName, schemas, desc.isEnum()).wrap(this));
+        }
+
+        // perform put() instead of putIfAbsent() because "registered" flag might have been changed or class loader
+        // might have reloaded described class.
+        if (IgniteUtils.detectClassLoader(cls).equals(dfltLdr))
+            userTypes.put(typeId, desc);
+
+        descByCls.put(cls, desc);
+
+        mappers.putIfAbsent(typeId, idMapper);
+
+        return desc;
+    }
+
+    /**
+     * @param cls Collection class.
+     * @return Collection type ID.
+     */
+    public byte collectionType(Class<? extends Collection> cls) {
+        assert cls != null;
+
+        Byte type = colTypes.get(cls);
+
+        if (type != null)
+            return type;
+
+        return Set.class.isAssignableFrom(cls) ? GridBinaryMarshaller.USER_SET : GridBinaryMarshaller.USER_COL;
+    }
+
+    /**
+     * @param cls Map class.
+     * @return Map type ID.
+     */
+    public byte mapType(Class<? extends Map> cls) {
+        assert cls != null;
+
+        Byte type = mapTypes.get(cls);
+
+        return type != null ? type : GridBinaryMarshaller.USER_COL;
+    }
+
+    /**
+     * @param typeName Type name.
+     * @return Type ID.
+     */
+    public int typeId(String typeName) {
+        String typeName0 = typeName(typeName);
+
+        Integer id = predefinedTypeNames.get(typeName0);
+
+        if (id != null)
+            return id;
+
+        if (marshCtx.isSystemType(typeName))
+            return typeName.hashCode();
+
+        return userTypeIdMapper(typeName0).typeId(typeName0);
+    }
+
+    /**
+     * @param typeId Type ID.
+     * @param fieldName Field name.
+     * @return Field ID.
+     */
+    public int fieldId(int typeId, String fieldName) {
+        return userTypeIdMapper(typeId).fieldId(typeId, fieldName);
+    }
+
+    /**
+     * @param typeId Type ID.
+     * @return Instance of ID mapper.
+     */
+    public BinaryIdMapper userTypeIdMapper(int typeId) {
+        BinaryIdMapper idMapper = mappers.get(typeId);
+
+        return idMapper != null ? idMapper : BinaryInternalIdMapper.defaultInstance();
+    }
+
+    /**
+     * @param typeName Type name.
+     * @return Instance of ID mapper.
+     */
+    private BinaryIdMapper userTypeIdMapper(String typeName) {
+        BinaryIdMapper idMapper = typeMappers.get(typeName);
+
+        return idMapper != null ? idMapper : BinaryInternalIdMapper.defaultInstance();
+    }
+
+    /**
+     * @param cls Class to get affinity field for.
+     * @return Affinity field name or {@code null} if field name was not found.
+     */
+    private String affinityFieldName(Class cls) {
+        for (; cls != Object.class && cls != null; cls = cls.getSuperclass()) {
+            for (Field f : cls.getDeclaredFields()) {
+                if (f.getAnnotation(AffinityKeyMapped.class) != null)
+                    return f.getName();
+            }
+        }
+
+        return null;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeExternal(ObjectOutput out) throws IOException {
+        U.writeString(out, igniteCfg.getGridName());
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+        gridName = U.readString(in);
+    }
+
+    /**
+     * @return Portable context.
+     * @throws ObjectStreamException In case of error.
+     */
+    protected Object readResolve() throws ObjectStreamException {
+        try {
+            IgniteKernal g = IgnitionEx.gridx(gridName);
+
+            if (g == null)
+                throw new IllegalStateException("Failed to find grid for name: " + gridName);
+
+            return ((CacheObjectBinaryProcessorImpl)g.context().cacheObjects()).portableContext();
+        }
+        catch (IllegalStateException e) {
+            throw U.withCause(new InvalidObjectException(e.getMessage()), e);
+        }
+    }
+
+    /**
+     * @param cls Class.
+     * @param id Type ID.
+     * @return GridPortableClassDescriptor.
+     */
+    public BinaryClassDescriptor registerPredefinedType(Class<?> cls, int id) {
+        String typeName = typeName(cls.getName());
+
+        BinaryClassDescriptor desc = new BinaryClassDescriptor(
+            this,
+            cls,
+            false,
+            id,
+            typeName,
+            null,
+            BinaryInternalIdMapper.defaultInstance(),
+            null,
+            false,
+            true, /* registered */
+            true /* predefined */
+        );
+
+        predefinedTypeNames.put(typeName, id);
+        predefinedTypes.put(id, desc);
+
+        descByCls.put(cls, desc);
+
+        return desc;
+    }
+
+    /**
+     * @param clsName Class name.
+     * @param idMapper ID mapper.
+     * @param serializer Serializer.
+     * @param affKeyFieldName Affinity key field name.
+     * @param isEnum If enum.
+     * @throws BinaryObjectException In case of error.
+     */
+    @SuppressWarnings("ErrorNotRethrown")
+    public void registerUserType(String clsName,
+        BinaryIdMapper idMapper,
+        @Nullable BinarySerializer serializer,
+        @Nullable String affKeyFieldName,
+        boolean isEnum)
+        throws BinaryObjectException {
+        assert idMapper != null;
+
+        Class<?> cls = null;
+
+        try {
+            cls = Class.forName(clsName);
+        }
+        catch (ClassNotFoundException | NoClassDefFoundError ignored) {
+            // No-op.
+        }
+
+        String typeName = typeName(clsName);
+
+        int id = idMapper.typeId(typeName);
+
+        //Workaround for IGNITE-1358
+        if (predefinedTypes.get(id) != null)
+            throw new BinaryObjectException("Duplicate type ID [clsName=" + clsName + ", id=" + id + ']');
+
+        if (mappers.put(id, idMapper) != null)
+            throw new BinaryObjectException("Duplicate type ID [clsName=" + clsName + ", id=" + id + ']');
+
+        if (affKeyFieldName != null) {
+            if (affKeyFieldNames.put(id, affKeyFieldName) != null)
+                throw new BinaryObjectException("Duplicate type ID [clsName=" + clsName + ", id=" + id + ']');
+        }
+
+        typeMappers.put(typeName, idMapper);
+
+        Map<String, Integer> fieldsMeta = null;
+        Collection<BinarySchema> schemas = null;
+
+        if (cls != null) {
+            BinaryClassDescriptor desc = new BinaryClassDescriptor(
+                this,
+                cls,
+                true,
+                id,
+                typeName,
+                affKeyFieldName,
+                idMapper,
+                serializer,
+                true,
+                true, /* registered */
+                false /* predefined */
+            );
+
+            fieldsMeta = desc.fieldsMeta();
+            schemas = desc.schema() != null ? Collections.singleton(desc.schema()) : null;
+
+            if (IgniteUtils.detectClassLoader(cls).equals(dfltLdr))
+                userTypes.put(id, desc);
+
+            descByCls.put(cls, desc);
+        }
+
+        metaHnd.addMeta(id, new BinaryMetadata(id, typeName, fieldsMeta, affKeyFieldName, schemas, isEnum).wrap(this));
+    }
+
+    /**
+     * Create binary field.
+     *
+     * @param typeId Type ID.
+     * @param fieldName Field name.
+     * @return Binary field.
+     */
+    public BinaryFieldImpl createField(int typeId, String fieldName) {
+        BinarySchemaRegistry schemaReg = schemaRegistry(typeId);
+
+        int fieldId = userTypeIdMapper(typeId).fieldId(typeId, fieldName);
+
+        return new BinaryFieldImpl(typeId, schemaReg, fieldName, fieldId);
+    }
+
+    /**
+     * @param typeId Type ID.
+     * @return Meta data.
+     * @throws BinaryObjectException In case of error.
+     */
+    @Nullable public BinaryType metadata(int typeId) throws BinaryObjectException {
+        return metaHnd != null ? metaHnd.metadata(typeId) : null;
+    }
+
+    /**
+     * @param typeId Type ID.
+     * @return Affinity key field name.
+     */
+    public String affinityKeyFieldName(int typeId) {
+        return affKeyFieldNames.get(typeId);
+    }
+
+    /**
+     * @param typeId Type ID.
+     * @param meta Meta data.
+     * @throws BinaryObjectException In case of error.
+     */
+    public void updateMetadata(int typeId, BinaryMetadata meta) throws BinaryObjectException {
+        metaHnd.addMeta(typeId, meta.wrap(this));
+    }
+
+    /**
+     * @return Whether field IDs should be skipped in footer or not.
+     */
+    public boolean isCompactFooter() {
+        return compactFooter;
+    }
+
+    /**
+     * Get schema registry for type ID.
+     *
+     * @param typeId Type ID.
+     * @return Schema registry for type ID.
+     */
+    public BinarySchemaRegistry schemaRegistry(int typeId) {
+        Map<Integer, BinarySchemaRegistry> schemas0 = schemas;
+
+        if (schemas0 == null) {
+            synchronized (this) {
+                schemas0 = schemas;
+
+                if (schemas0 == null) {
+                    schemas0 = new HashMap<>();
+
+                    BinarySchemaRegistry reg = new BinarySchemaRegistry();
+
+                    schemas0.put(typeId, reg);
+
+                    schemas = schemas0;
+
+                    return reg;
+                }
+            }
+        }
+
+        BinarySchemaRegistry reg = schemas0.get(typeId);
+
+        if (reg == null) {
+            synchronized (this) {
+                reg = schemas.get(typeId);
+
+                if (reg == null) {
+                    reg = new BinarySchemaRegistry();
+
+                    schemas0 = new HashMap<>(schemas);
+
+                    schemas0.put(typeId, reg);
+
+                    schemas = schemas0;
+                }
+            }
+        }
+
+        return reg;
+    }
+
+    /**
+     * Returns instance of {@link OptimizedMarshaller}.
+     *
+     * @return Optimized marshaller.
+     */
+    OptimizedMarshaller optimizedMarsh() {
+        return optmMarsh;
+    }
+
+    /**
+     * @param clsName Class name.
+     * @return Type name.
+     */
+    @SuppressWarnings("ResultOfMethodCallIgnored")
+    public static String typeName(String clsName) {
+        assert clsName != null;
+
+        int idx = clsName.lastIndexOf('$');
+
+        if (idx == clsName.length() - 1)
+            // This is a regular (not inner) class name that ends with '$'. Common use case for Scala classes.
+            idx = -1;
+        else if (idx >= 0) {
+            String typeName = clsName.substring(idx + 1);
+
+            try {
+                Integer.parseInt(typeName);
+
+                // This is an anonymous class. Don't cut off enclosing class name for it.
+                idx = -1;
+            }
+            catch (NumberFormatException ignore) {
+                // This is a lambda class.
+                if (clsName.indexOf("$$Lambda$") > 0)
+                    idx = -1;
+                else
+                    return typeName;
+            }
+        }
+
+        if (idx < 0)
+            idx = clsName.lastIndexOf('.');
+
+        return idx >= 0 ? clsName.substring(idx + 1) : clsName;
+    }
+
+    /**
+     * Undeployment callback invoked when class loader is being undeployed.
+     *
+     * Some marshallers may want to clean their internal state that uses the undeployed class loader somehow.
+     *
+     * @param ldr Class loader being undeployed.
+     */
+    public void onUndeploy(ClassLoader ldr) {
+        for (Class<?> cls : descByCls.keySet()) {
+            if (ldr.equals(cls.getClassLoader()))
+                descByCls.remove(cls);
+        }
+
+        U.clearClassCache(ldr);
+    }
+
+    /**
+     * Type descriptors.
+     */
+    private static class TypeDescriptors {
+        /** Descriptors map. */
+        private final Map<String, TypeDescriptor> descs = new LinkedHashMap<>();
+
+        /**
+         * Add type descriptor.
+         *
+         * @param clsName Class name.
+         * @param idMapper ID mapper.
+         * @param serializer Serializer.
+         * @param affKeyFieldName Affinity key field name.
+         * @param isEnum Enum flag.
+         * @param canOverride Whether this descriptor can be override.
+         * @throws BinaryObjectException If failed.
+         */
+        private void add(String clsName,
+            BinaryIdMapper idMapper,
+            BinarySerializer serializer,
+            String affKeyFieldName,
+            boolean isEnum,
+            boolean canOverride)
+            throws BinaryObjectException {
+            TypeDescriptor desc = new TypeDescriptor(clsName,
+                idMapper,
+                serializer,
+                affKeyFieldName,
+                isEnum,
+                canOverride);
+
+            TypeDescriptor oldDesc = descs.get(clsName);
+
+            if (oldDesc == null)
+                descs.put(clsName, desc);
+            else
+                oldDesc.override(desc);
+        }
+
+        /**
+         * Get all collected descriptors.
+         *
+         * @return Descriptors.
+         */
+        private Iterable<TypeDescriptor> descriptors() {
+            return descs.values();
+        }
+    }
+
+    /**
+     * Type descriptor.
+     */
+    private static class TypeDescriptor {
+        /** Class name. */
+        private final String clsName;
+
+        /** ID mapper. */
+        private BinaryIdMapper idMapper;
+
+        /** Serializer. */
+        private BinarySerializer serializer;
+
+        /** Affinity key field name. */
+        private String affKeyFieldName;
+
+        /** Enum flag. */
+        private boolean isEnum;
+
+        /** Whether this descriptor can be override. */
+        private boolean canOverride;
+
+        /**
+         * Constructor.
+         *
+         * @param clsName Class name.
+         * @param idMapper ID mapper.
+         * @param serializer Serializer.
+         * @param affKeyFieldName Affinity key field name.
+         * @param isEnum Enum type.
+         * @param canOverride Whether this descriptor can be override.
+         */
+        private TypeDescriptor(String clsName, BinaryIdMapper idMapper, BinarySerializer serializer,
+            String affKeyFieldName, boolean isEnum, boolean canOverride) {
+            this.clsName = clsName;
+            this.idMapper = idMapper;
+            this.serializer = serializer;
+            this.affKeyFieldName = affKeyFieldName;
+            this.isEnum = isEnum;
+            this.canOverride = canOverride;
+        }
+
+        /**
+         * Override portable class descriptor.
+         *
+         * @param other Other descriptor.
+         * @throws BinaryObjectException If failed.
+         */
+        private void override(TypeDescriptor other) throws BinaryObjectException {
+            assert clsName.equals(other.clsName);
+
+            if (canOverride) {
+                idMapper = other.idMapper;
+                serializer = other.serializer;
+                affKeyFieldName = other.affKeyFieldName;
+                canOverride = other.canOverride;
+            }
+            else if (!other.canOverride)
+                throw new BinaryObjectException("Duplicate explicit class definition in configuration: " + clsName);
+        }
+    }
+
+    /**
+     * Type id wrapper.
+     */
+    static class Type {
+        /** Type id */
+        private final int id;
+
+        /** Whether the following type is registered in a cache or not */
+        private final boolean registered;
+
+        /**
+         * @param id Id.
+         * @param registered Registered.
+         */
+        public Type(int id, boolean registered) {
+            this.id = id;
+            this.registered = registered;
+        }
+
+        /**
+         * @return Type ID.
+         */
+        public int id() {
+            return id;
+        }
+
+        /**
+         * @return Registered flag value.
+         */
+        public boolean registered() {
+            return registered;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/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 15e42e3..3321170 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
@@ -45,7 +45,7 @@ public class BinaryEnumObjectImpl implements BinaryObjectEx, Externalizable, Cac
 
     /** Context. */
     @GridDirectTransient
-    private PortableContext ctx;
+    private BinaryContext ctx;
 
     /** Type ID. */
     private int typeId;
@@ -71,7 +71,7 @@ public class BinaryEnumObjectImpl implements BinaryObjectEx, Externalizable, Cac
      * @param clsName Class name.
      * @param ord Ordinal.
      */
-    public BinaryEnumObjectImpl(PortableContext ctx, int typeId, @Nullable String clsName, int ord) {
+    public BinaryEnumObjectImpl(BinaryContext ctx, int typeId, @Nullable String clsName, int ord) {
         assert ctx != null;
 
         this.ctx = ctx;
@@ -110,7 +110,7 @@ public class BinaryEnumObjectImpl implements BinaryObjectEx, Externalizable, Cac
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public <T> T deserialize() throws BinaryObjectException {
-        Class cls = PortableUtils.resolveClass(ctx, typeId, clsName, null, true);
+        Class cls = BinaryUtils.resolveClass(ctx, typeId, clsName, null, true);
 
         return BinaryEnumCache.get(cls, ord);
     }
@@ -167,7 +167,7 @@ public class BinaryEnumObjectImpl implements BinaryObjectEx, Externalizable, Cac
             return type.typeName() + "[ordinal=" + ord  + ']';
         }
         else {
-            if (typeId == GridPortableMarshaller.UNREGISTERED_TYPE_ID)
+            if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID)
                 return "BinaryEnum[clsName=" + clsName + ", ordinal=" + ord + ']';
             else
                 return "BinaryEnum[typeId=" + typeId + ", ordinal=" + ord + ']';
@@ -185,7 +185,7 @@ public class BinaryEnumObjectImpl implements BinaryObjectEx, Externalizable, Cac
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        ctx = (PortableContext)in.readObject();
+        ctx = (BinaryContext)in.readObject();
 
         typeId = in.readInt();
         clsName = (String)in.readObject();

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java
index 962805d..8cf1a11 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryFieldAccessor.java
@@ -48,7 +48,7 @@ public abstract class BinaryFieldAccessor {
      * @return Accessor.
      */
     public static BinaryFieldAccessor create(Field field, int id) {
-        BinaryWriteMode mode = PortableUtils.mode(field.getType());
+        BinaryWriteMode mode = BinaryUtils.mode(field.getType());
 
         switch (mode) {
             case P_BYTE:
@@ -849,7 +849,7 @@ public abstract class BinaryFieldAccessor {
          */
         protected BinaryWriteMode mode(Object val) {
             return dynamic ?
-                val == null ? BinaryWriteMode.OBJECT : PortableUtils.mode(val.getClass()) :
+                val == null ? BinaryWriteMode.OBJECT : BinaryUtils.mode(val.getClass()) :
                 mode;
         }
     }


[02/50] [abbrv] ignite git commit: Changed docker file.

Posted by vo...@apache.org.
Changed docker file.


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

Branch: refs/heads/ignite-2100
Commit: ec1ffe13465221c497e603eb51dc690bc8a16f3d
Parents: 9a02acb
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Fri Dec 11 16:47:57 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Fri Dec 11 16:47:57 2015 +0300

----------------------------------------------------------------------
 modules/docker/1.0.0/Dockerfile    | 40 +++++++++++++++++++++
 modules/docker/1.0.0/run.sh        | 50 ++++++++++++++++++++++++++
 modules/docker/1.1.0/Dockerfile    | 40 +++++++++++++++++++++
 modules/docker/1.1.0/run.sh        | 50 ++++++++++++++++++++++++++
 modules/docker/1.2.0/Dockerfile    | 40 +++++++++++++++++++++
 modules/docker/1.2.0/run.sh        | 50 ++++++++++++++++++++++++++
 modules/docker/1.3.0/Dockerfile    | 40 +++++++++++++++++++++
 modules/docker/1.3.0/run.sh        | 50 ++++++++++++++++++++++++++
 modules/docker/1.4.0/Dockerfile    | 40 +++++++++++++++++++++
 modules/docker/1.4.0/run.sh        | 50 ++++++++++++++++++++++++++
 modules/docker/Dockerfile          | 41 +++++++---------------
 modules/docker/build_users_libs.sh | 39 ---------------------
 modules/docker/download_ignite.sh  | 49 --------------------------
 modules/docker/execute.sh          | 62 ---------------------------------
 modules/docker/run.sh              | 36 +++++++++++++------
 15 files changed, 489 insertions(+), 188 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/1.0.0/Dockerfile
----------------------------------------------------------------------
diff --git a/modules/docker/1.0.0/Dockerfile b/modules/docker/1.0.0/Dockerfile
new file mode 100644
index 0000000..79c35c8
--- /dev/null
+++ b/modules/docker/1.0.0/Dockerfile
@@ -0,0 +1,40 @@
+#
+# 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.
+#
+
+# Start from a Java image.
+FROM java:7
+
+# Ignite version
+ENV IGNITE_VERSION 1.0.0-incubating
+
+WORKDIR /opt/ignite
+
+ADD http://www.us.apache.org/dist/ignite/1.0.0/ignite-fabric-1.0.0-incubating.zip /opt/ignite/ignite.zip
+
+# Ignite home
+ENV IGNITE_HOME /opt/ignite/ignite-fabric-1.0.0-incubating
+
+RUN unzip ignite.zip
+
+RUN rm ignite.zip
+
+# Copy sh files and set permission
+ADD ./run.sh $IGNITE_HOME/
+
+RUN chmod +x $IGNITE_HOME/run.sh
+
+CMD $IGNITE_HOME/run.sh
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/1.0.0/run.sh
----------------------------------------------------------------------
diff --git a/modules/docker/1.0.0/run.sh b/modules/docker/1.0.0/run.sh
new file mode 100644
index 0000000..dbf2871
--- /dev/null
+++ b/modules/docker/1.0.0/run.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+#
+# 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.
+#
+
+if [ ! -z "$OPTION_LIBS" ]; then
+  IFS=, LIBS_LIST=("$OPTION_LIBS")
+
+  for lib in ${LIBS_LIST[@]}; do
+    cp -r $IGNITE_HOME/libs/optional/"$lib"/* \
+        $IGNITE_HOME/libs/
+  done
+fi
+
+if [ ! -z "$EXTERNAL_LIBS" ]; then
+  IFS=, LIBS_LIST=("$EXTERNAL_LIBS")
+
+  for lib in ${LIBS_LIST[@]}; do
+    echo $lib >> temp
+  done
+
+  wget -i temp -P $IGNITE_HOME/libs
+
+  rm temp
+fi
+
+QUIET=""
+
+if [ "$IGNITE_QUIET" = "false" ]; then
+  QUIET="-v"
+fi
+
+if [ -z $CONFIG_URI ]; then
+  $IGNITE_HOME/bin/ignite.sh $QUIET
+else
+  $IGNITE_HOME/bin/ignite.sh $QUIET $CONFIG_URI
+fi

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/1.1.0/Dockerfile
----------------------------------------------------------------------
diff --git a/modules/docker/1.1.0/Dockerfile b/modules/docker/1.1.0/Dockerfile
new file mode 100644
index 0000000..f132309
--- /dev/null
+++ b/modules/docker/1.1.0/Dockerfile
@@ -0,0 +1,40 @@
+#
+# 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.
+#
+
+# Start from a Java image.
+FROM java:7
+
+# Ignite version
+ENV IGNITE_VERSION 1.1.0-incubating
+
+WORKDIR /opt/ignite
+
+ADD http://www.us.apache.org/dist/ignite/1.1.0/apache-ignite-fabric-1.1.0-incubating-bin.zip /opt/ignite/ignite.zip
+
+# Ignite home
+ENV IGNITE_HOME /opt/ignite/apache-ignite-fabric-1.1.0-incubating-bin
+
+RUN unzip ignite.zip
+
+RUN rm ignite.zip
+
+# Copy sh files and set permission
+ADD ./run.sh $IGNITE_HOME/
+
+RUN chmod +x $IGNITE_HOME/run.sh
+
+CMD $IGNITE_HOME/run.sh
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/1.1.0/run.sh
----------------------------------------------------------------------
diff --git a/modules/docker/1.1.0/run.sh b/modules/docker/1.1.0/run.sh
new file mode 100644
index 0000000..dbf2871
--- /dev/null
+++ b/modules/docker/1.1.0/run.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+#
+# 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.
+#
+
+if [ ! -z "$OPTION_LIBS" ]; then
+  IFS=, LIBS_LIST=("$OPTION_LIBS")
+
+  for lib in ${LIBS_LIST[@]}; do
+    cp -r $IGNITE_HOME/libs/optional/"$lib"/* \
+        $IGNITE_HOME/libs/
+  done
+fi
+
+if [ ! -z "$EXTERNAL_LIBS" ]; then
+  IFS=, LIBS_LIST=("$EXTERNAL_LIBS")
+
+  for lib in ${LIBS_LIST[@]}; do
+    echo $lib >> temp
+  done
+
+  wget -i temp -P $IGNITE_HOME/libs
+
+  rm temp
+fi
+
+QUIET=""
+
+if [ "$IGNITE_QUIET" = "false" ]; then
+  QUIET="-v"
+fi
+
+if [ -z $CONFIG_URI ]; then
+  $IGNITE_HOME/bin/ignite.sh $QUIET
+else
+  $IGNITE_HOME/bin/ignite.sh $QUIET $CONFIG_URI
+fi

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/1.2.0/Dockerfile
----------------------------------------------------------------------
diff --git a/modules/docker/1.2.0/Dockerfile b/modules/docker/1.2.0/Dockerfile
new file mode 100644
index 0000000..b4b1a4a
--- /dev/null
+++ b/modules/docker/1.2.0/Dockerfile
@@ -0,0 +1,40 @@
+#
+# 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.
+#
+
+# Start from a Java image.
+FROM java:7
+
+# Ignite version
+ENV IGNITE_VERSION 1.2.0-incubating
+
+WORKDIR /opt/ignite
+
+ADD http://www.us.apache.org/dist/ignite/1.2.0/apache-ignite-fabric-1.2.0-incubating-bin.zip /opt/ignite/ignite.zip
+
+# Ignite home
+ENV IGNITE_HOME /opt/ignite/apache-ignite-fabric-1.2.0-incubating-bin
+
+RUN unzip ignite.zip
+
+RUN rm ignite.zip
+
+# Copy sh files and set permission
+ADD ./run.sh $IGNITE_HOME/
+
+RUN chmod +x $IGNITE_HOME/run.sh
+
+CMD $IGNITE_HOME/run.sh
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/1.2.0/run.sh
----------------------------------------------------------------------
diff --git a/modules/docker/1.2.0/run.sh b/modules/docker/1.2.0/run.sh
new file mode 100644
index 0000000..dbf2871
--- /dev/null
+++ b/modules/docker/1.2.0/run.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+#
+# 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.
+#
+
+if [ ! -z "$OPTION_LIBS" ]; then
+  IFS=, LIBS_LIST=("$OPTION_LIBS")
+
+  for lib in ${LIBS_LIST[@]}; do
+    cp -r $IGNITE_HOME/libs/optional/"$lib"/* \
+        $IGNITE_HOME/libs/
+  done
+fi
+
+if [ ! -z "$EXTERNAL_LIBS" ]; then
+  IFS=, LIBS_LIST=("$EXTERNAL_LIBS")
+
+  for lib in ${LIBS_LIST[@]}; do
+    echo $lib >> temp
+  done
+
+  wget -i temp -P $IGNITE_HOME/libs
+
+  rm temp
+fi
+
+QUIET=""
+
+if [ "$IGNITE_QUIET" = "false" ]; then
+  QUIET="-v"
+fi
+
+if [ -z $CONFIG_URI ]; then
+  $IGNITE_HOME/bin/ignite.sh $QUIET
+else
+  $IGNITE_HOME/bin/ignite.sh $QUIET $CONFIG_URI
+fi

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/1.3.0/Dockerfile
----------------------------------------------------------------------
diff --git a/modules/docker/1.3.0/Dockerfile b/modules/docker/1.3.0/Dockerfile
new file mode 100644
index 0000000..eade9d9
--- /dev/null
+++ b/modules/docker/1.3.0/Dockerfile
@@ -0,0 +1,40 @@
+#
+# 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.
+#
+
+# Start from a Java image.
+FROM java:7
+
+# Ignite version
+ENV IGNITE_VERSION 1.3.0-incubating
+
+WORKDIR /opt/ignite
+
+ADD http://www.us.apache.org/dist/ignite/1.3.0/apache-ignite-fabric-1.3.0-incubating-bin.zip /opt/ignite/ignite.zip
+
+# Ignite home
+ENV IGNITE_HOME /opt/ignite/apache-ignite-fabric-1.3.0-incubating-bin
+
+RUN unzip ignite.zip
+
+RUN rm ignite.zip
+
+# Copy sh files and set permission
+ADD ./run.sh $IGNITE_HOME/
+
+RUN chmod +x $IGNITE_HOME/run.sh
+
+CMD $IGNITE_HOME/run.sh
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/1.3.0/run.sh
----------------------------------------------------------------------
diff --git a/modules/docker/1.3.0/run.sh b/modules/docker/1.3.0/run.sh
new file mode 100644
index 0000000..dbf2871
--- /dev/null
+++ b/modules/docker/1.3.0/run.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+#
+# 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.
+#
+
+if [ ! -z "$OPTION_LIBS" ]; then
+  IFS=, LIBS_LIST=("$OPTION_LIBS")
+
+  for lib in ${LIBS_LIST[@]}; do
+    cp -r $IGNITE_HOME/libs/optional/"$lib"/* \
+        $IGNITE_HOME/libs/
+  done
+fi
+
+if [ ! -z "$EXTERNAL_LIBS" ]; then
+  IFS=, LIBS_LIST=("$EXTERNAL_LIBS")
+
+  for lib in ${LIBS_LIST[@]}; do
+    echo $lib >> temp
+  done
+
+  wget -i temp -P $IGNITE_HOME/libs
+
+  rm temp
+fi
+
+QUIET=""
+
+if [ "$IGNITE_QUIET" = "false" ]; then
+  QUIET="-v"
+fi
+
+if [ -z $CONFIG_URI ]; then
+  $IGNITE_HOME/bin/ignite.sh $QUIET
+else
+  $IGNITE_HOME/bin/ignite.sh $QUIET $CONFIG_URI
+fi

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/1.4.0/Dockerfile
----------------------------------------------------------------------
diff --git a/modules/docker/1.4.0/Dockerfile b/modules/docker/1.4.0/Dockerfile
new file mode 100644
index 0000000..41f6a68
--- /dev/null
+++ b/modules/docker/1.4.0/Dockerfile
@@ -0,0 +1,40 @@
+#
+# 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.
+#
+
+# Start from a Java image.
+FROM java:7
+
+# Ignite version
+ENV IGNITE_VERSION 1.4.0
+
+WORKDIR /opt/ignite
+
+ADD http://www.us.apache.org/dist/ignite/1.4.0/apache-ignite-fabric-1.4.0-bin.zip /opt/ignite/ignite.zip
+
+# Ignite home
+ENV IGNITE_HOME /opt/ignite/apache-ignite-fabric-1.4.0-bin
+
+RUN unzip ignite.zip
+
+RUN rm ignite.zip
+
+# Copy sh files and set permission
+ADD ./run.sh $IGNITE_HOME/
+
+RUN chmod +x $IGNITE_HOME/run.sh
+
+CMD $IGNITE_HOME/run.sh
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/1.4.0/run.sh
----------------------------------------------------------------------
diff --git a/modules/docker/1.4.0/run.sh b/modules/docker/1.4.0/run.sh
new file mode 100644
index 0000000..dbf2871
--- /dev/null
+++ b/modules/docker/1.4.0/run.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+#
+# 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.
+#
+
+if [ ! -z "$OPTION_LIBS" ]; then
+  IFS=, LIBS_LIST=("$OPTION_LIBS")
+
+  for lib in ${LIBS_LIST[@]}; do
+    cp -r $IGNITE_HOME/libs/optional/"$lib"/* \
+        $IGNITE_HOME/libs/
+  done
+fi
+
+if [ ! -z "$EXTERNAL_LIBS" ]; then
+  IFS=, LIBS_LIST=("$EXTERNAL_LIBS")
+
+  for lib in ${LIBS_LIST[@]}; do
+    echo $lib >> temp
+  done
+
+  wget -i temp -P $IGNITE_HOME/libs
+
+  rm temp
+fi
+
+QUIET=""
+
+if [ "$IGNITE_QUIET" = "false" ]; then
+  QUIET="-v"
+fi
+
+if [ -z $CONFIG_URI ]; then
+  $IGNITE_HOME/bin/ignite.sh $QUIET
+else
+  $IGNITE_HOME/bin/ignite.sh $QUIET $CONFIG_URI
+fi

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/Dockerfile
----------------------------------------------------------------------
diff --git a/modules/docker/Dockerfile b/modules/docker/Dockerfile
index 11e2e3d..11be2b4 100644
--- a/modules/docker/Dockerfile
+++ b/modules/docker/Dockerfile
@@ -15,41 +15,26 @@
 # limitations under the License.
 #
 
-# Start from a Debian image.
-FROM debian:8
+# Start from a Java image.
+FROM java:7
 
-# Install tools.
-RUN apt-get update && apt-get install -y --fix-missing \
-  wget \
-  dstat \
-  maven \
-  git
+# Ignite version
+ENV IGNITE_VERSION 1.5.0-b1
 
-# Intasll Oracle JDK.
-RUN mkdir /opt/jdk
+WORKDIR /opt/ignite
 
-RUN wget --header "Cookie: oraclelicense=accept-securebackup-cookie" \
-  http://download.oracle.com/otn-pub/java/jdk/7u76-b13/jdk-7u76-linux-x64.tar.gz
+ADD http://www.us.apache.org/dist/ignite/1.5.0-b1/apache-ignite-fabric-1.5.0-b1-bin.zip /opt/ignite/ignite.zip
 
-RUN tar -zxf jdk-7u76-linux-x64.tar.gz -C /opt/jdk
+# Ignite home
+ENV IGNITE_HOME /opt/ignite/apache-ignite-fabric-1.5.0-b1-bin
 
-RUN rm jdk-7u76-linux-x64.tar.gz
+RUN unzip ignite.zip
 
-RUN update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.7.0_76/bin/java 100
-
-RUN update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.7.0_76/bin/javac 100
-
-# Sets java variables.
-ENV JAVA_HOME /opt/jdk/jdk1.7.0_76/
-
-# Create working directory
-RUN mkdir /home/ignite_home
-
-WORKDIR /home/ignite_home
+RUN rm ignite.zip
 
 # Copy sh files and set permission
-ADD *.sh ./
+ADD ./run.sh $IGNITE_HOME/
 
-RUN chmod +x *.sh
+RUN chmod +x $IGNITE_HOME/run.sh
 
-CMD ./run.sh
\ No newline at end of file
+CMD $IGNITE_HOME/run.sh
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/build_users_libs.sh
----------------------------------------------------------------------
diff --git a/modules/docker/build_users_libs.sh b/modules/docker/build_users_libs.sh
deleted file mode 100644
index 4d37187..0000000
--- a/modules/docker/build_users_libs.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-if [ -z $GIT_REPO ]; then
-  echo Users git repo is not provided.
-
-  exit 0
-fi
-
-git clone $GIT_REPO user-repo
-
-cd user-repo
-
-if [ ! -z $GIT_BRANCH ]; then
-  git checkout $GIT_BRANCH
-fi
-
-if [ ! -z "$BUILD_CMD" ]; then
-  echo "Starting to execute build command: $BUILD_CMD"
-
-  eval "$BUILD_CMD"
-else
-  mvn clean package
-fi
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/download_ignite.sh
----------------------------------------------------------------------
diff --git a/modules/docker/download_ignite.sh b/modules/docker/download_ignite.sh
deleted file mode 100644
index 8a91c59..0000000
--- a/modules/docker/download_ignite.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-function download {
-  wget -O ignite.zip $1
-
-  unzip ignite.zip -d ignite
-
-  rm ignite.zip
-
-  exit 0
-}
-
-if [ ! -z $IGNITE_URL ]; then
-  download $IGNITE_URL
-fi
-
-if [ ! -z $IGNITE_VERSION ]; then
-  if [[ $IGNITE_VERSION  =~ [0-9]*\.[0-9]*\.0 ]]; then
-    download http://apache-mirror.rbc.ru/pub/apache/ignite/${IGNITE_VERSION}/apache-ignite-fabric-${IGNITE_VERSION}-bin.zip
-  else
-    download http://www.gridgain.com/media/gridgain-community-fabric-${IGNITE_VERSION}.zip
-  fi
-fi
-
-if [ -z $IGNITE_SOURCE ] || [ $IGNITE_SOURCE = "COMMUNITY" ]; then
-  download http://tiny.cc/updater/download_community.php
-fi
-
-if [ $IGNITE_SOURCE = "APACHE" ]; then
-  download http://tiny.cc/updater/download_ignite.php
-fi
-
-echo "Unsupported IGNITE_SOURCE type: ${IGNITE_SOURCE}"

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/execute.sh
----------------------------------------------------------------------
diff --git a/modules/docker/execute.sh b/modules/docker/execute.sh
deleted file mode 100644
index 8afba59..0000000
--- a/modules/docker/execute.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-if [ ! -z "$GIT_REPO" ]; then
-  if [ -z "$LIB_PATTERN" ]; then
-    find user-repo/ -regextype posix-extended -regex "user-repo/target/.*(jar|zip)$" -exec cp {} ignite/*/libs \;
-  else
-    find user-repo/ -regextype posix-extended -regex "$LIB_PATTERN" -exec cp {} ignite/*/libs \;
-  fi
-fi
-
-if [ -z "$OPTION_LIBS" ]; then
-  OPTION_LIBS="ignite-log4j"
-fi
-
-if [ ! -z "$OPTION_LIBS" ]; then
-  IFS=, LIBS_LIST=("$OPTION_LIBS")
-
-  for lib in ${LIBS_LIST[@]}; do
-    cp -r ./ignite/*/libs/optional/"$lib"/* ./ignite/*/libs
-  done
-fi
-
-# Try to download
-if [ ! -z "$IGNITE_CONFIG" ]; then
-  wget -O ignite-config.xml "$IGNITE_CONFIG" 2>/dev/null
-
-  RETVAL=$?
-
-  [ $RETVAL -eq 0 ] && IGNITE_CONFIG=ignite-config.xml
-
-  [ $RETVAL -ne 0 ] && rm ignite-config.xml && echo "Failed download config: $IGNITE_CONFIG. Try to load config from classpath."
-fi
-
-if [ ! -z "$EXEC_CMD" ]; then
-  echo "Starting to execute command: $EXEC_CMD"
-
-  eval "$EXEC_CMD"
-
-  exit 0
-fi
-
-if [ -z "$IGNITE_CONFIG" ]; then
-  ignite/*/bin/ignite.sh
-else
-  ignite/*/bin/ignite.sh ignite-config.xml
-fi
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/ec1ffe13/modules/docker/run.sh
----------------------------------------------------------------------
diff --git a/modules/docker/run.sh b/modules/docker/run.sh
index 0f01c1c..dbf2871 100644
--- a/modules/docker/run.sh
+++ b/modules/docker/run.sh
@@ -16,19 +16,35 @@
 # limitations under the License.
 #
 
-if [ -z $SKIP_BUILD_LIBS ]; then
-  ./build_users_libs.sh
+if [ ! -z "$OPTION_LIBS" ]; then
+  IFS=, LIBS_LIST=("$OPTION_LIBS")
 
-  PROJ_VER=$(mvn -f user-repo/pom.xml dependency:list | grep ':ignite-core:jar:.*:' | \
-    sed -rn 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/p')
+  for lib in ${LIBS_LIST[@]}; do
+    cp -r $IGNITE_HOME/libs/optional/"$lib"/* \
+        $IGNITE_HOME/libs/
+  done
+fi
+
+if [ ! -z "$EXTERNAL_LIBS" ]; then
+  IFS=, LIBS_LIST=("$EXTERNAL_LIBS")
+
+  for lib in ${LIBS_LIST[@]}; do
+    echo $lib >> temp
+  done
 
-  if [ ! -z $PROJ_VER ]; then
-    IGNITE_VERSION=$PROJ_VER
-  fi
+  wget -i temp -P $IGNITE_HOME/libs
+
+  rm temp
 fi
 
-if [ -z $SKIP_DOWNLOAD ]; then
-  IGNITE_VERSION=$IGNITE_VERSION ./download_ignite.sh
+QUIET=""
+
+if [ "$IGNITE_QUIET" = "false" ]; then
+  QUIET="-v"
 fi
 
-./execute.sh
\ No newline at end of file
+if [ -z $CONFIG_URI ]; then
+  $IGNITE_HOME/bin/ignite.sh $QUIET
+else
+  $IGNITE_HOME/bin/ignite.sh $QUIET $CONFIG_URI
+fi


[15/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary"

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java
new file mode 100644
index 0000000..99e642c
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchema.java
@@ -0,0 +1,466 @@
+/*
+ * 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.binary;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * Schema describing portable object content. We rely on the following assumptions:
+ * - When amount of fields in the object is low, it is better to inline these values into int fields thus allowing
+ * for quick comparisons performed within already fetched L1 cache line.
+ * - When there are more fields, we store them inside a hash map.
+ */
+public class BinarySchema implements Externalizable {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Order returned if field is not found. */
+    public static final int ORDER_NOT_FOUND = -1;
+
+    /** Minimum sensible size. */
+    private static final int MAP_MIN_SIZE = 32;
+
+    /** Empty cell. */
+    private static final int MAP_EMPTY = 0;
+
+    /** Schema ID. */
+    private int schemaId;
+
+    /** IDs depending on order. */
+    private int[] ids;
+
+    /** Interned names of associated fields. */
+    private String[] names;
+
+    /** ID-to-order data. */
+    private int[] idToOrderData;
+
+    /** ID-to-order mask. */
+    private int idToOrderMask;
+
+    /** ID 1. */
+    private int id0;
+
+    /** ID 2. */
+    private int id1;
+
+    /** ID 3. */
+    private int id2;
+
+    /** ID 4. */
+    private int id3;
+
+    /**
+     * {@link Externalizable} support.
+     */
+    public BinarySchema() {
+        // No-op.
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param schemaId Schema ID.
+     * @param fieldIds Field IDs.
+     */
+    private BinarySchema(int schemaId, List<Integer> fieldIds) {
+        assert fieldIds != null;
+
+        this.schemaId = schemaId;
+
+        initialize(fieldIds);
+    }
+
+    /**
+     * @return Schema ID.
+     */
+    public int schemaId() {
+        return schemaId;
+    }
+
+    /**
+     * Try speculatively confirming order for the given field name.
+     *
+     * @param expOrder Expected order.
+     * @param expName Expected name.
+     * @return Field ID.
+     */
+    @SuppressWarnings("StringEquality")
+    public Confirmation confirmOrder(int expOrder, String expName) {
+        assert expName != null;
+
+        if (expOrder < names.length) {
+            String name = names[expOrder];
+
+            // Note that we use only reference equality assuming that field names are interned literals.
+            if (name == expName)
+                return Confirmation.CONFIRMED;
+
+            if (name == null)
+                return Confirmation.CLARIFY;
+        }
+
+        return Confirmation.REJECTED;
+    }
+
+    /**
+     * Add field name.
+     *
+     * @param order Order.
+     * @param name Name.
+     */
+    public void clarifyFieldName(int order, String name) {
+        assert name != null;
+        assert order < names.length;
+
+        names[order] = name.intern();
+    }
+
+    /**
+     * Get field ID by order in footer.
+     *
+     * @param order Order.
+     * @return Field ID.
+     */
+    public int fieldId(int order) {
+        return order < ids.length ? ids[order] : 0;
+    }
+
+    /**
+     * Get field order in footer by field ID.
+     *
+     * @param id Field ID.
+     * @return Offset or {@code 0} if there is no such field.
+     */
+    public int order(int id) {
+        if (idToOrderData == null) {
+            if (id == id0)
+                return 0;
+
+            if (id == id1)
+                return 1;
+
+            if (id == id2)
+                return 2;
+
+            if (id == id3)
+                return 3;
+
+            return ORDER_NOT_FOUND;
+        }
+        else {
+            int idx = (id & idToOrderMask) << 1;
+
+            int curId = idToOrderData[idx];
+
+            if (id == curId) // Hit!
+                return idToOrderData[idx + 1];
+            else if (curId == MAP_EMPTY) // No such ID!
+                return ORDER_NOT_FOUND;
+            else {
+                // Unlikely collision scenario.
+                for (int i = 2; i < idToOrderData.length; i += 2) {
+                    int newIdx = (idx + i) % idToOrderData.length;
+
+                    assert newIdx < idToOrderData.length - 1;
+
+                    curId = idToOrderData[newIdx];
+
+                    if (id == curId)
+                        return idToOrderData[newIdx + 1];
+                    else if (curId == MAP_EMPTY)
+                        return ORDER_NOT_FOUND;
+                }
+
+                return ORDER_NOT_FOUND;
+            }
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public int hashCode() {
+        return schemaId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object o) {
+        return o != null && o instanceof BinarySchema && schemaId == ((BinarySchema)o).schemaId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeExternal(ObjectOutput out) throws IOException {
+        out.writeInt(schemaId);
+
+        out.writeInt(ids.length);
+
+        for (Integer id : ids)
+            out.writeInt(id);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+        schemaId = in.readInt();
+
+        int idsCnt = in.readInt();
+
+        List<Integer> fieldIds = new ArrayList<>(idsCnt);
+
+        for (int i = 0; i < idsCnt; i++)
+            fieldIds.add(in.readInt());
+
+        initialize(fieldIds);
+    }
+
+    /**
+     * Parse values.
+     *
+     * @param vals Values.
+     * @param size Proposed result size.
+     * @return Parse result.
+     */
+    private static ParseResult parse(int[] vals, int size) {
+        int mask = maskForPowerOfTwo(size);
+
+        int totalSize = size * 2;
+
+        int[] data = new int[totalSize];
+        int collisions = 0;
+
+        for (int order = 0; order < vals.length; order++) {
+            int id = vals[order];
+
+            assert id != 0;
+
+            int idIdx = (id & mask) << 1;
+
+            if (data[idIdx] == 0) {
+                // Found empty slot.
+                data[idIdx] = id;
+                data[idIdx + 1] = order;
+            }
+            else {
+                // Collision!
+                collisions++;
+
+                boolean placeFound = false;
+
+                for (int i = 2; i < totalSize; i += 2) {
+                    int newIdIdx = (idIdx + i) % totalSize;
+
+                    if (data[newIdIdx] == 0) {
+                        data[newIdIdx] = id;
+                        data[newIdIdx + 1] = order;
+
+                        placeFound = true;
+
+                        break;
+                    }
+                }
+
+                assert placeFound : "Should always have a place for entry!";
+            }
+        }
+
+        return new ParseResult(data, collisions);
+    }
+
+    /**
+     * Get next power of two which greater or equal to the given number.
+     * This implementation is not meant to be very efficient, so it is expected to be used relatively rare.
+     *
+     * @param val Number
+     * @return Nearest pow2.
+     */
+    private static int nextPowerOfTwo(int val) {
+        int res = 1;
+
+        while (res < val)
+            res = res << 1;
+
+        if (res < 0)
+            throw new IllegalArgumentException("Value is too big to find positive pow2: " + val);
+
+        return res;
+    }
+
+    /**
+     * Calculate mask for the given value which is a power of two.
+     *
+     * @param val Value.
+     * @return Mask.
+     */
+    private static int maskForPowerOfTwo(int val) {
+        int mask = 0;
+        int comparand = 1;
+
+        while (comparand < val) {
+            mask |= comparand;
+
+            comparand <<= 1;
+        }
+
+        return mask;
+    }
+
+    /**
+     * 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.
+     */
+    private void initializeMap(int[] vals) {
+        int size = Math.max(nextPowerOfTwo(vals.length) << 2, MAP_MIN_SIZE);
+
+        assert size > 0;
+
+        ParseResult finalRes;
+
+        ParseResult res1 = parse(vals, size);
+
+        if (res1.collisions == 0)
+            finalRes = res1;
+        else {
+            ParseResult res2 = parse(vals, size * 2);
+
+            // Failed to decrease aom
+            if (res2.collisions == 0)
+                finalRes = res2;
+            else
+                finalRes = parse(vals, size * 4);
+        }
+
+        idToOrderData = finalRes.data;
+        idToOrderMask = maskForPowerOfTwo(idToOrderData.length / 2);
+    }
+
+    /**
+     * Schema builder.
+     */
+    public static class Builder {
+        /** Schema ID. */
+        private int schemaId = BinaryUtils.schemaInitialId();
+
+        /** Fields. */
+        private final ArrayList<Integer> fields = new ArrayList<>();
+
+        /**
+         * Create new schema builder.
+         *
+         * @return Schema builder.
+         */
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        /**
+         * Private constructor.
+         */
+        private Builder() {
+            // No-op.
+        }
+
+        /**
+         * Add field.
+         *
+         * @param fieldId Field ID.
+         */
+        public void addField(int fieldId) {
+            fields.add(fieldId);
+
+            schemaId = BinaryUtils.updateSchemaId(schemaId, fieldId);
+        }
+
+        /**
+         * Build schema.
+         *
+         * @return Schema.
+         */
+        public BinarySchema build() {
+            return new BinarySchema(schemaId, fields);
+        }
+    }
+
+    /**
+     * Order confirmation result.
+     */
+    public enum Confirmation {
+        /** Confirmed. */
+        CONFIRMED,
+
+        /** Denied. */
+        REJECTED,
+
+        /** Field name clarification is needed. */
+        CLARIFY
+    }
+
+    /**
+     * Result of map parsing.
+     */
+    private static class ParseResult {
+        /** Data. */
+        private int[] data;
+
+        /** Collisions. */
+        private int collisions;
+
+        /**
+         * Constructor.
+         *
+         * @param data Data.
+         * @param collisions Collisions.
+         */
+        private ParseResult(int[] data, int collisions) {
+            this.data = data;
+            this.collisions = collisions;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java
new file mode 100644
index 0000000..6920a34
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinarySchemaRegistry.java
@@ -0,0 +1,172 @@
+/*
+ * 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.binary;
+
+import org.jetbrains.annotations.Nullable;
+
+import java.util.HashMap;
+
+/**
+ * Portable schema registry. Contains all well-known object schemas.
+ * <p>
+ * We rely on the fact that usually object has only few different schemas. For this reason we inline several
+ * of them with optional fallback to normal hash map lookup.
+ *
+ */
+public class BinarySchemaRegistry {
+    /** Empty schema ID. */
+    private static final int EMPTY = 0;
+
+    /** Whether registry still works in inline mode. */
+    private volatile boolean inline = true;
+
+    /** First schema ID. */
+    private int schemaId1;
+
+    /** Second schema ID. */
+    private int schemaId2;
+
+    /** Third schema ID. */
+    private int schemaId3;
+
+    /** Fourth schema ID. */
+    private int schemaId4;
+
+    /** First schema. */
+    private BinarySchema schema1;
+
+    /** Second schema. */
+    private BinarySchema schema2;
+
+    /** Third schema. */
+    private BinarySchema schema3;
+
+    /** Fourth schema. */
+    private BinarySchema schema4;
+
+    /** Schemas with COW semantics. */
+    private volatile HashMap<Integer, BinarySchema> schemas;
+
+    /**
+     * Get schema for the given ID. We rely on very relaxed memory semantics here assuming that it is not critical
+     * to return false-positive {@code null} values.
+     *
+     * @param schemaId Schema ID.
+     * @return Schema or {@code null}.
+     */
+    @Nullable public BinarySchema schema(int schemaId) {
+        if (inline) {
+            if (schemaId == schemaId1)
+                return schema1;
+            else if (schemaId == schemaId2)
+                return schema2;
+            else if (schemaId == schemaId3)
+                return schema3;
+            else if (schemaId == schemaId4)
+                return schema4;
+        }
+        else {
+            HashMap<Integer, BinarySchema> schemas0 = schemas;
+
+            // Null can be observed here due to either data race or race condition when switching to non-inlined mode.
+            // Both of them are benign for us because they lead only to unnecessary schema re-calc.
+            if (schemas0 != null)
+                return schemas0.get(schemaId);
+        }
+
+        return null;
+    }
+
+    /**
+     * Add schema.
+     *
+     * @param schemaId Schema ID.
+     * @param schema Schema.
+     */
+    public void addSchema(int schemaId, BinarySchema schema) {
+        synchronized (this) {
+            if (inline) {
+                // Check if this is already known schema.
+                if (schemaId == schemaId1 || schemaId == schemaId2 || schemaId == schemaId3 || schemaId == schemaId4)
+                    return;
+
+                // Try positioning new schema in inline mode.
+                if (schemaId1 == EMPTY) {
+                    schemaId1 = schemaId;
+
+                    schema1 = schema;
+
+                    inline = true; // Forcing HB edge just in case.
+
+                    return;
+                }
+
+                if (schemaId2 == EMPTY) {
+                    schemaId2 = schemaId;
+
+                    schema2 = schema;
+
+                    inline = true; // Forcing HB edge just in case.
+
+                    return;
+                }
+
+                if (schemaId3 == EMPTY) {
+                    schemaId3 = schemaId;
+
+                    schema3 = schema;
+
+                    inline = true; // Forcing HB edge just in case.
+
+                    return;
+                }
+
+                if (schemaId4 == EMPTY) {
+                    schemaId4 = schemaId;
+
+                    schema4 = schema;
+
+                    inline = true; // Forcing HB edge just in case.
+
+                    return;
+                }
+
+                // No luck, switching to hash map mode.
+                HashMap<Integer, BinarySchema> newSchemas = new HashMap<>();
+
+                newSchemas.put(schemaId1, schema1);
+                newSchemas.put(schemaId2, schema2);
+                newSchemas.put(schemaId3, schema3);
+                newSchemas.put(schemaId4, schema4);
+
+                newSchemas.put(schemaId, schema);
+
+                schemas = newSchemas;
+
+                inline = false;
+            }
+            else {
+                HashMap<Integer, BinarySchema> newSchemas = new HashMap<>(schemas);
+
+                newSchemas.put(schemaId, schema);
+
+                schemas = newSchemas;
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryThreadLocalContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryThreadLocalContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryThreadLocalContext.java
index 8fff80b..0ddd581 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryThreadLocalContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryThreadLocalContext.java
@@ -17,9 +17,8 @@
 
 package org.apache.ignite.internal.binary;
 
-import org.apache.ignite.internal.binary.streams.PortableMemoryAllocatorChunk;
-import org.apache.ignite.internal.binary.streams.PortableMemoryAllocator;
-import org.apache.ignite.internal.binary.streams.PortableMemoryAllocatorChunk;
+import org.apache.ignite.internal.binary.streams.BinaryMemoryAllocatorChunk;
+import org.apache.ignite.internal.binary.streams.BinaryMemoryAllocator;
 
 /**
  * Contains thread-local data for binary marshalling.
@@ -33,7 +32,7 @@ public class BinaryThreadLocalContext {
     };
 
     /** Memory chunk. */
-    private final PortableMemoryAllocatorChunk chunk = PortableMemoryAllocator.INSTANCE.chunk();
+    private final BinaryMemoryAllocatorChunk chunk = BinaryMemoryAllocator.INSTANCE.chunk();
 
     /** Schema holder. */
     private final BinaryWriterSchemaHolder schema = new BinaryWriterSchemaHolder();
@@ -57,7 +56,7 @@ public class BinaryThreadLocalContext {
     /**
      * @return Memory chunk.
      */
-    public PortableMemoryAllocatorChunk chunk() {
+    public BinaryMemoryAllocatorChunk chunk() {
         return chunk;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java
index d19076b..23aacb2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryTypeImpl.java
@@ -26,7 +26,7 @@ import java.util.Collection;
  */
 public class BinaryTypeImpl implements BinaryType {
     /** Portable context. */
-    private final PortableContext ctx;
+    private final BinaryContext ctx;
 
     /** Type metadata. */
     private final BinaryMetadata meta;
@@ -37,7 +37,7 @@ public class BinaryTypeImpl implements BinaryType {
      * @param ctx Portable context.
      * @param meta Type  metadata.
      */
-    public BinaryTypeImpl(PortableContext ctx, BinaryMetadata meta) {
+    public BinaryTypeImpl(BinaryContext ctx, BinaryMetadata meta) {
         this.ctx = ctx;
         this.meta = meta;
     }
@@ -80,7 +80,7 @@ public class BinaryTypeImpl implements BinaryType {
     /**
      * @return Context.
      */
-    public PortableContext context() {
+    public BinaryContext context() {
         return ctx;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/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
new file mode 100644
index 0000000..d285df5
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
@@ -0,0 +1,1859 @@
+/*
+ * 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.binary;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.binary.BinaryCollectionFactory;
+import org.apache.ignite.binary.BinaryInvalidTypeException;
+import org.apache.ignite.binary.BinaryMapFactory;
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.internal.binary.builder.BinaryLazyValue;
+import org.apache.ignite.internal.binary.streams.BinaryInputStream;
+import org.apache.ignite.internal.util.typedef.F;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.jetbrains.annotations.Nullable;
+import org.jsr166.ConcurrentHashMap8;
+
+import java.io.ByteArrayInputStream;
+import java.io.Externalizable;
+import java.lang.reflect.Array;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentSkipListSet;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+/**
+ * Portable utils.
+ */
+public class BinaryUtils {
+    /** */
+    public static final Map<Class<?>, Byte> PLAIN_CLASS_TO_FLAG = new HashMap<>();
+
+    /** */
+    public static final Map<Byte, Class<?>> FLAG_TO_CLASS = new HashMap<>();
+
+    /** {@code true} if serialized value of this type cannot contain references to objects. */
+    private static final boolean[] PLAIN_TYPE_FLAG = new boolean[102];
+
+    /** Portable classes. */
+    private static final Collection<Class<?>> PORTABLE_CLS = new HashSet<>();
+
+    /** Flag: user type. */
+    public static final short FLAG_USR_TYP = 0x0001;
+
+    /** Flag: only raw data exists. */
+    public static final short FLAG_HAS_SCHEMA = 0x0002;
+
+    /** Flag indicating that object has raw data. */
+    public static final short FLAG_HAS_RAW = 0x0004;
+
+    /** Flag: offsets take 1 byte. */
+    public static final short FLAG_OFFSET_ONE_BYTE = 0x0008;
+
+    /** Flag: offsets take 2 bytes. */
+    public static final short FLAG_OFFSET_TWO_BYTES = 0x0010;
+
+    /** Flag: compact footer, no field IDs. */
+    public static final short FLAG_COMPACT_FOOTER = 0x0020;
+
+    /** Offset which fits into 1 byte. */
+    public static final int OFFSET_1 = 1;
+
+    /** Offset which fits into 2 bytes. */
+    public static final int OFFSET_2 = 2;
+
+    /** Offset which fits into 4 bytes. */
+    public static final int OFFSET_4 = 4;
+
+    /** Field ID length. */
+    public static final int FIELD_ID_LEN = 4;
+
+    /** Field type names. */
+    private static final String[] FIELD_TYPE_NAMES;
+
+    /** FNV1 hash offset basis. */
+    private static final int FNV1_OFFSET_BASIS = 0x811C9DC5;
+
+    /** FNV1 hash prime. */
+    private static final int FNV1_PRIME = 0x01000193;
+
+    /**
+     * Static class initializer.
+     */
+    static {
+        PLAIN_CLASS_TO_FLAG.put(Byte.class, GridBinaryMarshaller.BYTE);
+        PLAIN_CLASS_TO_FLAG.put(Short.class, GridBinaryMarshaller.SHORT);
+        PLAIN_CLASS_TO_FLAG.put(Integer.class, GridBinaryMarshaller.INT);
+        PLAIN_CLASS_TO_FLAG.put(Long.class, GridBinaryMarshaller.LONG);
+        PLAIN_CLASS_TO_FLAG.put(Float.class, GridBinaryMarshaller.FLOAT);
+        PLAIN_CLASS_TO_FLAG.put(Double.class, GridBinaryMarshaller.DOUBLE);
+        PLAIN_CLASS_TO_FLAG.put(Character.class, GridBinaryMarshaller.CHAR);
+        PLAIN_CLASS_TO_FLAG.put(Boolean.class, GridBinaryMarshaller.BOOLEAN);
+        PLAIN_CLASS_TO_FLAG.put(BigDecimal.class, GridBinaryMarshaller.DECIMAL);
+        PLAIN_CLASS_TO_FLAG.put(String.class, GridBinaryMarshaller.STRING);
+        PLAIN_CLASS_TO_FLAG.put(UUID.class, GridBinaryMarshaller.UUID);
+        PLAIN_CLASS_TO_FLAG.put(Date.class, GridBinaryMarshaller.DATE);
+        PLAIN_CLASS_TO_FLAG.put(Timestamp.class, GridBinaryMarshaller.TIMESTAMP);
+
+        PLAIN_CLASS_TO_FLAG.put(byte[].class, GridBinaryMarshaller.BYTE_ARR);
+        PLAIN_CLASS_TO_FLAG.put(short[].class, GridBinaryMarshaller.SHORT_ARR);
+        PLAIN_CLASS_TO_FLAG.put(int[].class, GridBinaryMarshaller.INT_ARR);
+        PLAIN_CLASS_TO_FLAG.put(long[].class, GridBinaryMarshaller.LONG_ARR);
+        PLAIN_CLASS_TO_FLAG.put(float[].class, GridBinaryMarshaller.FLOAT_ARR);
+        PLAIN_CLASS_TO_FLAG.put(double[].class, GridBinaryMarshaller.DOUBLE_ARR);
+        PLAIN_CLASS_TO_FLAG.put(char[].class, GridBinaryMarshaller.CHAR_ARR);
+        PLAIN_CLASS_TO_FLAG.put(boolean[].class, GridBinaryMarshaller.BOOLEAN_ARR);
+        PLAIN_CLASS_TO_FLAG.put(BigDecimal[].class, GridBinaryMarshaller.DECIMAL_ARR);
+        PLAIN_CLASS_TO_FLAG.put(String[].class, GridBinaryMarshaller.STRING_ARR);
+        PLAIN_CLASS_TO_FLAG.put(UUID[].class, GridBinaryMarshaller.UUID_ARR);
+        PLAIN_CLASS_TO_FLAG.put(Date[].class, GridBinaryMarshaller.DATE_ARR);
+        PLAIN_CLASS_TO_FLAG.put(Timestamp[].class, GridBinaryMarshaller.TIMESTAMP_ARR);
+
+        for (Map.Entry<Class<?>, Byte> entry : PLAIN_CLASS_TO_FLAG.entrySet())
+            FLAG_TO_CLASS.put(entry.getValue(), entry.getKey());
+
+        PLAIN_CLASS_TO_FLAG.put(byte.class, GridBinaryMarshaller.BYTE);
+        PLAIN_CLASS_TO_FLAG.put(short.class, GridBinaryMarshaller.SHORT);
+        PLAIN_CLASS_TO_FLAG.put(int.class, GridBinaryMarshaller.INT);
+        PLAIN_CLASS_TO_FLAG.put(long.class, GridBinaryMarshaller.LONG);
+        PLAIN_CLASS_TO_FLAG.put(float.class, GridBinaryMarshaller.FLOAT);
+        PLAIN_CLASS_TO_FLAG.put(double.class, GridBinaryMarshaller.DOUBLE);
+        PLAIN_CLASS_TO_FLAG.put(char.class, GridBinaryMarshaller.CHAR);
+        PLAIN_CLASS_TO_FLAG.put(boolean.class, GridBinaryMarshaller.BOOLEAN);
+
+        for (byte b : new byte[] {
+            GridBinaryMarshaller.BYTE, GridBinaryMarshaller.SHORT, GridBinaryMarshaller.INT, GridBinaryMarshaller.LONG, GridBinaryMarshaller.FLOAT, GridBinaryMarshaller.DOUBLE,
+            GridBinaryMarshaller.CHAR, GridBinaryMarshaller.BOOLEAN, GridBinaryMarshaller.DECIMAL, GridBinaryMarshaller.STRING, GridBinaryMarshaller.UUID, GridBinaryMarshaller.DATE, GridBinaryMarshaller.TIMESTAMP,
+            GridBinaryMarshaller.BYTE_ARR, GridBinaryMarshaller.SHORT_ARR, GridBinaryMarshaller.INT_ARR, GridBinaryMarshaller.LONG_ARR, GridBinaryMarshaller.FLOAT_ARR, GridBinaryMarshaller.DOUBLE_ARR,
+            GridBinaryMarshaller.CHAR_ARR, GridBinaryMarshaller.BOOLEAN_ARR, GridBinaryMarshaller.DECIMAL_ARR, GridBinaryMarshaller.STRING_ARR, GridBinaryMarshaller.UUID_ARR, GridBinaryMarshaller.DATE_ARR, GridBinaryMarshaller.TIMESTAMP_ARR,
+            GridBinaryMarshaller.ENUM, GridBinaryMarshaller.ENUM_ARR, GridBinaryMarshaller.NULL}) {
+
+            PLAIN_TYPE_FLAG[b] = true;
+        }
+
+        PORTABLE_CLS.add(Byte.class);
+        PORTABLE_CLS.add(Short.class);
+        PORTABLE_CLS.add(Integer.class);
+        PORTABLE_CLS.add(Long.class);
+        PORTABLE_CLS.add(Float.class);
+        PORTABLE_CLS.add(Double.class);
+        PORTABLE_CLS.add(Character.class);
+        PORTABLE_CLS.add(Boolean.class);
+        PORTABLE_CLS.add(String.class);
+        PORTABLE_CLS.add(UUID.class);
+        PORTABLE_CLS.add(Date.class);
+        PORTABLE_CLS.add(Timestamp.class);
+        PORTABLE_CLS.add(BigDecimal.class);
+        PORTABLE_CLS.add(byte[].class);
+        PORTABLE_CLS.add(short[].class);
+        PORTABLE_CLS.add(int[].class);
+        PORTABLE_CLS.add(long[].class);
+        PORTABLE_CLS.add(float[].class);
+        PORTABLE_CLS.add(double[].class);
+        PORTABLE_CLS.add(char[].class);
+        PORTABLE_CLS.add(boolean[].class);
+        PORTABLE_CLS.add(String[].class);
+        PORTABLE_CLS.add(UUID[].class);
+        PORTABLE_CLS.add(Date[].class);
+        PORTABLE_CLS.add(Timestamp[].class);
+        PORTABLE_CLS.add(BigDecimal[].class);
+
+        FIELD_TYPE_NAMES = new String[104];
+
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.BYTE] = "byte";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.SHORT] = "short";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.INT] = "int";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.LONG] = "long";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.BOOLEAN] = "boolean";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.FLOAT] = "float";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.DOUBLE] = "double";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.CHAR] = "char";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.UUID] = "UUID";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.DECIMAL] = "decimal";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.STRING] = "String";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.DATE] = "Date";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.TIMESTAMP] = "Timestamp";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM] = "Enum";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.OBJ] = "Object";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.PORTABLE_OBJ] = "Object";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.COL] = "Collection";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.MAP] = "Map";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.CLASS] = "Class";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.BYTE_ARR] = "byte[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.SHORT_ARR] = "short[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.INT_ARR] = "int[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.LONG_ARR] = "long[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.BOOLEAN_ARR] = "boolean[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.FLOAT_ARR] = "float[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.DOUBLE_ARR] = "double[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.CHAR_ARR] = "char[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.UUID_ARR] = "UUID[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.DECIMAL_ARR] = "decimal[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.STRING_ARR] = "String[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.DATE_ARR] = "Date[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.TIMESTAMP_ARR] = "Timestamp[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.OBJ_ARR] = "Object[]";
+        FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM_ARR] = "Enum[]";
+    }
+
+    /**
+     * Check if user type flag is set.
+     *
+     * @param flags Flags.
+     * @return {@code True} if set.
+     */
+    public static boolean isUserType(short flags) {
+        return isFlagSet(flags, FLAG_USR_TYP);
+    }
+
+    /**
+     * Check if raw-only flag is set.
+     *
+     * @param flags Flags.
+     * @return {@code True} if set.
+     */
+    public static boolean hasSchema(short flags) {
+        return isFlagSet(flags, FLAG_HAS_SCHEMA);
+    }
+
+    /**
+     * Check if raw-only flag is set.
+     *
+     * @param flags Flags.
+     * @return {@code True} if set.
+     */
+    public static boolean hasRaw(short flags) {
+        return isFlagSet(flags, FLAG_HAS_RAW);
+    }
+
+    /**
+     * Check if "no-field-ids" flag is set.
+     *
+     * @param flags Flags.
+     * @return {@code True} if set.
+     */
+    public static boolean isCompactFooter(short flags) {
+        return isFlagSet(flags, FLAG_COMPACT_FOOTER);
+    }
+
+    /**
+     * Check whether particular flag is set.
+     *
+     * @param flags Flags.
+     * @param flag Flag.
+     * @return {@code True} if flag is set in flags.
+     */
+    private static boolean isFlagSet(short flags, short flag) {
+        return (flags & flag) == flag;
+    }
+
+    /**
+     * Schema initial ID.
+     *
+     * @return ID.
+     */
+    public static int schemaInitialId() {
+        return FNV1_OFFSET_BASIS;
+    }
+
+    /**
+     * Update schema ID when new field is added.
+     *
+     * @param schemaId Current schema ID.
+     * @param fieldId Field ID.
+     * @return New schema ID.
+     */
+    public static int updateSchemaId(int schemaId, int fieldId) {
+        schemaId = schemaId ^ (fieldId & 0xFF);
+        schemaId = schemaId * FNV1_PRIME;
+        schemaId = schemaId ^ ((fieldId >> 8) & 0xFF);
+        schemaId = schemaId * FNV1_PRIME;
+        schemaId = schemaId ^ ((fieldId >> 16) & 0xFF);
+        schemaId = schemaId * FNV1_PRIME;
+        schemaId = schemaId ^ ((fieldId >> 24) & 0xFF);
+        schemaId = schemaId * FNV1_PRIME;
+
+        return schemaId;
+    }
+
+    /**
+     * @param typeName Field type name.
+     * @return Field type ID;
+     */
+    @SuppressWarnings("StringEquality")
+    public static int fieldTypeId(String typeName) {
+        for (int i = 0; i < FIELD_TYPE_NAMES.length; i++) {
+            String typeName0 = FIELD_TYPE_NAMES[i];
+
+            if (typeName.equals(typeName0))
+                return i;
+        }
+
+        throw new IllegalArgumentException("Invalid metadata type name: " + typeName);
+    }
+
+    /**
+     * @param typeId Field type ID.
+     * @return Field type name.
+     */
+    public static String fieldTypeName(int typeId) {
+        assert typeId >= 0 && typeId < FIELD_TYPE_NAMES.length : typeId;
+
+        String typeName = FIELD_TYPE_NAMES[typeId];
+
+        assert typeName != null : typeId;
+
+        return typeName;
+    }
+
+    /**
+     * Write value with flag. e.g. writePlainObject(writer, (byte)77) will write two byte: {BYTE, 77}.
+     *
+     * @param writer W
+     * @param val Value.
+     */
+    public static void writePlainObject(BinaryWriterExImpl writer, Object val) {
+        Byte flag = PLAIN_CLASS_TO_FLAG.get(val.getClass());
+
+        if (flag == null)
+            throw new IllegalArgumentException("Can't write object with type: " + val.getClass());
+
+        switch (flag) {
+            case GridBinaryMarshaller.BYTE:
+                writer.writeByte(flag);
+                writer.writeByte((Byte)val);
+
+                break;
+
+            case GridBinaryMarshaller.SHORT:
+                writer.writeByte(flag);
+                writer.writeShort((Short)val);
+
+                break;
+
+            case GridBinaryMarshaller.INT:
+                writer.writeByte(flag);
+                writer.writeInt((Integer)val);
+
+                break;
+
+            case GridBinaryMarshaller.LONG:
+                writer.writeByte(flag);
+                writer.writeLong((Long)val);
+
+                break;
+
+            case GridBinaryMarshaller.FLOAT:
+                writer.writeByte(flag);
+                writer.writeFloat((Float)val);
+
+                break;
+
+            case GridBinaryMarshaller.DOUBLE:
+                writer.writeByte(flag);
+                writer.writeDouble((Double)val);
+
+                break;
+
+            case GridBinaryMarshaller.CHAR:
+                writer.writeByte(flag);
+                writer.writeChar((Character)val);
+
+                break;
+
+            case GridBinaryMarshaller.BOOLEAN:
+                writer.writeByte(flag);
+                writer.writeBoolean((Boolean)val);
+
+                break;
+
+            case GridBinaryMarshaller.DECIMAL:
+                writer.doWriteDecimal((BigDecimal)val);
+
+                break;
+
+            case GridBinaryMarshaller.STRING:
+                writer.doWriteString((String)val);
+
+                break;
+
+            case GridBinaryMarshaller.UUID:
+                writer.doWriteUuid((UUID)val);
+
+                break;
+
+            case GridBinaryMarshaller.DATE:
+                writer.doWriteDate((Date)val);
+
+                break;
+
+            case GridBinaryMarshaller.TIMESTAMP:
+                writer.doWriteTimestamp((Timestamp) val);
+
+                break;
+
+            case GridBinaryMarshaller.BYTE_ARR:
+                writer.doWriteByteArray((byte[])val);
+
+                break;
+
+            case GridBinaryMarshaller.SHORT_ARR:
+                writer.doWriteShortArray((short[])val);
+
+                break;
+
+            case GridBinaryMarshaller.INT_ARR:
+                writer.doWriteIntArray((int[])val);
+
+                break;
+
+            case GridBinaryMarshaller.LONG_ARR:
+                writer.doWriteLongArray((long[])val);
+
+                break;
+
+            case GridBinaryMarshaller.FLOAT_ARR:
+                writer.doWriteFloatArray((float[])val);
+
+                break;
+
+            case GridBinaryMarshaller.DOUBLE_ARR:
+                writer.doWriteDoubleArray((double[])val);
+
+                break;
+
+            case GridBinaryMarshaller.CHAR_ARR:
+                writer.doWriteCharArray((char[])val);
+
+                break;
+
+            case GridBinaryMarshaller.BOOLEAN_ARR:
+                writer.doWriteBooleanArray((boolean[])val);
+
+                break;
+
+            case GridBinaryMarshaller.DECIMAL_ARR:
+                writer.doWriteDecimalArray((BigDecimal[])val);
+
+                break;
+
+            case GridBinaryMarshaller.STRING_ARR:
+                writer.doWriteStringArray((String[])val);
+
+                break;
+
+            case GridBinaryMarshaller.UUID_ARR:
+                writer.doWriteUuidArray((UUID[])val);
+
+                break;
+
+            case GridBinaryMarshaller.DATE_ARR:
+                writer.doWriteDateArray((Date[])val);
+
+                break;
+
+            case GridBinaryMarshaller.TIMESTAMP_ARR:
+                writer.doWriteTimestampArray((Timestamp[])val);
+
+                break;
+
+            default:
+                throw new IllegalArgumentException("Can't write object with type: " + val.getClass());
+        }
+    }
+
+    /**
+     * @param obj Value to unwrap.
+     * @return Unwrapped value.
+     */
+    public static Object unwrapLazy(@Nullable Object obj) {
+        if (obj instanceof BinaryLazyValue)
+            return ((BinaryLazyValue)obj).value();
+
+        return obj;
+    }
+
+    /**
+     * @param delegate Iterator to delegate.
+     * @return New iterator.
+     */
+    public static Iterator<Object> unwrapLazyIterator(final Iterator<Object> delegate) {
+        return new Iterator<Object>() {
+            @Override public boolean hasNext() {
+                return delegate.hasNext();
+            }
+
+            @Override public Object next() {
+                return unwrapLazy(delegate.next());
+            }
+
+            @Override public void remove() {
+                delegate.remove();
+            }
+        };
+    }
+
+    /**
+     * @return {@code true} if content of serialized value cannot contain references to other object.
+     */
+    public static boolean isPlainType(int type) {
+        return type > 0 && type < PLAIN_TYPE_FLAG.length && PLAIN_TYPE_FLAG[type];
+    }
+
+    /**
+     * Checks whether an array type values can or can not contain references to other object.
+     *
+     * @param type Array type.
+     * @return {@code true} if content of serialized array value cannot contain references to other object.
+     */
+    public static boolean isPlainArrayType(int type) {
+        return (type >= GridBinaryMarshaller.BYTE_ARR && type <= GridBinaryMarshaller.DATE_ARR) || type == GridBinaryMarshaller.TIMESTAMP_ARR;
+    }
+
+    /**
+     * @param cls Class.
+     * @return Portable field type.
+     */
+    public static byte typeByClass(Class<?> cls) {
+        Byte type = PLAIN_CLASS_TO_FLAG.get(cls);
+
+        if (type != null)
+            return type;
+
+        if (cls.isEnum())
+            return GridBinaryMarshaller.ENUM;
+
+        if (cls.isArray())
+            return cls.getComponentType().isEnum() || cls.getComponentType() == Enum.class ? GridBinaryMarshaller.ENUM_ARR : GridBinaryMarshaller.OBJ_ARR;
+
+        if (isSpecialCollection(cls))
+            return GridBinaryMarshaller.COL;
+
+        if (isSpecialMap(cls))
+            return GridBinaryMarshaller.MAP;
+
+        return GridBinaryMarshaller.OBJ;
+    }
+
+    /**
+     * Tells whether provided type is portable.
+     *
+     * @param cls Class to check.
+     * @return Whether type is portable.
+     */
+    public static boolean isPortableType(Class<?> cls) {
+        assert cls != null;
+
+        return BinaryObject.class.isAssignableFrom(cls) ||
+            PORTABLE_CLS.contains(cls) ||
+            cls.isEnum() ||
+            (cls.isArray() && cls.getComponentType().isEnum());
+    }
+
+    /**
+     * Attempts to create a new map of the same type as {@code map} has. Otherwise returns new {@code HashMap} instance.
+     *
+     * @param map Original map.
+     * @return New map.
+     */
+    public static <K, V> Map<K, V> newMap(Map<K, V> map) {
+        if (map instanceof LinkedHashMap)
+            return U.newLinkedHashMap(map.size());
+        else if (map instanceof TreeMap)
+            return new TreeMap<>(((TreeMap<Object, Object>)map).comparator());
+        else if (map instanceof ConcurrentHashMap8)
+            return new ConcurrentHashMap8<>(U.capacity(map.size()));
+        else if (map instanceof ConcurrentHashMap)
+            return new ConcurrentHashMap<>(U.capacity(map.size()));
+
+        return U.newHashMap(map.size());
+    }
+
+    /**
+     * Attempts to create a new set of the same type as {@code set} has. Otherwise returns new {@code HashSet} instance.
+     *
+     * @param set Original set.
+     * @return New set.
+     */
+    public static <V> Set<V> newSet(Set<V> set) {
+        if (set instanceof LinkedHashSet)
+            return U.newLinkedHashSet(set.size());
+        else if (set instanceof TreeSet)
+            return new TreeSet<>(((TreeSet<Object>)set).comparator());
+        else if (set instanceof ConcurrentSkipListSet)
+            return new ConcurrentSkipListSet<>(((ConcurrentSkipListSet<Object>)set).comparator());
+
+        return U.newHashSet(set.size());
+    }
+
+    /**
+     * Check protocol version.
+     *
+     * @param protoVer Protocol version.
+     */
+    public static void checkProtocolVersion(byte protoVer) {
+        if (GridBinaryMarshaller.PROTO_VER != protoVer)
+            throw new BinaryObjectException("Unsupported protocol version: " + protoVer);
+    }
+
+    /**
+     * Get portable object length.
+     *
+     * @param in Input stream.
+     * @param start Start position.
+     * @return Length.
+     */
+    public static int length(BinaryPositionReadable in, int start) {
+        return in.readIntPositioned(start + GridBinaryMarshaller.TOTAL_LEN_POS);
+    }
+
+    /**
+     * Get footer start of the object.
+     *
+     * @param in Input stream.
+     * @param start Object start position inside the stream.
+     * @return Footer start.
+     */
+    public static int footerStartRelative(BinaryPositionReadable in, int start) {
+        short flags = in.readShortPositioned(start + GridBinaryMarshaller.FLAGS_POS);
+
+        if (hasSchema(flags))
+            // Schema exists, use offset.
+            return in.readIntPositioned(start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS);
+        else
+            // No schema, footer start equals to object end.
+            return length(in, start);
+    }
+
+    /**
+     * Get object's footer.
+     *
+     * @param in Input stream.
+     * @param start Start position.
+     * @return Footer start.
+     */
+    public static int footerStartAbsolute(BinaryPositionReadable in, int start) {
+        return footerStartRelative(in, start) + start;
+    }
+
+    /**
+     * Get object's footer.
+     *
+     * @param in Input stream.
+     * @param start Start position.
+     * @return Footer.
+     */
+    public static IgniteBiTuple<Integer, Integer> footerAbsolute(BinaryPositionReadable in, int start) {
+        short flags = in.readShortPositioned(start + GridBinaryMarshaller.FLAGS_POS);
+
+        int footerEnd = length(in, start);
+
+        if (hasSchema(flags)) {
+            // Schema exists.
+            int footerStart = in.readIntPositioned(start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS);
+
+            if (hasRaw(flags))
+                footerEnd -= 4;
+
+            assert footerStart <= footerEnd;
+
+            return F.t(start + footerStart, start + footerEnd);
+        }
+        else
+            // No schema.
+            return F.t(start + footerEnd, start + footerEnd);
+    }
+
+    /**
+     * Get relative raw offset of the object.
+     *
+     * @param in Input stream.
+     * @param start Object start position inside the stream.
+     * @return Raw offset.
+     */
+    public static int rawOffsetRelative(BinaryPositionReadable in, int start) {
+        short flags = in.readShortPositioned(start + GridBinaryMarshaller.FLAGS_POS);
+
+        int len = length(in, start);
+
+        if (hasSchema(flags)){
+            // Schema exists.
+            if (hasRaw(flags))
+                // Raw offset is set, it is at the very end of the object.
+                return in.readIntPositioned(start + len - 4);
+            else
+                // Raw offset is not set, so just return schema offset.
+                return in.readIntPositioned(start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS);
+        }
+        else
+            // No schema, raw offset is located on schema offset position.
+            return in.readIntPositioned(start + GridBinaryMarshaller.SCHEMA_OR_RAW_OFF_POS);
+    }
+
+    /**
+     * Get absolute raw offset of the object.
+     *
+     * @param in Input stream.
+     * @param start Object start position inside the stream.
+     * @return Raw offset.
+     */
+    public static int rawOffsetAbsolute(BinaryPositionReadable in, int start) {
+        return start + rawOffsetRelative(in, start);
+    }
+
+    /**
+     * Get offset length for the given flags.
+     *
+     * @param flags Flags.
+     * @return Offset size.
+     */
+    public static int fieldOffsetLength(short flags) {
+        if ((flags & FLAG_OFFSET_ONE_BYTE) == FLAG_OFFSET_ONE_BYTE)
+            return OFFSET_1;
+        else if ((flags & FLAG_OFFSET_TWO_BYTES) == FLAG_OFFSET_TWO_BYTES)
+            return OFFSET_2;
+        else
+            return OFFSET_4;
+    }
+
+    /**
+     * Get field ID length.
+     *
+     * @param flags Flags.
+     * @return Field ID length.
+     */
+    public static int fieldIdLength(short flags) {
+        return isCompactFooter(flags) ? 0 : FIELD_ID_LEN;
+    }
+
+    /**
+     * Get relative field offset.
+     *
+     * @param stream Stream.
+     * @param pos Position.
+     * @param fieldOffsetSize Field offset size.
+     * @return Relative field offset.
+     */
+    public static int fieldOffsetRelative(BinaryPositionReadable stream, int pos, int fieldOffsetSize) {
+        int res;
+
+        if (fieldOffsetSize == OFFSET_1)
+            res = (int)stream.readBytePositioned(pos) & 0xFF;
+        else if (fieldOffsetSize == OFFSET_2)
+            res = (int)stream.readShortPositioned(pos) & 0xFFFF;
+        else
+            res = stream.readIntPositioned(pos);
+
+        return res;
+    }
+
+    /**
+     * Merge old and new metas.
+     *
+     * @param oldMeta Old meta.
+     * @param newMeta New meta.
+     * @return New meta if old meta was null, old meta if no changes detected, merged meta otherwise.
+     * @throws BinaryObjectException If merge failed due to metadata conflict.
+     */
+    public static BinaryMetadata mergeMetadata(@Nullable BinaryMetadata oldMeta, BinaryMetadata newMeta) {
+        assert newMeta != null;
+
+        if (oldMeta == null)
+            return newMeta;
+        else {
+            assert oldMeta.typeId() == newMeta.typeId();
+
+            // Check type name.
+            if (!F.eq(oldMeta.typeName(), newMeta.typeName())) {
+                throw new BinaryObjectException(
+                    "Two portable types have duplicate type ID [" + "typeId=" + oldMeta.typeId() +
+                        ", typeName1=" + oldMeta.typeName() + ", typeName2=" + newMeta.typeName() + ']'
+                );
+            }
+
+            // Check affinity field names.
+            if (!F.eq(oldMeta.affinityKeyFieldName(), newMeta.affinityKeyFieldName())) {
+                throw new BinaryObjectException(
+                    "Binary type has different affinity key fields [" + "typeName=" + newMeta.typeName() +
+                        ", affKeyFieldName1=" + oldMeta.affinityKeyFieldName() +
+                        ", affKeyFieldName2=" + newMeta.affinityKeyFieldName() + ']'
+                );
+            }
+
+            // Check enum flag.
+            if (oldMeta.isEnum() != newMeta.isEnum()) {
+                if (oldMeta.isEnum())
+                    throw new BinaryObjectException("Binary type already registered as enum: " +
+                        newMeta.typeName());
+                else
+                    throw new BinaryObjectException("Binary type already registered as non-enum: " +
+                        newMeta.typeName());
+            }
+
+            // Check and merge fields.
+            boolean changed = false;
+
+            Map<String, Integer> mergedFields = new HashMap<>(oldMeta.fieldsMap());
+            Map<String, Integer> newFields = newMeta.fieldsMap();
+
+            for (Map.Entry<String, Integer> newField : newFields.entrySet()) {
+                Integer oldFieldType = mergedFields.put(newField.getKey(), newField.getValue());
+
+                if (oldFieldType == null)
+                    changed = true;
+                else if (!F.eq(oldFieldType, newField.getValue())) {
+                    throw new BinaryObjectException(
+                        "Binary type has different field types [" + "typeName=" + oldMeta.typeName() +
+                            ", fieldName=" + newField.getKey() +
+                            ", fieldTypeName1=" + fieldTypeName(oldFieldType) +
+                            ", fieldTypeName2=" + fieldTypeName(newField.getValue()) + ']'
+                    );
+                }
+            }
+
+            // Check and merge schemas.
+            Collection<BinarySchema> mergedSchemas = new HashSet<>(oldMeta.schemas());
+
+            for (BinarySchema newSchema : newMeta.schemas()) {
+                if (mergedSchemas.add(newSchema))
+                    changed = true;
+            }
+
+            // Return either old meta if no changes detected, or new merged meta.
+            return changed ? new BinaryMetadata(oldMeta.typeId(), oldMeta.typeName(), mergedFields,
+                oldMeta.affinityKeyFieldName(), mergedSchemas, oldMeta.isEnum()) : oldMeta;
+        }
+    }
+
+    /**
+     * @param cls Class.
+     * @return Mode.
+     */
+    @SuppressWarnings("IfMayBeConditional")
+    public static BinaryWriteMode mode(Class<?> cls) {
+        assert cls != null;
+
+        /** Primitives. */
+        if (cls == byte.class)
+            return BinaryWriteMode.P_BYTE;
+        else if (cls == boolean.class)
+            return BinaryWriteMode.P_BOOLEAN;
+        else if (cls == short.class)
+            return BinaryWriteMode.P_SHORT;
+        else if (cls == char.class)
+            return BinaryWriteMode.P_CHAR;
+        else if (cls == int.class)
+            return BinaryWriteMode.P_INT;
+        else if (cls == long.class)
+            return BinaryWriteMode.P_LONG;
+        else if (cls == float.class)
+            return BinaryWriteMode.P_FLOAT;
+        else if (cls == double.class)
+            return BinaryWriteMode.P_DOUBLE;
+
+        /** Boxed primitives. */
+        else if (cls == Byte.class)
+            return BinaryWriteMode.BYTE;
+        else if (cls == Boolean.class)
+            return BinaryWriteMode.BOOLEAN;
+        else if (cls == Short.class)
+            return BinaryWriteMode.SHORT;
+        else if (cls == Character.class)
+            return BinaryWriteMode.CHAR;
+        else if (cls == Integer.class)
+            return BinaryWriteMode.INT;
+        else if (cls == Long.class)
+            return BinaryWriteMode.LONG;
+        else if (cls == Float.class)
+            return BinaryWriteMode.FLOAT;
+        else if (cls == Double.class)
+            return BinaryWriteMode.DOUBLE;
+
+        /** The rest types. */
+        else if (cls == BigDecimal.class)
+            return BinaryWriteMode.DECIMAL;
+        else if (cls == String.class)
+            return BinaryWriteMode.STRING;
+        else if (cls == UUID.class)
+            return BinaryWriteMode.UUID;
+        else if (cls == Date.class)
+            return BinaryWriteMode.DATE;
+        else if (cls == Timestamp.class)
+            return BinaryWriteMode.TIMESTAMP;
+        else if (cls == byte[].class)
+            return BinaryWriteMode.BYTE_ARR;
+        else if (cls == short[].class)
+            return BinaryWriteMode.SHORT_ARR;
+        else if (cls == int[].class)
+            return BinaryWriteMode.INT_ARR;
+        else if (cls == long[].class)
+            return BinaryWriteMode.LONG_ARR;
+        else if (cls == float[].class)
+            return BinaryWriteMode.FLOAT_ARR;
+        else if (cls == double[].class)
+            return BinaryWriteMode.DOUBLE_ARR;
+        else if (cls == char[].class)
+            return BinaryWriteMode.CHAR_ARR;
+        else if (cls == boolean[].class)
+            return BinaryWriteMode.BOOLEAN_ARR;
+        else if (cls == BigDecimal[].class)
+            return BinaryWriteMode.DECIMAL_ARR;
+        else if (cls == String[].class)
+            return BinaryWriteMode.STRING_ARR;
+        else if (cls == UUID[].class)
+            return BinaryWriteMode.UUID_ARR;
+        else if (cls == Date[].class)
+            return BinaryWriteMode.DATE_ARR;
+        else if (cls == Timestamp[].class)
+            return BinaryWriteMode.TIMESTAMP_ARR;
+        else if (cls.isArray())
+            return cls.getComponentType().isEnum() ? BinaryWriteMode.ENUM_ARR : BinaryWriteMode.OBJECT_ARR;
+        else if (cls == BinaryObjectImpl.class)
+            return BinaryWriteMode.PORTABLE_OBJ;
+        else if (Binarylizable.class.isAssignableFrom(cls))
+            return BinaryWriteMode.PORTABLE;
+        else if (Externalizable.class.isAssignableFrom(cls))
+            return BinaryWriteMode.EXTERNALIZABLE;
+        else if (isSpecialCollection(cls))
+            return BinaryWriteMode.COL;
+        else if (isSpecialMap(cls))
+            return BinaryWriteMode.MAP;
+        else if (cls.isEnum())
+            return BinaryWriteMode.ENUM;
+        else if (cls == Class.class)
+            return BinaryWriteMode.CLASS;
+        else
+            return BinaryWriteMode.OBJECT;
+    }
+
+    /**
+     * Check if class represents a collection which must be treated specially.
+     *
+     * @param cls Class.
+     * @return {@code True} if this is a special collection class.
+     */
+    private static boolean isSpecialCollection(Class cls) {
+        return ArrayList.class.equals(cls) || LinkedList.class.equals(cls) ||
+            HashSet.class.equals(cls) || LinkedHashSet.class.equals(cls);
+    }
+
+    /**
+     * Check if class represents a map which must be treated specially.
+     *
+     * @param cls Class.
+     * @return {@code True} if this is a special map class.
+     */
+    private static boolean isSpecialMap(Class cls) {
+        return HashMap.class.equals(cls) || LinkedHashMap.class.equals(cls);
+    }
+
+    /**
+     * @return Value.
+     */
+    public static byte[] doReadByteArray(BinaryInputStream in) {
+        int len = in.readInt();
+
+        return in.readByteArray(len);
+    }
+
+    /**
+     * @return Value.
+     */
+    public static boolean[] doReadBooleanArray(BinaryInputStream in) {
+        int len = in.readInt();
+
+        return in.readBooleanArray(len);
+    }
+
+    /**
+     * @return Value.
+     */
+    public static short[] doReadShortArray(BinaryInputStream in) {
+        int len = in.readInt();
+
+        return in.readShortArray(len);
+    }
+
+    /**
+     * @return Value.
+     */
+    public static char[] doReadCharArray(BinaryInputStream in) {
+        int len = in.readInt();
+
+        return in.readCharArray(len);
+    }
+
+    /**
+     * @return Value.
+     */
+    public static int[] doReadIntArray(BinaryInputStream in) {
+        int len = in.readInt();
+
+        return in.readIntArray(len);
+    }
+
+    /**
+     * @return Value.
+     */
+    public static long[] doReadLongArray(BinaryInputStream in) {
+        int len = in.readInt();
+
+        return in.readLongArray(len);
+    }
+
+    /**
+     * @return Value.
+     */
+    public static float[] doReadFloatArray(BinaryInputStream in) {
+        int len = in.readInt();
+
+        return in.readFloatArray(len);
+    }
+
+    /**
+     * @return Value.
+     */
+    public static double[] doReadDoubleArray(BinaryInputStream in) {
+        int len = in.readInt();
+
+        return in.readDoubleArray(len);
+    }
+
+    /**
+     * @return Value.
+     */
+    public static BigDecimal doReadDecimal(BinaryInputStream in) {
+        int scale = in.readInt();
+        byte[] mag = doReadByteArray(in);
+
+        BigInteger intVal = new BigInteger(mag);
+
+        if (scale < 0) {
+            scale &= 0x7FFFFFFF;
+
+            intVal = intVal.negate();
+        }
+
+        return new BigDecimal(intVal, scale);
+    }
+
+    /**
+     * @return Value.
+     */
+    public static String doReadString(BinaryInputStream in) {
+        if (!in.hasArray())
+            return new String(doReadByteArray(in), UTF_8);
+
+        int strLen = in.readInt();
+
+        int pos = in.position();
+
+        // String will copy necessary array part for us.
+        String res = new String(in.array(), pos, strLen, UTF_8);
+
+        in.position(pos + strLen);
+
+        return res;
+    }
+
+    /**
+     * @return Value.
+     */
+    public static UUID doReadUuid(BinaryInputStream in) {
+        return new UUID(in.readLong(), in.readLong());
+    }
+
+    /**
+     * @return Value.
+     */
+    public static Date doReadDate(BinaryInputStream in) {
+        long time = in.readLong();
+
+        return new Date(time);
+    }
+
+    /**
+     * @return Value.
+     */
+    public static Timestamp doReadTimestamp(BinaryInputStream in) {
+        long time = in.readLong();
+        int nanos = in.readInt();
+
+        Timestamp ts = new Timestamp(time);
+
+        ts.setNanos(ts.getNanos() + nanos);
+
+        return ts;
+    }
+
+    /**
+     * @return Value.
+     * @throws BinaryObjectException In case of error.
+     */
+    public static BigDecimal[] doReadDecimalArray(BinaryInputStream in) throws BinaryObjectException {
+        int len = in.readInt();
+
+        BigDecimal[] arr = new BigDecimal[len];
+
+        for (int i = 0; i < len; i++) {
+            byte flag = in.readByte();
+
+            if (flag == GridBinaryMarshaller.NULL)
+                arr[i] = null;
+            else {
+                if (flag != GridBinaryMarshaller.DECIMAL)
+                    throw new BinaryObjectException("Invalid flag value: " + flag);
+
+                arr[i] = doReadDecimal(in);
+            }
+        }
+
+        return arr;
+    }
+
+    /**
+     * @return Value.
+     * @throws BinaryObjectException In case of error.
+     */
+    public static String[] doReadStringArray(BinaryInputStream in) throws BinaryObjectException {
+        int len = in.readInt();
+
+        String[] arr = new String[len];
+
+        for (int i = 0; i < len; i++) {
+            byte flag = in.readByte();
+
+            if (flag == GridBinaryMarshaller.NULL)
+                arr[i] = null;
+            else {
+                if (flag != GridBinaryMarshaller.STRING)
+                    throw new BinaryObjectException("Invalid flag value: " + flag);
+
+                arr[i] = doReadString(in);
+            }
+        }
+
+        return arr;
+    }
+
+    /**
+     * @return Value.
+     * @throws BinaryObjectException In case of error.
+     */
+    public static UUID[] doReadUuidArray(BinaryInputStream in) throws BinaryObjectException {
+        int len = in.readInt();
+
+        UUID[] arr = new UUID[len];
+
+        for (int i = 0; i < len; i++) {
+            byte flag = in.readByte();
+
+            if (flag == GridBinaryMarshaller.NULL)
+                arr[i] = null;
+            else {
+                if (flag != GridBinaryMarshaller.UUID)
+                    throw new BinaryObjectException("Invalid flag value: " + flag);
+
+                arr[i] = doReadUuid(in);
+            }
+        }
+
+        return arr;
+    }
+
+    /**
+     * @return Value.
+     * @throws BinaryObjectException In case of error.
+     */
+    public static Date[] doReadDateArray(BinaryInputStream in) throws BinaryObjectException {
+        int len = in.readInt();
+
+        Date[] arr = new Date[len];
+
+        for (int i = 0; i < len; i++) {
+            byte flag = in.readByte();
+
+            if (flag == GridBinaryMarshaller.NULL)
+                arr[i] = null;
+            else {
+                if (flag != GridBinaryMarshaller.DATE)
+                    throw new BinaryObjectException("Invalid flag value: " + flag);
+
+                arr[i] = doReadDate(in);
+            }
+        }
+
+        return arr;
+    }
+
+    /**
+     * @return Value.
+     * @throws BinaryObjectException In case of error.
+     */
+    public static Timestamp[] doReadTimestampArray(BinaryInputStream in) throws BinaryObjectException {
+        int len = in.readInt();
+
+        Timestamp[] arr = new Timestamp[len];
+
+        for (int i = 0; i < len; i++) {
+            byte flag = in.readByte();
+
+            if (flag == GridBinaryMarshaller.NULL)
+                arr[i] = null;
+            else {
+                if (flag != GridBinaryMarshaller.TIMESTAMP)
+                    throw new BinaryObjectException("Invalid flag value: " + flag);
+
+                arr[i] = doReadTimestamp(in);
+            }
+        }
+
+        return arr;
+    }
+
+    /**
+     * @return Value.
+     */
+    public static BinaryObject doReadPortableObject(BinaryInputStream in, BinaryContext ctx) {
+        if (in.offheapPointer() > 0) {
+            int len = in.readInt();
+
+            int pos = in.position();
+
+            in.position(in.position() + len);
+
+            int start = in.readInt();
+
+            return new BinaryObjectOffheapImpl(ctx, in.offheapPointer() + pos, start, len);
+        }
+        else {
+            byte[] arr = doReadByteArray(in);
+            int start = in.readInt();
+
+            return new BinaryObjectImpl(ctx, arr, start);
+        }
+    }
+
+    /**
+     * @return Value.
+     */
+    public static Class doReadClass(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr)
+        throws BinaryObjectException {
+        int typeId = in.readInt();
+
+        return doReadClass(in, ctx, ldr, typeId);
+    }
+
+    /**
+     * Read plain type.
+     *
+     * @param in Input stream.
+     * @return Plain type.
+     */
+    private static EnumType doReadEnumType(BinaryInputStream in) {
+        int typeId = in.readInt();
+
+        if (typeId != GridBinaryMarshaller.UNREGISTERED_TYPE_ID)
+            return new EnumType(typeId, null);
+        else {
+            String clsName = doReadClassName(in);
+
+            return new EnumType(GridBinaryMarshaller.UNREGISTERED_TYPE_ID, clsName);
+        }
+    }
+
+    /**
+     * @param in Input stream.
+     * @return Class name.
+     */
+    private static String doReadClassName(BinaryInputStream in) {
+        byte flag = in.readByte();
+
+        if (flag != GridBinaryMarshaller.STRING)
+            throw new BinaryObjectException("Failed to read class name [position=" + (in.position() - 1) + ']');
+
+        return doReadString(in);
+    }
+
+    /**
+     * @param typeId Type id.
+     * @return Value.
+     */
+    public static Class doReadClass(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr, int typeId)
+        throws BinaryObjectException {
+        Class cls;
+
+        if (typeId == GridBinaryMarshaller.OBJECT_TYPE_ID)
+            return Object.class;
+
+        if (typeId != GridBinaryMarshaller.UNREGISTERED_TYPE_ID)
+            cls = ctx.descriptorForTypeId(true, typeId, ldr, false).describedClass();
+        else {
+            String clsName = doReadClassName(in);
+
+            try {
+                cls = U.forName(clsName, ldr);
+            }
+            catch (ClassNotFoundException e) {
+                throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e);
+            }
+
+            // forces registering of class by type id, at least locally
+            ctx.descriptorForClass(cls, true);
+        }
+
+        return cls;
+    }
+
+    /**
+     * Resolve the class.
+     *
+     * @param ctx Portable context.
+     * @param typeId Type ID.
+     * @param clsName Class name.
+     * @param ldr Class loaded.
+     * @return Resovled class.
+     */
+    public static Class resolveClass(BinaryContext ctx, int typeId, @Nullable String clsName,
+        @Nullable ClassLoader ldr, boolean deserialize) {
+        Class cls;
+
+        if (typeId == GridBinaryMarshaller.OBJECT_TYPE_ID)
+            return Object.class;
+
+        if (typeId != GridBinaryMarshaller.UNREGISTERED_TYPE_ID)
+            cls = ctx.descriptorForTypeId(true, typeId, ldr, deserialize).describedClass();
+        else {
+            try {
+                cls = U.forName(clsName, ldr);
+            }
+            catch (ClassNotFoundException e) {
+                throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e);
+            }
+
+            // forces registering of class by type id, at least locally
+            ctx.descriptorForClass(cls, true);
+        }
+
+        return cls;
+    }
+
+    /**
+     * Read portable enum.
+     *
+     * @param in Input stream.
+     * @param ctx Portable context.
+     * @param type Plain type.
+     * @return Enum.
+     */
+    private static BinaryEnumObjectImpl doReadPortableEnum(BinaryInputStream in, BinaryContext ctx,
+        EnumType type) {
+        return new BinaryEnumObjectImpl(ctx, type.typeId, type.clsName, in.readInt());
+    }
+
+    /**
+     * Read portable enum array.
+     *
+     * @param in Input stream.
+     * @param ctx Portable context.
+     * @return Enum array.
+     */
+    private static Object[] doReadPortableEnumArray(BinaryInputStream in, BinaryContext ctx) {
+        int len = in.readInt();
+
+        Object[] arr = (Object[]) Array.newInstance(BinaryObject.class, len);
+
+        for (int i = 0; i < len; i++) {
+            byte flag = in.readByte();
+
+            if (flag == GridBinaryMarshaller.NULL)
+                arr[i] = null;
+            else
+                arr[i] = doReadPortableEnum(in, ctx, doReadEnumType(in));
+        }
+
+        return arr;
+    }
+
+    /**
+     * Having target class in place we simply read ordinal and create final representation.
+     *
+     * @param cls Enum class.
+     * @return Value.
+     */
+    public static Enum<?> doReadEnum(BinaryInputStream in, Class<?> cls) throws BinaryObjectException {
+        assert cls != null;
+
+        if (!cls.isEnum())
+            throw new BinaryObjectException("Class does not represent enum type: " + cls.getName());
+
+        int ord = in.readInt();
+
+        return BinaryEnumCache.get(cls, ord);
+    }
+
+    /**
+     * @param cls Enum class.
+     * @return Value.
+     */
+    public static Object[] doReadEnumArray(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr, Class<?> cls)
+        throws BinaryObjectException {
+        int len = in.readInt();
+
+        Object[] arr = (Object[]) Array.newInstance(cls, len);
+
+        for (int i = 0; i < len; i++) {
+            byte flag = in.readByte();
+
+            if (flag == GridBinaryMarshaller.NULL)
+                arr[i] = null;
+            else
+                arr[i] = doReadEnum(in, doReadClass(in, ctx, ldr));
+        }
+
+        return arr;
+    }
+
+    /**
+     * Read object serialized using optimized marshaller.
+     *
+     * @return Result.
+     */
+    public static Object doReadOptimized(BinaryInputStream in, BinaryContext ctx, @Nullable ClassLoader clsLdr) {
+        int len = in.readInt();
+
+        ByteArrayInputStream input = new ByteArrayInputStream(in.array(), in.position(), len);
+
+        try {
+            return ctx.optimizedMarsh().unmarshal(input, clsLdr);
+        }
+        catch (IgniteCheckedException e) {
+            throw new BinaryObjectException("Failed to unmarshal object with optimized marshaller", e);
+        }
+        finally {
+            in.position(in.position() + len);
+        }
+    }
+
+    /**
+     * @return Object.
+     * @throws BinaryObjectException In case of error.
+     */
+    @Nullable public static Object doReadObject(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr,
+        BinaryReaderHandlesHolder handles) throws BinaryObjectException {
+        return new BinaryReaderExImpl(ctx, in, ldr, handles.handles()).deserialize();
+    }
+
+    /**
+     * @return Unmarshalled value.
+     * @throws BinaryObjectException In case of error.
+     */
+    @Nullable public static Object unmarshal(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr)
+        throws BinaryObjectException {
+        return unmarshal(in, ctx, ldr, new BinaryReaderHandlesHolderImpl());
+    }
+
+    /**
+     * @return Unmarshalled value.
+     * @throws BinaryObjectException In case of error.
+     */
+    @Nullable public static Object unmarshal(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr,
+        BinaryReaderHandlesHolder handles) throws BinaryObjectException {
+        return unmarshal(in, ctx, ldr, handles, false);
+    }
+
+    /**
+     * @return Unmarshalled value.
+     * @throws BinaryObjectException In case of error.
+     */
+    @Nullable public static Object unmarshal(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr,
+        BinaryReaderHandlesHolder handles, boolean detach) throws BinaryObjectException {
+        int start = in.position();
+
+        byte flag = in.readByte();
+
+        switch (flag) {
+            case GridBinaryMarshaller.NULL:
+                return null;
+
+            case GridBinaryMarshaller.HANDLE: {
+                int handlePos = start - in.readInt();
+
+                Object obj = handles.getHandle(handlePos);
+
+                if (obj == null) {
+                    int retPos = in.position();
+
+                    in.position(handlePos);
+
+                    obj = unmarshal(in, ctx, ldr, handles);
+
+                    in.position(retPos);
+                }
+
+                return obj;
+            }
+
+            case GridBinaryMarshaller.OBJ: {
+                checkProtocolVersion(in.readByte());
+
+                int len = length(in, start);
+
+                BinaryObjectExImpl po;
+
+                if (detach) {
+                    // In detach mode we simply copy object's content.
+                    in.position(start);
+
+                    po = new BinaryObjectImpl(ctx, in.readByteArray(len), 0);
+                }
+                else {
+                    if (in.offheapPointer() == 0)
+                        po = new BinaryObjectImpl(ctx, in.array(), start);
+                    else
+                        po = new BinaryObjectOffheapImpl(ctx, in.offheapPointer(), start,
+                            in.remaining() + in.position());
+
+                    in.position(start + po.length());
+                }
+
+                handles.setHandle(po, start);
+
+                return po;
+            }
+
+            case GridBinaryMarshaller.BYTE:
+                return in.readByte();
+
+            case GridBinaryMarshaller.SHORT:
+                return in.readShort();
+
+            case GridBinaryMarshaller.INT:
+                return in.readInt();
+
+            case GridBinaryMarshaller.LONG:
+                return in.readLong();
+
+            case GridBinaryMarshaller.FLOAT:
+                return in.readFloat();
+
+            case GridBinaryMarshaller.DOUBLE:
+                return in.readDouble();
+
+            case GridBinaryMarshaller.CHAR:
+                return in.readChar();
+
+            case GridBinaryMarshaller.BOOLEAN:
+                return in.readBoolean();
+
+            case GridBinaryMarshaller.DECIMAL:
+                return doReadDecimal(in);
+
+            case GridBinaryMarshaller.STRING:
+                return doReadString(in);
+
+            case GridBinaryMarshaller.UUID:
+                return doReadUuid(in);
+
+            case GridBinaryMarshaller.DATE:
+                return doReadDate(in);
+
+            case GridBinaryMarshaller.TIMESTAMP:
+                return doReadTimestamp(in);
+
+            case GridBinaryMarshaller.BYTE_ARR:
+                return doReadByteArray(in);
+
+            case GridBinaryMarshaller.SHORT_ARR:
+                return doReadShortArray(in);
+
+            case GridBinaryMarshaller.INT_ARR:
+                return doReadIntArray(in);
+
+            case GridBinaryMarshaller.LONG_ARR:
+                return doReadLongArray(in);
+
+            case GridBinaryMarshaller.FLOAT_ARR:
+                return doReadFloatArray(in);
+
+            case GridBinaryMarshaller.DOUBLE_ARR:
+                return doReadDoubleArray(in);
+
+            case GridBinaryMarshaller.CHAR_ARR:
+                return doReadCharArray(in);
+
+            case GridBinaryMarshaller.BOOLEAN_ARR:
+                return doReadBooleanArray(in);
+
+            case GridBinaryMarshaller.DECIMAL_ARR:
+                return doReadDecimalArray(in);
+
+            case GridBinaryMarshaller.STRING_ARR:
+                return doReadStringArray(in);
+
+            case GridBinaryMarshaller.UUID_ARR:
+                return doReadUuidArray(in);
+
+            case GridBinaryMarshaller.DATE_ARR:
+                return doReadDateArray(in);
+
+            case GridBinaryMarshaller.TIMESTAMP_ARR:
+                return doReadTimestampArray(in);
+
+            case GridBinaryMarshaller.OBJ_ARR:
+                return doReadObjectArray(in, ctx, ldr, handles, false);
+
+            case GridBinaryMarshaller.COL:
+                return doReadCollection(in, ctx, ldr, handles, false, null);
+
+            case GridBinaryMarshaller.MAP:
+                return doReadMap(in, ctx, ldr, handles, false, null);
+
+            case GridBinaryMarshaller.PORTABLE_OBJ:
+                return doReadPortableObject(in, ctx);
+
+            case GridBinaryMarshaller.ENUM:
+                return doReadPortableEnum(in, ctx, doReadEnumType(in));
+
+            case GridBinaryMarshaller.ENUM_ARR:
+                doReadEnumType(in); // Simply skip this part as we do not need it.
+
+                return doReadPortableEnumArray(in, ctx);
+
+            case GridBinaryMarshaller.CLASS:
+                return doReadClass(in, ctx, ldr);
+
+            case GridBinaryMarshaller.OPTM_MARSH:
+                return doReadOptimized(in, ctx, ldr);
+
+            default:
+                throw new BinaryObjectException("Invalid flag value: " + flag);
+        }
+    }
+
+    /**
+     * @param deserialize Deep flag.
+     * @return Value.
+     * @throws BinaryObjectException In case of error.
+     */
+    public static Object[] doReadObjectArray(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr,
+        BinaryReaderHandlesHolder handles, boolean deserialize) throws BinaryObjectException {
+        int hPos = positionForHandle(in);
+
+        Class compType = doReadClass(in, ctx, ldr);
+
+        int len = in.readInt();
+
+        Object[] arr = deserialize ? (Object[])Array.newInstance(compType, len) : new Object[len];
+
+        handles.setHandle(arr, hPos);
+
+        for (int i = 0; i < len; i++)
+            arr[i] = deserializeOrUnmarshal(in, ctx, ldr, handles, deserialize);
+
+        return arr;
+    }
+
+    /**
+     * @param deserialize Deep flag.
+     * @param factory Collection factory.
+     * @return Value.
+     * @throws BinaryObjectException In case of error.
+     */
+    @SuppressWarnings("unchecked")
+    public static Collection<?> doReadCollection(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr,
+        BinaryReaderHandlesHolder handles, boolean deserialize, BinaryCollectionFactory factory)
+        throws BinaryObjectException {
+        int hPos = positionForHandle(in);
+
+        int size = in.readInt();
+
+        assert size >= 0;
+
+        byte colType = in.readByte();
+
+        Collection<Object> col;
+
+        if (factory != null)
+            col = factory.create(size);
+        else {
+            switch (colType) {
+                case GridBinaryMarshaller.ARR_LIST:
+                    col = new ArrayList<>(size);
+
+                    break;
+
+                case GridBinaryMarshaller.LINKED_LIST:
+                    col = new LinkedList<>();
+
+                    break;
+
+                case GridBinaryMarshaller.HASH_SET:
+                    col = U.newHashSet(size);
+
+                    break;
+
+                case GridBinaryMarshaller.LINKED_HASH_SET:
+                    col = U.newLinkedHashSet(size);
+
+                    break;
+
+                case GridBinaryMarshaller.USER_SET:
+                    col = U.newHashSet(size);
+
+                    break;
+
+                case GridBinaryMarshaller.USER_COL:
+                    col = new ArrayList<>(size);
+
+                    break;
+
+                default:
+                    throw new BinaryObjectException("Invalid collection type: " + colType);
+            }
+        }
+
+        handles.setHandle(col, hPos);
+
+        for (int i = 0; i < size; i++)
+            col.add(deserializeOrUnmarshal(in, ctx, ldr, handles, deserialize));
+
+        return col;
+    }
+
+    /**
+     * @param deserialize Deep flag.
+     * @param factory Map factory.
+     * @return Value.
+     * @throws BinaryObjectException In case of error.
+     */
+    @SuppressWarnings("unchecked")
+    public static Map<?, ?> doReadMap(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr,
+        BinaryReaderHandlesHolder handles, boolean deserialize, BinaryMapFactory factory)
+        throws BinaryObjectException {
+        int hPos = positionForHandle(in);
+
+        int size = in.readInt();
+
+        assert size >= 0;
+
+        byte mapType = in.readByte();
+
+        Map<Object, Object> map;
+
+        if (factory != null)
+            map = factory.create(size);
+        else {
+            switch (mapType) {
+                case GridBinaryMarshaller.HASH_MAP:
+                    map = U.newHashMap(size);
+
+                    break;
+
+                case GridBinaryMarshaller.LINKED_HASH_MAP:
+                    map = U.newLinkedHashMap(size);
+
+                    break;
+
+                case GridBinaryMarshaller.USER_COL:
+                    map = U.newHashMap(size);
+
+                    break;
+
+                default:
+                    throw new BinaryObjectException("Invalid map type: " + mapType);
+            }
+        }
+
+        handles.setHandle(map, hPos);
+
+        for (int i = 0; i < size; i++) {
+            Object key = deserializeOrUnmarshal(in, ctx, ldr, handles, deserialize);
+            Object val = deserializeOrUnmarshal(in, ctx, ldr, handles, deserialize);
+
+            map.put(key, val);
+        }
+
+        return map;
+    }
+
+    /**
+     * Deserialize or unmarshal the object.
+     *
+     * @param deserialize Deserialize.
+     * @return Result.
+     */
+    private static Object deserializeOrUnmarshal(BinaryInputStream in, BinaryContext ctx, ClassLoader ldr,
+        BinaryReaderHandlesHolder handles, boolean deserialize) {
+        return deserialize ? doReadObject(in, ctx, ldr, handles) : unmarshal(in, ctx, ldr, handles);
+    }
+
+    /**
+     * Get position to be used for handle. We assume here that the hdr byte was read, hence subtract -1.
+     *
+     * @return Position for handle.
+     */
+    public static int positionForHandle(BinaryInputStream in) {
+        return in.position() - 1;
+    }
+
+    /**
+     * Enum type.
+     */
+    private static class EnumType {
+        /** Type ID. */
+        private final int typeId;
+
+        /** Class name. */
+        private final String clsName;
+
+        /**
+         * Constructor.
+         *
+         * @param typeId Type ID.
+         * @param clsName Class name.
+         */
+        public EnumType(int typeId, @Nullable String clsName) {
+            assert typeId != GridBinaryMarshaller.UNREGISTERED_TYPE_ID && clsName == null ||
+                typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID && clsName != null;
+
+            this.typeId = typeId;
+            this.clsName = clsName;
+        }
+    }
+}


[25/50] [abbrv] ignite git commit: ignite-2065: portable -> binary renaming (methods, javadoc and etc.)

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 33c0fa9..a3aed34 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -714,7 +714,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                         key,
                                         e.cached().rawGetOrUnmarshal(true),
                                         e.keepBinary()),
-                                    cacheCtx.cacheObjectContext().unwrapPortableIfNeeded(val, e.keepBinary(), false));
+                                    cacheCtx.cacheObjectContext().unwrapBinaryIfNeeded(val, e.keepBinary(), false));
 
                                 if (interceptorVal == null)
                                     continue;
@@ -1342,7 +1342,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
      * @param map Return map.
      * @param missed Map of missed keys.
      * @param keysCnt Keys count (to avoid call to {@code Collection.size()}).
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param skipVals Skip values flag.
      * @param keepCacheObjects Keep cache objects flag.
      * @param skipStore Skip store flag.
@@ -1357,7 +1357,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
         Map<K, V> map,
         Map<KeyCacheObject, GridCacheVersion> missed,
         int keysCnt,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         boolean skipVals,
         boolean keepCacheObjects,
         boolean skipStore
@@ -1396,7 +1396,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                         val = txEntry.applyEntryProcessors(val);
 
                     if (val != null)
-                        cacheCtx.addResult(map, key, val, skipVals, keepCacheObjects, deserializePortable, false);
+                        cacheCtx.addResult(map, key, val, skipVals, keepCacheObjects, deserializeBinary, false);
                 }
                 else {
                     assert txEntry.op() == TRANSFORM;
@@ -1433,7 +1433,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                     val,
                                     skipVals,
                                     keepCacheObjects,
-                                    deserializePortable,
+                                    deserializeBinary,
                                     false);
                             }
                             else
@@ -1479,7 +1479,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                         null,
                                         resolveTaskName(),
                                         accessPlc,
-                                        !deserializePortable) : null;
+                                        !deserializeBinary) : null;
 
                                 if (res != null) {
                                     val = res.get1();
@@ -1499,7 +1499,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                     null,
                                     resolveTaskName(),
                                     accessPlc,
-                                    !deserializePortable);
+                                    !deserializeBinary);
                             }
 
                             if (val != null) {
@@ -1508,7 +1508,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                     val,
                                     skipVals,
                                     keepCacheObjects,
-                                    deserializePortable,
+                                    deserializeBinary,
                                     false);
                             }
                             else
@@ -1531,7 +1531,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                 -1L,
                                 null,
                                 skipStore,
-                                !deserializePortable);
+                                !deserializeBinary);
 
                             // As optimization, mark as checked immediately
                             // for non-pessimistic if value is not null.
@@ -1597,7 +1597,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
      * @param cacheCtx Cache context.
      * @param map Return map.
      * @param missedMap Missed keys.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param skipVals Skip values flag.
      * @param keepCacheObjects Keep cache objects flag.
      * @param skipStore Skip store flag.
@@ -1607,7 +1607,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
         final GridCacheContext cacheCtx,
         final Map<K, V> map,
         final Map<KeyCacheObject, GridCacheVersion> missedMap,
-        final boolean deserializePortable,
+        final boolean deserializeBinary,
         final boolean skipVals,
         final boolean keepCacheObjects,
         final boolean skipStore
@@ -1636,7 +1636,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                 missedMap.keySet(),
                 skipVals,
                 needReadVer,
-                !deserializePortable,
+                !deserializeBinary,
                 new GridInClosure3<KeyCacheObject, Object, GridCacheVersion>() {
                     @Override public void apply(KeyCacheObject key, Object val, GridCacheVersion loadVer) {
                         if (isRollbackOnly()) {
@@ -1676,7 +1676,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                     visibleVal,
                                     skipVals,
                                     keepCacheObjects,
-                                    deserializePortable,
+                                    deserializeBinary,
                                     false);
                             }
                         }
@@ -1697,7 +1697,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                     visibleVal,
                                     skipVals,
                                     keepCacheObjects,
-                                    deserializePortable,
+                                    deserializeBinary,
                                     false);
                             }
                         }
@@ -1710,7 +1710,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
     @Override public <K, V> IgniteInternalFuture<Map<K, V>> getAllAsync(
         final GridCacheContext cacheCtx,
         Collection<KeyCacheObject> keys,
-        final boolean deserializePortable,
+        final boolean deserializeBinary,
         final boolean skipVals,
         final boolean keepCacheObjects,
         final boolean skipStore) {
@@ -1740,7 +1740,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                 retMap,
                 missed,
                 keysCnt,
-                deserializePortable,
+                deserializeBinary,
                 skipVals,
                 keepCacheObjects,
                 skipStore);
@@ -1773,7 +1773,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                         for (KeyCacheObject cacheKey : lockKeys) {
                             K keyVal = (K)
                                 (keepCacheObjects ? cacheKey :
-                                cacheCtx.cacheObjectContext().unwrapPortableIfNeeded(cacheKey, !deserializePortable));
+                                cacheCtx.cacheObjectContext().unwrapBinaryIfNeeded(cacheKey, !deserializeBinary));
 
                             if (retMap.containsKey(keyVal))
                                 // We already have a return value.
@@ -1823,7 +1823,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                                             val,
                                             skipVals,
                                             keepCacheObjects,
-                                            deserializePortable,
+                                            deserializeBinary,
                                             false);
                                     }
 
@@ -1847,7 +1847,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                             return checkMissed(cacheCtx,
                                 retMap,
                                 missed,
-                                deserializePortable,
+                                deserializeBinary,
                                 skipVals,
                                 keepCacheObjects,
                                 skipStore);
@@ -1913,7 +1913,7 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                     return checkMissed(cacheCtx,
                         retMap,
                         missed,
-                        deserializePortable,
+                        deserializeBinary,
                         skipVals,
                         keepCacheObjects,
                         skipStore);
@@ -3488,12 +3488,12 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
     }
 
     /**
-     * Checks if portable values should be deserialized.
+     * Checks if binary values should be deserialized.
      *
      * @param cacheCtx Cache context.
      * @return {@code True} if binary should be deserialized, {@code false} otherwise.
      */
-    private boolean deserializePortables(GridCacheContext cacheCtx) {
+    private boolean deserializeBinaries(GridCacheContext cacheCtx) {
         CacheOperationContext opCtx = cacheCtx.operationContextPerCall();
 
         return opCtx == null || !opCtx.isKeepBinary();

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
index 24d880b..a5d3373 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalEx.java
@@ -64,7 +64,7 @@ public interface IgniteTxLocalEx extends IgniteInternalTx {
     /**
      * @param cacheCtx Cache context.
      * @param keys Keys to get.
-     * @param deserializePortable Deserialize portable flag.
+     * @param deserializeBinary Deserialize binary flag.
      * @param skipVals Skip values flag.
      * @param keepCacheObjects Keep cache objects
      * @param skipStore Skip store flag.
@@ -73,7 +73,7 @@ public interface IgniteTxLocalEx extends IgniteInternalTx {
     public <K, V> IgniteInternalFuture<Map<K, V>> getAllAsync(
         GridCacheContext cacheCtx,
         Collection<KeyCacheObject> keys,
-        boolean deserializePortable,
+        boolean deserializeBinary,
         boolean skipVals,
         boolean keepCacheObjects,
         boolean skipStore);
@@ -196,4 +196,4 @@ public interface IgniteTxLocalEx extends IgniteInternalTx {
         boolean needVer,
         boolean keepBinary,
         GridInClosure3<KeyCacheObject, Object, GridCacheVersion> c);
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
index 239b1b9..cadf1a9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessor.java
@@ -71,22 +71,22 @@ public interface IgniteCacheObjectProcessor extends GridProcessor {
     @Nullable public CacheObject prepareForCache(@Nullable CacheObject obj, GridCacheContext cctx);
 
     /**
-     * Checks whether object is portable object.
+     * Checks whether object is binary object.
      *
      * @param obj Object to check.
-     * @return {@code True} if object is already a portable object, {@code false} otherwise.
+     * @return {@code True} if object is already a binary object, {@code false} otherwise.
      */
-    public boolean isPortableObject(Object obj);
+    public boolean isBinaryObject(Object obj);
 
     /**
-     * Checks whether given class is portable.
+     * Checks whether given class is binary.
      *
-     * @return {@code true} If portable objects are enabled.
+     * @return {@code true} If binary objects are enabled.
      */
-    public boolean isPortableEnabled(CacheConfiguration<?, ?> ccfg);
+    public boolean isBinaryEnabled(CacheConfiguration<?, ?> ccfg);
 
     /**
-     * @param obj Portable object to get field from.
+     * @param obj Binary object to get field from.
      * @param fieldName Field name.
      * @return Field value.
      */
@@ -170,4 +170,4 @@ public interface IgniteCacheObjectProcessor extends GridProcessor {
      * @return Ignite binary interface.
      */
     public IgniteBinary binary();
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
index 0d36e0e..5b764b6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/IgniteCacheObjectProcessorImpl.java
@@ -219,7 +219,7 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
             ccfg.getAffinityMapper() != null ? ccfg.getAffinityMapper() : new GridCacheDefaultAffinityKeyMapper(),
             ccfg.isCopyOnRead() && memMode != OFFHEAP_VALUES,
             storeVal,
-            ctx.config().isPeerClassLoadingEnabled() && !isPortableEnabled(ccfg));
+            ctx.config().isPeerClassLoadingEnabled() && !isBinaryEnabled(ccfg));
 
         ctx.resource().injectGeneric(res.defaultAffMapper());
 
@@ -250,12 +250,12 @@ public class IgniteCacheObjectProcessorImpl extends GridProcessorAdapter impleme
     }
 
     /** {@inheritDoc} */
-    @Override public boolean isPortableObject(Object obj) {
+    @Override public boolean isBinaryObject(Object obj) {
         return false;
     }
 
     /** {@inheritDoc} */
-    @Override public boolean isPortableEnabled(CacheConfiguration<?, ?> ccfg) {
+    @Override public boolean isBinaryEnabled(CacheConfiguration<?, ?> ccfg) {
         return false;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/NoOpBinary.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/NoOpBinary.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/NoOpBinary.java
index 80e7b39..c1c8fed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/NoOpBinary.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cacheobject/NoOpBinary.java
@@ -44,7 +44,7 @@ public class NoOpBinary implements IgniteBinary {
     }
 
     /** {@inheritDoc} */
-    @Override public BinaryObjectBuilder builder(BinaryObject portableObj) throws BinaryObjectException {
+    @Override public BinaryObjectBuilder builder(BinaryObject binaryObj) throws BinaryObjectException {
         throw unsupported();
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerEntry.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerEntry.java
index 874d2e2..d1c0cc3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerEntry.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastreamer/DataStreamerEntry.java
@@ -85,7 +85,7 @@ public class DataStreamerEntry implements Map.Entry<KeyCacheObject, CacheObject>
     public <K, V> Map.Entry<K, V> toEntry(final GridCacheContext ctx, final boolean keepBinary) {
         return new Map.Entry<K, V>() {
             @Override public K getKey() {
-                return (K)ctx.cacheObjectContext().unwrapPortableIfNeeded(key, keepBinary, false);
+                return (K)ctx.cacheObjectContext().unwrapBinaryIfNeeded(key, keepBinary, false);
             }
 
             @Override public V setValue(V val) {
@@ -93,7 +93,7 @@ public class DataStreamerEntry implements Map.Entry<KeyCacheObject, CacheObject>
             }
 
             @Override public V getValue() {
-                return (V)ctx.cacheObjectContext().unwrapPortableIfNeeded(val, keepBinary, false);
+                return (V)ctx.cacheObjectContext().unwrapBinaryIfNeeded(val, keepBinary, false);
             }
         };
     }
@@ -170,4 +170,4 @@ public class DataStreamerEntry implements Map.Entry<KeyCacheObject, CacheObject>
     @Override public String toString() {
         return S.toString(DataStreamerEntry.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractPredicate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractPredicate.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractPredicate.java
index bcfe19e..fa792f9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractPredicate.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractPredicate.java
@@ -26,7 +26,7 @@ import java.io.ObjectOutput;
  * Base interop predicate. Delegates apply to native platform.
  */
 public abstract class PlatformAbstractPredicate implements Externalizable {
-    /** .Net portable predicate */
+    /** .Net binary predicate */
     protected Object pred;
 
     /** Pointer to deployed predicate. */
@@ -45,7 +45,7 @@ public abstract class PlatformAbstractPredicate implements Externalizable {
     /**
      * Constructor.
      *
-     * @param pred .Net portable predicate.
+     * @param pred .Net binary predicate.
      * @param ptr Pointer to predicate in the native platform.
      * @param ctx Kernal context.
      */
@@ -64,4 +64,4 @@ public abstract class PlatformAbstractPredicate implements Externalizable {
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
         pred = in.readObject();
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java
index 9c783aa..34a2cca 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformAbstractTarget.java
@@ -229,7 +229,7 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
      * Process IN operation.
      *
      * @param type Type.
-     * @param reader Portable reader.
+     * @param reader Binary reader.
      * @return Result.
      * @throws IgniteCheckedException In case of exception.
      */
@@ -241,8 +241,8 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
      * Process IN-OUT operation.
      *
      * @param type Type.
-     * @param reader Portable reader.
-     * @param writer Portable writer.
+     * @param reader Binary reader.
+     * @param writer Binary writer.
      * @throws IgniteCheckedException In case of exception.
      */
     protected void processInStreamOutStream(int type, BinaryRawReaderEx reader, BinaryRawWriterEx writer)
@@ -254,7 +254,7 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
      * Process IN operation with managed object as result.
      *
      * @param type Type.
-     * @param reader Portable reader.
+     * @param reader Binary reader.
      * @return Result.
      * @throws IgniteCheckedException In case of exception.
      */
@@ -267,8 +267,8 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
      *
      * @param type Type.
      * @param arg Argument.
-     * @param reader Portable reader.
-     * @param writer Portable writer.
+     * @param reader Binary reader.
+     * @param writer Binary writer.
      * @throws IgniteCheckedException In case of exception.
      */
     protected void processInObjectStreamOutStream(int type, @Nullable Object arg, BinaryRawReaderEx reader,
@@ -290,7 +290,7 @@ public abstract class PlatformAbstractTarget implements PlatformTarget {
      * Process OUT operation.
      *
      * @param type Type.
-     * @param writer Portable writer.
+     * @param writer Binary writer.
      * @throws IgniteCheckedException In case of exception.
      */
     protected void processOutStream(int type, BinaryRawWriterEx writer) throws IgniteCheckedException {

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContext.java
index b8f5912..b05d331 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContext.java
@@ -260,10 +260,10 @@ public interface PlatformContext {
      *
      * @param rcv Native receiver.
      * @param ptr Pointer.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      * @return Stream receiver.
      */
-    public PlatformStreamReceiver createStreamReceiver(Object rcv, long ptr, boolean keepPortable);
+    public PlatformStreamReceiver createStreamReceiver(Object rcv, long ptr, boolean keepBinary);
 
     /**
      * Create cluster node filter.

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java
index f69ea3e..c531718 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java
@@ -384,7 +384,7 @@ public class PlatformContextImpl implements PlatformContext {
     }
 
     /**
-     * Write portable metadata.
+     * Write binary metadata.
      *
      * @param writer Writer.
      * @param typeId Type id.
@@ -612,8 +612,8 @@ public class PlatformContextImpl implements PlatformContext {
     }
 
     /** {@inheritDoc} */
-    @Override public PlatformStreamReceiver createStreamReceiver(Object rcv, long ptr, boolean keepPortable) {
-        return new PlatformStreamReceiverImpl(rcv, ptr, keepPortable, this);
+    @Override public PlatformStreamReceiver createStreamReceiver(Object rcv, long ptr, boolean keepBinary) {
+        return new PlatformStreamReceiverImpl(rcv, ptr, keepBinary, this);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformNoopProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformNoopProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformNoopProcessor.java
index d49d3e2..9142543 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformNoopProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformNoopProcessor.java
@@ -79,7 +79,7 @@ public class PlatformNoopProcessor extends GridProcessorAdapter implements Platf
     }
 
     /** {@inheritDoc} */
-    @Override public PlatformTarget dataStreamer(@Nullable String cacheName, boolean keepPortable) throws IgniteCheckedException {
+    @Override public PlatformTarget dataStreamer(@Nullable String cacheName, boolean keepBinary) throws IgniteCheckedException {
         return null;
     }
 
@@ -119,7 +119,7 @@ public class PlatformNoopProcessor extends GridProcessorAdapter implements Platf
     }
 
     /** {@inheritDoc} */
-    @Override public void registerStore(PlatformCacheStore store, boolean convertPortable)
+    @Override public void registerStore(PlatformCacheStore store, boolean convertBinary)
         throws IgniteCheckedException {
         // No-op.
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessor.java
index 5c6490f..fa22953 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessor.java
@@ -102,11 +102,11 @@ public interface PlatformProcessor extends GridProcessor {
      * Get data streamer.
      *
      * @param cacheName Cache name.
-     * @param keepPortable Portable flag.
+     * @param keepBinary Binary flag.
      * @return Data streamer.
      * @throws IgniteCheckedException If failed.
      */
-    public PlatformTarget dataStreamer(@Nullable String cacheName, boolean keepPortable) throws IgniteCheckedException;
+    public PlatformTarget dataStreamer(@Nullable String cacheName, boolean keepBinary) throws IgniteCheckedException;
 
     /**
      * Get transactions.
@@ -166,10 +166,10 @@ public interface PlatformProcessor extends GridProcessor {
      * Register cache store.
      *
      * @param store Store.
-     * @param convertPortable Convert portable flag.
+     * @param convertBinary Convert binary flag.
      * @throws IgniteCheckedException If failed.
      */
-    public void registerStore(PlatformCacheStore store, boolean convertPortable) throws IgniteCheckedException;
+    public void registerStore(PlatformCacheStore store, boolean convertBinary) throws IgniteCheckedException;
 
     /**
      * Get or create AtomicLong.

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessorImpl.java
index a788775..b0870bb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformProcessorImpl.java
@@ -136,7 +136,7 @@ public class PlatformProcessorImpl extends GridProcessorAdapter implements Platf
 
         try {
             for (StoreInfo store : pendingStores)
-                registerStore0(store.store, store.convertPortable);
+                registerStore0(store.store, store.convertBinary);
 
             pendingStores.clear();
 
@@ -222,7 +222,7 @@ public class PlatformProcessorImpl extends GridProcessorAdapter implements Platf
         if (cache == null)
             throw new IllegalArgumentException("Cache doesn't exist: " + name);
 
-        return new PlatformCache(platformCtx, cache.keepPortable(), false);
+        return new PlatformCache(platformCtx, cache.keepBinary(), false);
     }
 
     /** {@inheritDoc} */
@@ -231,7 +231,7 @@ public class PlatformProcessorImpl extends GridProcessorAdapter implements Platf
 
         assert cache != null;
 
-        return new PlatformCache(platformCtx, cache.keepPortable(), false);
+        return new PlatformCache(platformCtx, cache.keepBinary(), false);
     }
 
     /** {@inheritDoc} */
@@ -240,7 +240,7 @@ public class PlatformProcessorImpl extends GridProcessorAdapter implements Platf
 
         assert cache != null;
 
-        return new PlatformCache(platformCtx, cache.keepPortable(), false);
+        return new PlatformCache(platformCtx, cache.keepBinary(), false);
     }
 
     /** {@inheritDoc} */
@@ -249,13 +249,13 @@ public class PlatformProcessorImpl extends GridProcessorAdapter implements Platf
     }
 
     /** {@inheritDoc} */
-    @Override public PlatformTarget dataStreamer(@Nullable String cacheName, boolean keepPortable)
+    @Override public PlatformTarget dataStreamer(@Nullable String cacheName, boolean keepBinary)
         throws IgniteCheckedException {
         IgniteDataStreamer ldr = ctx.dataStream().dataStreamer(cacheName);
 
         ldr.keepBinary(true);
 
-        return new PlatformDataStreamer(platformCtx, cacheName, (DataStreamerImpl)ldr, keepPortable);
+        return new PlatformDataStreamer(platformCtx, cacheName, (DataStreamerImpl)ldr, keepBinary);
     }
 
     /** {@inheritDoc} */
@@ -304,7 +304,7 @@ public class PlatformProcessorImpl extends GridProcessorAdapter implements Platf
     }
 
     /** {@inheritDoc} */
-    @Override public void registerStore(PlatformCacheStore store, boolean convertPortable)
+    @Override public void registerStore(PlatformCacheStore store, boolean convertBinary)
         throws IgniteCheckedException {
         storeLock.readLock().lock();
 
@@ -314,9 +314,9 @@ public class PlatformProcessorImpl extends GridProcessorAdapter implements Platf
                     store);
 
             if (started)
-                registerStore0(store, convertPortable);
+                registerStore0(store, convertBinary);
             else
-                pendingStores.add(new StoreInfo(store, convertPortable));
+                pendingStores.add(new StoreInfo(store, convertBinary));
         }
         finally {
             storeLock.readLock().unlock();
@@ -337,14 +337,14 @@ public class PlatformProcessorImpl extends GridProcessorAdapter implements Platf
      * Internal store initialization routine.
      *
      * @param store Store.
-     * @param convertPortable Convert portable flag.
+     * @param convertBinary Convert binary flag.
      * @throws IgniteCheckedException If failed.
      */
-    private void registerStore0(PlatformCacheStore store, boolean convertPortable) throws IgniteCheckedException {
+    private void registerStore0(PlatformCacheStore store, boolean convertBinary) throws IgniteCheckedException {
         if (store instanceof PlatformDotNetCacheStore) {
             PlatformDotNetCacheStore store0 = (PlatformDotNetCacheStore)store;
 
-            store0.initialize(ctx, convertPortable);
+            store0.initialize(ctx, convertBinary);
         }
         else
             throw new IgniteCheckedException("Unsupported interop store: " + store);
@@ -357,18 +357,18 @@ public class PlatformProcessorImpl extends GridProcessorAdapter implements Platf
         /** Store. */
         private final PlatformCacheStore store;
 
-        /** Convert portable flag. */
-        private final boolean convertPortable;
+        /** Convert binary flag. */
+        private final boolean convertBinary;
 
         /**
          * Constructor.
          *
          * @param store Store.
-         * @param convertPortable Convert portable flag.
+         * @param convertBinary Convert binary flag.
          */
-        private StoreInfo(PlatformCacheStore store, boolean convertPortable) {
+        private StoreInfo(PlatformCacheStore store, boolean convertBinary) {
             this.store = store;
-            this.convertPortable = convertPortable;
+            this.convertBinary = convertBinary;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
index da7a15d..2f7cab2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java
@@ -180,7 +180,7 @@ public class PlatformCache extends PlatformAbstractTarget {
     private final IgniteCacheProxy cache;
 
     /** Whether this cache is created with "keepBinary" flag on the other side. */
-    private final boolean keepPortable;
+    private final boolean keepBinary;
 
     /** */
     private static final GetAllWriter WRITER_GET_ALL = new GetAllWriter();
@@ -202,13 +202,13 @@ public class PlatformCache extends PlatformAbstractTarget {
      *
      * @param platformCtx Context.
      * @param cache Underlying cache.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      */
-    public PlatformCache(PlatformContext platformCtx, IgniteCache cache, boolean keepPortable) {
+    public PlatformCache(PlatformContext platformCtx, IgniteCache cache, boolean keepBinary) {
         super(platformCtx);
 
         this.cache = (IgniteCacheProxy)cache;
-        this.keepPortable = keepPortable;
+        this.keepBinary = keepBinary;
     }
 
     /**
@@ -220,16 +220,16 @@ public class PlatformCache extends PlatformAbstractTarget {
         if (cache.delegate().skipStore())
             return this;
 
-        return new PlatformCache(platformCtx, cache.withSkipStore(), keepPortable);
+        return new PlatformCache(platformCtx, cache.withSkipStore(), keepBinary);
     }
 
     /**
-     * Gets cache with "keep portable" flag.
+     * Gets cache with "keep binary" flag.
      *
-     * @return Cache with "keep portable" flag set.
+     * @return Cache with "keep binary" flag set.
      */
-    public PlatformCache withKeepPortable() {
-        if (keepPortable)
+    public PlatformCache withKeepBinary() {
+        if (keepBinary)
             return this;
 
         return new PlatformCache(platformCtx, cache.withKeepBinary(), true);
@@ -246,7 +246,7 @@ public class PlatformCache extends PlatformAbstractTarget {
     public PlatformCache withExpiryPolicy(final long create, final long update, final long access) {
         IgniteCache cache0 = cache.withExpiryPolicy(new InteropExpiryPolicy(create, update, access));
 
-        return new PlatformCache(platformCtx, cache0, keepPortable);
+        return new PlatformCache(platformCtx, cache0, keepBinary);
     }
 
     /**
@@ -258,7 +258,7 @@ public class PlatformCache extends PlatformAbstractTarget {
         if (cache.isAsync())
             return this;
 
-        return new PlatformCache(platformCtx, (IgniteCache)cache.withAsync(), keepPortable);
+        return new PlatformCache(platformCtx, (IgniteCache)cache.withAsync(), keepBinary);
     }
 
     /**
@@ -272,7 +272,7 @@ public class PlatformCache extends PlatformAbstractTarget {
         if (opCtx != null && opCtx.noRetries())
             return this;
 
-        return new PlatformCache(platformCtx, cache.withNoRetries(), keepPortable);
+        return new PlatformCache(platformCtx, cache.withNoRetries(), keepBinary);
     }
 
     /** {@inheritDoc} */
@@ -623,10 +623,10 @@ public class PlatformCache extends PlatformAbstractTarget {
     @Override public Exception convertException(Exception e) {
         if (e instanceof CachePartialUpdateException)
             return new PlatformCachePartialUpdateException((CachePartialUpdateCheckedException)e.getCause(),
-                platformCtx, keepPortable);
+                platformCtx, keepBinary);
 
         if (e instanceof CachePartialUpdateCheckedException)
-            return new PlatformCachePartialUpdateException((CachePartialUpdateCheckedException)e, platformCtx, keepPortable);
+            return new PlatformCachePartialUpdateException((CachePartialUpdateCheckedException)e, platformCtx, keepBinary);
 
         if (e.getCause() instanceof EntryProcessorException)
             return (EntryProcessorException) e.getCause();

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryFilterImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryFilterImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryFilterImpl.java
index d027a9a..4c86d6d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryFilterImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryFilterImpl.java
@@ -43,7 +43,7 @@ public class PlatformCacheEntryFilterImpl extends PlatformAbstractPredicate impl
     /**
      * Constructor.
      *
-     * @param pred .Net portable predicate.
+     * @param pred .Net binary predicate.
      * @param ptr Pointer to predicate in the native platform.
      * @param ctx Kernal context.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryProcessorImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryProcessorImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryProcessorImpl.java
index 3986a13..3e8ad61 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryProcessorImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCacheEntryProcessorImpl.java
@@ -52,13 +52,13 @@ public class PlatformCacheEntryProcessorImpl implements PlatformCacheEntryProces
     /** Indicates that remove has been called on an entry  */
     private static final byte ENTRY_STATE_REMOVED = 2;
 
-    /** Indicates error in processor that is written as portable.  */
-    private static final byte ENTRY_STATE_ERR_PORTABLE = 3;
+    /** Indicates error in processor that is written as binary.  */
+    private static final byte ENTRY_STATE_ERR_BINARY = 3;
 
     /** Indicates error in processor that is written as string.  */
     private static final byte ENTRY_STATE_ERR_STRING = 4;
 
-    /** Native portable processor */
+    /** Native binary processor */
     private Object proc;
 
     /** Pointer to processor in the native platform. */
@@ -74,7 +74,7 @@ public class PlatformCacheEntryProcessorImpl implements PlatformCacheEntryProces
     /**
      * Constructor.
      *
-     * @param proc Native portable processor
+     * @param proc Native binary processor
      * @param ptr Pointer to processor in the native platform.
      */
     public PlatformCacheEntryProcessorImpl(Object proc, long ptr) {
@@ -184,7 +184,7 @@ public class PlatformCacheEntryProcessorImpl implements PlatformCacheEntryProces
 
                 break;
 
-            case ENTRY_STATE_ERR_PORTABLE:
+            case ENTRY_STATE_ERR_BINARY:
                 // Full exception
                 Object nativeErr = reader.readObjectDetached();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCachePartialUpdateException.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCachePartialUpdateException.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCachePartialUpdateException.java
index 8cb1490..c3cc434 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCachePartialUpdateException.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCachePartialUpdateException.java
@@ -32,27 +32,27 @@ public class PlatformCachePartialUpdateException extends PlatformExtendedExcepti
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** Keep portable flag. */
-    private final boolean keepPortable;
+    /** Keep binary flag. */
+    private final boolean keepBinary;
 
     /**
      * Constructor.
      *
      * @param cause Root cause.
      * @param ctx Context.
-     * @param keepPortable Keep portable flag.
+     * @param keepBinary Keep binary flag.
      */
     public PlatformCachePartialUpdateException(CachePartialUpdateCheckedException cause, PlatformContext ctx,
-        boolean keepPortable) {
+        boolean keepBinary) {
         super(cause, ctx);
-        this.keepPortable = keepPortable;
+        this.keepBinary = keepBinary;
     }
 
     /** {@inheritDoc} */
     @Override public void writeData(BinaryRawWriterEx writer) {
         Collection keys = ((CachePartialUpdateCheckedException)getCause()).failedKeys();
 
-        writer.writeBoolean(keepPortable);
+        writer.writeBoolean(keepBinary);
 
         PlatformUtils.writeNullableCollection(writer, keys);
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackGateway.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackGateway.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackGateway.java
index 5d5cdb8..47862a2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackGateway.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackGateway.java
@@ -426,13 +426,13 @@ public class PlatformCallbackGateway {
      * @param ptr Receiver native pointer.
      * @param cache Cache object.
      * @param memPtr Stream pointer.
-     * @param keepPortable Portable flag.
+     * @param keepBinary Binary flag.
      */
-    public void dataStreamerStreamReceiverInvoke(long ptr, Object cache, long memPtr, boolean keepPortable) {
+    public void dataStreamerStreamReceiverInvoke(long ptr, Object cache, long memPtr, boolean keepBinary) {
         enter();
 
         try {
-            PlatformCallbackUtils.dataStreamerStreamReceiverInvoke(envPtr, ptr, cache, memPtr, keepPortable);
+            PlatformCallbackUtils.dataStreamerStreamReceiverInvoke(envPtr, ptr, cache, memPtr, keepBinary);
         }
         finally {
             leave();
@@ -940,4 +940,4 @@ public class PlatformCallbackGateway {
     protected void block() {
         lock.block();
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackUtils.java
index 64749ea..7f3ba6f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackUtils.java
@@ -223,10 +223,10 @@ public class PlatformCallbackUtils {
      * @param ptr Receiver native pointer.
      * @param cache Cache object.
      * @param memPtr Stream pointer.
-     * @param keepPortable Portable flag.
+     * @param keepBinary Binary flag.
      */
     static native void dataStreamerStreamReceiverInvoke(long envPtr, long ptr, Object cache, long memPtr,
-        boolean keepPortable);
+        boolean keepBinary);
 
     /**
      * Notify future with byte result.
@@ -487,4 +487,4 @@ public class PlatformCallbackUtils {
     private PlatformCallbackUtils() {
         // No-op.
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterNodeFilterImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterNodeFilterImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterNodeFilterImpl.java
index 72e4a71..bebff8e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterNodeFilterImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cluster/PlatformClusterNodeFilterImpl.java
@@ -44,7 +44,7 @@ public class PlatformClusterNodeFilterImpl extends PlatformAbstractPredicate imp
     /**
      * Constructor.
      *
-     * @param pred .Net portable predicate.
+     * @param pred .Net binary predicate.
      * @param ctx Kernal context.
      */
     public PlatformClusterNodeFilterImpl(Object pred, PlatformContext ctx) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
index 3cb65b9..9ef6b5e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/compute/PlatformCompute.java
@@ -258,7 +258,7 @@ public class PlatformCompute extends PlatformAbstractTarget {
      */
     protected Object executeJavaTask(BinaryRawReaderEx reader, boolean async) {
         String taskName = reader.readString();
-        boolean keepPortable = reader.readBoolean();
+        boolean keepBinary = reader.readBoolean();
         Object arg = reader.readObjectDetached();
 
         Collection<UUID> nodeIds = readNodeIds(reader);
@@ -268,7 +268,7 @@ public class PlatformCompute extends PlatformAbstractTarget {
         if (async)
             compute0 = compute0.withAsync();
 
-        if (!keepPortable && arg instanceof BinaryObjectImpl)
+        if (!keepBinary && arg instanceof BinaryObjectImpl)
             arg = ((BinaryObject)arg).deserialize();
 
         Object res = compute0.execute(taskName, arg);
@@ -278,23 +278,23 @@ public class PlatformCompute extends PlatformAbstractTarget {
                 private static final long serialVersionUID = 0L;
 
                 @Override public Object apply(IgniteFuture fut) {
-                    return toPortable(fut.get());
+                    return toBinary(fut.get());
                 }
             }));
 
             return null;
         }
         else
-            return toPortable(res);
+            return toBinary(res);
     }
 
     /**
-     * Convert object to portable form.
+     * Convert object to binary form.
      *
      * @param src Source object.
      * @return Result.
      */
-    private Object toPortable(Object src) {
+    private Object toBinary(Object src) {
         return platformCtx.kernalContext().grid().binary().toBinary(src);
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java
index 82c3e59..07ef4f2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformDataStreamer.java
@@ -65,8 +65,8 @@ public class PlatformDataStreamer extends PlatformAbstractTarget {
     /** Data streamer. */
     private final DataStreamerImpl ldr;
 
-    /** Portable flag. */
-    private final boolean keepPortable;
+    /** Binary flag. */
+    private final boolean keepBinary;
 
     /** Topology update event listener. */
     private volatile GridLocalEventListener lsnr;
@@ -78,12 +78,12 @@ public class PlatformDataStreamer extends PlatformAbstractTarget {
      * @param ldr Data streamer.
      */
     public PlatformDataStreamer(PlatformContext platformCtx, String cacheName, DataStreamerImpl ldr,
-        boolean keepPortable) {
+        boolean keepBinary) {
         super(platformCtx);
 
         this.cacheName = cacheName;
         this.ldr = ldr;
-        this.keepPortable = keepPortable;
+        this.keepBinary = keepBinary;
     }
 
     /** {@inheritDoc}  */
@@ -131,7 +131,7 @@ public class PlatformDataStreamer extends PlatformAbstractTarget {
 
                 Object rec = reader.readObjectDetached();
 
-                ldr.receiver(platformCtx.createStreamReceiver(rec, ptr, keepPortable));
+                ldr.receiver(platformCtx.createStreamReceiver(rec, ptr, keepBinary));
 
                 return TRUE;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformStreamReceiverImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformStreamReceiverImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformStreamReceiverImpl.java
index 2a3848a..add11ed 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformStreamReceiverImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/datastreamer/PlatformStreamReceiverImpl.java
@@ -43,7 +43,7 @@ public class PlatformStreamReceiverImpl extends PlatformAbstractPredicate implem
     private static final long serialVersionUID = 0L;
 
     /** */
-    private boolean keepPortable;
+    private boolean keepBinary;
 
     /**
      * Constructor.
@@ -56,16 +56,16 @@ public class PlatformStreamReceiverImpl extends PlatformAbstractPredicate implem
     /**
      * Constructor.
      *
-     * @param pred .Net portable receiver.
+     * @param pred .Net binary receiver.
      * @param ptr Pointer to receiver in the native platform.
      * @param ctx Kernal context.
      */
-    public PlatformStreamReceiverImpl(Object pred, long ptr, boolean keepPortable, PlatformContext ctx) {
+    public PlatformStreamReceiverImpl(Object pred, long ptr, boolean keepBinary, PlatformContext ctx) {
         super(pred, ptr, ctx);
 
         assert pred != null;
 
-        this.keepPortable = keepPortable;
+        this.keepBinary = keepBinary;
     }
 
     /** {@inheritDoc} */
@@ -89,8 +89,8 @@ public class PlatformStreamReceiverImpl extends PlatformAbstractPredicate implem
 
             out.synchronize();
 
-            ctx.gateway().dataStreamerStreamReceiverInvoke(ptr, new PlatformCache(ctx, cache, keepPortable),
-                mem.pointer(), keepPortable);
+            ctx.gateway().dataStreamerStreamReceiverInvoke(ptr, new PlatformCache(ctx, cache, keepBinary),
+                mem.pointer(), keepBinary);
         }
     }
 
@@ -107,13 +107,13 @@ public class PlatformStreamReceiverImpl extends PlatformAbstractPredicate implem
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         super.writeExternal(out);
 
-        out.writeBoolean(keepPortable);
+        out.writeBoolean(keepBinary);
     }
 
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
         super.readExternal(in);
 
-        keepPortable = in.readBoolean();
+        keepBinary = in.readBoolean();
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
index c41ca6e..7e65c22 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetCacheStore.java
@@ -318,10 +318,10 @@ public class PlatformDotNetCacheStore<K, V> implements CacheStore<K, V>, Platfor
      * Initialize the store.
      *
      * @param ctx Context.
-     * @param convertPortable Convert portable flag.
+     * @param convertBinary Convert binary flag.
      * @throws org.apache.ignite.IgniteCheckedException
      */
-    public void initialize(GridKernalContext ctx, boolean convertPortable) throws IgniteCheckedException {
+    public void initialize(GridKernalContext ctx, boolean convertBinary) throws IgniteCheckedException {
         A.notNull(typName, "typName");
 
         platformCtx = PlatformUtils.platformContext(ctx.grid());
@@ -331,7 +331,7 @@ public class PlatformDotNetCacheStore<K, V> implements CacheStore<K, V>, Platfor
 
             BinaryRawWriterEx writer = platformCtx.writer(out);
 
-            write(writer, convertPortable);
+            write(writer, convertBinary);
 
             out.synchronize();
 
@@ -343,11 +343,11 @@ public class PlatformDotNetCacheStore<K, V> implements CacheStore<K, V>, Platfor
      * Write store data to a stream.
      *
      * @param writer Writer.
-     * @param convertPortable Convert portable flag.
+     * @param convertBinary Convert binary flag.
      */
-    protected void write(BinaryRawWriterEx writer, boolean convertPortable) {
+    protected void write(BinaryRawWriterEx writer, boolean convertBinary) {
         writer.writeString(typName);
-        writer.writeBoolean(convertPortable);
+        writer.writeBoolean(convertBinary);
         writer.writeMap(props);
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
index b2bd5d4..4ac3536 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
@@ -234,7 +234,7 @@ public class PlatformDotNetConfigurationClosure extends PlatformAbstractConfigur
     }
 
     /**
-     * Create portable marshaller.
+     * Create binary marshaller.
      *
      * @return Marshaller.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetServiceImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetServiceImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetServiceImpl.java
index ec241ee..1eb9a2c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetServiceImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetServiceImpl.java
@@ -39,9 +39,9 @@ public class PlatformDotNetServiceImpl extends PlatformAbstractService implement
      *
      * @param svc Service.
      * @param ctx Context.
-     * @param srvKeepPortable Whether to keep objects portable on server if possible.
+     * @param srvKeepBinary Whether to keep objects binary on server if possible.
      */
-    public PlatformDotNetServiceImpl(Object svc, PlatformContext ctx, boolean srvKeepPortable) {
-        super(svc, ctx, srvKeepPortable);
+    public PlatformDotNetServiceImpl(Object svc, PlatformContext ctx, boolean srvKeepBinary) {
+        super(svc, ctx, srvKeepBinary);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEventFilterListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEventFilterListenerImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEventFilterListenerImpl.java
index 624870a..fffa772 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEventFilterListenerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/events/PlatformEventFilterListenerImpl.java
@@ -79,7 +79,7 @@ public class PlatformEventFilterListenerImpl implements PlatformEventFilterListe
     /**
      * Constructor.
      *
-     * @param pred .Net portable predicate.
+     * @param pred .Net binary predicate.
      */
     public PlatformEventFilterListenerImpl(Object pred, final int... types) {
         assert pred != null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/messaging/PlatformMessageFilterImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/messaging/PlatformMessageFilterImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/messaging/PlatformMessageFilterImpl.java
index a737442..b8451ee 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/messaging/PlatformMessageFilterImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/messaging/PlatformMessageFilterImpl.java
@@ -46,7 +46,7 @@ public class PlatformMessageFilterImpl extends PlatformAbstractPredicate impleme
     /**
      * Constructor.
      *
-     * @param pred .Net portable predicate.
+     * @param pred .Net binary predicate.
      * @param ptr Pointer to predicate in the native platform.
      * @param ctx Kernal context.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformAbstractService.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformAbstractService.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformAbstractService.java
index 6d143aa..0840275 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformAbstractService.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformAbstractService.java
@@ -41,11 +41,11 @@ public abstract class PlatformAbstractService implements PlatformService, Extern
     /** */
     private static final long serialVersionUID = 0L;
 
-    /** .Net portable service. */
+    /** .Net binary service. */
     protected Object svc;
 
-    /** Whether to keep objects portable on server if possible. */
-    protected boolean srvKeepPortable;
+    /** Whether to keep objects binary on server if possible. */
+    protected boolean srvKeepBinary;
 
     /** Pointer to deployed service. */
     protected transient long ptr;
@@ -65,15 +65,15 @@ public abstract class PlatformAbstractService implements PlatformService, Extern
      *
      * @param svc Service.
      * @param ctx Context.
-     * @param srvKeepPortable Whether to keep objects portable on server if possible.
+     * @param srvKeepBinary Whether to keep objects binary on server if possible.
      */
-    public PlatformAbstractService(Object svc, PlatformContext ctx, boolean srvKeepPortable) {
+    public PlatformAbstractService(Object svc, PlatformContext ctx, boolean srvKeepBinary) {
         assert svc != null;
         assert ctx != null;
 
         this.svc = svc;
         this.platformCtx = ctx;
-        this.srvKeepPortable = srvKeepPortable;
+        this.srvKeepBinary = srvKeepBinary;
     }
 
     /** {@inheritDoc} */
@@ -86,7 +86,7 @@ public abstract class PlatformAbstractService implements PlatformService, Extern
 
             BinaryRawWriterEx writer = platformCtx.writer(out);
 
-            writer.writeBoolean(srvKeepPortable);
+            writer.writeBoolean(srvKeepBinary);
             writer.writeObject(svc);
 
             writeServiceContext(ctx, writer);
@@ -110,7 +110,7 @@ public abstract class PlatformAbstractService implements PlatformService, Extern
 
             BinaryRawWriterEx writer = platformCtx.writer(out);
 
-            writer.writeBoolean(srvKeepPortable);
+            writer.writeBoolean(srvKeepBinary);
 
             writeServiceContext(ctx, writer);
 
@@ -133,7 +133,7 @@ public abstract class PlatformAbstractService implements PlatformService, Extern
 
             BinaryRawWriterEx writer = platformCtx.writer(out);
 
-            writer.writeBoolean(srvKeepPortable);
+            writer.writeBoolean(srvKeepBinary);
 
             writeServiceContext(ctx, writer);
 
@@ -168,7 +168,7 @@ public abstract class PlatformAbstractService implements PlatformService, Extern
     }
 
     /** {@inheritDoc} */
-    @Override public Object invokeMethod(String mthdName, boolean srvKeepPortable, Object[] args)
+    @Override public Object invokeMethod(String mthdName, boolean srvKeepBinary, Object[] args)
         throws IgniteCheckedException {
         assert ptr != 0;
         assert platformCtx != null;
@@ -177,7 +177,7 @@ public abstract class PlatformAbstractService implements PlatformService, Extern
             PlatformOutputStream out = outMem.output();
             BinaryRawWriterEx writer = platformCtx.writer(out);
 
-            writer.writeBoolean(srvKeepPortable);
+            writer.writeBoolean(srvKeepBinary);
             writer.writeString(mthdName);
 
             if (args == null)
@@ -219,12 +219,12 @@ public abstract class PlatformAbstractService implements PlatformService, Extern
     /** {@inheritDoc} */
     @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
         svc = in.readObject();
-        srvKeepPortable = in.readBoolean();
+        srvKeepBinary = in.readBoolean();
     }
 
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         out.writeObject(svc);
-        out.writeBoolean(srvKeepPortable);
+        out.writeBoolean(srvKeepBinary);
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformService.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformService.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformService.java
index a6d9216..2d6e1cc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformService.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformService.java
@@ -28,12 +28,12 @@ public interface PlatformService extends Service {
      * Invokes native service method.
      *
      * @param mthdName Method name.
-     * @param srvKeepPortable Server keep portable flag.
+     * @param srvKeepBinary Server keep binary flag.
      * @param args Arguments.
      * @return Resulting data.
      * @throws org.apache.ignite.IgniteCheckedException If failed.
      */
-    public Object invokeMethod(String mthdName, boolean srvKeepPortable, Object[] args) throws IgniteCheckedException;
+    public Object invokeMethod(String mthdName, boolean srvKeepBinary, Object[] args) throws IgniteCheckedException;
 
     /**
      * Gets native pointer.
@@ -41,4 +41,4 @@ public interface PlatformService extends Service {
      * @return Native pointer.
      */
     public long pointer();
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformServices.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformServices.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformServices.java
index ff09357..9676b6f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformServices.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/services/PlatformServices.java
@@ -60,23 +60,23 @@ public class PlatformServices extends PlatformAbstractTarget {
     /** */
     private final IgniteServices services;
 
-    /** Server keep portable flag. */
-    private final boolean srvKeepPortable;
+    /** Server keep binary flag. */
+    private final boolean srvKeepBinary;
 
     /**
      * Ctor.
      *
      * @param platformCtx Context.
      * @param services Services facade.
-     * @param srvKeepPortable Server keep portable flag.
+     * @param srvKeepBinary Server keep binary flag.
      */
-    public PlatformServices(PlatformContext platformCtx, IgniteServices services, boolean srvKeepPortable) {
+    public PlatformServices(PlatformContext platformCtx, IgniteServices services, boolean srvKeepBinary) {
         super(platformCtx);
 
         assert services != null;
 
         this.services = services;
-        this.srvKeepPortable = srvKeepPortable;
+        this.srvKeepBinary = srvKeepBinary;
     }
 
     /**
@@ -88,16 +88,16 @@ public class PlatformServices extends PlatformAbstractTarget {
         if (services.isAsync())
             return this;
 
-        return new PlatformServices(platformCtx, services.withAsync(), srvKeepPortable);
+        return new PlatformServices(platformCtx, services.withAsync(), srvKeepBinary);
     }
 
     /**
-     * Gets services with server "keep portable" mode enabled.
+     * Gets services with server "keep binary" mode enabled.
      *
-     * @return Services with server "keep portable" mode enabled.
+     * @return Services with server "keep binary" mode enabled.
      */
-    public PlatformServices withServerKeepPortable() {
-        return srvKeepPortable ? this : new PlatformServices(platformCtx, services, true);
+    public PlatformServices withServerKeepBinary() {
+        return srvKeepBinary ? this : new PlatformServices(platformCtx, services, true);
     }
 
     /**
@@ -135,7 +135,7 @@ public class PlatformServices extends PlatformAbstractTarget {
                 ServiceConfiguration cfg = new ServiceConfiguration();
 
                 cfg.setName(reader.readString());
-                cfg.setService(new PlatformDotNetServiceImpl(reader.readObjectDetached(), platformCtx, srvKeepPortable));
+                cfg.setService(new PlatformDotNetServiceImpl(reader.readObjectDetached(), platformCtx, srvKeepBinary));
                 cfg.setTotalCount(reader.readInt());
                 cfg.setMaxPerNodeCount(reader.readInt());
                 cfg.setCacheName(reader.readString());
@@ -157,7 +157,7 @@ public class PlatformServices extends PlatformAbstractTarget {
                 int totalCnt = reader.readInt();
                 int maxPerNodeCnt = reader.readInt();
 
-                services.deployMultiple(name, new PlatformDotNetServiceImpl(svc, platformCtx, srvKeepPortable),
+                services.deployMultiple(name, new PlatformDotNetServiceImpl(svc, platformCtx, srvKeepBinary),
                     totalCnt, maxPerNodeCnt);
 
                 return TRUE;
@@ -218,7 +218,7 @@ public class PlatformServices extends PlatformAbstractTarget {
                     args = null;
 
                 try {
-                    Object result = ((PlatformDotNetService)arg).invokeMethod(mthdName, srvKeepPortable, args);
+                    Object result = ((PlatformDotNetService)arg).invokeMethod(mthdName, srvKeepBinary, args);
 
                     PlatformUtils.writeInvocationResult(writer, result, null);
                 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryCacheObjectsIterator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryCacheObjectsIterator.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryCacheObjectsIterator.java
index b25538b..b006c75 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryCacheObjectsIterator.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryCacheObjectsIterator.java
@@ -24,7 +24,7 @@ import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.util.typedef.internal.U;
 
 /**
- * Deserializes portable objects if needed.
+ * Deserializes binary objects if needed.
  */
 public class GridQueryCacheObjectsIterator implements Iterator<List<?>>, AutoCloseable {
     /** */
@@ -34,17 +34,17 @@ public class GridQueryCacheObjectsIterator implements Iterator<List<?>>, AutoClo
     private final GridCacheContext<?,?> cctx;
 
     /** */
-    private final boolean keepPortable;
+    private final boolean keepBinary;
 
     /**
      * @param iter Iterator.
      * @param cctx Cache context.
-     * @param keepPortable Keep portable.
+     * @param keepBinary Keep binary.
      */
-    public GridQueryCacheObjectsIterator(Iterator<List<?>> iter, GridCacheContext<?,?> cctx, boolean keepPortable) {
+    public GridQueryCacheObjectsIterator(Iterator<List<?>> iter, GridCacheContext<?,?> cctx, boolean keepBinary) {
         this.iter = iter;
         this.cctx = cctx;
-        this.keepPortable = keepPortable;
+        this.keepBinary = keepBinary;
     }
 
     /** {@inheritDoc} */
@@ -61,11 +61,11 @@ public class GridQueryCacheObjectsIterator implements Iterator<List<?>>, AutoClo
     /** {@inheritDoc} */
     @SuppressWarnings("unchecked")
     @Override public List<?> next() {
-        return (List<?>)cctx.unwrapPortablesIfNeeded((Collection<Object>)iter.next(), keepPortable);
+        return (List<?>)cctx.unwrapBinariesIfNeeded((Collection<Object>)iter.next(), keepBinary);
     }
 
     /** {@inheritDoc} */
     @Override public void remove() {
         iter.remove();
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/10b83fb8/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 005f617..0412b4c 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
@@ -209,7 +209,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
 
                     desc.name(simpleValType);
 
-                    if (ctx.cacheObjects().isPortableEnabled(ccfg)) {
+                    if (ctx.cacheObjects().isBinaryEnabled(ccfg)) {
                         // Safe to check null.
                         if (SQL_TYPES.contains(valCls))
                             desc.valueClass(valCls);
@@ -237,8 +237,8 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                     TypeId typeId;
                     TypeId altTypeId = null;
 
-                    if (valCls == null || ctx.cacheObjects().isPortableEnabled(ccfg)) {
-                        processPortableMeta(qryEntity, desc);
+                    if (valCls == null || ctx.cacheObjects().isBinaryEnabled(ccfg)) {
+                        processBinaryMeta(qryEntity, desc);
 
                         typeId = new TypeId(ccfg.getName(), ctx.cacheObjects().typeId(qryEntity.getValueType()));
 
@@ -281,7 +281,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
 
                     desc.name(meta.getSimpleValueType());
 
-                    if (ctx.cacheObjects().isPortableEnabled(ccfg)) {
+                    if (ctx.cacheObjects().isBinaryEnabled(ccfg)) {
                         // Safe to check null.
                         if (SQL_TYPES.contains(valCls))
                             desc.valueClass(valCls);
@@ -301,8 +301,8 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                     TypeId typeId;
                     TypeId altTypeId = null;
 
-                    if (valCls == null || ctx.cacheObjects().isPortableEnabled(ccfg)) {
-                        processPortableMeta(meta, desc);
+                    if (valCls == null || ctx.cacheObjects().isBinaryEnabled(ccfg)) {
+                        processBinaryMeta(meta, desc);
 
                         typeId = new TypeId(ccfg.getName(), ctx.cacheObjects().typeId(meta.getValueType()));
 
@@ -586,9 +586,9 @@ public class GridQueryProcessor extends GridProcessorAdapter {
 
             TypeId id;
 
-            boolean portableVal = ctx.cacheObjects().isPortableObject(val);
+            boolean binaryVal = ctx.cacheObjects().isBinaryObject(val);
 
-            if (portableVal) {
+            if (binaryVal) {
                 int typeId = ctx.cacheObjects().typeId(val);
 
                 id = new TypeId(space, typeId);
@@ -604,12 +604,12 @@ public class GridQueryProcessor extends GridProcessorAdapter {
             if (desc == null || !desc.registered())
                 return;
 
-            if (!portableVal && !desc.valueClass().isAssignableFrom(valCls))
+            if (!binaryVal && !desc.valueClass().isAssignableFrom(valCls))
                 throw new IgniteCheckedException("Failed to update index due to class name conflict" +
                     "(multiple classes with same simple name are stored in the same cache) " +
                     "[expCls=" + desc.valueClass().getName() + ", actualCls=" + valCls.getName() + ']');
 
-            if (!ctx.cacheObjects().isPortableObject(key)) {
+            if (!ctx.cacheObjects().isBinaryObject(key)) {
                 Class<?> keyCls = key.value(coctx, false).getClass();
 
                 if (!desc.keyClass().isAssignableFrom(keyCls))
@@ -697,7 +697,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                     return idx.queryTwoStep(
                         cctx,
                         qry,
-                        cctx.keepPortable());
+                        cctx.keepBinary());
                 }
             }, false);
         }
@@ -870,7 +870,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
             throw new IllegalStateException("Failed to execute query (grid is stopping).");
 
         try {
-            final boolean keepPortable = cctx.keepPortable();
+            final boolean keepBinary = cctx.keepBinary();
 
             return executeQuery(cctx, new IgniteOutClosureX<QueryCursor<List<?>>>() {
                 @Override public QueryCursor<List<?>> applyx() throws IgniteCheckedException {
@@ -885,7 +885,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
 
                     QueryCursorImpl<List<?>> cursor = new QueryCursorImpl<>(new Iterable<List<?>>() {
                         @Override public Iterator<List<?>> iterator() {
-                            return new GridQueryCacheObjectsIterator(res.iterator(), cctx, keepPortable);
+                            return new GridQueryCacheObjectsIterator(res.iterator(), cctx, keepBinary);
                         }
                     });
 
@@ -1304,13 +1304,13 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * Processes declarative metadata for portable object.
+     * Processes declarative metadata for binary object.
      *
      * @param meta Declared metadata.
      * @param d Type descriptor.
      * @throws IgniteCheckedException If failed.
      */
-    private void processPortableMeta(CacheTypeMetadata meta, TypeDescriptor d)
+    private void processBinaryMeta(CacheTypeMetadata meta, TypeDescriptor d)
         throws IgniteCheckedException {
         Map<String,String> aliases = meta.getAliases();
 
@@ -1318,7 +1318,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
             aliases = Collections.emptyMap();
 
         for (Map.Entry<String, Class<?>> entry : meta.getAscendingFields().entrySet()) {
-            PortableProperty prop = buildPortableProperty(entry.getKey(), entry.getValue(), aliases);
+            BinaryProperty prop = buildBinaryProperty(entry.getKey(), entry.getValue(), aliases);
 
             d.addProperty(prop, false);
 
@@ -1330,7 +1330,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
         }
 
         for (Map.Entry<String, Class<?>> entry : meta.getDescendingFields().entrySet()) {
-            PortableProperty prop = buildPortableProperty(entry.getKey(), entry.getValue(), aliases);
+            BinaryProperty prop = buildBinaryProperty(entry.getKey(), entry.getValue(), aliases);
 
             d.addProperty(prop, false);
 
@@ -1342,7 +1342,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
         }
 
         for (String txtIdx : meta.getTextFields()) {
-            PortableProperty prop = buildPortableProperty(txtIdx, String.class, aliases);
+            BinaryProperty prop = buildBinaryProperty(txtIdx, String.class, aliases);
 
             d.addProperty(prop, false);
 
@@ -1360,7 +1360,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                 int order = 0;
 
                 for (Map.Entry<String, IgniteBiTuple<Class<?>, Boolean>> idxField : idxFields.entrySet()) {
-                    PortableProperty prop = buildPortableProperty(idxField.getKey(), idxField.getValue().get1(), aliases);
+                    BinaryProperty prop = buildBinaryProperty(idxField.getKey(), idxField.getValue().get1(), aliases);
 
                     d.addProperty(prop, false);
 
@@ -1374,7 +1374,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
         }
 
         for (Map.Entry<String, Class<?>> entry : meta.getQueryFields().entrySet()) {
-            PortableProperty prop = buildPortableProperty(entry.getKey(), entry.getValue(), aliases);
+            BinaryProperty prop = buildBinaryProperty(entry.getKey(), entry.getValue(), aliases);
 
             if (!d.props.containsKey(prop.name()))
                 d.addProperty(prop, false);
@@ -1382,20 +1382,20 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * Processes declarative metadata for portable object.
+     * Processes declarative metadata for binary object.
      *
      * @param qryEntity Declared metadata.
      * @param d Type descriptor.
      * @throws IgniteCheckedException If failed.
      */
-    private void processPortableMeta(QueryEntity qryEntity, TypeDescriptor d) throws IgniteCheckedException {
+    private void processBinaryMeta(QueryEntity qryEntity, TypeDescriptor d) throws IgniteCheckedException {
         Map<String,String> aliases = qryEntity.getAliases();
 
         if (aliases == null)
             aliases = Collections.emptyMap();
 
         for (Map.Entry<String, String> entry : qryEntity.getFields().entrySet()) {
-            PortableProperty prop = buildPortableProperty(entry.getKey(), U.classForName(entry.getValue(), Object.class), aliases);
+            BinaryProperty prop = buildBinaryProperty(entry.getKey(), U.classForName(entry.getValue(), Object.class), aliases);
 
             d.addProperty(prop, false);
         }
@@ -1404,7 +1404,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * Processes declarative metadata for portable object.
+     * Processes declarative metadata for binary object.
      *
      * @param qryEntity Declared metadata.
      * @param d Type descriptor.
@@ -1485,18 +1485,18 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * Builds portable object property.
+     * Builds binary object property.
      *
      * @param pathStr String representing path to the property. May contains dots '.' to identify
      *      nested fields.
      * @param resType Result type.
      * @param aliases Aliases.
-     * @return Portable property.
+     * @return Binary property.
      */
-    private PortableProperty buildPortableProperty(String pathStr, Class<?> resType, Map<String,String> aliases) {
+    private BinaryProperty buildBinaryProperty(String pathStr, Class<?> resType, Map<String,String> aliases) {
         String[] path = pathStr.split("\\.");
 
-        PortableProperty res = null;
+        BinaryProperty res = null;
 
         StringBuilder fullName = new StringBuilder();
 
@@ -1508,7 +1508,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
 
             String alias = aliases.get(fullName.toString());
 
-            res = new PortableProperty(prop, res, resType, alias);
+            res = new BinaryProperty(prop, res, resType, alias);
         }
 
         return res;
@@ -1532,7 +1532,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
             resType,
             aliases);
 
-        if (res == null) // We check key before value consistently with PortableProperty.
+        if (res == null) // We check key before value consistently with BinaryProperty.
             res = buildClassProperty(false, valCls, pathStr, resType, aliases);
 
         if (res == null)
@@ -1812,7 +1812,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
     /**
      *
      */
-    private class PortableProperty extends GridQueryProperty {
+    private class BinaryProperty extends GridQueryProperty {
         /** Property name. */
         private String propName;
 
@@ -1820,7 +1820,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
         private String alias;
 
         /** Parent property. */
-        private PortableProperty parent;
+        private BinaryProperty parent;
 
         /** Result class. */
         private Class<?> type;
@@ -1841,7 +1841,7 @@ public class GridQueryProcessor extends GridProcessorAdapter {
          * @param parent Parent property.
          * @param type Result type.
          */
-        private PortableProperty(String propName, PortableProperty parent, Class<?> type, String alias) {
+        private BinaryProperty(String propName, BinaryProperty parent, Class<?> type, String alias) {
             this.propName = propName;
             this.alias = F.isEmpty(alias) ? propName : alias;
             this.parent = parent;
@@ -1858,15 +1858,15 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                 if (obj == null)
                     return null;
 
-                if (!ctx.cacheObjects().isPortableObject(obj))
-                    throw new IgniteCheckedException("Non-portable object received as a result of property extraction " +
+                if (!ctx.cacheObjects().isBinaryObject(obj))
+                    throw new IgniteCheckedException("Non-binary object received as a result of property extraction " +
                         "[parent=" + parent + ", propName=" + propName + ", obj=" + obj + ']');
             }
             else {
                 int isKeyProp0 = isKeyProp;
 
                 if (isKeyProp0 == 0) {
-                    // Key is allowed to be a non-portable object here.
+                    // Key is allowed to be a non-binary object here.
                     // We check key before value consistently with ClassProperty.
                     if (key instanceof BinaryObject && ((BinaryObject)key).hasField(propName))
                         isKeyProp = isKeyProp0 = 1;


[11/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary"

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java
new file mode 100644
index 0000000..9b9e8b8
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderReader.java
@@ -0,0 +1,846 @@
+/*
+ * 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.binary.builder;
+
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.internal.binary.BinaryObjectImpl;
+import org.apache.ignite.internal.binary.BinaryReaderExImpl;
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.binary.BinaryContext;
+import org.apache.ignite.internal.binary.BinaryPositionReadable;
+import org.apache.ignite.internal.binary.BinaryPrimitives;
+import org.apache.ignite.internal.binary.BinarySchema;
+import org.apache.ignite.internal.binary.streams.BinaryHeapInputStream;
+import org.apache.ignite.internal.binary.BinaryUtils;
+
+import java.sql.Timestamp;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+
+/**
+ *
+ */
+public class BinaryBuilderReader implements BinaryPositionReadable {
+    /** */
+    private final BinaryContext ctx;
+
+    /** */
+    private final byte[] arr;
+
+    /** */
+    private final BinaryReaderExImpl reader;
+
+    /** */
+    private final Map<Integer, BinaryObjectBuilderImpl> objMap;
+
+    /** */
+    private int pos;
+
+    /*
+     * Constructor.
+     *
+     * @param objImpl Portable object
+     */
+    BinaryBuilderReader(BinaryObjectImpl objImpl) {
+        ctx = objImpl.context();
+        arr = objImpl.array();
+        pos = objImpl.start();
+
+        reader = new BinaryReaderExImpl(ctx,
+            BinaryHeapInputStream.create(arr, pos),
+            ctx.configuration().getClassLoader());
+
+        objMap = new HashMap<>();
+    }
+
+    /**
+     * Copying constructor.
+     *
+     * @param other Other reader.
+     * @param start Start position.
+     */
+    BinaryBuilderReader(BinaryBuilderReader other, int start) {
+        this.ctx = other.ctx;
+        this.arr = other.arr;
+        this.pos = start;
+
+        reader = new BinaryReaderExImpl(ctx, BinaryHeapInputStream.create(arr, start), null, other.reader.handles());
+
+        this.objMap = other.objMap;
+    }
+
+    /**
+     * @return Portable context.
+     */
+    public BinaryContext portableContext() {
+        return ctx;
+    }
+
+    /**
+     * @param obj Mutable portable object.
+     */
+    public void registerObject(BinaryObjectBuilderImpl obj) {
+        objMap.put(obj.start(), obj);
+    }
+
+    /**
+     * Get schema of the object, starting at the given position.
+     *
+     * @return Object's schema.
+     */
+    public BinarySchema schema() {
+        return reader.getOrCreateSchema();
+    }
+
+    /**
+     * @return Read int value.
+     */
+    public int readInt() {
+        int res = readInt(0);
+
+        pos += 4;
+
+        return res;
+    }
+
+    /**
+     * @return Read int value.
+     */
+    public byte readByte() {
+        return arr[pos++];
+    }
+
+    /**
+     * @return Read boolean value.
+     */
+    public boolean readBoolean() {
+        return readByte() == 1;
+    }
+
+    /**
+     * @return Read int value.
+     */
+    public byte readByte(int off) {
+        return arr[pos + off];
+    }
+
+    /**
+     * @param off Offset related to {@link #pos}
+     * @return Read int value.
+     */
+    public int readInt(int off) {
+        return BinaryPrimitives.readInt(arr, pos + off);
+    }
+
+    /**
+     * @param pos Position in the source array.
+     * @return Read byte value.
+     */
+    public byte readBytePositioned(int pos) {
+        return BinaryPrimitives.readByte(arr, pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public short readShortPositioned(int pos) {
+        return BinaryPrimitives.readShort(arr, pos);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int readIntPositioned(int pos) {
+        return BinaryPrimitives.readInt(arr, pos);
+    }
+
+    /**
+     * @return Read length of array.
+     */
+    public int readLength() {
+        return BinaryPrimitives.readInt(arr, pos);
+    }
+
+    /**
+     * Read string length.
+     *
+     * @return String length.
+     */
+    public int readStringLength() {
+        return BinaryPrimitives.readInt(arr, pos);
+    }
+
+    /**
+     * Reads string.
+     *
+     * @return String.
+     */
+    public String readString() {
+        byte flag = readByte();
+
+        if (flag == GridBinaryMarshaller.NULL)
+            return null;
+
+        if (flag != GridBinaryMarshaller.STRING)
+            throw new BinaryObjectException("Failed to deserialize String.");
+
+        int len = readInt();
+
+        String str = new String(arr, pos, len, UTF_8);
+
+        pos += len;
+
+        return str;
+    }
+
+    /**
+     *
+     */
+    public void skipValue() {
+        byte type = arr[pos++];
+
+        int len;
+
+        switch (type) {
+            case GridBinaryMarshaller.NULL:
+                return;
+
+            case GridBinaryMarshaller.OBJ:
+                pos += readInt(GridBinaryMarshaller.TOTAL_LEN_POS - 1) - 1;
+
+                return;
+
+            case GridBinaryMarshaller.BOOLEAN:
+            case GridBinaryMarshaller.BYTE:
+                len = 1;
+                break;
+
+            case GridBinaryMarshaller.CHAR:
+            case GridBinaryMarshaller.SHORT:
+                len = 2;
+
+                break;
+
+            case GridBinaryMarshaller.HANDLE:
+            case GridBinaryMarshaller.FLOAT:
+            case GridBinaryMarshaller.INT:
+                len = 4;
+
+                break;
+
+            case GridBinaryMarshaller.ENUM:
+                //skipping type id and ordinal value
+                len = 8;
+
+                break;
+
+            case GridBinaryMarshaller.LONG:
+            case GridBinaryMarshaller.DOUBLE:
+                len = 8;
+
+                break;
+
+            case GridBinaryMarshaller.BYTE_ARR:
+            case GridBinaryMarshaller.BOOLEAN_ARR:
+                len = 4 + readLength();
+
+                break;
+
+            case GridBinaryMarshaller.STRING:
+                len = 4 + readStringLength();
+
+                break;
+
+            case GridBinaryMarshaller.DECIMAL:
+                len = /** scale */ 4  + /** mag len */ 4  + /** mag bytes count */ readInt(4);
+
+                break;
+
+            case GridBinaryMarshaller.UUID:
+                len = 8 + 8;
+
+                break;
+
+            case GridBinaryMarshaller.DATE:
+                len = 8;
+
+                break;
+
+            case GridBinaryMarshaller.TIMESTAMP:
+                len = 8 + 4;
+
+                break;
+
+            case GridBinaryMarshaller.CHAR_ARR:
+            case GridBinaryMarshaller.SHORT_ARR:
+                len = 4 + readLength() * 2;
+
+                break;
+
+            case GridBinaryMarshaller.INT_ARR:
+            case GridBinaryMarshaller.FLOAT_ARR:
+                len = 4 + readLength() * 4;
+
+                break;
+
+            case GridBinaryMarshaller.LONG_ARR:
+            case GridBinaryMarshaller.DOUBLE_ARR:
+                len = 4 + readLength() * 8;
+
+                break;
+
+            case GridBinaryMarshaller.DECIMAL_ARR:
+            case GridBinaryMarshaller.DATE_ARR:
+            case GridBinaryMarshaller.TIMESTAMP_ARR:
+            case GridBinaryMarshaller.OBJ_ARR:
+            case GridBinaryMarshaller.ENUM_ARR:
+            case GridBinaryMarshaller.UUID_ARR:
+            case GridBinaryMarshaller.STRING_ARR: {
+                int size = readInt();
+
+                for (int i = 0; i < size; i++)
+                    skipValue();
+
+                return;
+            }
+
+            case GridBinaryMarshaller.COL: {
+                int size = readInt();
+
+                pos++; // skip collection type
+
+                for (int i = 0; i < size; i++)
+                    skipValue();
+
+                return;
+            }
+
+            case GridBinaryMarshaller.MAP: {
+                int size = readInt();
+
+                pos++; // skip collection type
+
+                for (int i = 0; i < size; i++) {
+                    skipValue(); // skip key.
+                    skipValue(); // skip value.
+                }
+
+                return;
+            }
+
+            case GridBinaryMarshaller.PORTABLE_OBJ:
+                len = readInt() + 4;
+
+                break;
+
+            default:
+                throw new BinaryObjectException("Invalid flag value: " + type);
+        }
+
+        pos += len;
+    }
+
+    /**
+     * @param pos Position.
+     * @param len Length.
+     * @return Object.
+     */
+    public Object getValueQuickly(int pos, int len) {
+        byte type = arr[pos];
+
+        switch (type) {
+            case GridBinaryMarshaller.NULL:
+                return null;
+
+            case GridBinaryMarshaller.HANDLE: {
+                int objStart = pos - readIntPositioned(pos + 1);
+
+                BinaryObjectBuilderImpl res = objMap.get(objStart);
+
+                if (res == null) {
+                    res = new BinaryObjectBuilderImpl(new BinaryBuilderReader(this, objStart), objStart);
+
+                    objMap.put(objStart, res);
+                }
+
+                return res;
+            }
+
+            case GridBinaryMarshaller.OBJ: {
+                BinaryObjectBuilderImpl res = objMap.get(pos);
+
+                if (res == null) {
+                    res = new BinaryObjectBuilderImpl(new BinaryBuilderReader(this, pos), pos);
+
+                    objMap.put(pos, res);
+                }
+
+                return res;
+            }
+
+            case GridBinaryMarshaller.BYTE:
+                return arr[pos + 1];
+
+            case GridBinaryMarshaller.SHORT:
+                return BinaryPrimitives.readShort(arr, pos + 1);
+
+            case GridBinaryMarshaller.INT:
+                return BinaryPrimitives.readInt(arr, pos + 1);
+
+            case GridBinaryMarshaller.LONG:
+                return BinaryPrimitives.readLong(arr, pos + 1);
+
+            case GridBinaryMarshaller.FLOAT:
+                return BinaryPrimitives.readFloat(arr, pos + 1);
+
+            case GridBinaryMarshaller.DOUBLE:
+                return BinaryPrimitives.readDouble(arr, pos + 1);
+
+            case GridBinaryMarshaller.CHAR:
+                return BinaryPrimitives.readChar(arr, pos + 1);
+
+            case GridBinaryMarshaller.BOOLEAN:
+                return arr[pos + 1] != 0;
+
+            case GridBinaryMarshaller.DECIMAL:
+            case GridBinaryMarshaller.STRING:
+            case GridBinaryMarshaller.UUID:
+            case GridBinaryMarshaller.DATE:
+            case GridBinaryMarshaller.TIMESTAMP:
+                return new BinaryPlainLazyValue(this, pos, len);
+
+            case GridBinaryMarshaller.BYTE_ARR:
+            case GridBinaryMarshaller.SHORT_ARR:
+            case GridBinaryMarshaller.INT_ARR:
+            case GridBinaryMarshaller.LONG_ARR:
+            case GridBinaryMarshaller.FLOAT_ARR:
+            case GridBinaryMarshaller.DOUBLE_ARR:
+            case GridBinaryMarshaller.CHAR_ARR:
+            case GridBinaryMarshaller.BOOLEAN_ARR:
+            case GridBinaryMarshaller.DECIMAL_ARR:
+            case GridBinaryMarshaller.DATE_ARR:
+            case GridBinaryMarshaller.TIMESTAMP_ARR:
+            case GridBinaryMarshaller.UUID_ARR:
+            case GridBinaryMarshaller.STRING_ARR:
+            case GridBinaryMarshaller.ENUM_ARR:
+            case GridBinaryMarshaller.OBJ_ARR:
+            case GridBinaryMarshaller.COL:
+            case GridBinaryMarshaller.MAP:
+                return new LazyCollection(pos);
+
+            case GridBinaryMarshaller.ENUM: {
+                if (len == 1) {
+                    assert readByte(pos) == GridBinaryMarshaller.NULL;
+
+                    return null;
+                }
+
+                int mark = position();
+                position(pos + 1);
+
+                BinaryBuilderEnum builderEnum = new BinaryBuilderEnum(this);
+
+                position(mark);
+
+                return builderEnum;
+            }
+
+            case GridBinaryMarshaller.PORTABLE_OBJ: {
+                int size = readIntPositioned(pos + 1);
+
+                int start = readIntPositioned(pos + 4 + size);
+
+                BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr, pos + 4 + start);
+
+                return new BinaryPlainBinaryObject(portableObj);
+            }
+
+            default:
+                throw new BinaryObjectException("Invalid flag value: " + type);
+        }
+    }
+
+    /**
+     * @return Parsed value.
+     */
+    public Object parseValue() {
+        int valPos = pos;
+
+        byte type = arr[pos++];
+
+        int plainLazyValLen;
+
+        boolean modifiableLazyVal = false;
+
+        switch (type) {
+            case GridBinaryMarshaller.NULL:
+                return null;
+
+            case GridBinaryMarshaller.HANDLE: {
+                int objStart = pos - 1 - readInt();
+
+                BinaryObjectBuilderImpl res = objMap.get(objStart);
+
+                if (res == null) {
+                    res = new BinaryObjectBuilderImpl(new BinaryBuilderReader(this, objStart), objStart);
+
+                    objMap.put(objStart, res);
+                }
+
+                return res;
+            }
+
+            case GridBinaryMarshaller.OBJ: {
+                pos--;
+
+                BinaryObjectBuilderImpl res = objMap.get(pos);
+
+                if (res == null) {
+                    res = new BinaryObjectBuilderImpl(new BinaryBuilderReader(this, pos), pos);
+
+                    objMap.put(pos, res);
+                }
+
+                pos += readInt(GridBinaryMarshaller.TOTAL_LEN_POS);
+
+                return res;
+            }
+
+            case GridBinaryMarshaller.BYTE:
+                return arr[pos++];
+
+            case GridBinaryMarshaller.SHORT: {
+                Object res = BinaryPrimitives.readShort(arr, pos);
+                pos += 2;
+                return res;
+            }
+
+            case GridBinaryMarshaller.INT:
+                return readInt();
+
+            case GridBinaryMarshaller.LONG:
+                plainLazyValLen = 8;
+
+                break;
+
+            case GridBinaryMarshaller.FLOAT:
+                plainLazyValLen = 4;
+
+                break;
+
+            case GridBinaryMarshaller.DOUBLE:
+                plainLazyValLen = 8;
+
+                break;
+
+            case GridBinaryMarshaller.CHAR:
+                plainLazyValLen = 2;
+
+                break;
+
+            case GridBinaryMarshaller.BOOLEAN:
+                return arr[pos++] != 0;
+
+            case GridBinaryMarshaller.DECIMAL:
+                plainLazyValLen = /** scale */ 4  + /** mag len */ 4  + /** mag bytes count */ readInt(4);
+
+                break;
+
+            case GridBinaryMarshaller.STRING:
+                plainLazyValLen = 4 + readStringLength();
+
+                break;
+
+            case GridBinaryMarshaller.UUID:
+                plainLazyValLen = 8 + 8;
+
+                break;
+
+            case GridBinaryMarshaller.DATE:
+                plainLazyValLen = 8;
+
+                break;
+
+            case GridBinaryMarshaller.TIMESTAMP:
+                plainLazyValLen = 8 + 4;
+
+                break;
+
+            case GridBinaryMarshaller.BYTE_ARR:
+                plainLazyValLen = 4 + readLength();
+                modifiableLazyVal = true;
+
+                break;
+
+            case GridBinaryMarshaller.SHORT_ARR:
+                plainLazyValLen = 4 + readLength() * 2;
+                modifiableLazyVal = true;
+
+                break;
+
+            case GridBinaryMarshaller.INT_ARR:
+                plainLazyValLen = 4 + readLength() * 4;
+                modifiableLazyVal = true;
+
+                break;
+
+            case GridBinaryMarshaller.LONG_ARR:
+                plainLazyValLen = 4 + readLength() * 8;
+                modifiableLazyVal = true;
+
+                break;
+
+            case GridBinaryMarshaller.FLOAT_ARR:
+                plainLazyValLen = 4 + readLength() * 4;
+                modifiableLazyVal = true;
+
+                break;
+
+            case GridBinaryMarshaller.DOUBLE_ARR:
+                plainLazyValLen = 4 + readLength() * 8;
+                modifiableLazyVal = true;
+
+                break;
+
+            case GridBinaryMarshaller.CHAR_ARR:
+                plainLazyValLen = 4 + readLength() * 2;
+                modifiableLazyVal = true;
+
+                break;
+
+            case GridBinaryMarshaller.BOOLEAN_ARR:
+                plainLazyValLen = 4 + readLength();
+                modifiableLazyVal = true;
+
+                break;
+
+            case GridBinaryMarshaller.OBJ_ARR:
+                return new BinaryObjectArrayLazyValue(this);
+
+            case GridBinaryMarshaller.DATE_ARR: {
+                int size = readInt();
+
+                Date[] res = new Date[size];
+
+                for (int i = 0; i < res.length; i++) {
+                    byte flag = arr[pos++];
+
+                    if (flag == GridBinaryMarshaller.NULL) continue;
+
+                    if (flag != GridBinaryMarshaller.DATE)
+                        throw new BinaryObjectException("Invalid flag value: " + flag);
+
+                    long time = BinaryPrimitives.readLong(arr, pos);
+
+                    pos += 8;
+
+                    res[i] = new Date(time);
+                }
+
+                return res;
+            }
+
+            case GridBinaryMarshaller.TIMESTAMP_ARR: {
+                int size = readInt();
+
+                Timestamp[] res = new Timestamp[size];
+
+                for (int i = 0; i < res.length; i++) {
+                    byte flag = arr[pos++];
+
+                    if (flag == GridBinaryMarshaller.NULL)
+                        continue;
+
+                    if (flag != GridBinaryMarshaller.TIMESTAMP)
+                        throw new BinaryObjectException("Invalid flag value: " + flag);
+
+                    long time = BinaryPrimitives.readLong(arr, pos);
+
+                    pos += 8;
+
+                    int nano = BinaryPrimitives.readInt(arr, pos);
+
+                    pos += 4;
+
+                    Timestamp ts = new Timestamp(time);
+
+                    ts.setNanos(ts.getNanos() + nano);
+
+                    res[i] = ts;
+                }
+
+                return res;
+            }
+
+            case GridBinaryMarshaller.UUID_ARR:
+            case GridBinaryMarshaller.STRING_ARR:
+            case GridBinaryMarshaller.DECIMAL_ARR: {
+                int size = readInt();
+
+                for (int i = 0; i < size; i++) {
+                    byte flag = arr[pos++];
+
+                    if (flag == GridBinaryMarshaller.UUID)
+                        pos += 8 + 8;
+                    else if (flag == GridBinaryMarshaller.STRING)
+                        pos += 4 + readStringLength();
+                    else if (flag == GridBinaryMarshaller.DECIMAL) {
+                        pos += 4; // scale value
+                        pos += 4 + readLength();
+                    }
+                    else
+                        assert flag == GridBinaryMarshaller.NULL;
+                }
+
+                return new BinaryModifiableLazyValue(this, valPos, pos - valPos);
+            }
+
+            case GridBinaryMarshaller.COL: {
+                int size = readInt();
+                byte colType = arr[pos++];
+
+                switch (colType) {
+                    case GridBinaryMarshaller.USER_COL:
+                    case GridBinaryMarshaller.ARR_LIST:
+                        return new BinaryLazyArrayList(this, size);
+
+                    case GridBinaryMarshaller.LINKED_LIST:
+                        return new BinaryLazyLinkedList(this, size);
+
+                    case GridBinaryMarshaller.HASH_SET:
+                    case GridBinaryMarshaller.LINKED_HASH_SET:
+                        return new BinaryLazySet(this, size);
+                }
+
+                throw new BinaryObjectException("Unknown collection type: " + colType);
+            }
+
+            case GridBinaryMarshaller.MAP:
+                return BinaryLazyMap.parseMap(this);
+
+            case GridBinaryMarshaller.ENUM:
+                return new BinaryBuilderEnum(this);
+
+            case GridBinaryMarshaller.ENUM_ARR:
+                return new BinaryEnumArrayLazyValue(this);
+
+            case GridBinaryMarshaller.PORTABLE_OBJ: {
+                int size = readInt();
+
+                pos += size;
+
+                int start = readInt();
+
+                BinaryObjectImpl portableObj = new BinaryObjectImpl(ctx, arr,
+                    pos - 4 - size + start);
+
+                return new BinaryPlainBinaryObject(portableObj);
+            }
+
+            default:
+                throw new BinaryObjectException("Invalid flag value: " + type);
+        }
+
+        BinaryAbstractLazyValue res;
+
+        if (modifiableLazyVal)
+            res = new BinaryModifiableLazyValue(this, valPos, 1 + plainLazyValLen);
+        else
+            res = new BinaryPlainLazyValue(this, valPos, 1 + plainLazyValLen);
+
+        pos += plainLazyValLen;
+
+        return res;
+    }
+
+    /**
+     * @return Array.
+     */
+    public byte[] array() {
+        return arr;
+    }
+
+    /**
+     * @return Position of reader.
+     */
+    public int position() {
+        return pos;
+    }
+
+    /**
+     * @param pos New pos.
+     */
+    public void position(int pos) {
+        this.pos = pos;
+    }
+
+    /**
+     * @param n Number of bytes to skip.
+     */
+    public void skip(int n) {
+        pos += n;
+    }
+
+    /**
+     * @return Reader.
+     */
+    BinaryReaderExImpl reader() {
+        return reader;
+    }
+
+    /**
+     *
+     */
+    private class LazyCollection implements BinaryLazyValue {
+        /** */
+        private final int valOff;
+
+        /** */
+        private Object col;
+
+        /**
+         * @param valOff Value.
+         */
+        protected LazyCollection(int valOff) {
+            this.valOff = valOff;
+        }
+
+        /**
+         * @return Object.
+         */
+        private Object wrappedCollection() {
+            if (col == null) {
+                position(valOff);
+
+                col = parseValue();
+            }
+
+            return col;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) {
+            ctx.writeValue(writer, wrappedCollection());
+        }
+
+        /** {@inheritDoc} */
+        @Override public Object value() {
+            return BinaryUtils.unwrapLazy(wrappedCollection());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializationAware.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializationAware.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializationAware.java
new file mode 100644
index 0000000..7710ba3
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializationAware.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.binary.builder;
+
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+
+/**
+ *
+ */
+interface BinaryBuilderSerializationAware {
+    /**
+     * @param writer Writer.
+     * @param ctx Context.
+     */
+    public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx);
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java
new file mode 100644
index 0000000..458602d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryBuilderSerializer.java
@@ -0,0 +1,217 @@
+/*
+ * 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.binary.builder;
+
+import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.internal.binary.BinaryMetadata;
+import org.apache.ignite.internal.binary.BinaryObjectExImpl;
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.binary.BinaryContext;
+import org.apache.ignite.internal.binary.BinaryUtils;
+
+import java.util.Collection;
+import java.util.IdentityHashMap;
+import java.util.Map;
+
+/**
+ *
+ */
+class BinaryBuilderSerializer {
+    /** */
+    private final Map<BinaryObjectBuilderImpl, Integer> objToPos = new IdentityHashMap<>();
+
+    /** */
+    private Map<BinaryObject, BinaryObjectBuilderImpl> portableObjToWrapper;
+
+    /**
+     * @param obj Mutable object.
+     * @param posInResArr Object position in the array.
+     */
+    public void registerObjectWriting(BinaryObjectBuilderImpl obj, int posInResArr) {
+        objToPos.put(obj, posInResArr);
+    }
+
+    /**
+     * @param writer Writer.
+     * @param val Value.
+     */
+    public void writeValue(BinaryWriterExImpl writer, Object val) {
+        if (val == null) {
+            writer.writeByte(GridBinaryMarshaller.NULL);
+
+            return;
+        }
+
+        if (val instanceof BinaryBuilderSerializationAware) {
+            ((BinaryBuilderSerializationAware)val).writeTo(writer, this);
+
+            return;
+        }
+
+        if (val instanceof BinaryObjectExImpl) {
+            if (portableObjToWrapper == null)
+                portableObjToWrapper = new IdentityHashMap<>();
+
+            BinaryObjectBuilderImpl wrapper = portableObjToWrapper.get(val);
+
+            if (wrapper == null) {
+                wrapper = BinaryObjectBuilderImpl.wrap((BinaryObject)val);
+
+                portableObjToWrapper.put((BinaryObject)val, wrapper);
+            }
+
+            val = wrapper;
+        }
+
+        if (val instanceof BinaryObjectBuilderImpl) {
+            BinaryObjectBuilderImpl obj = (BinaryObjectBuilderImpl)val;
+
+            Integer posInResArr = objToPos.get(obj);
+
+            if (posInResArr == null) {
+                objToPos.put(obj, writer.out().position());
+
+                obj.serializeTo(writer.newWriter(obj.typeId()), this);
+            }
+            else {
+                int handle = writer.out().position() - posInResArr;
+
+                writer.writeByte(GridBinaryMarshaller.HANDLE);
+                writer.writeInt(handle);
+            }
+
+            return;
+        }
+
+        if (val.getClass().isEnum()) {
+            String typeName = BinaryContext.typeName(val.getClass().getName());
+            int typeId = writer.context().typeId(typeName);
+
+            BinaryMetadata meta = new BinaryMetadata(typeId, typeName, null, null, null, true);
+            writer.context().updateMetadata(typeId, meta);
+
+            writer.writeByte(GridBinaryMarshaller.ENUM);
+            writer.writeInt(typeId);
+            writer.writeInt(((Enum)val).ordinal());
+
+            return;
+        }
+
+        if (val instanceof Collection) {
+            Collection<?> c = (Collection<?>)val;
+
+            writer.writeByte(GridBinaryMarshaller.COL);
+            writer.writeInt(c.size());
+
+            byte colType = writer.context().collectionType(c.getClass());
+
+            writer.writeByte(colType);
+
+            for (Object obj : c)
+                writeValue(writer, obj);
+
+            return;
+        }
+
+        if (val instanceof Map) {
+            Map<?, ?> map = (Map<?, ?>)val;
+
+            writer.writeByte(GridBinaryMarshaller.MAP);
+            writer.writeInt(map.size());
+
+            writer.writeByte(writer.context().mapType(map.getClass()));
+
+            for (Map.Entry<?, ?> entry : map.entrySet()) {
+                writeValue(writer, entry.getKey());
+                writeValue(writer, entry.getValue());
+            }
+
+            return;
+        }
+
+        Byte flag = BinaryUtils.PLAIN_CLASS_TO_FLAG.get(val.getClass());
+
+        if (flag != null) {
+            BinaryUtils.writePlainObject(writer, val);
+
+            return;
+        }
+
+        if (val instanceof Object[]) {
+            int compTypeId = writer.context().typeId(((Object[])val).getClass().getComponentType().getName());
+
+            if (val instanceof BinaryBuilderEnum[]) {
+                writeArray(writer, GridBinaryMarshaller.ENUM_ARR, (Object[])val, compTypeId);
+
+                return;
+            }
+
+            if (((Object[])val).getClass().getComponentType().isEnum()) {
+                Enum[] enumArr = (Enum[])val;
+
+                writer.writeByte(GridBinaryMarshaller.ENUM_ARR);
+                writer.writeInt(compTypeId);
+                writer.writeInt(enumArr.length);
+
+                for (Enum anEnum : enumArr)
+                    writeValue(writer, anEnum);
+
+                return;
+            }
+
+            writeArray(writer, GridBinaryMarshaller.OBJ_ARR, (Object[])val, compTypeId);
+
+            return;
+        }
+
+        writer.doWriteObject(val);
+    }
+
+    /**
+     * @param writer Writer.
+     * @param elementType Element type.
+     * @param arr The array.
+     * @param compTypeId Component type ID.
+     */
+    public void writeArray(BinaryWriterExImpl writer, byte elementType, Object[] arr, int compTypeId) {
+        writer.writeByte(elementType);
+        writer.writeInt(compTypeId);
+        writer.writeInt(arr.length);
+
+        for (Object obj : arr)
+            writeValue(writer, obj);
+    }
+
+    /**
+     * @param writer Writer.
+     * @param elementType Element type.
+     * @param arr The array.
+     * @param clsName Component class name.
+     */
+    public void writeArray(BinaryWriterExImpl writer, byte elementType, Object[] arr, String clsName) {
+        writer.writeByte(elementType);
+        writer.writeInt(GridBinaryMarshaller.UNREGISTERED_TYPE_ID);
+        writer.writeString(clsName);
+        writer.writeInt(arr.length);
+
+        for (Object obj : arr)
+            writeValue(writer, obj);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java
new file mode 100644
index 0000000..db55050
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryEnumArrayLazyValue.java
@@ -0,0 +1,113 @@
+/*
+ * 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.binary.builder;
+
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryInvalidTypeException;
+
+/**
+ *
+ */
+class BinaryEnumArrayLazyValue extends BinaryAbstractLazyValue {
+    /** */
+    private final int len;
+
+    /** */
+    private final int compTypeId;
+
+    /** */
+    private final String clsName;
+
+    /**
+     * @param reader Reader.
+     */
+    protected BinaryEnumArrayLazyValue(BinaryBuilderReader reader) {
+        super(reader, reader.position() - 1);
+
+        int typeId = reader.readInt();
+
+        if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) {
+            clsName = reader.readString();
+
+            Class cls;
+
+            try {
+                cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader());
+            }
+            catch (ClassNotFoundException e) {
+                throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e);
+            }
+
+            compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId();
+        }
+        else {
+            compTypeId = typeId;
+            clsName = null;
+        }
+
+        int size = reader.readInt();
+
+        for (int i = 0; i < size; i++)
+            reader.skipValue();
+
+        len = reader.position() - valOff;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected Object init() {
+        reader.position(valOff + 1);
+
+        //skipping component type id
+        reader.readInt();
+
+        int size = reader.readInt();
+
+        BinaryBuilderEnum[] res = new BinaryBuilderEnum[size];
+
+        for (int i = 0; i < size; i++) {
+            byte flag = reader.readByte();
+
+            if (flag == GridBinaryMarshaller.NULL)
+                continue;
+
+            if (flag != GridBinaryMarshaller.ENUM)
+                throw new BinaryObjectException("Invalid flag value: " + flag);
+
+            res[i] = new BinaryBuilderEnum(reader);
+        }
+
+        return res;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) {
+        if (val != null) {
+            if (clsName != null)
+                ctx.writeArray(writer, GridBinaryMarshaller.ENUM_ARR, (Object[])val, clsName);
+            else
+                ctx.writeArray(writer, GridBinaryMarshaller.ENUM_ARR, (Object[])val, compTypeId);
+
+            return;
+        }
+
+        writer.write(reader.array(), valOff, len);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java
new file mode 100644
index 0000000..3627b1d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyArrayList.java
@@ -0,0 +1,167 @@
+/*
+ * 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.binary.builder;
+
+import java.util.AbstractList;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.binary.BinaryUtils;
+
+/**
+ *
+ */
+class BinaryLazyArrayList extends AbstractList<Object> implements BinaryBuilderSerializationAware {
+    /** */
+    private final BinaryBuilderReader reader;
+
+    /** */
+    private final int off;
+
+    /** */
+    private List<Object> delegate;
+
+    /**
+     * @param reader Reader.
+     * @param size Size,
+     */
+    BinaryLazyArrayList(BinaryBuilderReader reader, int size) {
+        this.reader = reader;
+        off = reader.position() - 1/* flag */ - 4/* size */ - 1/* col type */;
+
+        assert size >= 0;
+
+        for (int i = 0; i < size; i++)
+            reader.skipValue();
+    }
+
+    /**
+     *
+     */
+    private void ensureDelegateInit() {
+        if (delegate == null) {
+            int size = reader.readIntPositioned(off + 1);
+
+            reader.position(off + 1/* flag */ + 4/* size */ + 1/* col type */);
+
+            delegate = new ArrayList<>(size);
+
+            for (int i = 0; i < size; i++)
+                delegate.add(reader.parseValue());
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public Object get(int idx) {
+        ensureDelegateInit();
+
+        return BinaryUtils.unwrapLazy(delegate.get(idx));
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean add(Object o) {
+        ensureDelegateInit();
+
+        return delegate.add(o);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void add(int idx, Object element) {
+        ensureDelegateInit();
+
+        delegate.add(idx, element);
+    }
+
+    /** {@inheritDoc} */
+    @Override public Object set(int idx, Object element) {
+        ensureDelegateInit();
+
+        return BinaryUtils.unwrapLazy(delegate.set(idx, element));
+    }
+
+    /** {@inheritDoc} */
+    @Override public Object remove(int idx) {
+        ensureDelegateInit();
+
+        return BinaryUtils.unwrapLazy(delegate.remove(idx));
+    }
+
+    /** {@inheritDoc} */
+    @Override public void clear() {
+        if (delegate == null)
+            delegate = new ArrayList<>();
+        else
+            delegate.clear();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean addAll(int idx, Collection<?> c) {
+        return delegate.addAll(idx, c);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void removeRange(int fromIdx, int toIdx) {
+        ensureDelegateInit();
+
+        delegate.subList(fromIdx, toIdx).clear();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        if (delegate == null)
+            return reader.readIntPositioned(off + 1);
+
+        return delegate.size();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) {
+        if (delegate == null) {
+            int size = reader.readIntPositioned(off + 1);
+
+            int hdrSize = 1 /* flag */ + 4 /* size */ + 1 /* col type */;
+
+            writer.write(reader.array(), off, hdrSize);
+
+            reader.position(off + hdrSize);
+
+            for (int i = 0; i < size; i++) {
+                Object o = reader.parseValue();
+
+                ctx.writeValue(writer, o);
+            }
+        }
+        else {
+            writer.writeByte(GridBinaryMarshaller.COL);
+            writer.writeInt(delegate.size());
+
+            byte colType = reader.array()[off + 1 /* flag */ + 4 /* size */];
+            writer.writeByte(colType);
+
+            int oldPos = reader.position();
+
+            for (Object o : delegate)
+                ctx.writeValue(writer, o);
+
+            // PortableBuilderImpl might have been written. It could override reader's position.
+            reader.position(oldPos);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyLinkedList.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyLinkedList.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyLinkedList.java
new file mode 100644
index 0000000..1813fcc
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyLinkedList.java
@@ -0,0 +1,218 @@
+/*
+ * 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.binary.builder;
+
+import java.util.AbstractList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.binary.BinaryUtils;
+
+/**
+ *
+ */
+class BinaryLazyLinkedList extends AbstractList<Object> implements BinaryBuilderSerializationAware {
+    /** */
+    private final BinaryBuilderReader reader;
+
+    /** */
+    private final int off;
+
+    /** */
+    private List<Object> delegate;
+
+    /**
+     * @param reader Reader.
+     * @param size Size,
+     */
+    BinaryLazyLinkedList(BinaryBuilderReader reader, int size) {
+        this.reader = reader;
+        off = reader.position() - 1/* flag */ - 4/* size */ - 1/* col type */;
+
+        assert size >= 0;
+
+        for (int i = 0; i < size; i++)
+            reader.skipValue();
+    }
+
+    /**
+     *
+     */
+    private void ensureDelegateInit() {
+        if (delegate == null) {
+            int size = reader.readIntPositioned(off + 1);
+
+            reader.position(off + 1/* flag */ + 4/* size */ + 1/* col type */);
+
+            delegate = new LinkedList<>();
+
+            for (int i = 0; i < size; i++)
+                delegate.add(reader.parseValue());
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public Object get(int idx) {
+        ensureDelegateInit();
+
+        return BinaryUtils.unwrapLazy(delegate.get(idx));
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean add(Object o) {
+        ensureDelegateInit();
+
+        return delegate.add(o);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void add(int idx, Object element) {
+        ensureDelegateInit();
+
+        delegate.add(idx, element);
+    }
+
+    /** {@inheritDoc} */
+    @Override public Object set(int idx, Object element) {
+        ensureDelegateInit();
+
+        return BinaryUtils.unwrapLazy(delegate.set(idx, element));
+    }
+
+    /** {@inheritDoc} */
+    @Override public Object remove(int idx) {
+        ensureDelegateInit();
+
+        return BinaryUtils.unwrapLazy(delegate.remove(idx));
+    }
+
+    /** {@inheritDoc} */
+    @Override public void clear() {
+        if (delegate == null)
+            delegate = new LinkedList<>();
+        else
+            delegate.clear();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean addAll(int idx, Collection<?> c) {
+        ensureDelegateInit();
+
+        return delegate.addAll(idx, c);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void removeRange(int fromIdx, int toIdx) {
+        ensureDelegateInit();
+
+        delegate.subList(fromIdx, toIdx).clear();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        if (delegate == null)
+            return reader.readIntPositioned(off + 1);
+
+        return delegate.size();
+    }
+
+    /** {@inheritDoc} */
+    @Override public ListIterator<Object> listIterator(final int idx) {
+        ensureDelegateInit();
+
+        return new ListIterator<Object>() {
+            /** */
+            private final ListIterator<Object> delegate = BinaryLazyLinkedList.super.listIterator(idx);
+
+            @Override public boolean hasNext() {
+                return delegate.hasNext();
+            }
+
+            @Override public Object next() {
+                return BinaryUtils.unwrapLazy(delegate.next());
+            }
+
+            @Override public boolean hasPrevious() {
+                return delegate.hasPrevious();
+            }
+
+            @Override public Object previous() {
+                return BinaryUtils.unwrapLazy(delegate.previous());
+            }
+
+            @Override public int nextIndex() {
+                return delegate.nextIndex();
+            }
+
+            @Override public int previousIndex() {
+                return delegate.previousIndex();
+            }
+
+            @Override public void remove() {
+                delegate.remove();
+            }
+
+            @Override public void set(Object o) {
+                delegate.set(o);
+            }
+
+            @Override public void add(Object o) {
+                delegate.add(o);
+            }
+        };
+    }
+
+    /** {@inheritDoc} */
+    @Override public Iterator<Object> iterator() {
+        ensureDelegateInit();
+
+        return BinaryUtils.unwrapLazyIterator(super.iterator());
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) {
+        if (delegate == null) {
+            int size = reader.readIntPositioned(off + 1);
+
+            int hdrSize = 1 /* flag */ + 4 /* size */ + 1 /* col type */;
+            writer.write(reader.array(), off, hdrSize);
+
+            reader.position(off + hdrSize);
+
+            for (int i = 0; i < size; i++) {
+                Object o = reader.parseValue();
+
+                ctx.writeValue(writer, o);
+            }
+        }
+        else {
+            writer.writeByte(GridBinaryMarshaller.COL);
+            writer.writeInt(delegate.size());
+
+            byte colType = reader.array()[off + 1 /* flag */ + 4 /* size */];
+            writer.writeByte(colType);
+
+            for (Object o : delegate)
+                ctx.writeValue(writer, o);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java
new file mode 100644
index 0000000..c82ff7d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyMap.java
@@ -0,0 +1,221 @@
+/*
+ * 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.binary.builder;
+
+import java.util.AbstractMap;
+import java.util.AbstractSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.binary.BinaryUtils;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ *
+ */
+class BinaryLazyMap extends AbstractMap<Object, Object> implements BinaryBuilderSerializationAware {
+    /** */
+    private final BinaryBuilderReader reader;
+
+    /** */
+    private final int off;
+
+    /** */
+    private Map<Object, Object> delegate;
+
+    /**
+     * @param reader Reader.
+     * @param off Offset.
+     */
+    private BinaryLazyMap(BinaryBuilderReader reader, int off) {
+        this.reader = reader;
+        this.off = off;
+    }
+
+    /**
+     * @param reader Reader.
+     * @return PortableLazyMap.
+     */
+    @Nullable public static BinaryLazyMap parseMap(BinaryBuilderReader reader) {
+        int off = reader.position() - 1;
+
+        int size = reader.readInt();
+
+        reader.skip(1); // map type.
+
+        for (int i = 0; i < size; i++) {
+            reader.skipValue(); // skip key
+            reader.skipValue(); // skip value
+        }
+
+        return new BinaryLazyMap(reader, off);
+    }
+
+    /**
+     *
+     */
+    private void ensureDelegateInit() {
+        if (delegate == null) {
+            int size = reader.readIntPositioned(off + 1);
+
+            reader.position(off + 1/* flag */ + 4/* size */ + 1/* col type */);
+
+            delegate = new LinkedHashMap<>();
+
+            for (int i = 0; i < size; i++)
+                delegate.put(BinaryUtils.unwrapLazy(reader.parseValue()), reader.parseValue());
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) {
+        if (delegate == null) {
+            int size = reader.readIntPositioned(off + 1);
+
+            int hdrSize = 1 /* flag */ + 4 /* size */ + 1 /* col type */;
+            writer.write(reader.array(), off, hdrSize);
+
+            reader.position(off + hdrSize);
+
+            for (int i = 0; i < size; i++) {
+                ctx.writeValue(writer, reader.parseValue()); // key
+                ctx.writeValue(writer, reader.parseValue()); // value
+            }
+        }
+        else {
+            writer.writeByte(GridBinaryMarshaller.MAP);
+            writer.writeInt(delegate.size());
+
+            byte colType = reader.array()[off + 1 /* flag */ + 4 /* size */];
+
+            writer.writeByte(colType);
+
+            for (Entry<Object, Object> entry : delegate.entrySet()) {
+                ctx.writeValue(writer, entry.getKey());
+                ctx.writeValue(writer, entry.getValue());
+            }
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        if (delegate == null)
+            return reader.readIntPositioned(off + 1);
+
+        return delegate.size();
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean containsKey(Object key) {
+        ensureDelegateInit();
+
+        return delegate.containsKey(key);
+    }
+
+    /** {@inheritDoc} */
+    @Override public boolean containsValue(Object val) {
+        return values().contains(val);
+    }
+
+    /** {@inheritDoc} */
+    @Override public Set<Object> keySet() {
+        ensureDelegateInit();
+
+        return delegate.keySet();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void clear() {
+        if (delegate == null)
+            delegate = new LinkedHashMap<>();
+        else
+            delegate.clear();
+    }
+
+    /** {@inheritDoc} */
+    @Override public Object get(Object key) {
+        ensureDelegateInit();
+
+        return BinaryUtils.unwrapLazy(delegate.get(key));
+    }
+
+    /** {@inheritDoc} */
+    @Override public Object put(Object key, Object val) {
+        ensureDelegateInit();
+
+        return BinaryUtils.unwrapLazy(delegate.put(key, val));
+    }
+
+    /** {@inheritDoc} */
+    @Override public Object remove(Object key) {
+        ensureDelegateInit();
+
+        return BinaryUtils.unwrapLazy(delegate.remove(key));
+    }
+
+    /** {@inheritDoc} */
+    @Override public Set<Entry<Object, Object>> entrySet() {
+        ensureDelegateInit();
+
+        return new AbstractSet<Entry<Object, Object>>() {
+            @Override public boolean contains(Object o) {
+                throw new UnsupportedOperationException();
+            }
+
+            @Override public Iterator<Entry<Object, Object>> iterator() {
+                return new Iterator<Entry<Object, Object>>() {
+                    /** */
+                    private final Iterator<Entry<Object, Object>> itr = delegate.entrySet().iterator();
+
+                    @Override public boolean hasNext() {
+                        return itr.hasNext();
+                    }
+
+                    @Override public Entry<Object, Object> next() {
+                        Entry<Object, Object> res = itr.next();
+
+                        final Object val = res.getValue();
+
+                        if (val instanceof BinaryLazyValue) {
+                            return new SimpleEntry<Object, Object>(res.getKey(), val) {
+                                private static final long serialVersionUID = 0L;
+
+                                @Override public Object getValue() {
+                                    return ((BinaryLazyValue)val).value();
+                                }
+                            };
+                        }
+
+                        return res;
+                    }
+
+                    @Override public void remove() {
+                        itr.remove();
+                    }
+                };
+            }
+
+            @Override public int size() {
+                return delegate.size();
+            }
+        };
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazySet.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazySet.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazySet.java
new file mode 100644
index 0000000..6be4c76
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazySet.java
@@ -0,0 +1,92 @@
+/*
+ * 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.binary.builder;
+
+import java.util.Collection;
+import java.util.Set;
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.binary.BinaryUtils;
+import org.apache.ignite.internal.util.typedef.internal.U;
+
+/**
+ *
+ */
+class BinaryLazySet extends BinaryAbstractLazyValue {
+    /** */
+    private final int off;
+
+    /**
+     * @param reader Reader.
+     * @param size Size.
+     */
+    BinaryLazySet(BinaryBuilderReader reader, int size) {
+        super(reader, reader.position() - 1);
+
+        off = reader.position() - 1/* flag */ - 4/* size */ - 1/* col type */;
+
+        assert size >= 0;
+
+        for (int i = 0; i < size; i++)
+            reader.skipValue();
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) {
+        if (val == null) {
+            int size = reader.readIntPositioned(off + 1);
+
+            int hdrSize = 1 /* flag */ + 4 /* size */ + 1 /* col type */;
+            writer.write(reader.array(), off, hdrSize);
+
+            reader.position(off + hdrSize);
+
+            for (int i = 0; i < size; i++) {
+                Object o = reader.parseValue();
+
+                ctx.writeValue(writer, o);
+            }
+        }
+        else {
+            Collection<Object> c = (Collection<Object>)val;
+
+            writer.writeByte(GridBinaryMarshaller.COL);
+            writer.writeInt(c.size());
+
+            byte colType = reader.array()[off + 1 /* flag */ + 4 /* size */];
+            writer.writeByte(colType);
+
+            for (Object o : c)
+                ctx.writeValue(writer, o);
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override protected Object init() {
+        int size = reader.readIntPositioned(off + 1);
+
+        reader.position(off + 1/* flag */ + 4/* size */ + 1/* col type */);
+
+        Set<Object> res = U.newLinkedHashSet(size);
+
+        for (int i = 0; i < size; i++)
+            res.add(BinaryUtils.unwrapLazy(reader.parseValue()));
+
+        return res;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyValue.java
new file mode 100644
index 0000000..f9da84b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryLazyValue.java
@@ -0,0 +1,28 @@
+/*
+ * 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.binary.builder;
+
+/**
+ *
+ */
+public interface BinaryLazyValue extends BinaryBuilderSerializationAware {
+    /**
+     * @return Value.
+     */
+    public Object value();
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryModifiableLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryModifiableLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryModifiableLazyValue.java
new file mode 100644
index 0000000..070abf3
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryModifiableLazyValue.java
@@ -0,0 +1,52 @@
+/*
+ * 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.binary.builder;
+
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+
+/**
+ *
+ */
+public class BinaryModifiableLazyValue extends BinaryAbstractLazyValue {
+    /** */
+    protected final int len;
+
+    /**
+     * @param reader
+     * @param valOff
+     * @param len
+     */
+    public BinaryModifiableLazyValue(BinaryBuilderReader reader, int valOff, int len) {
+        super(reader, valOff);
+
+        this.len = len;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected Object init() {
+        return reader.reader().unmarshal(valOff);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) {
+        if (val == null)
+            writer.write(reader.array(), valOff, len);
+        else
+            writer.writeObject(val);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java
new file mode 100644
index 0000000..05713b4
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectArrayLazyValue.java
@@ -0,0 +1,90 @@
+/*
+ * 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.binary.builder;
+
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.binary.BinaryInvalidTypeException;
+
+/**
+ *
+ */
+class BinaryObjectArrayLazyValue extends BinaryAbstractLazyValue {
+    /** */
+    private Object[] lazyValsArr;
+
+    /** */
+    private int compTypeId;
+
+    /** */
+    private String clsName;
+
+    /**
+     * @param reader Reader.
+     */
+    protected BinaryObjectArrayLazyValue(BinaryBuilderReader reader) {
+        super(reader, reader.position() - 1);
+
+        int typeId = reader.readInt();
+
+        if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) {
+            clsName = reader.readString();
+
+            Class cls;
+
+            try {
+                cls = U.forName(reader.readString(), reader.portableContext().configuration().getClassLoader());
+            }
+            catch (ClassNotFoundException e) {
+                throw new BinaryInvalidTypeException("Failed to load the class: " + clsName, e);
+            }
+
+            compTypeId = reader.portableContext().descriptorForClass(cls, true).typeId();
+        }
+        else {
+            compTypeId = typeId;
+            clsName = null;
+        }
+
+        int size = reader.readInt();
+
+        lazyValsArr = new Object[size];
+
+        for (int i = 0; i < size; i++)
+            lazyValsArr[i] = reader.parseValue();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected Object init() {
+        for (int i = 0; i < lazyValsArr.length; i++) {
+            if (lazyValsArr[i] instanceof BinaryLazyValue)
+                lazyValsArr[i] = ((BinaryLazyValue)lazyValsArr[i]).value();
+        }
+
+        return lazyValsArr;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) {
+        if (clsName == null)
+            ctx.writeArray(writer, GridBinaryMarshaller.OBJ_ARR, lazyValsArr, compTypeId);
+        else
+            ctx.writeArray(writer, GridBinaryMarshaller.OBJ_ARR, lazyValsArr, clsName);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
index f1d4185..5e60a20 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryObjectBuilderImpl.java
@@ -25,19 +25,12 @@ import org.apache.ignite.binary.BinaryType;
 import org.apache.ignite.internal.binary.BinaryMetadata;
 import org.apache.ignite.internal.binary.BinaryObjectImpl;
 import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.PortableContext;
-import org.apache.ignite.internal.binary.PortableSchema;
-import org.apache.ignite.internal.binary.PortableSchemaRegistry;
-import org.apache.ignite.internal.binary.BinaryMetadata;
-import org.apache.ignite.internal.binary.BinaryObjectImpl;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.binary.BinaryContext;
+import org.apache.ignite.internal.binary.BinarySchema;
+import org.apache.ignite.internal.binary.BinarySchemaRegistry;
 import org.apache.ignite.internal.binary.BinaryObjectOffheapImpl;
-import org.apache.ignite.internal.binary.BinaryWriterExImpl;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.PortableContext;
-import org.apache.ignite.internal.binary.PortableSchema;
-import org.apache.ignite.internal.binary.PortableSchemaRegistry;
-import org.apache.ignite.internal.binary.PortableUtils;
+import org.apache.ignite.internal.binary.BinaryUtils;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
@@ -49,13 +42,6 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Set;
 
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.DFLT_HDR_LEN;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.FLAGS_POS;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.HASH_CODE_POS;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.PROTO_VER_POS;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.TYPE_ID_POS;
-import static org.apache.ignite.internal.binary.GridPortableMarshaller.UNREGISTERED_TYPE_ID;
-
 /**
  *
  */
@@ -64,7 +50,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
     private static final Object REMOVED_FIELD_MARKER = new Object();
 
     /** */
-    private final PortableContext ctx;
+    private final BinaryContext ctx;
 
     /** */
     private final int typeId;
@@ -94,7 +80,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
     private final int hdrLen;
 
     /** Context of PortableObject reading process. Or {@code null} if object is not created from PortableObject. */
-    private final PortableBuilderReader reader;
+    private final BinaryBuilderReader reader;
 
     /** */
     private int hashCode;
@@ -103,8 +89,8 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
      * @param clsName Class name.
      * @param ctx Portable context.
      */
-    public BinaryObjectBuilderImpl(PortableContext ctx, String clsName) {
-        this(ctx, ctx.typeId(clsName), PortableContext.typeName(clsName));
+    public BinaryObjectBuilderImpl(BinaryContext ctx, String clsName) {
+        this(ctx, ctx.typeId(clsName), BinaryContext.typeName(clsName));
     }
 
     /**
@@ -112,7 +98,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
      * @param ctx Context.
      * @param typeId Type id.
      */
-    public BinaryObjectBuilderImpl(PortableContext ctx, int typeId, String typeName) {
+    public BinaryObjectBuilderImpl(BinaryContext ctx, int typeId, String typeName) {
         this.typeId = typeId;
         this.typeName = typeName;
         this.ctx = ctx;
@@ -120,7 +106,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
         start = -1;
         flags = -1;
         reader = null;
-        hdrLen = GridPortableMarshaller.DFLT_HDR_LEN;
+        hdrLen = GridBinaryMarshaller.DFLT_HDR_LEN;
 
         readCache = Collections.emptyMap();
     }
@@ -129,7 +115,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
      * @param obj Object to wrap.
      */
     public BinaryObjectBuilderImpl(BinaryObjectImpl obj) {
-        this(new PortableBuilderReader(obj), obj.start());
+        this(new BinaryBuilderReader(obj), obj.start());
 
         reader.registerObject(this);
     }
@@ -138,23 +124,23 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
      * @param reader ctx
      * @param start Start.
      */
-    BinaryObjectBuilderImpl(PortableBuilderReader reader, int start) {
+    BinaryObjectBuilderImpl(BinaryBuilderReader reader, int start) {
         this.reader = reader;
         this.start = start;
-        this.flags = reader.readShortPositioned(start + GridPortableMarshaller.FLAGS_POS);
+        this.flags = reader.readShortPositioned(start + GridBinaryMarshaller.FLAGS_POS);
 
-        byte ver = reader.readBytePositioned(start + GridPortableMarshaller.PROTO_VER_POS);
+        byte ver = reader.readBytePositioned(start + GridBinaryMarshaller.PROTO_VER_POS);
 
-        PortableUtils.checkProtocolVersion(ver);
+        BinaryUtils.checkProtocolVersion(ver);
 
-        int typeId = reader.readIntPositioned(start + GridPortableMarshaller.TYPE_ID_POS);
+        int typeId = reader.readIntPositioned(start + GridBinaryMarshaller.TYPE_ID_POS);
         ctx = reader.portableContext();
-        hashCode = reader.readIntPositioned(start + GridPortableMarshaller.HASH_CODE_POS);
+        hashCode = reader.readIntPositioned(start + GridBinaryMarshaller.HASH_CODE_POS);
 
-        if (typeId == GridPortableMarshaller.UNREGISTERED_TYPE_ID) {
+        if (typeId == GridBinaryMarshaller.UNREGISTERED_TYPE_ID) {
             int mark = reader.position();
 
-            reader.position(start + GridPortableMarshaller.DFLT_HDR_LEN);
+            reader.position(start + GridBinaryMarshaller.DFLT_HDR_LEN);
 
             clsNameToWrite = reader.readString();
 
@@ -177,7 +163,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
         }
         else {
             this.typeId = typeId;
-            hdrLen = GridPortableMarshaller.DFLT_HDR_LEN;
+            hdrLen = GridBinaryMarshaller.DFLT_HDR_LEN;
         }
     }
 
@@ -186,7 +172,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
         try (BinaryWriterExImpl writer = new BinaryWriterExImpl(ctx)) {
             writer.typeId(typeId);
 
-            PortableBuilderSerializer serializationCtx = new PortableBuilderSerializer();
+            BinaryBuilderSerializer serializationCtx = new BinaryBuilderSerializer();
 
             serializationCtx.registerObjectWriting(this, 0);
 
@@ -202,14 +188,14 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
      * @param writer Writer.
      * @param serializer Serializer.
      */
-    void serializeTo(BinaryWriterExImpl writer, PortableBuilderSerializer serializer) {
+    void serializeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer serializer) {
         try {
             writer.preWrite(registeredType ? null : clsNameToWrite);
 
             Set<Integer> remainsFlds = null;
 
             if (reader != null) {
-                PortableSchema schema = reader.schema();
+                BinarySchema schema = reader.schema();
 
                 Map<Integer, Object> assignedFldsById;
 
@@ -228,16 +214,16 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
                     assignedFldsById = Collections.emptyMap();
 
                 // Get footer details.
-                int fieldIdLen = PortableUtils.fieldIdLength(flags);
-                int fieldOffsetLen = PortableUtils.fieldOffsetLength(flags);
+                int fieldIdLen = BinaryUtils.fieldIdLength(flags);
+                int fieldOffsetLen = BinaryUtils.fieldOffsetLength(flags);
 
-                IgniteBiTuple<Integer, Integer> footer = PortableUtils.footerAbsolute(reader, start);
+                IgniteBiTuple<Integer, Integer> footer = BinaryUtils.footerAbsolute(reader, start);
 
                 int footerPos = footer.get1();
                 int footerEnd = footer.get2();
 
                 // Get raw position.
-                int rawPos = PortableUtils.rawOffsetAbsolute(reader, start);
+                int rawPos = BinaryUtils.rawOffsetAbsolute(reader, start);
 
                 // Position reader on data.
                 reader.position(start + hdrLen);
@@ -265,7 +251,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
                     else {
                         int type = fieldLen != 0 ? reader.readByte(0) : 0;
 
-                        if (fieldLen != 0 && !PortableUtils.isPlainArrayType(type) && PortableUtils.isPlainType(type)) {
+                        if (fieldLen != 0 && !BinaryUtils.isPlainArrayType(type) && BinaryUtils.isPlainType(type)) {
                             writer.writeFieldId(fieldId);
 
                             writer.write(reader.array(), reader.position(), fieldLen);
@@ -321,26 +307,26 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
 
                     int newFldTypeId;
 
-                    if (val instanceof PortableValueWithType) {
-                        newFldTypeId = ((PortableValueWithType)val).typeId();
+                    if (val instanceof BinaryValueWithType) {
+                        newFldTypeId = ((BinaryValueWithType)val).typeId();
 
-                        if (newFldTypeId == GridPortableMarshaller.OBJ && ((PortableValueWithType)val).value() == null)
+                        if (newFldTypeId == GridBinaryMarshaller.OBJ && ((BinaryValueWithType)val).value() == null)
                             nullObjField = true;
                     }
                     else
-                        newFldTypeId = PortableUtils.typeByClass(val.getClass());
+                        newFldTypeId = BinaryUtils.typeByClass(val.getClass());
 
-                    String newFldTypeName = PortableUtils.fieldTypeName(newFldTypeId);
+                    String newFldTypeName = BinaryUtils.fieldTypeName(newFldTypeId);
 
                     if (oldFldTypeName == null) {
                         // It's a new field, we have to add it to metadata.
                         if (fieldsMeta == null)
                             fieldsMeta = new HashMap<>();
 
-                        fieldsMeta.put(name, PortableUtils.fieldTypeId(newFldTypeName));
+                        fieldsMeta.put(name, BinaryUtils.fieldTypeId(newFldTypeName));
                     }
                     else if (!nullObjField) {
-                        String objTypeName = PortableUtils.fieldTypeName(GridPortableMarshaller.OBJ);
+                        String objTypeName = BinaryUtils.fieldTypeName(GridBinaryMarshaller.OBJ);
 
                         if (!objTypeName.equals(oldFldTypeName) && !oldFldTypeName.equals(newFldTypeName)) {
                             throw new BinaryObjectException(
@@ -357,8 +343,8 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
 
             if (reader != null) {
                 // Write raw data if any.
-                int rawOff = PortableUtils.rawOffsetAbsolute(reader, start);
-                int footerStart = PortableUtils.footerStartAbsolute(reader, start);
+                int rawOff = BinaryUtils.rawOffsetAbsolute(reader, start);
+                int footerStart = BinaryUtils.footerStartAbsolute(reader, start);
 
                 if (rawOff < footerStart) {
                     writer.rawWriter();
@@ -367,7 +353,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
                 }
 
                 // Shift reader to the end of the object.
-                reader.position(start + PortableUtils.length(reader, start));
+                reader.position(start + BinaryUtils.length(reader, start));
             }
 
             writer.postWrite(true, registeredType, hashCode);
@@ -375,7 +361,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
             // Update metadata if needed.
             int schemaId = writer.schemaId();
 
-            PortableSchemaRegistry schemaReg = ctx.schemaRegistry(typeId);
+            BinarySchemaRegistry schemaReg = ctx.schemaRegistry(typeId);
 
             if (schemaReg.schema(schemaId) == null) {
                 String typeName = this.typeName;
@@ -386,7 +372,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
                     typeName = meta.typeName();
                 }
 
-                PortableSchema curSchema = writer.currentSchema();
+                BinarySchema curSchema = writer.currentSchema();
 
                 ctx.updateMetadata(typeId, new BinaryMetadata(typeId, typeName, fieldsMeta,
                     ctx.affinityKeyFieldName(typeId), Collections.singleton(curSchema), false));
@@ -419,7 +405,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
     private IgniteBiTuple<Integer, Integer> fieldPositionAndLength(int footerPos, int footerEnd, int rawPos,
         int fieldIdLen, int fieldOffsetLen) {
         // Get field offset first.
-        int fieldOffset = PortableUtils.fieldOffsetRelative(reader, footerPos + fieldIdLen, fieldOffsetLen);
+        int fieldOffset = BinaryUtils.fieldOffsetRelative(reader, footerPos + fieldIdLen, fieldOffsetLen);
         int fieldPos = start + fieldOffset;
 
         // Get field length.
@@ -430,7 +416,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
             fieldLen = rawPos - fieldPos;
         else {
             // Field is somewhere in the middle, get difference with the next offset.
-            int nextFieldOffset = PortableUtils.fieldOffsetRelative(reader,
+            int nextFieldOffset = BinaryUtils.fieldOffsetRelative(reader,
                 footerPos + fieldIdLen + fieldOffsetLen + fieldIdLen, fieldOffsetLen);
 
             fieldLen = nextFieldOffset - fieldOffset;
@@ -446,19 +432,19 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
         assert reader != null;
 
         if (readCache == null) {
-            int fieldIdLen = PortableUtils.fieldIdLength(flags);
-            int fieldOffsetLen = PortableUtils.fieldOffsetLength(flags);
+            int fieldIdLen = BinaryUtils.fieldIdLength(flags);
+            int fieldOffsetLen = BinaryUtils.fieldOffsetLength(flags);
 
-            PortableSchema schema = reader.schema();
+            BinarySchema schema = reader.schema();
 
             Map<Integer, Object> readCache = new HashMap<>();
 
-            IgniteBiTuple<Integer, Integer> footer = PortableUtils.footerAbsolute(reader, start);
+            IgniteBiTuple<Integer, Integer> footer = BinaryUtils.footerAbsolute(reader, start);
 
             int footerPos = footer.get1();
             int footerEnd = footer.get2();
 
-            int rawPos = PortableUtils.rawOffsetAbsolute(reader, start);
+            int rawPos = BinaryUtils.rawOffsetAbsolute(reader, start);
 
             int idx = 0;
 
@@ -499,20 +485,20 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
             val = readCache.get(fldId);
         }
 
-        return (T)PortableUtils.unwrapLazy(val);
+        return (T)BinaryUtils.unwrapLazy(val);
     }
 
     /** {@inheritDoc} */
     @Override public BinaryObjectBuilder setField(String name, Object val0) {
-        Object val = val0 == null ? new PortableValueWithType(PortableUtils.typeByClass(Object.class), null) : val0;
+        Object val = val0 == null ? new BinaryValueWithType(BinaryUtils.typeByClass(Object.class), null) : val0;
 
         if (assignedVals == null)
             assignedVals = new LinkedHashMap<>();
 
         Object oldVal = assignedVals.put(name, val);
 
-        if (oldVal instanceof PortableValueWithType && val0 != null) {
-            ((PortableValueWithType)oldVal).value(val);
+        if (oldVal instanceof BinaryValueWithType && val0 != null) {
+            ((BinaryValueWithType)oldVal).value(val);
 
             assignedVals.put(name, oldVal);
         }
@@ -525,7 +511,7 @@ public class BinaryObjectBuilderImpl implements BinaryObjectBuilder {
         if (assignedVals == null)
             assignedVals = new LinkedHashMap<>();
 
-        assignedVals.put(name, new PortableValueWithType(PortableUtils.typeByClass(type), val));
+        assignedVals.put(name, new BinaryValueWithType(BinaryUtils.typeByClass(type), val));
 
         return this;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java
new file mode 100644
index 0000000..5ac4e97
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/builder/BinaryPlainBinaryObject.java
@@ -0,0 +1,53 @@
+/*
+ * 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.binary.builder;
+
+import org.apache.ignite.internal.binary.BinaryObjectImpl;
+import org.apache.ignite.internal.binary.BinaryObjectOffheapImpl;
+import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+import org.apache.ignite.binary.BinaryObject;
+
+/**
+ *
+ */
+public class BinaryPlainBinaryObject implements BinaryLazyValue {
+    /** */
+    private final BinaryObject portableObj;
+
+    /**
+     * @param portableObj Portable object.
+     */
+    public BinaryPlainBinaryObject(BinaryObject portableObj) {
+        this.portableObj = portableObj;
+    }
+
+    /** {@inheritDoc} */
+    @Override public Object value() {
+        return portableObj;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeTo(BinaryWriterExImpl writer, BinaryBuilderSerializer ctx) {
+        BinaryObject val = portableObj;
+
+        if (val instanceof BinaryObjectOffheapImpl)
+            val = ((BinaryObjectOffheapImpl)val).heapCopy();
+
+        writer.doWritePortableObject((BinaryObjectImpl)val);
+    }
+}


[08/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary"

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableHeapInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableHeapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableHeapInputStream.java
deleted file mode 100644
index d8717ce..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableHeapInputStream.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * 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.binary.streams;
-
-import java.util.Arrays;
-
-/**
- * Portable off-heap input stream.
- */
-public final class PortableHeapInputStream extends PortableAbstractInputStream {
-    /**
-     * Create stream with pointer set at the given position.
-     *
-     * @param data Data.
-     * @param pos Position.
-     * @return Stream.
-     */
-    public static PortableHeapInputStream create(byte[] data, int pos) {
-        assert pos < data.length;
-
-        PortableHeapInputStream stream = new PortableHeapInputStream(data);
-
-        stream.pos = pos;
-
-        return stream;
-    }
-
-    /** Data. */
-    private byte[] data;
-
-    /**
-     * Constructor.
-     *
-     * @param data Data.
-     */
-    public PortableHeapInputStream(byte[] data) {
-        this.data = data;
-
-        len = data.length;
-    }
-
-    /**
-     * @return Copy of this stream.
-     */
-    public PortableHeapInputStream copy() {
-        PortableHeapInputStream in = new PortableHeapInputStream(Arrays.copyOf(data, data.length));
-
-        in.position(pos);
-
-        return in;
-    }
-
-    /**
-     * Method called from JNI to resize stream.
-     *
-     * @param len Required length.
-     * @return Underlying byte array.
-     */
-    public byte[] resize(int len) {
-        if (data.length < len) {
-            byte[] data0 = new byte[len];
-
-            UNSAFE.copyMemory(data, BYTE_ARR_OFF, data0, BYTE_ARR_OFF, data.length);
-
-            data = data0;
-        }
-
-        return data;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int remaining() {
-        return data.length - pos;
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] array() {
-        return data;
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] arrayCopy() {
-        byte[] res = new byte[len];
-
-        UNSAFE.copyMemory(data, BYTE_ARR_OFF, res, BYTE_ARR_OFF, res.length);
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean hasArray() {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected byte readByteAndShift() {
-        return data[pos++];
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void copyAndShift(Object target, long off, int len) {
-        UNSAFE.copyMemory(data, BYTE_ARR_OFF + pos, target, off, len);
-
-        shift(len);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected short readShortFast() {
-        return UNSAFE.getShort(data, BYTE_ARR_OFF + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected char readCharFast() {
-        return UNSAFE.getChar(data, BYTE_ARR_OFF + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected int readIntFast() {
-        return UNSAFE.getInt(data, BYTE_ARR_OFF + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected long readLongFast() {
-        return UNSAFE.getLong(data, BYTE_ARR_OFF + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected byte readBytePositioned0(int pos) {
-        return UNSAFE.getByte(data, BYTE_ARR_OFF + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected short readShortPositioned0(int pos) {
-        short res = UNSAFE.getShort(data, BYTE_ARR_OFF + pos);
-
-        if (!LITTLE_ENDIAN)
-            res = Short.reverseBytes(res);
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected int readIntPositioned0(int pos) {
-        int res = UNSAFE.getInt(data, BYTE_ARR_OFF + pos);
-
-        if (!LITTLE_ENDIAN)
-            res = Integer.reverseBytes(res);
-
-        return res;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableHeapOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableHeapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableHeapOutputStream.java
deleted file mode 100644
index 8f9ca4a..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableHeapOutputStream.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * 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.binary.streams;
-
-/**
- * Portable heap output stream.
- */
-public final class PortableHeapOutputStream extends PortableAbstractOutputStream {
-    /** Allocator. */
-    private final PortableMemoryAllocatorChunk chunk;
-
-    /** Data. */
-    private byte[] data;
-
-    /**
-     * Constructor.
-     *
-     * @param cap Initial capacity.
-     */
-    public PortableHeapOutputStream(int cap) {
-        this(cap, PortableMemoryAllocator.INSTANCE.chunk());
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param cap Capacity.
-     * @param chunk Chunk.
-     */
-    public PortableHeapOutputStream(int cap, PortableMemoryAllocatorChunk chunk) {
-        this.chunk = chunk;
-
-        data = chunk.allocate(cap);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void close() {
-        chunk.release(data, pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void ensureCapacity(int cnt) {
-        if (cnt > data.length) {
-            int newCap = capacity(data.length, cnt);
-
-            data = chunk.reallocate(data, newCap);
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] array() {
-        return data;
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] arrayCopy() {
-        byte[] res = new byte[pos];
-
-        UNSAFE.copyMemory(data, BYTE_ARR_OFF, res, BYTE_ARR_OFF, pos);
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean hasArray() {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void writeByteAndShift(byte val) {
-        data[pos++] = val;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void copyAndShift(Object src, long off, int len) {
-        UNSAFE.copyMemory(src, off, data, BYTE_ARR_OFF + pos, len);
-
-        shift(len);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void writeShortFast(short val) {
-        UNSAFE.putShort(data, BYTE_ARR_OFF + pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void writeCharFast(char val) {
-        UNSAFE.putChar(data, BYTE_ARR_OFF + pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void writeIntFast(int val) {
-        UNSAFE.putInt(data, BYTE_ARR_OFF + pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void writeLongFast(long val) {
-        UNSAFE.putLong(data, BYTE_ARR_OFF + pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteByte(byte val) {
-        UNSAFE.putByte(data, BYTE_ARR_OFF + pos++, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteShort(short val) {
-        if (!LITTLE_ENDIAN)
-            val = Short.reverseBytes(val);
-
-        UNSAFE.putShort(data, BYTE_ARR_OFF + pos, val);
-
-        shift(2);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteShort(int pos, short val) {
-        if (!LITTLE_ENDIAN)
-            val = Short.reverseBytes(val);
-
-        UNSAFE.putShort(data, BYTE_ARR_OFF + pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteChar(char val) {
-        if (!LITTLE_ENDIAN)
-            val = Character.reverseBytes(val);
-
-        UNSAFE.putChar(data, BYTE_ARR_OFF + pos, val);
-
-        shift(2);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteInt(int val) {
-        if (!LITTLE_ENDIAN)
-            val = Integer.reverseBytes(val);
-
-        UNSAFE.putInt(data, BYTE_ARR_OFF + pos, val);
-
-        shift(4);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteInt(int pos, int val) {
-        if (!LITTLE_ENDIAN)
-            val = Integer.reverseBytes(val);
-
-        UNSAFE.putInt(data, BYTE_ARR_OFF + pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteLong(long val) {
-        if (!LITTLE_ENDIAN)
-            val = Long.reverseBytes(val);
-
-        UNSAFE.putLong(data, BYTE_ARR_OFF + pos, val);
-
-        shift(8);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableInputStream.java
deleted file mode 100644
index cf71dc7..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableInputStream.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * 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.binary.streams;
-
-import org.apache.ignite.internal.binary.PortablePositionReadable;
-import org.apache.ignite.internal.binary.PortablePositionReadable;
-
-/**
- * Portable input stream.
- */
-public interface PortableInputStream extends PortableStream, PortablePositionReadable {
-    /**
-     * Read byte value.
-     *
-     * @return Byte value.
-     */
-    public byte readByte();
-
-    /**
-     * Read byte array.
-     *
-     * @param cnt Expected item count.
-     * @return Byte array.
-     */
-    public byte[] readByteArray(int cnt);
-
-    /**
-     * Reads {@code cnt} of bytes into byte array.
-     *
-     * @param arr Expected item count.
-     * @param off offset
-     * @param cnt number of bytes to read.
-     * @return actual length read.
-     */
-    public int read(byte[] arr, int off, int cnt);
-
-    /**
-     * Read boolean value.
-     *
-     * @return Boolean value.
-     */
-    public boolean readBoolean();
-
-    /**
-     * Read boolean array.
-     *
-     * @param cnt Expected item count.
-     * @return Boolean array.
-     */
-    public boolean[] readBooleanArray(int cnt);
-
-    /**
-     * Read short value.
-     *
-     * @return Short value.
-     */
-    public short readShort();
-
-    /**
-     * Read short array.
-     *
-     * @param cnt Expected item count.
-     * @return Short array.
-     */
-    public short[] readShortArray(int cnt);
-
-    /**
-     * Read char value.
-     *
-     * @return Char value.
-     */
-    public char readChar();
-
-    /**
-     * Read char array.
-     *
-     * @param cnt Expected item count.
-     * @return Char array.
-     */
-    public char[] readCharArray(int cnt);
-
-    /**
-     * Read int value.
-     *
-     * @return Int value.
-     */
-    public int readInt();
-
-    /**
-     * Read int array.
-     *
-     * @param cnt Expected item count.
-     * @return Int array.
-     */
-    public int[] readIntArray(int cnt);
-
-    /**
-     * Read float value.
-     *
-     * @return Float value.
-     */
-    public float readFloat();
-
-    /**
-     * Read float array.
-     *
-     * @param cnt Expected item count.
-     * @return Float array.
-     */
-    public float[] readFloatArray(int cnt);
-
-    /**
-     * Read long value.
-     *
-     * @return Long value.
-     */
-    public long readLong();
-
-    /**
-     * Read long array.
-     *
-     * @param cnt Expected item count.
-     * @return Long array.
-     */
-    public long[] readLongArray(int cnt);
-
-    /**
-     * Read double value.
-     *
-     * @return Double value.
-     */
-    public double readDouble();
-
-    /**
-     * Read double array.
-     *
-     * @param cnt Expected item count.
-     * @return Double array.
-     */
-    public double[] readDoubleArray(int cnt);
-
-    /**
-     * Gets amount of remaining data in bytes.
-     *
-     * @return Remaining data.
-     */
-    public int remaining();
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableMemoryAllocator.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableMemoryAllocator.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableMemoryAllocator.java
deleted file mode 100644
index f20a7bc..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableMemoryAllocator.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.binary.streams;
-
-/**
- * Thread-local memory allocator.
- */
-public final class PortableMemoryAllocator {
-    /** Memory allocator instance. */
-    public static final PortableMemoryAllocator INSTANCE = new PortableMemoryAllocator();
-
-    /** Holders. */
-    private static final ThreadLocal<PortableMemoryAllocatorChunk> holders = new ThreadLocal<>();
-
-    /**
-     * Ensures singleton.
-     */
-    private PortableMemoryAllocator() {
-        // No-op.
-    }
-
-    public PortableMemoryAllocatorChunk chunk() {
-        PortableMemoryAllocatorChunk holder = holders.get();
-
-        if (holder == null)
-            holders.set(holder = new PortableMemoryAllocatorChunk());
-
-        return holder;
-    }
-
-    /**
-     * Checks whether a thread-local array is acquired or not.
-     * The function is used by Unit tests.
-     *
-     * @return {@code true} if acquired {@code false} otherwise.
-     */
-    public boolean isAcquired() {
-        PortableMemoryAllocatorChunk holder = holders.get();
-
-        return holder != null && holder.isAcquired();
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableMemoryAllocatorChunk.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableMemoryAllocatorChunk.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableMemoryAllocatorChunk.java
deleted file mode 100644
index 749a0b4..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableMemoryAllocatorChunk.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * 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.binary.streams;
-
-import org.apache.ignite.internal.util.GridUnsafe;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import sun.misc.Unsafe;
-
-import static org.apache.ignite.IgniteSystemProperties.IGNITE_MARSHAL_BUFFERS_RECHECK;
-
-/**
- * Memory allocator chunk.
- */
-public class PortableMemoryAllocatorChunk {
-    /** Unsafe instance. */
-    protected static final Unsafe UNSAFE = GridUnsafe.unsafe();
-
-    /** Array offset: byte. */
-    protected static final long BYTE_ARR_OFF = UNSAFE.arrayBaseOffset(byte[].class);
-
-    /** Buffer size re-check frequency. */
-    private static final Long CHECK_FREQ = Long.getLong(IGNITE_MARSHAL_BUFFERS_RECHECK, 10000);
-
-    /** Data array */
-    private byte[] data;
-
-    /** Max message size detected between checks. */
-    private int maxMsgSize;
-
-    /** Last time array size is checked. */
-    private long lastCheck = U.currentTimeMillis();
-
-    /** Whether the holder is acquired or not. */
-    private boolean acquired;
-
-    /**
-     * Allocate.
-     *
-     * @param size Desired size.
-     * @return Data.
-     */
-    public byte[] allocate(int size) {
-        if (acquired)
-            return new byte[size];
-
-        acquired = true;
-
-        if (data == null || size > data.length)
-            data = new byte[size];
-
-        return data;
-    }
-
-    /**
-     * Reallocate.
-     *
-     * @param data Old data.
-     * @param size Size.
-     * @return New data.
-     */
-    public byte[] reallocate(byte[] data, int size) {
-        byte[] newData = new byte[size];
-
-        if (this.data == data)
-            this.data = newData;
-
-        UNSAFE.copyMemory(data, BYTE_ARR_OFF, newData, BYTE_ARR_OFF, data.length);
-
-        return newData;
-    }
-
-    /**
-     * Shrinks array size if needed.
-     */
-    public void release(byte[] data, int maxMsgSize) {
-        if (this.data != data)
-            return;
-
-        if (maxMsgSize > this.maxMsgSize)
-            this.maxMsgSize = maxMsgSize;
-
-        this.acquired = false;
-
-        long now = U.currentTimeMillis();
-
-        if (now - this.lastCheck >= CHECK_FREQ) {
-            int halfSize = data.length >> 1;
-
-            if (this.maxMsgSize < halfSize)
-                this.data = new byte[halfSize];
-
-            this.lastCheck = now;
-        }
-    }
-
-    /**
-     * @return {@code True} if acquired.
-     */
-    public boolean isAcquired() {
-        return acquired;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableOffheapInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableOffheapInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableOffheapInputStream.java
deleted file mode 100644
index 2a4d7d7..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableOffheapInputStream.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * 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.binary.streams;
-
-/**
- * Portable off-heap input stream.
- */
-public class PortableOffheapInputStream extends PortableAbstractInputStream {
-    /** Pointer. */
-    private final long ptr;
-
-    /** Capacity. */
-    private final int cap;
-
-    /** */
-    private boolean forceHeap;
-
-    /**
-     * Constructor.
-     *
-     * @param ptr Pointer.
-     * @param cap Capacity.
-     */
-    public PortableOffheapInputStream(long ptr, int cap) {
-        this(ptr, cap, false);
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param ptr Pointer.
-     * @param cap Capacity.
-     * @param forceHeap If {@code true} method {@link #offheapPointer} returns 0 and unmarshalling will
-     *        create heap-based objects.
-     */
-    public PortableOffheapInputStream(long ptr, int cap, boolean forceHeap) {
-        this.ptr = ptr;
-        this.cap = cap;
-        this.forceHeap = forceHeap;
-
-        len = cap;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int remaining() {
-        return cap - pos;
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] array() {
-        return arrayCopy();
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] arrayCopy() {
-        byte[] res = new byte[len];
-
-        UNSAFE.copyMemory(null, ptr, res, BYTE_ARR_OFF, res.length);
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean hasArray() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected byte readByteAndShift() {
-        return UNSAFE.getByte(ptr + pos++);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void copyAndShift(Object target, long off, int len) {
-        UNSAFE.copyMemory(null, ptr + pos, target, off, len);
-
-        shift(len);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected short readShortFast() {
-        return UNSAFE.getShort(ptr + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected char readCharFast() {
-        return UNSAFE.getChar(ptr + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected int readIntFast() {
-        return UNSAFE.getInt(ptr + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected long readLongFast() {
-        return UNSAFE.getLong(ptr + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected byte readBytePositioned0(int pos) {
-        return UNSAFE.getByte(ptr + pos);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected short readShortPositioned0(int pos) {
-        short res = UNSAFE.getShort(ptr + pos);
-
-        if (!LITTLE_ENDIAN)
-            res = Short.reverseBytes(res);
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected int readIntPositioned0(int pos) {
-        int res = UNSAFE.getInt(ptr + pos);
-
-        if (!LITTLE_ENDIAN)
-            res = Integer.reverseBytes(res);
-
-        return res;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long offheapPointer() {
-        return forceHeap ? 0 : ptr;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableOffheapOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableOffheapOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableOffheapOutputStream.java
deleted file mode 100644
index 9bcb1f4..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableOffheapOutputStream.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * 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.binary.streams;
-
-/**
- * Portable offheap output stream.
- */
-public class PortableOffheapOutputStream extends PortableAbstractOutputStream {
-    /** Pointer. */
-    private long ptr;
-
-    /** Length of bytes that cen be used before resize is necessary. */
-    private int cap;
-
-    /**
-     * Constructor.
-     *
-     * @param cap Capacity.
-     */
-    public PortableOffheapOutputStream(int cap) {
-        this(0, cap);
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param ptr Pointer to existing address.
-     * @param cap Capacity.
-     */
-    public PortableOffheapOutputStream(long ptr, int cap) {
-        this.ptr = ptr == 0 ? allocate(cap) : ptr;
-
-        this.cap = cap;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void close() {
-        release(ptr);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void ensureCapacity(int cnt) {
-        if (cnt > cap) {
-            int newCap = capacity(cap, cnt);
-
-            ptr = reallocate(ptr, newCap);
-
-            cap = newCap;
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] array() {
-        return arrayCopy();
-    }
-
-    /** {@inheritDoc} */
-    @Override public byte[] arrayCopy() {
-        byte[] res = new byte[pos];
-
-        UNSAFE.copyMemory(null, ptr, res, BYTE_ARR_OFF, pos);
-
-        return res;
-    }
-
-    /**
-     * @return Pointer.
-     */
-    public long pointer() {
-        return ptr;
-    }
-
-    /**
-     * @return Capacity.
-     */
-    public int capacity() {
-        return cap;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void writeByteAndShift(byte val) {
-        UNSAFE.putByte(ptr + pos++, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void copyAndShift(Object src, long offset, int len) {
-        UNSAFE.copyMemory(src, offset, null, ptr + pos, len);
-
-        shift(len);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void writeShortFast(short val) {
-        UNSAFE.putShort(ptr + pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void writeCharFast(char val) {
-        UNSAFE.putChar(ptr + pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void writeIntFast(int val) {
-        UNSAFE.putInt(ptr + pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void writeLongFast(long val) {
-        UNSAFE.putLong(ptr + pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean hasArray() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteByte(byte val) {
-        UNSAFE.putByte(ptr + pos++, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteShort(short val) {
-        if (!LITTLE_ENDIAN)
-            val = Short.reverseBytes(val);
-
-        UNSAFE.putShort(ptr + pos, val);
-
-        shift(2);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteShort(int pos, short val) {
-        if (!LITTLE_ENDIAN)
-            val = Short.reverseBytes(val);
-
-        UNSAFE.putShort(ptr + pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteChar(char val) {
-        if (!LITTLE_ENDIAN)
-            val = Character.reverseBytes(val);
-
-        UNSAFE.putChar(ptr + pos, val);
-
-        shift(2);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteInt(int val) {
-        if (!LITTLE_ENDIAN)
-            val = Integer.reverseBytes(val);
-
-        UNSAFE.putInt(ptr + pos, val);
-
-        shift(4);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteInt(int pos, int val) {
-        if (!LITTLE_ENDIAN)
-            val = Integer.reverseBytes(val);
-
-        UNSAFE.putInt(ptr + pos, val);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unsafeWriteLong(long val) {
-        if (!LITTLE_ENDIAN)
-            val = Long.reverseBytes(val);
-
-        UNSAFE.putLong(ptr + pos, val);
-
-        shift(8);
-    }
-
-    /**
-     * Allocate memory.
-     *
-     * @param cap Capacity.
-     * @return Pointer.
-     */
-    protected long allocate(int cap) {
-        return UNSAFE.allocateMemory(cap);
-    }
-
-    /**
-     * Reallocate memory.
-     *
-     * @param ptr Old pointer.
-     * @param cap Capacity.
-     * @return New pointer.
-     */
-    protected long reallocate(long ptr, int cap) {
-        return UNSAFE.reallocateMemory(ptr, cap);
-    }
-
-    /**
-     * Release memory.
-     *
-     * @param ptr Pointer.
-     */
-    protected void release(long ptr) {
-        UNSAFE.freeMemory(ptr);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableOutputStream.java
deleted file mode 100644
index a686e54..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableOutputStream.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * 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.binary.streams;
-
-/**
- * Portable output stream.
- */
-public interface PortableOutputStream extends PortableStream, AutoCloseable {
-    /**
-     * Write byte value.
-     *
-     * @param val Byte value.
-     */
-    public void writeByte(byte val);
-
-    /**
-     * Write byte array.
-     *
-     * @param val Byte array.
-     */
-    public void writeByteArray(byte[] val);
-
-    /**
-     * Write boolean value.
-     *
-     * @param val Boolean value.
-     */
-    public void writeBoolean(boolean val);
-
-    /**
-     * Write boolean array.
-     *
-     * @param val Boolean array.
-     */
-    public void writeBooleanArray(boolean[] val);
-
-    /**
-     * Write short value.
-     *
-     * @param val Short value.
-     */
-    public void writeShort(short val);
-
-    /**
-     * Write short array.
-     *
-     * @param val Short array.
-     */
-    public void writeShortArray(short[] val);
-
-    /**
-     * Write char value.
-     *
-     * @param val Char value.
-     */
-    public void writeChar(char val);
-
-    /**
-     * Write char array.
-     *
-     * @param val Char array.
-     */
-    public void writeCharArray(char[] val);
-
-    /**
-     * Write int value.
-     *
-     * @param val Int value.
-     */
-    public void writeInt(int val);
-
-    /**
-     * Write short value at the given position.
-     *
-     * @param pos Position.
-     * @param val Value.
-     */
-    public void writeShort(int pos, short val);
-
-    /**
-     * Write int value to the given position.
-     *
-     * @param pos Position.
-     * @param val Value.
-     */
-    public void writeInt(int pos, int val);
-
-    /**
-     * Write int array.
-     *
-     * @param val Int array.
-     */
-    public void writeIntArray(int[] val);
-
-    /**
-     * Write float value.
-     *
-     * @param val Float value.
-     */
-    public void writeFloat(float val);
-
-    /**
-     * Write float array.
-     *
-     * @param val Float array.
-     */
-    public void writeFloatArray(float[] val);
-
-    /**
-     * Write long value.
-     *
-     * @param val Long value.
-     */
-    public void writeLong(long val);
-
-    /**
-     * Write long array.
-     *
-     * @param val Long array.
-     */
-    public void writeLongArray(long[] val);
-
-    /**
-     * Write double value.
-     *
-     * @param val Double value.
-     */
-    public void writeDouble(double val);
-
-    /**
-     * Write double array.
-     *
-     * @param val Double array.
-     */
-    public void writeDoubleArray(double[] val);
-
-    /**
-     * Write byte array.
-     *
-     * @param arr Array.
-     * @param off Offset.
-     * @param len Length.
-     */
-    public void write(byte[] arr, int off, int len);
-
-    /**
-     * Write data from unmanaged memory.
-     *
-     * @param addr Address.
-     * @param cnt Count.
-     */
-    public void write(long addr, int cnt);
-
-    /**
-     * Close the stream releasing resources.
-     */
-    @Override public void close();
-
-    /**
-     * Set position in unsafe mode.
-     *
-     * @param pos Position.
-     */
-    public void unsafePosition(int pos);
-
-    /**
-     * Ensure capacity for unsafe writes.
-     *
-     * @param cap Capacity.
-     */
-    public void unsafeEnsure(int cap);
-
-    /**
-     * Write byte in unsafe mode.
-     *
-     * @param val Value.
-     */
-    public void unsafeWriteByte(byte val);
-
-    /**
-     * Write boolean in unsafe mode.
-     *
-     * @param val Value.
-     */
-    public void unsafeWriteBoolean(boolean val);
-
-    /**
-     * Write short in unsafe mode.
-     *
-     * @param val Value.
-     */
-    public void unsafeWriteShort(short val);
-
-    /**
-     * Write short in unsafe mode.
-     *
-     * @param pos Position.
-     * @param val Value.
-     */
-    public void unsafeWriteShort(int pos, short val);
-
-    /**
-     * Write char in unsafe mode.
-     *
-     * @param val Value.
-     */
-    public void unsafeWriteChar(char val);
-
-    /**
-     * Write int in unsafe mode.
-     *
-     * @param val Value.
-     */
-    public void unsafeWriteInt(int val);
-
-    /**
-     * Write int in unsafe mode.
-     *
-     * @param pos Position.
-     * @param val Value.
-     */
-    public void unsafeWriteInt(int pos, int val);
-
-    /**
-     * Write long in unsafe mode.
-     *
-     * @param val Value.
-     */
-    public void unsafeWriteLong(long val);
-
-    /**
-     * Write float in unsafe mode.
-     *
-     * @param val Value.
-     */
-    public void unsafeWriteFloat(float val);
-
-    /**
-     * Write double in unsafe mode.
-     *
-     * @param val Value.
-     */
-    public void unsafeWriteDouble(double val);
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableStream.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableStream.java
deleted file mode 100644
index 18d4609..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/binary/streams/PortableStream.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.binary.streams;
-
-/**
- * Portable stream.
- */
-public interface PortableStream {
-    /**
-     * @return Position.
-     */
-    public int position();
-
-    /**
-     * @param pos Position.
-     */
-    public void position(int pos);
-
-    /**
-     * @return Underlying array.
-     */
-    public byte[] array();
-
-    /**
-     * @return Copy of data in the stream.
-     */
-    public byte[] arrayCopy();
-
-    /**
-     * @return Offheap pointer if stream is offheap based, otherwise {@code 0}.
-     */
-    public long offheapPointer();
-
-    /**
-     * @return {@code True} is stream is array based.
-     */
-    public boolean hasArray();
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
index 6c6c0d2..88a8027 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheObjectContext.java
@@ -23,7 +23,7 @@ import java.util.Map;
 import java.util.Set;
 import org.apache.ignite.cache.affinity.AffinityKeyMapper;
 import org.apache.ignite.internal.GridKernalContext;
-import org.apache.ignite.internal.binary.PortableUtils;
+import org.apache.ignite.internal.binary.BinaryUtils;
 import org.apache.ignite.internal.processors.cacheobject.IgniteCacheObjectProcessor;
 import org.apache.ignite.internal.util.typedef.F;
 
@@ -203,7 +203,7 @@ import org.apache.ignite.internal.util.typedef.F;
         if (keepPortable)
             return map;
 
-        Map<Object, Object> map0 = PortableUtils.newMap(map);
+        Map<Object, Object> map0 = BinaryUtils.newMap(map);
 
         for (Map.Entry<Object, Object> e : map.entrySet())
             map0.put(unwrapPortable(e.getKey(), keepPortable, cpy), unwrapPortable(e.getValue(), keepPortable, cpy));
@@ -241,7 +241,7 @@ import org.apache.ignite.internal.util.typedef.F;
      * @return Unwrapped set.
      */
     private Set<Object> unwrapPortables(Set<Object> set, boolean keepPortable, boolean cpy) {
-        Set<Object> set0 = PortableUtils.newSet(set);
+        Set<Object> set0 = BinaryUtils.newSet(set);
 
         for (Object obj : set)
             set0.add(unwrapPortable(obj, keepPortable, cpy));

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java
new file mode 100644
index 0000000..f6204fb
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/BinaryMetadataKey.java
@@ -0,0 +1,82 @@
+/*
+ * 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.processors.cache.binary;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import org.apache.ignite.internal.processors.cache.GridCacheUtilityKey;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Key for portable meta data.
+ */
+class BinaryMetadataKey extends GridCacheUtilityKey<BinaryMetadataKey> implements Externalizable {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private int typeId;
+
+    /**
+     * For {@link Externalizable}.
+     */
+    public BinaryMetadataKey() {
+        // No-op.
+    }
+
+    /**
+     * @param typeId Type ID.
+     */
+    BinaryMetadataKey(int typeId) {
+        this.typeId = typeId;
+    }
+
+    /**
+     * @return Type id.
+     */
+    public int typeId() {
+        return typeId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void writeExternal(ObjectOutput out) throws IOException {
+        out.writeInt(typeId);
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+        typeId = in.readInt();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected boolean equalsx(BinaryMetadataKey key) {
+        return typeId == key.typeId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public int hashCode() {
+        return typeId;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(BinaryMetadataKey.class, this);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java
new file mode 100644
index 0000000..c0a4612
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultBinaryAffinityKeyMapper.java
@@ -0,0 +1,51 @@
+/*
+ * 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.processors.cache.binary;
+
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.internal.IgniteKernal;
+import org.apache.ignite.internal.processors.cache.GridCacheDefaultAffinityKeyMapper;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.binary.BinaryObject;
+
+/**
+ *
+ */
+public class CacheDefaultBinaryAffinityKeyMapper extends GridCacheDefaultAffinityKeyMapper {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** {@inheritDoc} */
+    @Override public Object affinityKey(Object key) {
+        IgniteKernal kernal = (IgniteKernal)ignite;
+
+        CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects();
+
+        try {
+            key = proc.toPortable(key);
+        }
+        catch (IgniteException e) {
+            U.error(log, "Failed to marshal key to portable: " + key, e);
+        }
+
+        if (key instanceof BinaryObject)
+            return proc.affinityKey((BinaryObject)key);
+        else
+            return super.affinityKey(key);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultPortableAffinityKeyMapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultPortableAffinityKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultPortableAffinityKeyMapper.java
deleted file mode 100644
index 698cd7b..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheDefaultPortableAffinityKeyMapper.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.processors.cache.binary;
-
-import org.apache.ignite.IgniteException;
-import org.apache.ignite.internal.IgniteKernal;
-import org.apache.ignite.internal.processors.cache.GridCacheDefaultAffinityKeyMapper;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.binary.BinaryObject;
-
-/**
- *
- */
-public class CacheDefaultPortableAffinityKeyMapper extends GridCacheDefaultAffinityKeyMapper {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** {@inheritDoc} */
-    @Override public Object affinityKey(Object key) {
-        IgniteKernal kernal = (IgniteKernal)ignite;
-
-        CacheObjectBinaryProcessorImpl proc = (CacheObjectBinaryProcessorImpl)kernal.context().cacheObjects();
-
-        try {
-            key = proc.toPortable(key);
-        }
-        catch (IgniteException e) {
-            U.error(log, "Failed to marshal key to portable: " + key, e);
-        }
-
-        if (key instanceof BinaryObject)
-            return proc.affinityKey((BinaryObject)key);
-        else
-            return super.affinityKey(key);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java
new file mode 100644
index 0000000..039f5ce
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectBinaryContext.java
@@ -0,0 +1,56 @@
+/*
+ * 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.processors.cache.binary;
+
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.cache.CacheDefaultBinaryAffinityKeyMapper;
+import org.apache.ignite.internal.processors.cache.CacheObjectContext;
+import org.apache.ignite.internal.processors.cache.GridCacheDefaultAffinityKeyMapper;
+
+/**
+ *
+ */
+public class CacheObjectBinaryContext extends CacheObjectContext {
+    /** */
+    private boolean portableEnabled;
+
+    /**
+     * @param kernalCtx Kernal context.
+     * @param portableEnabled Portable enabled flag.
+     * @param cpyOnGet Copy on get flag.
+     * @param storeVal {@code True} if should store unmarshalled value in cache.
+     * @param depEnabled {@code true} if deployment is enabled for the given cache.
+     */
+    public CacheObjectBinaryContext(GridKernalContext kernalCtx,
+        boolean cpyOnGet,
+        boolean storeVal,
+        boolean portableEnabled,
+        boolean depEnabled) {
+        super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() :
+            new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled);
+
+        this.portableEnabled = portableEnabled;
+    }
+
+    /**
+     * @return Portable enabled flag.
+     */
+    public boolean portableEnabled() {
+        return portableEnabled;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/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 12e7078..a9f0d74 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
@@ -57,12 +57,12 @@ import org.apache.ignite.internal.binary.BinaryObjectEx;
 import org.apache.ignite.internal.binary.BinaryObjectImpl;
 import org.apache.ignite.internal.binary.BinaryObjectOffheapImpl;
 import org.apache.ignite.internal.binary.BinaryTypeImpl;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.PortableContext;
-import org.apache.ignite.internal.binary.PortableUtils;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.binary.BinaryContext;
+import org.apache.ignite.internal.binary.BinaryUtils;
 import org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl;
-import org.apache.ignite.internal.binary.streams.PortableInputStream;
-import org.apache.ignite.internal.binary.streams.PortableOffheapInputStream;
+import org.apache.ignite.internal.binary.streams.BinaryInputStream;
+import org.apache.ignite.internal.binary.streams.BinaryOffheapInputStream;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.CacheEntryPredicate;
 import org.apache.ignite.internal.processors.cache.CacheEntryPredicateAdapter;
@@ -112,7 +112,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     private final boolean clientNode;
 
     /** */
-    private volatile IgniteCacheProxy<PortableMetadataKey, BinaryMetadata> metaDataCache;
+    private volatile IgniteCacheProxy<BinaryMetadataKey, BinaryMetadata> metaDataCache;
 
     /** */
     private final ConcurrentHashMap8<Integer, BinaryTypeImpl> clientMetaDataCache;
@@ -122,18 +122,18 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
         private static final long serialVersionUID = 0L;
 
         @Override public boolean apply(GridCacheEntryEx e) {
-            return e.key().value(e.context().cacheObjectContext(), false) instanceof PortableMetadataKey;
+            return e.key().value(e.context().cacheObjectContext(), false) instanceof BinaryMetadataKey;
         }
     };
 
     /** */
-    private PortableContext portableCtx;
+    private BinaryContext portableCtx;
 
     /** */
     private Marshaller marsh;
 
     /** */
-    private GridPortableMarshaller portableMarsh;
+    private GridBinaryMarshaller portableMarsh;
 
     /** */
     @GridToStringExclude
@@ -170,11 +170,11 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
                     if (metaDataCache == null) {
                         BinaryMetadata oldMeta = metaBuf.get(typeId);
-                        BinaryMetadata mergedMeta = PortableUtils.mergeMetadata(oldMeta, newMeta0);
+                        BinaryMetadata mergedMeta = BinaryUtils.mergeMetadata(oldMeta, newMeta0);
 
                         if (oldMeta != mergedMeta) {
                             synchronized (this) {
-                                mergedMeta = PortableUtils.mergeMetadata(oldMeta, newMeta0);
+                                mergedMeta = BinaryUtils.mergeMetadata(oldMeta, newMeta0);
 
                                 if (oldMeta != mergedMeta)
                                     metaBuf.put(typeId, mergedMeta);
@@ -206,12 +206,12 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
             BinaryMarshaller pMarh0 = (BinaryMarshaller)marsh;
 
-            portableCtx = new PortableContext(metaHnd, ctx.config());
+            portableCtx = new BinaryContext(metaHnd, ctx.config());
 
             IgniteUtils.invoke(BinaryMarshaller.class, pMarh0, "setPortableContext", portableCtx,
                 ctx.config());
 
-            portableMarsh = new GridPortableMarshaller(portableCtx);
+            portableMarsh = new GridBinaryMarshaller(portableCtx);
 
             portables = new IgniteBinaryImpl(ctx, this);
         }
@@ -249,7 +249,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
                 GridCacheQueryManager qryMgr = metaDataCache.context().queries();
 
-                CacheQuery<Map.Entry<PortableMetadataKey, BinaryMetadata>> qry =
+                CacheQuery<Map.Entry<BinaryMetadataKey, BinaryMetadata>> qry =
                     qryMgr.createScanQuery(new MetaDataPredicate(), null, false);
 
                 qry.keepAll(false);
@@ -257,9 +257,9 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
                 qry.projection(ctx.cluster().get().forNode(oldestSrvNode));
 
                 try {
-                    CacheQueryFuture<Map.Entry<PortableMetadataKey, BinaryMetadata>> fut = qry.execute();
+                    CacheQueryFuture<Map.Entry<BinaryMetadataKey, BinaryMetadata>> fut = qry.execute();
 
-                    Map.Entry<PortableMetadataKey, BinaryMetadata> next;
+                    Map.Entry<BinaryMetadataKey, BinaryMetadata> next;
 
                     while ((next = fut.next()) != null) {
                         assert next.getKey() != null : next;
@@ -305,7 +305,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
      * @param key Metadata key.
      * @param newMeta Metadata.
      */
-    private void addClientCacheMetaData(PortableMetadataKey key, final BinaryMetadata newMeta) {
+    private void addClientCacheMetaData(BinaryMetadataKey key, final BinaryMetadata newMeta) {
         int key0 = key.typeId();
 
         clientMetaDataCache.compute(key0, new ConcurrentHashMap8.BiFun<Integer, BinaryTypeImpl, BinaryTypeImpl>() {
@@ -315,7 +315,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
                 BinaryMetadata oldMeta0 = oldMeta != null ? oldMeta.metadata() : null;
 
                 try {
-                    res = PortableUtils.mergeMetadata(oldMeta0, newMeta);
+                    res = BinaryUtils.mergeMetadata(oldMeta0, newMeta);
                 }
                 catch (BinaryObjectException e) {
                     res = oldMeta0;
@@ -365,7 +365,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
         if (type != CacheObject.TYPE_BYTE_ARR) {
             assert size > 0 : size;
 
-            PortableInputStream in = new PortableOffheapInputStream(ptr, size, forceHeap);
+            BinaryInputStream in = new BinaryOffheapInputStream(ptr, size, forceHeap);
 
             return portableMarsh.unmarshal(in);
         }
@@ -379,7 +379,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
         if (obj == null)
             return null;
 
-        if (PortableUtils.isPortableType(obj.getClass()))
+        if (BinaryUtils.isPortableType(obj.getClass()))
             return obj;
 
         if (obj instanceof Object[]) {
@@ -408,7 +408,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
             Collection<Object> pCol;
 
             if (col instanceof Set)
-                pCol = (Collection<Object>)PortableUtils.newSet((Set<?>)col);
+                pCol = (Collection<Object>)BinaryUtils.newSet((Set<?>)col);
             else
                 pCol = new ArrayList<>(col.size());
 
@@ -421,7 +421,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
         if (obj instanceof Map) {
             Map<?, ?> map = (Map<?, ?>)obj;
 
-            Map<Object, Object> pMap = PortableUtils.newMap((Map<Object, Object>)obj);
+            Map<Object, Object> pMap = BinaryUtils.newMap((Map<Object, Object>)obj);
 
             for (Map.Entry<?, ?> e : map.entrySet())
                 pMap.put(marshalToPortable(e.getKey()), marshalToPortable(e.getValue()));
@@ -451,7 +451,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     /**
      * @return Marshaller.
      */
-    public GridPortableMarshaller marshaller() {
+    public GridBinaryMarshaller marshaller() {
         return portableMarsh;
     }
 
@@ -480,11 +480,11 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
         BinaryMetadata newMeta0 = ((BinaryTypeImpl)newMeta).metadata();
 
-        final PortableMetadataKey key = new PortableMetadataKey(typeId);
+        final BinaryMetadataKey key = new BinaryMetadataKey(typeId);
 
         try {
             BinaryMetadata oldMeta = metaDataCache.localPeek(key);
-            BinaryMetadata mergedMeta = PortableUtils.mergeMetadata(oldMeta, newMeta0);
+            BinaryMetadata mergedMeta = BinaryUtils.mergeMetadata(oldMeta, newMeta0);
 
             BinaryObjectException err = metaDataCache.invoke(key, new MetadataProcessor(mergedMeta));
 
@@ -505,12 +505,12 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
                 if (typeMeta != null)
                     return typeMeta;
 
-                BinaryMetadata meta = metaDataCache.getTopologySafe(new PortableMetadataKey(typeId));
+                BinaryMetadata meta = metaDataCache.getTopologySafe(new BinaryMetadataKey(typeId));
 
                 return meta != null ? meta.wrap(portableCtx) : null;
             }
             else {
-                PortableMetadataKey key = new PortableMetadataKey(typeId);
+                BinaryMetadataKey key = new BinaryMetadataKey(typeId);
 
                 BinaryMetadata meta = metaDataCache.localPeek(key);
 
@@ -529,16 +529,16 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     @Override public Map<Integer, BinaryType> metadata(Collection<Integer> typeIds)
         throws BinaryObjectException {
         try {
-            Collection<PortableMetadataKey> keys = new ArrayList<>(typeIds.size());
+            Collection<BinaryMetadataKey> keys = new ArrayList<>(typeIds.size());
 
             for (Integer typeId : typeIds)
-                keys.add(new PortableMetadataKey(typeId));
+                keys.add(new BinaryMetadataKey(typeId));
 
-            Map<PortableMetadataKey, BinaryMetadata> meta = metaDataCache.getAll(keys);
+            Map<BinaryMetadataKey, BinaryMetadata> meta = metaDataCache.getAll(keys);
 
             Map<Integer, BinaryType> res = U.newHashMap(meta.size());
 
-            for (Map.Entry<PortableMetadataKey, BinaryMetadata> e : meta.entrySet())
+            for (Map.Entry<BinaryMetadataKey, BinaryMetadata> e : meta.entrySet())
                 res.put(e.getKey().typeId(), e.getValue().wrap(portableCtx));
 
             return res;
@@ -559,10 +559,10 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
             });
         else {
             return F.viewReadOnly(metaDataCache.entrySetx(metaPred),
-                new C1<Cache.Entry<PortableMetadataKey, BinaryMetadata>, BinaryType>() {
+                new C1<Cache.Entry<BinaryMetadataKey, BinaryMetadata>, BinaryType>() {
                     private static final long serialVersionUID = 0L;
 
-                    @Override public BinaryType apply(Cache.Entry<PortableMetadataKey, BinaryMetadata> e) {
+                    @Override public BinaryType apply(Cache.Entry<BinaryMetadataKey, BinaryMetadata> e) {
                         return e.getValue().wrap(portableCtx);
                     }
                 });
@@ -571,7 +571,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
     /** {@inheritDoc} */
     @Override public BinaryObject buildEnum(String typeName, int ord) throws IgniteException {
-        typeName = PortableContext.typeName(typeName);
+        typeName = BinaryContext.typeName(typeName);
 
         int typeId = portableCtx.typeId(typeName);
 
@@ -649,7 +649,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     /**
      * @return Portable context.
      */
-    public PortableContext portableContext() {
+    public BinaryContext portableContext() {
         return portableCtx;
     }
 
@@ -662,7 +662,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
         CacheObjectContext ctx0 = super.contextForCache(cfg);
 
-        CacheObjectContext res = new CacheObjectPortableContext(ctx,
+        CacheObjectContext res = new CacheObjectBinaryContext(ctx,
             ctx0.copyOnGet(),
             ctx0.storeValue(),
             portableEnabled,
@@ -675,7 +675,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
     /** {@inheritDoc} */
     @Override public byte[] marshal(CacheObjectContext ctx, Object val) throws IgniteCheckedException {
-        if (!((CacheObjectPortableContext)ctx).portableEnabled() || portableMarsh == null)
+        if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null)
             return super.marshal(ctx, val);
 
         byte[] arr = portableMarsh.marshal(val);
@@ -688,7 +688,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     /** {@inheritDoc} */
     @Override public Object unmarshal(CacheObjectContext ctx, byte[] bytes, ClassLoader clsLdr)
         throws IgniteCheckedException {
-        if (!((CacheObjectPortableContext)ctx).portableEnabled() || portableMarsh == null)
+        if (!((CacheObjectBinaryContext)ctx).portableEnabled() || portableMarsh == null)
             return super.unmarshal(ctx, bytes, clsLdr);
 
         return portableMarsh.unmarshal(bytes, clsLdr);
@@ -696,13 +696,13 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
     /** {@inheritDoc} */
     @Override public KeyCacheObject toCacheKeyObject(CacheObjectContext ctx, Object obj, boolean userObj) {
-        if (!((CacheObjectPortableContext)ctx).portableEnabled())
+        if (!((CacheObjectBinaryContext)ctx).portableEnabled())
             return super.toCacheKeyObject(ctx, obj, userObj);
 
         if (obj instanceof KeyCacheObject)
             return (KeyCacheObject)obj;
 
-        if (((CacheObjectPortableContext)ctx).portableEnabled()) {
+        if (((CacheObjectBinaryContext)ctx).portableEnabled()) {
             obj = toPortable(obj);
 
             if (obj instanceof BinaryObject)
@@ -715,7 +715,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     /** {@inheritDoc} */
     @Nullable @Override public CacheObject toCacheObject(CacheObjectContext ctx, @Nullable Object obj,
         boolean userObj) {
-        if (!((CacheObjectPortableContext)ctx).portableEnabled())
+        if (!((CacheObjectBinaryContext)ctx).portableEnabled())
             return super.toCacheObject(ctx, obj, userObj);
 
         if (obj == null || obj instanceof CacheObject)
@@ -740,7 +740,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     /** {@inheritDoc} */
     @Override public CacheObject toCacheObject(GridCacheContext ctx, long valPtr, boolean tmp)
         throws IgniteCheckedException {
-        if (!((CacheObjectPortableContext)ctx.cacheObjectContext()).portableEnabled())
+        if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled())
             return super.toCacheObject(ctx, valPtr, tmp);
 
         Object val = unmarshal(valPtr, !tmp);
@@ -753,7 +753,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
     /** {@inheritDoc} */
     @Override public Object unwrapTemporary(GridCacheContext ctx, Object obj) throws BinaryObjectException {
-        if (!((CacheObjectPortableContext)ctx.cacheObjectContext()).portableEnabled())
+        if (!((CacheObjectBinaryContext)ctx.cacheObjectContext()).portableEnabled())
             return obj;
 
         if (obj instanceof BinaryObjectOffheapImpl)
@@ -781,7 +781,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
      * Processor responsible for metadata update.
      */
     private static class MetadataProcessor
-        implements EntryProcessor<PortableMetadataKey, BinaryMetadata, BinaryObjectException>, Externalizable {
+        implements EntryProcessor<BinaryMetadataKey, BinaryMetadata, BinaryObjectException>, Externalizable {
         /** */
         private static final long serialVersionUID = 0L;
 
@@ -805,12 +805,12 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
         }
 
         /** {@inheritDoc} */
-        @Override public BinaryObjectException process(MutableEntry<PortableMetadataKey, BinaryMetadata> entry,
+        @Override public BinaryObjectException process(MutableEntry<BinaryMetadataKey, BinaryMetadata> entry,
             Object... args) {
             try {
                 BinaryMetadata oldMeta = entry.getValue();
 
-                BinaryMetadata mergedMeta = PortableUtils.mergeMetadata(oldMeta, newMeta);
+                BinaryMetadata mergedMeta = BinaryUtils.mergeMetadata(oldMeta, newMeta);
 
                 if (mergedMeta != oldMeta)
                     entry.setValue(mergedMeta);
@@ -841,15 +841,15 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
     /**
      *
      */
-    class MetaDataEntryListener implements CacheEntryUpdatedListener<PortableMetadataKey, BinaryMetadata> {
+    class MetaDataEntryListener implements CacheEntryUpdatedListener<BinaryMetadataKey, BinaryMetadata> {
         /** {@inheritDoc} */
         @Override public void onUpdated(
-            Iterable<CacheEntryEvent<? extends PortableMetadataKey, ? extends BinaryMetadata>> evts)
+            Iterable<CacheEntryEvent<? extends BinaryMetadataKey, ? extends BinaryMetadata>> evts)
             throws CacheEntryListenerException {
-            for (CacheEntryEvent<? extends PortableMetadataKey, ? extends BinaryMetadata> evt : evts) {
+            for (CacheEntryEvent<? extends BinaryMetadataKey, ? extends BinaryMetadata> evt : evts) {
                 assert evt.getEventType() == EventType.CREATED || evt.getEventType() == EventType.UPDATED : evt;
 
-                PortableMetadataKey key = evt.getKey();
+                BinaryMetadataKey key = evt.getKey();
 
                 final BinaryMetadata newMeta = evt.getValue();
 
@@ -874,7 +874,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
         /** {@inheritDoc} */
         @Override public boolean evaluate(CacheEntryEvent<?, ?> evt) throws CacheEntryListenerException {
-            return evt.getKey() instanceof PortableMetadataKey;
+            return evt.getKey() instanceof BinaryMetadataKey;
         }
 
         /** {@inheritDoc} */
@@ -892,7 +892,7 @@ public class CacheObjectBinaryProcessorImpl extends IgniteCacheObjectProcessorIm
 
         /** {@inheritDoc} */
         @Override public boolean apply(Object key, Object val) {
-            return key instanceof PortableMetadataKey;
+            return key instanceof BinaryMetadataKey;
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectPortableContext.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectPortableContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectPortableContext.java
deleted file mode 100644
index c2b5261..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/CacheObjectPortableContext.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.processors.cache.binary;
-
-import org.apache.ignite.internal.GridKernalContext;
-import org.apache.ignite.internal.processors.cache.CacheDefaultBinaryAffinityKeyMapper;
-import org.apache.ignite.internal.processors.cache.CacheObjectContext;
-import org.apache.ignite.internal.processors.cache.GridCacheDefaultAffinityKeyMapper;
-
-/**
- *
- */
-public class CacheObjectPortableContext extends CacheObjectContext {
-    /** */
-    private boolean portableEnabled;
-
-    /**
-     * @param kernalCtx Kernal context.
-     * @param portableEnabled Portable enabled flag.
-     * @param cpyOnGet Copy on get flag.
-     * @param storeVal {@code True} if should store unmarshalled value in cache.
-     * @param depEnabled {@code true} if deployment is enabled for the given cache.
-     */
-    public CacheObjectPortableContext(GridKernalContext kernalCtx,
-        boolean cpyOnGet,
-        boolean storeVal,
-        boolean portableEnabled,
-        boolean depEnabled) {
-        super(kernalCtx, portableEnabled ? new CacheDefaultBinaryAffinityKeyMapper() :
-            new GridCacheDefaultAffinityKeyMapper(), cpyOnGet, storeVal, depEnabled);
-
-        this.portableEnabled = portableEnabled;
-    }
-
-    /**
-     * @return Portable enabled flag.
-     */
-    public boolean portableEnabled() {
-        return portableEnabled;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/PortableMetadataKey.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/PortableMetadataKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/PortableMetadataKey.java
deleted file mode 100644
index 3b0ce8e..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/PortableMetadataKey.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.processors.cache.binary;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import org.apache.ignite.internal.processors.cache.GridCacheUtilityKey;
-import org.apache.ignite.internal.util.typedef.internal.S;
-
-/**
- * Key for portable meta data.
- */
-class PortableMetadataKey extends GridCacheUtilityKey<PortableMetadataKey> implements Externalizable {
-    /** */
-    private static final long serialVersionUID = 0L;
-
-    /** */
-    private int typeId;
-
-    /**
-     * For {@link Externalizable}.
-     */
-    public PortableMetadataKey() {
-        // No-op.
-    }
-
-    /**
-     * @param typeId Type ID.
-     */
-    PortableMetadataKey(int typeId) {
-        this.typeId = typeId;
-    }
-
-    /**
-     * @return Type id.
-     */
-    public int typeId() {
-        return typeId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeInt(typeId);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        typeId = in.readInt();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected boolean equalsx(PortableMetadataKey key) {
-        return typeId == key.typeId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int hashCode() {
-        return typeId;
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(PortableMetadataKey.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java
index e8c9d4d..f69ea3e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/PlatformContextImpl.java
@@ -38,7 +38,7 @@ import org.apache.ignite.internal.binary.BinaryRawReaderEx;
 import org.apache.ignite.internal.binary.BinaryRawWriterEx;
 import org.apache.ignite.internal.binary.BinaryReaderExImpl;
 import org.apache.ignite.internal.binary.BinaryTypeImpl;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
 import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
 import org.apache.ignite.internal.processors.platform.cache.PlatformCacheEntryFilter;
 import org.apache.ignite.internal.processors.platform.cache.PlatformCacheEntryFilterImpl;
@@ -94,7 +94,7 @@ public class PlatformContextImpl implements PlatformContext {
     private final GridKernalContext ctx;
 
     /** Marshaller. */
-    private final GridPortableMarshaller marsh;
+    private final GridBinaryMarshaller marsh;
 
     /** Memory manager. */
     private final PlatformMemoryManagerImpl mem;

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
index caea840..b2bd5d4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/dotnet/PlatformDotNetConfigurationClosure.java
@@ -25,8 +25,8 @@ import org.apache.ignite.configuration.PlatformConfiguration;
 import org.apache.ignite.internal.MarshallerContextImpl;
 import org.apache.ignite.internal.binary.BinaryNoopMetadataHandler;
 import org.apache.ignite.internal.binary.BinaryRawWriterEx;
-import org.apache.ignite.internal.binary.GridPortableMarshaller;
-import org.apache.ignite.internal.binary.PortableContext;
+import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.binary.BinaryContext;
 import org.apache.ignite.internal.processors.platform.PlatformAbstractConfigurationClosure;
 import org.apache.ignite.internal.processors.platform.lifecycle.PlatformLifecycleBean;
 import org.apache.ignite.internal.processors.platform.memory.PlatformInputStream;
@@ -239,9 +239,9 @@ public class PlatformDotNetConfigurationClosure extends PlatformAbstractConfigur
      * @return Marshaller.
      */
     @SuppressWarnings("deprecation")
-    private static GridPortableMarshaller marshaller() {
+    private static GridBinaryMarshaller marshaller() {
         try {
-            PortableContext ctx = new PortableContext(BinaryNoopMetadataHandler.instance(), new IgniteConfiguration());
+            BinaryContext ctx = new BinaryContext(BinaryNoopMetadataHandler.instance(), new IgniteConfiguration());
 
             BinaryMarshaller marsh = new BinaryMarshaller();
 
@@ -249,7 +249,7 @@ public class PlatformDotNetConfigurationClosure extends PlatformAbstractConfigur
 
             ctx.configure(marsh, new IgniteConfiguration());
 
-            return new GridPortableMarshaller(ctx);
+            return new GridBinaryMarshaller(ctx);
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformInputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformInputStream.java
index 321e592..e4d1e46 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformInputStream.java
@@ -17,12 +17,12 @@
 
 package org.apache.ignite.internal.processors.platform.memory;
 
-import org.apache.ignite.internal.binary.streams.PortableInputStream;
+import org.apache.ignite.internal.binary.streams.BinaryInputStream;
 
 /**
  * Interop output stream,
  */
-public interface PlatformInputStream extends PortableInputStream {
+public interface PlatformInputStream extends BinaryInputStream {
     /**
      * Synchronize input. Must be called before start reading data from a memory changed by another platform.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformOutputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformOutputStream.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformOutputStream.java
index 7894f0c..95cbac2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformOutputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/memory/PlatformOutputStream.java
@@ -17,12 +17,12 @@
 
 package org.apache.ignite.internal.processors.platform.memory;
 
-import org.apache.ignite.internal.binary.streams.PortableOutputStream;
+import org.apache.ignite.internal.binary.streams.BinaryOutputStream;
 
 /**
  * Interop output stream.
  */
-public interface PlatformOutputStream extends PortableOutputStream {
+public interface PlatformOutputStream extends BinaryOutputStream {
     /**
      * Synchronize output stream with underlying memory
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/71ad9cea/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientBinaryMetaData.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientBinaryMetaData.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientBinaryMetaData.java
new file mode 100644
index 0000000..daa056b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientBinaryMetaData.java
@@ -0,0 +1,71 @@
+/*
+ * 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.processors.rest.client.message;
+
+import java.util.Map;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * Portable meta data sent from client.
+ */
+public class GridClientBinaryMetaData {
+    /** */
+    private int typeId;
+
+    /** */
+    private String typeName;
+
+    /** */
+    private Map<String, Integer> fields;
+
+    /** */
+    private String affKeyFieldName;
+
+    /**
+     * @return Type ID.
+     */
+    public int typeId() {
+        return typeId;
+    }
+
+    /**
+     * @return Type name.
+     */
+    public String typeName() {
+        return typeName;
+    }
+
+    /**
+     * @return Fields.
+     */
+    public Map<String, Integer> fields() {
+        return fields;
+    }
+
+    /**
+     * @return Affinity key field name.
+     */
+    public String affinityKeyFieldName() {
+        return affKeyFieldName;
+    }
+
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return S.toString(GridClientBinaryMetaData.class, this);
+    }
+}


[41/50] [abbrv] ignite git commit: ignite-1.5 Updated classnames.properties

Posted by vo...@apache.org.
ignite-1.5 Updated classnames.properties


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

Branch: refs/heads/ignite-2100
Commit: de0b1badbf34538e04e7cf4be5378ef929fb6201
Parents: 4d08673
Author: Alexey Kuznetsov <ak...@apache.org>
Authored: Mon Dec 14 15:33:09 2015 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Mon Dec 14 15:33:09 2015 +0700

----------------------------------------------------------------------
 .../resources/META-INF/classnames.properties    | 68 +++++++++++++-------
 1 file changed, 44 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/de0b1bad/modules/core/src/main/resources/META-INF/classnames.properties
----------------------------------------------------------------------
diff --git a/modules/core/src/main/resources/META-INF/classnames.properties b/modules/core/src/main/resources/META-INF/classnames.properties
index 913320b..d9a5514 100644
--- a/modules/core/src/main/resources/META-INF/classnames.properties
+++ b/modules/core/src/main/resources/META-INF/classnames.properties
@@ -80,8 +80,13 @@ org.apache.ignite.cache.query.SqlQuery
 org.apache.ignite.cache.query.TextQuery
 org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore$EntryMapping$1
 org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore$EntryMapping$2
+org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore$TypeKind
 org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactory
 org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory
+org.apache.ignite.cache.store.jdbc.JdbcType
+org.apache.ignite.cache.store.jdbc.JdbcTypeDefaultHasher
+org.apache.ignite.cache.store.jdbc.JdbcTypeField
+org.apache.ignite.cache.store.jdbc.JdbcTypeHasher
 org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect
 org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect$1
 org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect$2
@@ -220,6 +225,19 @@ org.apache.ignite.internal.IgniteMessagingImpl
 org.apache.ignite.internal.IgniteSchedulerImpl
 org.apache.ignite.internal.IgniteServicesImpl
 org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance$1
+org.apache.ignite.internal.NodeStoppingException
+org.apache.ignite.internal.binary.BinaryContext
+org.apache.ignite.internal.binary.BinaryEnumObjectImpl
+org.apache.ignite.internal.binary.BinaryMetadata
+org.apache.ignite.internal.binary.BinaryObjectEx
+org.apache.ignite.internal.binary.BinaryObjectExImpl
+org.apache.ignite.internal.binary.BinaryObjectImpl
+org.apache.ignite.internal.binary.BinaryObjectOffheapImpl
+org.apache.ignite.internal.binary.BinaryReaderExImpl$Flag
+org.apache.ignite.internal.binary.BinarySchema
+org.apache.ignite.internal.binary.BinarySchema$Confirmation
+org.apache.ignite.internal.binary.BinaryWriteMode
+org.apache.ignite.internal.binary.builder.BinaryLazyMap$1$1$1
 org.apache.ignite.internal.client.GridClientAuthenticationException
 org.apache.ignite.internal.client.GridClientCacheFlag
 org.apache.ignite.internal.client.GridClientCacheMode
@@ -285,30 +303,21 @@ org.apache.ignite.internal.managers.discovery.CustomMessageWrapper
 org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage
 org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$1
 org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$2
-org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$5$1
-org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$5$2
-org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$7
+org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$4$1
+org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$4$2
+org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$6
 org.apache.ignite.internal.managers.discovery.GridDiscoveryManager$DiscoCache$1
 org.apache.ignite.internal.managers.discovery.GridLocalMetrics
 org.apache.ignite.internal.managers.eventstorage.GridEventStorageMessage
 org.apache.ignite.internal.managers.indexing.GridIndexingManager$1
 org.apache.ignite.internal.managers.loadbalancer.GridLoadBalancerAdapter
 org.apache.ignite.internal.managers.loadbalancer.GridLoadBalancerManager$1
-org.apache.ignite.internal.binary.BinaryMetadata
-org.apache.ignite.internal.binary.BinaryObjectEx
-org.apache.ignite.internal.binary.BinaryObjectImpl
-org.apache.ignite.internal.binary.BinaryObjectOffheapImpl
-org.apache.ignite.internal.binary.BinaryReaderExImpl$Flag
-org.apache.ignite.internal.binary.BinaryWriteMode
-org.apache.ignite.internal.binary.BinaryContext
-org.apache.ignite.internal.binary.BinarySchema
-org.apache.ignite.internal.binary.BinarySchema$Confirmation
-org.apache.ignite.internal.binary.builder.BinaryLazyMap$1$1$1
 org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion
 org.apache.ignite.internal.processors.affinity.GridAffinityAssignment
 org.apache.ignite.internal.processors.affinity.GridAffinityMessage
 org.apache.ignite.internal.processors.affinity.GridAffinityUtils$AffinityJob
 org.apache.ignite.internal.processors.cache.CacheAtomicUpdateTimeoutCheckedException
+org.apache.ignite.internal.processors.cache.CacheDefaultBinaryAffinityKeyMapper
 org.apache.ignite.internal.processors.cache.CacheEntryImpl
 org.apache.ignite.internal.processors.cache.CacheEntryImplEx
 org.apache.ignite.internal.processors.cache.CacheEntryInfoCollection
@@ -370,6 +379,8 @@ org.apache.ignite.internal.processors.cache.GridCacheAdapter$GlobalClearKeySetNe
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadCacheClosure
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$LoadKeysCallable
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$SizeJob
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$SizeLongJob
+org.apache.ignite.internal.processors.cache.GridCacheAdapter$SizeLongTask
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$SizeTask
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$TopologyVersionAwareJob
 org.apache.ignite.internal.processors.cache.GridCacheAdapter$TopologyVersionAwareJob$1
@@ -393,6 +404,7 @@ org.apache.ignite.internal.processors.cache.GridCacheConcurrentMap$ValueIterator
 org.apache.ignite.internal.processors.cache.GridCacheConcurrentMap$Values
 org.apache.ignite.internal.processors.cache.GridCacheContext
 org.apache.ignite.internal.processors.cache.GridCacheContext$4
+org.apache.ignite.internal.processors.cache.GridCacheContext$5
 org.apache.ignite.internal.processors.cache.GridCacheDefaultAffinityKeyMapper
 org.apache.ignite.internal.processors.cache.GridCacheDefaultAffinityKeyMapper$1
 org.apache.ignite.internal.processors.cache.GridCacheDefaultAffinityKeyMapper$2
@@ -441,11 +453,11 @@ org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$7
 org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeFutureSet
 org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$MessageHandler
 org.apache.ignite.internal.processors.cache.GridCacheProcessor$2
-org.apache.ignite.internal.processors.cache.GridCacheProcessor$3
 org.apache.ignite.internal.processors.cache.GridCacheProcessor$4
 org.apache.ignite.internal.processors.cache.GridCacheProcessor$5
 org.apache.ignite.internal.processors.cache.GridCacheProcessor$6
-org.apache.ignite.internal.processors.cache.GridCacheProcessor$8
+org.apache.ignite.internal.processors.cache.GridCacheProcessor$7
+org.apache.ignite.internal.processors.cache.GridCacheProcessor$9
 org.apache.ignite.internal.processors.cache.GridCacheProcessor$LocalAffinityFunction
 org.apache.ignite.internal.processors.cache.GridCacheProxyImpl
 org.apache.ignite.internal.processors.cache.GridCacheReturn
@@ -506,6 +518,14 @@ org.apache.ignite.internal.processors.cache.IgniteCacheProxy$9
 org.apache.ignite.internal.processors.cache.KeyCacheObject
 org.apache.ignite.internal.processors.cache.KeyCacheObjectImpl
 org.apache.ignite.internal.processors.cache.affinity.GridCacheAffinityProxy
+org.apache.ignite.internal.processors.cache.binary.BinaryMetadataKey
+org.apache.ignite.internal.processors.cache.binary.CacheDefaultBinaryAffinityKeyMapper
+org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$1
+org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$4
+org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$5
+org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$MetaDataEntryFilter
+org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$MetaDataPredicate
+org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$MetadataProcessor
 org.apache.ignite.internal.processors.cache.datastructures.CacheDataStructuresManager$BlockSetCallable
 org.apache.ignite.internal.processors.cache.datastructures.CacheDataStructuresManager$QueueHeaderPredicate
 org.apache.ignite.internal.processors.cache.datastructures.CacheDataStructuresManager$RemoveSetDataCallable
@@ -612,6 +632,7 @@ org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomic
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$21
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$22
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$23
+org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$24
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$3
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$4
 org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache$5
@@ -667,6 +688,8 @@ org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPar
 org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsFullMessage
 org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsSingleMessage
 org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsSingleRequest
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader$1$1
+org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader$10
 org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader$2
 org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader$3
 org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader$4
@@ -710,6 +733,7 @@ org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticS
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticSerializableTxPrepareFuture$MiniFuture$1$1
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFuture$1
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFuture$2
+org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFuture$3
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFuture$MiniFuture$1
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearOptimisticTxPrepareFutureAdapter$1
 org.apache.ignite.internal.processors.cache.distributed.near.GridNearPessimisticTxPrepareFuture$1
@@ -745,14 +769,6 @@ org.apache.ignite.internal.processors.cache.local.atomic.GridLocalAtomicCache$4
 org.apache.ignite.internal.processors.cache.local.atomic.GridLocalAtomicCache$5
 org.apache.ignite.internal.processors.cache.local.atomic.GridLocalAtomicCache$6
 org.apache.ignite.internal.processors.cache.local.atomic.GridLocalAtomicCache$9
-org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheDefaultBinaryAffinityKeyMapper
-org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$1
-org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$4
-org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$5
-org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$MetaDataEntryFilter
-org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$MetaDataPredicate
-org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl$MetadataProcessor
-org.apache.ignite.internal.binaryorg.apache.ignite.internal.processors.cache.binary.BinaryMetadataKey
 org.apache.ignite.internal.processors.cache.query.CacheQueryType
 org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryFuture$1
 org.apache.ignite.internal.processors.cache.query.GridCacheDistributedQueryFuture$3
@@ -944,10 +960,13 @@ org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$13
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$14
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$15
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$16
+org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$17
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$18
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$19
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$2
-org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$20
+org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$21
+org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$22
+org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$23
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$3
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$4
 org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor$5
@@ -1277,6 +1296,7 @@ org.apache.ignite.internal.util.GridLogThrottle$LogLevel$1
 org.apache.ignite.internal.util.GridLogThrottle$LogLevel$2
 org.apache.ignite.internal.util.GridLogThrottle$LogLevel$3
 org.apache.ignite.internal.util.GridLongList
+org.apache.ignite.internal.util.GridMessageCollection
 org.apache.ignite.internal.util.GridMutex
 org.apache.ignite.internal.util.GridRandom
 org.apache.ignite.internal.util.GridReflectionCache


[31/50] [abbrv] ignite git commit: ignite-1.5 Fixed TcpDiscoveryMulticastIpFinder to request address on each getRegisteredAddresses call

Posted by vo...@apache.org.
ignite-1.5 Fixed TcpDiscoveryMulticastIpFinder to request address on each getRegisteredAddresses call


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

Branch: refs/heads/ignite-2100
Commit: 717dab259e3f0287046ffcefa28cf9214ab65ff7
Parents: 6c61598
Author: sboikov <sb...@gridgain.com>
Authored: Mon Dec 14 10:00:57 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Dec 14 10:00:57 2015 +0300

----------------------------------------------------------------------
 .../TcpDiscoveryMulticastIpFinder.java          | 106 +++++++++++++------
 .../tcp/TcpClientDiscoverySpiMulticastTest.java |  91 +++++++++++++++-
 .../TcpDiscoveryIpFinderAbstractSelfTest.java   |   2 +-
 .../TcpDiscoveryMulticastIpFinderSelfTest.java  |  16 ++-
 4 files changed, 174 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/717dab25/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
index d19d08b..77bb99d 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinder.java
@@ -122,6 +122,20 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
     @GridToStringExclude
     private Collection<AddressSender> addrSnds;
 
+    /** */
+    @GridToStringExclude
+    private InetAddress mcastAddr;
+
+    /** */
+    @GridToStringExclude
+    private Set<InetAddress> reqItfs;
+
+    /** */
+    private boolean firstReq;
+
+    /** */
+    private boolean mcastErr;
+
     /**
      * Constructs new IP finder.
      */
@@ -300,8 +314,6 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
 
         boolean clientMode = discoveryClientMode();
 
-        InetAddress mcastAddr;
-
         try {
             mcastAddr = InetAddress.getByName(mcastGrp);
         }
@@ -325,7 +337,7 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
 
         addrSnds = new ArrayList<>(locAddrs.size());
 
-        Set<InetAddress> reqItfs = new HashSet<>(locAddrs.size()); // Interfaces used to send requests.
+        reqItfs = new HashSet<>(locAddrs.size()); // Interfaces used to send requests.
 
         for (String locAddr : locAddrs) {
             InetAddress addr;
@@ -356,8 +368,6 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
             }
         }
 
-        boolean mcastErr = false;
-
         if (!clientMode) {
             if (addrSnds.isEmpty()) {
                 try {
@@ -395,11 +405,62 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
         }
         else
             assert addrSnds.isEmpty() : addrSnds;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void onSpiContextInitialized(IgniteSpiContext spiCtx) throws IgniteSpiException {
+        super.onSpiContextInitialized(spiCtx);
+
+        spiCtx.registerPort(mcastPort, UDP);
+    }
+
+    /** {@inheritDoc} */
+    @Override public synchronized Collection<InetSocketAddress> getRegisteredAddresses() {
+        if (mcastAddr != null && reqItfs != null) {
+            Collection<InetSocketAddress> ret;
+
+            if (reqItfs.size() > 1)
+                ret = requestAddresses(reqItfs);
+            else {
+                T2<Collection<InetSocketAddress>, Boolean> res = requestAddresses(mcastAddr, F.first(reqItfs));
 
-        Collection<InetSocketAddress> ret;
+                ret = res.get1();
+
+                mcastErr |= res.get2();
+            }
 
+            if (ret.isEmpty()) {
+                if (mcastErr && firstReq) {
+                    if (getRegisteredAddresses().isEmpty()) {
+                        InetSocketAddress addr = new InetSocketAddress("localhost", TcpDiscoverySpi.DFLT_PORT);
+
+                        U.quietAndWarn(log, "TcpDiscoveryMulticastIpFinder failed to initialize multicast, " +
+                            "will use default address: " + addr);
+
+                        registerAddresses(Collections.singleton(addr));
+                    }
+                    else
+                        U.quietAndWarn(log, "TcpDiscoveryMulticastIpFinder failed to initialize multicast, " +
+                            "will use pre-configured addresses.");
+                }
+            }
+            else
+                registerAddresses(ret);
+
+            firstReq = false;
+        }
+
+        return super.getRegisteredAddresses();
+    }
+
+
+    /**
+     * @param reqItfs Interfaces used to send requests.
+     * @return Addresses.
+     */
+    private Collection<InetSocketAddress> requestAddresses(Set<InetAddress> reqItfs) {
         if (reqItfs.size() > 1) {
-            ret = new HashSet<>();
+            Collection<InetSocketAddress> ret = new HashSet<>();
 
             Collection<AddressReceiver> rcvrs = new ArrayList<>();
 
@@ -425,39 +486,14 @@ public class TcpDiscoveryMulticastIpFinder extends TcpDiscoveryVmIpFinder {
                     break;
                 }
             }
+
+            return ret;
         }
         else {
             T2<Collection<InetSocketAddress>, Boolean> res = requestAddresses(mcastAddr, F.first(reqItfs));
 
-            ret = res.get1();
-
-            mcastErr |= res.get2();
+            return res.get1();
         }
-
-        if (ret.isEmpty()) {
-            if (mcastErr) {
-                if (getRegisteredAddresses().isEmpty()) {
-                    InetSocketAddress addr = new InetSocketAddress("localhost", TcpDiscoverySpi.DFLT_PORT);
-
-                    U.quietAndWarn(log, "TcpDiscoveryMulticastIpFinder failed to initialize multicast, " +
-                        "will use default address: " + addr);
-
-                    registerAddresses(Collections.singleton(addr));
-                }
-                else
-                    U.quietAndWarn(log, "TcpDiscoveryMulticastIpFinder failed to initialize multicast, " +
-                        "will use pre-configured addresses.");
-            }
-        }
-        else
-            registerAddresses(ret);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void onSpiContextInitialized(IgniteSpiContext spiCtx) throws IgniteSpiException {
-        super.onSpiContextInitialized(spiCtx);
-
-        spiCtx.registerPort(mcastPort, UDP);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/717dab25/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMulticastTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMulticastTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMulticastTest.java
index 79fd954..6611e00 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMulticastTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiMulticastTest.java
@@ -18,13 +18,23 @@
 package org.apache.ignite.spi.discovery.tcp;
 
 import java.util.Collection;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CountDownLatch;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.events.Event;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.lang.IgnitePredicate;
 import org.apache.ignite.spi.discovery.DiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static org.apache.ignite.events.EventType.EVT_CLIENT_NODE_DISCONNECTED;
+import static org.apache.ignite.events.EventType.EVT_CLIENT_NODE_RECONNECTED;
+
 /**
  *
  */
@@ -32,6 +42,12 @@ public class TcpClientDiscoverySpiMulticastTest extends GridCommonAbstractTest {
     /** */
     private boolean forceSrv;
 
+    /** */
+    private ThreadLocal<Boolean> client = new ThreadLocal<>();
+
+    /** */
+    private ThreadLocal<Integer> discoPort = new ThreadLocal<>();
+
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -42,11 +58,23 @@ public class TcpClientDiscoverySpiMulticastTest extends GridCommonAbstractTest {
 
         spi.setIpFinder(new TcpDiscoveryMulticastIpFinder());
 
-        if (getTestGridName(1).equals(gridName)) {
+        Boolean clientFlag = client.get();
+
+        client.set(null);
+
+        if (clientFlag != null && clientFlag) {
             cfg.setClientMode(true);
 
             spi.setForceServerMode(forceSrv);
         }
+        else {
+            Integer port = discoPort.get();
+
+            discoPort.set(null);
+
+            if (port != null)
+                spi.setLocalPort(port);
+        }
 
         cfg.setDiscoverySpi(spi);
 
@@ -59,6 +87,61 @@ public class TcpClientDiscoverySpiMulticastTest extends GridCommonAbstractTest {
 
         stopAllGrids();
     }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testClientStartsFirst() throws Exception {
+        IgniteInternalFuture<Ignite> fut = GridTestUtils.runAsync(new Callable<Ignite>() {
+            @Override public Ignite call() throws Exception {
+                client.set(true);
+
+                return startGrid(0);
+            }
+        }, "start-client");
+
+        U.sleep(10_000);
+
+        discoPort.set(TcpDiscoverySpi.DFLT_PORT);
+
+        Ignite srv = startGrid(1);
+
+        Ignite client = fut.get();
+
+        final CountDownLatch reconnectLatch = new CountDownLatch(1);
+
+        final CountDownLatch disconnectLatch = new CountDownLatch(1);
+
+        client.events().localListen(new IgnitePredicate<Event>() {
+            @Override public boolean apply(Event evt) {
+                info("Client event: " + evt);
+
+                if (evt.type() == EVT_CLIENT_NODE_DISCONNECTED) {
+                    assertEquals(1, reconnectLatch.getCount());
+
+                    disconnectLatch.countDown();
+                }
+                else if (evt.type() == EVT_CLIENT_NODE_RECONNECTED) {
+                    assertEquals(0, disconnectLatch.getCount());
+
+                    reconnectLatch.countDown();
+                }
+
+                return true;
+            }
+        }, EVT_CLIENT_NODE_DISCONNECTED, EVT_CLIENT_NODE_RECONNECTED);
+
+        srv.close();
+
+        assertTrue(disconnectLatch.await(10, SECONDS));
+
+        discoPort.set(TcpDiscoverySpi.DFLT_PORT + 100);
+
+        startGrid(1);
+
+        assertTrue(reconnectLatch.await(10, SECONDS));
+    }
+
     /**
      * @throws Exception If failed.
      */
@@ -83,8 +166,12 @@ public class TcpClientDiscoverySpiMulticastTest extends GridCommonAbstractTest {
 
         assertSpi(ignite0, false);
 
+        client.set(true);
+
         Ignite ignite1 = startGrid(1);
 
+        assertTrue(ignite1.configuration().isClientMode());
+
         assertSpi(ignite1, !forceSrv);
 
         assertTrue(ignite1.configuration().isClientMode());
@@ -92,6 +179,8 @@ public class TcpClientDiscoverySpiMulticastTest extends GridCommonAbstractTest {
         assertEquals(2, ignite0.cluster().nodes().size());
         assertEquals(2, ignite1.cluster().nodes().size());
 
+        client.set(false);
+
         Ignite ignite2 = startGrid(2);
 
         assertSpi(ignite2, false);

http://git-wip-us.apache.org/repos/asf/ignite/blob/717dab25/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/TcpDiscoveryIpFinderAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/TcpDiscoveryIpFinderAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/TcpDiscoveryIpFinderAbstractSelfTest.java
index 03df43c..06aadda 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/TcpDiscoveryIpFinderAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/TcpDiscoveryIpFinderAbstractSelfTest.java
@@ -81,7 +81,7 @@ public abstract class TcpDiscoveryIpFinderAbstractSelfTest<T extends TcpDiscover
         for (InetSocketAddress addr : initAddrs)
             assert addrs.contains(addr) : "Address is missing (got inconsistent addrs collection): " + addr;
 
-        finder.unregisterAddresses(Collections.singletonList(node1));
+        finder.unregisterAddresses(Collections.singletonList(node2));
 
         addrs = finder.getRegisteredAddresses();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/717dab25/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinderSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinderSelfTest.java
index 1e710ee..b39be56 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinderSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/multicast/TcpDiscoveryMulticastIpFinderSelfTest.java
@@ -84,19 +84,27 @@ public class TcpDiscoveryMulticastIpFinderSelfTest
             ipFinder3.setLocalAddress(locAddr);
 
             ipFinder1.initializeLocalAddresses(Collections.singleton(new InetSocketAddress("host1", 1001)));
-            ipFinder2.initializeLocalAddresses(Collections.singleton(new InetSocketAddress("host2", 1002)));
-            ipFinder3.initializeLocalAddresses(Collections.singleton(new InetSocketAddress("host3", 1003)));
 
             Collection<InetSocketAddress> addrs1 = ipFinder1.getRegisteredAddresses();
+
+            ipFinder2.initializeLocalAddresses(Collections.singleton(new InetSocketAddress("host2", 1002)));
+
             Collection<InetSocketAddress> addrs2 = ipFinder2.getRegisteredAddresses();
+
+            ipFinder3.initializeLocalAddresses(Collections.singleton(new InetSocketAddress("host3", 1003)));
+
             Collection<InetSocketAddress> addrs3 = ipFinder3.getRegisteredAddresses();
 
             info("Addrs1: " + addrs1);
             info("Addrs2: " + addrs2);
             info("Addrs2: " + addrs3);
 
-            assertEquals(1, ipFinder1.getRegisteredAddresses().size());
-            assertEquals(2, ipFinder2.getRegisteredAddresses().size());
+            assertEquals(1, addrs1.size());
+            assertEquals(2, addrs2.size());
+            assertEquals(3, addrs3.size());
+
+            assertEquals(3, ipFinder1.getRegisteredAddresses().size());
+            assertEquals(3, ipFinder2.getRegisteredAddresses().size());
             assertEquals(3, ipFinder3.getRegisteredAddresses().size());
         }
         finally {


[03/50] [abbrv] ignite git commit: IGNITE-2082: Added docs generation for the CPP

Posted by vo...@apache.org.
IGNITE-2082: Added docs generation for the CPP


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

Branch: refs/heads/ignite-2100
Commit: 98ef0ba35bdb103ea8317e5d1b0b5a4d2fe45f35
Parents: ec1ffe1
Author: sboikov <sb...@gridgain.com>
Authored: Fri Dec 11 17:26:09 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Fri Dec 11 17:26:09 2015 +0300

----------------------------------------------------------------------
 .gitignore                       |    1 +
 assembly/release-fabric-base.xml |    6 +
 modules/platforms/cpp/cpp.dxg    | 1722 +++++++++++++++++++++++++++++++++
 3 files changed, 1729 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/98ef0ba3/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 2eac5d9..ef12f3a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,3 +27,4 @@ git-patch-prop-local.sh
 **/cpp/**/vs/x64/
 **/cpp/**/vs/Win32/
 **/dotnet/**/obj/
+/modules/platforms/cpp/doc/

http://git-wip-us.apache.org/repos/asf/ignite/blob/98ef0ba3/assembly/release-fabric-base.xml
----------------------------------------------------------------------
diff --git a/assembly/release-fabric-base.xml b/assembly/release-fabric-base.xml
index e6d4eb9..5f6d5eb 100644
--- a/assembly/release-fabric-base.xml
+++ b/assembly/release-fabric-base.xml
@@ -131,6 +131,12 @@
             <outputDirectory>/platforms/cpp/licenses</outputDirectory>
         </fileSet>
 
+        <!-- Move CPP docs. -->
+        <fileSet>
+            <directory>modules/platforms/cpp/doc</directory>
+            <outputDirectory>/platforms/cpp/docs</outputDirectory>
+        </fileSet>
+
         <!-- Other files. -->
         <fileSet>
             <directory>bin</directory>

http://git-wip-us.apache.org/repos/asf/ignite/blob/98ef0ba3/modules/platforms/cpp/cpp.dxg
----------------------------------------------------------------------
diff --git a/modules/platforms/cpp/cpp.dxg b/modules/platforms/cpp/cpp.dxg
new file mode 100644
index 0000000..968ff71
--- /dev/null
+++ b/modules/platforms/cpp/cpp.dxg
@@ -0,0 +1,1722 @@
+# Doxyfile 1.7.4
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = "&nbsp; Apache Ignite C++ Client Library"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = docs
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = NO
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = NO
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = NO
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT                  = include src/model src/impl src/impl/cmd src/impl/connection src/impl/hash src/impl/utils
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = *ClientMessages.pb.*
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = NO
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+# for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is adviced to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the stylesheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES       = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the
+# mathjax.org site, so you can quickly see the result without installing
+# MathJax, but it is strongly recommended to install a local copy of MathJax
+# before deployment.
+
+MATHJAX_RELPATH        = http://www.mathjax.org/mathjax
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will write a font called Helvetica to the output
+# directory and reference it in all dot files that doxygen generates.
+# When you want a differently looking font you can specify the font name
+# using DOT_FONTNAME. You need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME           = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = YES
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+;INPUT=core/include/ignite core/src
+;EXCLUDE=core/include/ignite/impl core/os/linux/include/ignite/impl core/os/linux/src/impl core/os/win/include/ignite/impl core/os/win/src/impl core/src/impl
+;STRIP_FROM_PATH=core/include/ignite core/src
+;OUTPUT_DIRECTORY=doc
+;PROJECT_LOGO=../../../assembly/docfiles/ignite_logo.png


[40/50] [abbrv] ignite git commit: ignite-1.5 Use TcpDiscoveryVmIpFinder in test.

Posted by vo...@apache.org.
ignite-1.5 Use TcpDiscoveryVmIpFinder in test.


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

Branch: refs/heads/ignite-2100
Commit: 4d086734833d96b7e2403ce4f17f763a1c75caab
Parents: 47f1ced
Author: sboikov <sb...@gridgain.com>
Authored: Mon Dec 14 11:27:33 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Dec 14 11:27:33 2015 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/GridFactorySelfTest.java | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4d086734/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java b/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
index bc7dc4b..d72b577 100644
--- a/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
+++ b/modules/spring/src/test/java/org/apache/ignite/internal/GridFactorySelfTest.java
@@ -57,6 +57,8 @@ import org.apache.ignite.spi.collision.CollisionContext;
 import org.apache.ignite.spi.collision.CollisionExternalListener;
 import org.apache.ignite.spi.collision.CollisionSpi;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.config.GridTestProperties;
 import org.apache.ignite.testframework.http.GridEmbeddedHttpServer;
@@ -83,6 +85,9 @@ import static org.apache.ignite.IgniteSystemProperties.IGNITE_OVERRIDE_MCAST_GRP
 @SuppressWarnings("UnusedDeclaration")
 @GridCommonTest(group = "NonDistributed Kernal Self")
 public class GridFactorySelfTest extends GridCommonAbstractTest {
+    /** IP finder. */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
     /** */
     private static final AtomicInteger cnt = new AtomicInteger();
 
@@ -105,6 +110,15 @@ public class GridFactorySelfTest extends GridCommonAbstractTest {
         cnt.set(0);
     }
 
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(IP_FINDER);
+
+        return cfg;
+    }
+
     /**
      * @throws Exception If failed.
      */
@@ -863,9 +877,11 @@ public class GridFactorySelfTest extends GridCommonAbstractTest {
     public void testCurrentIgnite() throws Exception {
         final String LEFT = "LEFT";
         final String RIGHT = "RIGHT";
+
         try {
             Ignite iLEFT = startGrid(LEFT);
             Ignite iRIGHT = startGrid(RIGHT);
+
             waitForDiscovery(iLEFT, iRIGHT);
 
             iLEFT.compute(iLEFT.cluster().forRemotes()).run(new IgniteRunnable() {


[19/50] [abbrv] ignite git commit: ignite-2065: rename "portable" classes to "binary" (in tests)

Posted by vo...@apache.org.
http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java
new file mode 100644
index 0000000..9cf1242
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java
@@ -0,0 +1,464 @@
+/*
+ * 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.binary;
+
+import java.util.Collection;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.binary.BinaryIdMapper;
+import org.apache.ignite.binary.BinarySerializer;
+import org.apache.ignite.binary.BinaryTypeConfiguration;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.marshaller.MarshallerContextTestImpl;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+
+import java.util.Arrays;
+import java.util.Map;
+
+/**
+ * Wildcards test.
+ */
+public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
+    /**
+     * @throws Exception If failed.
+     */
+    public void testClassNames() throws Exception {
+        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
+            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
+            new BinaryTypeConfiguration("unknown.*")
+        ));
+
+        BinaryContext ctx = portableContext(marsh);
+
+        Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
+
+        assertEquals(3, typeIds.size());
+
+        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
+        assertTrue(typeIds.containsKey("gridportabletestclass2".hashCode()));
+        assertTrue(typeIds.containsKey("innerclass".hashCode()));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testClassNamesWithMapper() throws Exception {
+        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
+            @SuppressWarnings("IfMayBeConditional")
+            @Override public int typeId(String clsName) {
+                if (clsName.endsWith("1"))
+                    return 300;
+                else if (clsName.endsWith("2"))
+                    return 400;
+                else if (clsName.endsWith("InnerClass"))
+                    return 500;
+                else
+                    return -500;
+            }
+
+            @Override public int fieldId(int typeId, String fieldName) {
+                return 0;
+            }
+        }, Arrays.asList(
+            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
+            new BinaryTypeConfiguration("unknown.*")
+        ));
+
+        BinaryContext ctx = portableContext(marsh);
+
+        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
+
+        assertEquals(3, typeMappers.size());
+
+        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
+        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(500, typeMappers.get("InnerClass").typeId("InnerClass"));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testTypeConfigurations() throws Exception {
+        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
+            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
+            new BinaryTypeConfiguration("unknown.*")
+        ));
+
+        BinaryContext ctx = portableContext(marsh);
+
+        Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
+
+        assertEquals(3, typeIds.size());
+
+        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
+        assertTrue(typeIds.containsKey("gridportabletestclass2".hashCode()));
+        assertTrue(typeIds.containsKey("innerclass".hashCode()));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testTypeConfigurationsWithGlobalMapper() throws Exception {
+        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
+            @SuppressWarnings("IfMayBeConditional")
+            @Override public int typeId(String clsName) {
+                if (clsName.endsWith("1"))
+                    return 300;
+                else if (clsName.endsWith("2"))
+                    return 400;
+                else if (clsName.endsWith("InnerClass"))
+                    return 500;
+                else
+                    return -500;
+            }
+
+            @Override public int fieldId(int typeId, String fieldName) {
+                return 0;
+            }
+        }, Arrays.asList(
+            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
+            new BinaryTypeConfiguration("unknown.*")
+        ));
+
+        BinaryContext ctx = portableContext(marsh);
+
+        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
+
+        assertEquals(3, typeMappers.size());
+
+        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
+        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(500, typeMappers.get("InnerClass").typeId("InnerClass"));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testTypeConfigurationsWithNonGlobalMapper() throws Exception {
+        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
+            @SuppressWarnings("IfMayBeConditional")
+            @Override public int typeId(String clsName) {
+                if (clsName.endsWith("1"))
+                    return 300;
+                else if (clsName.endsWith("2"))
+                    return 400;
+                else if (clsName.endsWith("InnerClass"))
+                    return 500;
+                else
+                    return -500;
+            }
+
+            @Override public int fieldId(int typeId, String fieldName) {
+                return 0;
+            }
+        }, Arrays.asList(
+            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
+            new BinaryTypeConfiguration("unknown.*")
+        ));
+
+        BinaryContext ctx = portableContext(marsh);
+
+        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
+
+        assertEquals(3, typeMappers.size());
+
+        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
+        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+        assertEquals(500, typeMappers.get("InnerClass").typeId("InnerClass"));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testOverride() throws Exception {
+        BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();
+
+        typeCfg.setTypeName("GridPortableTestClass2");
+        typeCfg.setIdMapper(new BinaryIdMapper() {
+            @Override public int typeId(String clsName) {
+                return 100;
+            }
+
+            @Override public int fieldId(int typeId, String fieldName) {
+                return 0;
+            }
+        });
+
+        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
+            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
+            typeCfg));
+
+        BinaryContext ctx = portableContext(marsh);
+
+        Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
+
+        assertEquals(3, typeIds.size());
+
+        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
+        assertTrue(typeIds.containsKey("innerclass".hashCode()));
+        assertFalse(typeIds.containsKey("gridportabletestclass2".hashCode()));
+
+        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
+
+        assertEquals(100, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testClassNamesJar() throws Exception {
+        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
+            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
+            new BinaryTypeConfiguration("unknown.*")
+        ));
+
+        BinaryContext ctx = portableContext(marsh);
+
+        Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
+
+        assertEquals(3, typeIds.size());
+
+        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
+        assertTrue(typeIds.containsKey("gridportabletestclass2".hashCode()));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testClassNamesWithMapperJar() throws Exception {
+        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
+            @SuppressWarnings("IfMayBeConditional")
+            @Override public int typeId(String clsName) {
+                if (clsName.endsWith("1"))
+                    return 300;
+                else if (clsName.endsWith("2"))
+                    return 400;
+                else
+                    return -500;
+            }
+
+            @Override public int fieldId(int typeId, String fieldName) {
+                return 0;
+            }
+        }, Arrays.asList(
+            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
+            new BinaryTypeConfiguration("unknown.*")
+        ));
+
+        BinaryContext ctx = portableContext(marsh);
+
+        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
+
+        assertEquals(3, typeMappers.size());
+
+        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
+        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testTypeConfigurationsJar() throws Exception {
+        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
+            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
+            new BinaryTypeConfiguration("unknown.*")
+        ));
+
+        BinaryContext ctx = portableContext(marsh);
+
+        Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
+
+        assertEquals(3, typeIds.size());
+
+        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
+        assertTrue(typeIds.containsKey("gridportabletestclass2".hashCode()));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testTypeConfigurationsWithGlobalMapperJar() throws Exception {
+        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
+            @SuppressWarnings("IfMayBeConditional")
+            @Override public int typeId(String clsName) {
+                if (clsName.endsWith("1"))
+                    return 300;
+                else if (clsName.endsWith("2"))
+                    return 400;
+                else
+                    return -500;
+            }
+
+            @Override public int fieldId(int typeId, String fieldName) {
+                return 0;
+            }
+        }, Arrays.asList(
+            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
+            new BinaryTypeConfiguration("unknown.*")
+        ));
+
+        BinaryContext ctx = portableContext(marsh);
+
+        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
+
+        assertEquals(3, typeMappers.size());
+
+        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
+        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testTypeConfigurationsWithNonGlobalMapperJar() throws Exception {
+        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
+            @SuppressWarnings("IfMayBeConditional")
+            @Override public int typeId(String clsName) {
+                if (clsName.endsWith("1"))
+                    return 300;
+                else if (clsName.endsWith("2"))
+                    return 400;
+                else
+                    return -500;
+            }
+
+            @Override public int fieldId(int typeId, String fieldName) {
+                return 0;
+            }
+        }, Arrays.asList(
+            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
+            new BinaryTypeConfiguration("unknown.*")
+        ));
+
+        BinaryContext ctx = portableContext(marsh);
+
+        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
+
+        assertEquals(3, typeMappers.size());
+
+        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
+        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testOverrideJar() throws Exception {
+        BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration(
+            "org.apache.ignite.binary.testjar.GridPortableTestClass2");
+
+        typeCfg.setIdMapper(new BinaryIdMapper() {
+            @Override public int typeId(String clsName) {
+                return 100;
+            }
+
+            @Override public int fieldId(int typeId, String fieldName) {
+                return 0;
+            }
+        });
+
+        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
+            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
+            typeCfg));
+
+        BinaryContext ctx = portableContext(marsh);
+
+        Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
+
+        assertEquals(3, typeIds.size());
+
+        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
+
+        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
+
+        assertEquals(3, typeMappers.size());
+
+        assertEquals(100, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
+    }
+
+    /**
+     * @param marsh Marshaller.
+     * @return Portable context.
+     */
+    protected BinaryContext portableContext(BinaryMarshaller marsh) {
+        GridBinaryMarshaller impl = U.field(marsh, "impl");
+
+        return impl.context();
+    }
+
+    /**
+     *
+     */
+    protected BinaryMarshaller portableMarshaller()
+        throws IgniteCheckedException {
+        return portableMarshaller(null, null, null);
+    }
+
+    /**
+     *
+     */
+    protected BinaryMarshaller portableMarshaller(Collection<BinaryTypeConfiguration> cfgs)
+        throws IgniteCheckedException {
+        return portableMarshaller(null, null, cfgs);
+    }
+
+    /**
+     *
+     */
+    protected BinaryMarshaller portableMarshaller(BinaryIdMapper mapper, Collection<BinaryTypeConfiguration> cfgs)
+        throws IgniteCheckedException {
+        return portableMarshaller(mapper, null, cfgs);
+    }
+
+    /**
+     *
+     */
+    protected BinaryMarshaller portableMarshaller(BinarySerializer serializer, Collection<BinaryTypeConfiguration> cfgs)
+        throws IgniteCheckedException {
+        return portableMarshaller(null, serializer, cfgs);
+    }
+
+    protected BinaryMarshaller portableMarshaller(
+        BinaryIdMapper mapper,
+        BinarySerializer serializer,
+        Collection<BinaryTypeConfiguration> cfgs
+    ) throws IgniteCheckedException {
+        IgniteConfiguration iCfg = new IgniteConfiguration();
+
+        BinaryConfiguration bCfg = new BinaryConfiguration();
+
+        bCfg.setIdMapper(mapper);
+        bCfg.setSerializer(serializer);
+
+        bCfg.setTypeConfigurations(cfgs);
+
+        iCfg.setBinaryConfiguration(bCfg);
+
+        BinaryContext ctx = new BinaryContext(BinaryNoopMetadataHandler.instance(), iCfg);
+
+        BinaryMarshaller marsh = new BinaryMarshaller();
+
+        marsh.setContext(new MarshallerContextTestImpl(null));
+
+        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", ctx, iCfg);
+
+        return marsh;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableMetaDataSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableMetaDataSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableMetaDataSelfTest.java
deleted file mode 100644
index 5d74e12..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableMetaDataSelfTest.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * 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.binary;
-
-import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import org.apache.ignite.IgniteBinary;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.Binarylizable;
-import org.apache.ignite.binary.BinaryType;
-import org.apache.ignite.binary.BinaryObject;
-import org.apache.ignite.binary.BinaryRawWriter;
-import org.apache.ignite.binary.BinaryReader;
-import org.apache.ignite.binary.BinaryWriter;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-/**
- * Portable meta data test.
- */
-public class GridPortableMetaDataSelfTest extends GridCommonAbstractTest {
-    /** */
-    private static int idx;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        BinaryConfiguration bCfg = new BinaryConfiguration();
-
-        bCfg.setClassNames(Arrays.asList(TestObject1.class.getName(), TestObject2.class.getName()));
-
-        cfg.setBinaryConfiguration(bCfg);
-
-        cfg.setMarshaller(new BinaryMarshaller());
-
-        CacheConfiguration ccfg = new CacheConfiguration();
-
-        cfg.setCacheConfiguration(ccfg);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        idx = 0;
-
-        startGrid();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        stopGrid();
-    }
-
-    /**
-     * @return Portables API.
-     */
-    protected IgniteBinary portables() {
-        return grid().binary();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testGetAll() throws Exception {
-        portables().toBinary(new TestObject2());
-
-        Collection<BinaryType> metas = portables().types();
-
-        assertEquals(2, metas.size());
-
-        for (BinaryType meta : metas) {
-            Collection<String> fields;
-
-            switch (meta.typeName()) {
-                case "TestObject1":
-                    fields = meta.fieldNames();
-
-                    assertEquals(7, fields.size());
-
-                    assertTrue(fields.contains("intVal"));
-                    assertTrue(fields.contains("strVal"));
-                    assertTrue(fields.contains("arrVal"));
-                    assertTrue(fields.contains("obj1Val"));
-                    assertTrue(fields.contains("obj2Val"));
-                    assertTrue(fields.contains("decVal"));
-                    assertTrue(fields.contains("decArrVal"));
-
-                    assertEquals("int", meta.fieldTypeName("intVal"));
-                    assertEquals("String", meta.fieldTypeName("strVal"));
-                    assertEquals("byte[]", meta.fieldTypeName("arrVal"));
-                    assertEquals("Object", meta.fieldTypeName("obj1Val"));
-                    assertEquals("Object", meta.fieldTypeName("obj2Val"));
-                    assertEquals("decimal", meta.fieldTypeName("decVal"));
-                    assertEquals("decimal[]", meta.fieldTypeName("decArrVal"));
-
-                    break;
-
-                case "TestObject2":
-                    fields = meta.fieldNames();
-
-                    assertEquals(7, fields.size());
-
-                    assertTrue(fields.contains("boolVal"));
-                    assertTrue(fields.contains("dateVal"));
-                    assertTrue(fields.contains("uuidArrVal"));
-                    assertTrue(fields.contains("objVal"));
-                    assertTrue(fields.contains("mapVal"));
-                    assertTrue(fields.contains("decVal"));
-                    assertTrue(fields.contains("decArrVal"));
-
-                    assertEquals("boolean", meta.fieldTypeName("boolVal"));
-                    assertEquals("Date", meta.fieldTypeName("dateVal"));
-                    assertEquals("UUID[]", meta.fieldTypeName("uuidArrVal"));
-                    assertEquals("Object", meta.fieldTypeName("objVal"));
-                    assertEquals("Map", meta.fieldTypeName("mapVal"));
-                    assertEquals("decimal", meta.fieldTypeName("decVal"));
-                    assertEquals("decimal[]", meta.fieldTypeName("decArrVal"));
-
-                    break;
-
-                default:
-                    assert false : meta.typeName();
-            }
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testNoConfiguration() throws Exception {
-        portables().toBinary(new TestObject3());
-
-        assertNotNull(portables().type(TestObject3.class));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testReflection() throws Exception {
-        BinaryType meta = portables().type(TestObject1.class);
-
-        assertNotNull(meta);
-
-        assertEquals("TestObject1", meta.typeName());
-
-        Collection<String> fields = meta.fieldNames();
-
-        assertEquals(7, fields.size());
-
-        assertTrue(fields.contains("intVal"));
-        assertTrue(fields.contains("strVal"));
-        assertTrue(fields.contains("arrVal"));
-        assertTrue(fields.contains("obj1Val"));
-        assertTrue(fields.contains("obj2Val"));
-        assertTrue(fields.contains("decVal"));
-        assertTrue(fields.contains("decArrVal"));
-
-        assertEquals("int", meta.fieldTypeName("intVal"));
-        assertEquals("String", meta.fieldTypeName("strVal"));
-        assertEquals("byte[]", meta.fieldTypeName("arrVal"));
-        assertEquals("Object", meta.fieldTypeName("obj1Val"));
-        assertEquals("Object", meta.fieldTypeName("obj2Val"));
-        assertEquals("decimal", meta.fieldTypeName("decVal"));
-        assertEquals("decimal[]", meta.fieldTypeName("decArrVal"));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPortableMarshalAware() throws Exception {
-        portables().toBinary(new TestObject2());
-
-        BinaryType meta = portables().type(TestObject2.class);
-
-        assertNotNull(meta);
-
-        assertEquals("TestObject2", meta.typeName());
-
-        Collection<String> fields = meta.fieldNames();
-
-        assertEquals(7, fields.size());
-
-        assertTrue(fields.contains("boolVal"));
-        assertTrue(fields.contains("dateVal"));
-        assertTrue(fields.contains("uuidArrVal"));
-        assertTrue(fields.contains("objVal"));
-        assertTrue(fields.contains("mapVal"));
-        assertTrue(fields.contains("decVal"));
-        assertTrue(fields.contains("decArrVal"));
-
-        assertEquals("boolean", meta.fieldTypeName("boolVal"));
-        assertEquals("Date", meta.fieldTypeName("dateVal"));
-        assertEquals("UUID[]", meta.fieldTypeName("uuidArrVal"));
-        assertEquals("Object", meta.fieldTypeName("objVal"));
-        assertEquals("Map", meta.fieldTypeName("mapVal"));
-        assertEquals("decimal", meta.fieldTypeName("decVal"));
-        assertEquals("decimal[]", meta.fieldTypeName("decArrVal"));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testMerge() throws Exception {
-        portables().toBinary(new TestObject2());
-
-        idx = 1;
-
-        portables().toBinary(new TestObject2());
-
-        BinaryType meta = portables().type(TestObject2.class);
-
-        assertNotNull(meta);
-
-        assertEquals("TestObject2", meta.typeName());
-
-        Collection<String> fields = meta.fieldNames();
-
-        assertEquals(9, fields.size());
-
-        assertTrue(fields.contains("boolVal"));
-        assertTrue(fields.contains("dateVal"));
-        assertTrue(fields.contains("uuidArrVal"));
-        assertTrue(fields.contains("objVal"));
-        assertTrue(fields.contains("mapVal"));
-        assertTrue(fields.contains("charVal"));
-        assertTrue(fields.contains("colVal"));
-        assertTrue(fields.contains("decVal"));
-        assertTrue(fields.contains("decArrVal"));
-
-        assertEquals("boolean", meta.fieldTypeName("boolVal"));
-        assertEquals("Date", meta.fieldTypeName("dateVal"));
-        assertEquals("UUID[]", meta.fieldTypeName("uuidArrVal"));
-        assertEquals("Object", meta.fieldTypeName("objVal"));
-        assertEquals("Map", meta.fieldTypeName("mapVal"));
-        assertEquals("char", meta.fieldTypeName("charVal"));
-        assertEquals("Collection", meta.fieldTypeName("colVal"));
-        assertEquals("decimal", meta.fieldTypeName("decVal"));
-        assertEquals("decimal[]", meta.fieldTypeName("decArrVal"));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testSerializedObject() throws Exception {
-        TestObject1 obj = new TestObject1();
-
-        obj.intVal = 10;
-        obj.strVal = "str";
-        obj.arrVal = new byte[] {2, 4, 6};
-        obj.obj1Val = null;
-        obj.obj2Val = new TestObject2();
-        obj.decVal = BigDecimal.ZERO;
-        obj.decArrVal = new BigDecimal[] { BigDecimal.ONE };
-
-        BinaryObject po = portables().toBinary(obj);
-
-        info(po.toString());
-
-        BinaryType meta = po.type();
-
-        assertNotNull(meta);
-
-        assertEquals("TestObject1", meta.typeName());
-
-        Collection<String> fields = meta.fieldNames();
-
-        assertEquals(7, fields.size());
-
-        assertTrue(fields.contains("intVal"));
-        assertTrue(fields.contains("strVal"));
-        assertTrue(fields.contains("arrVal"));
-        assertTrue(fields.contains("obj1Val"));
-        assertTrue(fields.contains("obj2Val"));
-        assertTrue(fields.contains("decVal"));
-        assertTrue(fields.contains("decArrVal"));
-
-        assertEquals("int", meta.fieldTypeName("intVal"));
-        assertEquals("String", meta.fieldTypeName("strVal"));
-        assertEquals("byte[]", meta.fieldTypeName("arrVal"));
-        assertEquals("Object", meta.fieldTypeName("obj1Val"));
-        assertEquals("Object", meta.fieldTypeName("obj2Val"));
-        assertEquals("decimal", meta.fieldTypeName("decVal"));
-        assertEquals("decimal[]", meta.fieldTypeName("decArrVal"));
-    }
-
-    /**
-     */
-    @SuppressWarnings("UnusedDeclaration")
-    private static class TestObject1 {
-        /** */
-        private int intVal;
-
-        /** */
-        private String strVal;
-
-        /** */
-        private byte[] arrVal;
-
-        /** */
-        private TestObject1 obj1Val;
-
-        /** */
-        private TestObject2 obj2Val;
-
-        /** */
-        private BigDecimal decVal;
-
-        /** */
-        private BigDecimal[] decArrVal;
-    }
-
-    /**
-     */
-    private static class TestObject2 implements Binarylizable {
-        /** {@inheritDoc} */
-        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
-            writer.writeBoolean("boolVal", false);
-            writer.writeDate("dateVal", new Date());
-            writer.writeUuidArray("uuidArrVal", null);
-            writer.writeObject("objVal", null);
-            writer.writeMap("mapVal", new HashMap<>());
-            writer.writeDecimal("decVal", BigDecimal.ZERO);
-            writer.writeDecimalArray("decArrVal", new BigDecimal[] { BigDecimal.ONE });
-
-            if (idx == 1) {
-                writer.writeChar("charVal", (char)0);
-                writer.writeCollection("colVal", null);
-            }
-
-            BinaryRawWriter raw = writer.rawWriter();
-
-            raw.writeChar((char)0);
-            raw.writeCollection(null);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
-            // No-op.
-        }
-    }
-
-    /**
-     */
-    @SuppressWarnings("UnusedDeclaration")
-    private static class TestObject3 {
-        /** */
-        private int intVal;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableWildcardsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableWildcardsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableWildcardsSelfTest.java
deleted file mode 100644
index 9226272..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridPortableWildcardsSelfTest.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- * 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.binary;
-
-import java.util.Collection;
-import org.apache.ignite.IgniteCheckedException;
-import org.apache.ignite.binary.BinaryIdMapper;
-import org.apache.ignite.binary.BinarySerializer;
-import org.apache.ignite.binary.BinaryTypeConfiguration;
-import org.apache.ignite.configuration.BinaryConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.internal.util.IgniteUtils;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.marshaller.MarshallerContextTestImpl;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-import java.util.Arrays;
-import java.util.Map;
-
-/**
- * Wildcards test.
- */
-public class GridPortableWildcardsSelfTest extends GridCommonAbstractTest {
-    /**
-     * @throws Exception If failed.
-     */
-    public void testClassNames() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
-            new BinaryTypeConfiguration("unknown.*")
-        ));
-
-        BinaryContext ctx = portableContext(marsh);
-
-        Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
-
-        assertEquals(3, typeIds.size());
-
-        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
-        assertTrue(typeIds.containsKey("gridportabletestclass2".hashCode()));
-        assertTrue(typeIds.containsKey("innerclass".hashCode()));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testClassNamesWithMapper() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
-            @SuppressWarnings("IfMayBeConditional")
-            @Override public int typeId(String clsName) {
-                if (clsName.endsWith("1"))
-                    return 300;
-                else if (clsName.endsWith("2"))
-                    return 400;
-                else if (clsName.endsWith("InnerClass"))
-                    return 500;
-                else
-                    return -500;
-            }
-
-            @Override public int fieldId(int typeId, String fieldName) {
-                return 0;
-            }
-        }, Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
-            new BinaryTypeConfiguration("unknown.*")
-        ));
-
-        BinaryContext ctx = portableContext(marsh);
-
-        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
-
-        assertEquals(3, typeMappers.size());
-
-        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
-        assertEquals(500, typeMappers.get("InnerClass").typeId("InnerClass"));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTypeConfigurations() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
-            new BinaryTypeConfiguration("unknown.*")
-        ));
-
-        BinaryContext ctx = portableContext(marsh);
-
-        Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
-
-        assertEquals(3, typeIds.size());
-
-        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
-        assertTrue(typeIds.containsKey("gridportabletestclass2".hashCode()));
-        assertTrue(typeIds.containsKey("innerclass".hashCode()));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTypeConfigurationsWithGlobalMapper() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
-            @SuppressWarnings("IfMayBeConditional")
-            @Override public int typeId(String clsName) {
-                if (clsName.endsWith("1"))
-                    return 300;
-                else if (clsName.endsWith("2"))
-                    return 400;
-                else if (clsName.endsWith("InnerClass"))
-                    return 500;
-                else
-                    return -500;
-            }
-
-            @Override public int fieldId(int typeId, String fieldName) {
-                return 0;
-            }
-        }, Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
-            new BinaryTypeConfiguration("unknown.*")
-        ));
-
-        BinaryContext ctx = portableContext(marsh);
-
-        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
-
-        assertEquals(3, typeMappers.size());
-
-        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
-        assertEquals(500, typeMappers.get("InnerClass").typeId("InnerClass"));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTypeConfigurationsWithNonGlobalMapper() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
-            @SuppressWarnings("IfMayBeConditional")
-            @Override public int typeId(String clsName) {
-                if (clsName.endsWith("1"))
-                    return 300;
-                else if (clsName.endsWith("2"))
-                    return 400;
-                else if (clsName.endsWith("InnerClass"))
-                    return 500;
-                else
-                    return -500;
-            }
-
-            @Override public int fieldId(int typeId, String fieldName) {
-                return 0;
-            }
-        }, Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
-            new BinaryTypeConfiguration("unknown.*")
-        ));
-
-        BinaryContext ctx = portableContext(marsh);
-
-        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
-
-        assertEquals(3, typeMappers.size());
-
-        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
-        assertEquals(500, typeMappers.get("InnerClass").typeId("InnerClass"));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOverride() throws Exception {
-        BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration();
-
-        typeCfg.setTypeName("GridPortableTestClass2");
-        typeCfg.setIdMapper(new BinaryIdMapper() {
-            @Override public int typeId(String clsName) {
-                return 100;
-            }
-
-            @Override public int fieldId(int typeId, String fieldName) {
-                return 0;
-            }
-        });
-
-        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
-            typeCfg));
-
-        BinaryContext ctx = portableContext(marsh);
-
-        Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
-
-        assertEquals(3, typeIds.size());
-
-        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
-        assertTrue(typeIds.containsKey("innerclass".hashCode()));
-        assertFalse(typeIds.containsKey("gridportabletestclass2".hashCode()));
-
-        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
-
-        assertEquals(100, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testClassNamesJar() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
-            new BinaryTypeConfiguration("unknown.*")
-        ));
-
-        BinaryContext ctx = portableContext(marsh);
-
-        Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
-
-        assertEquals(3, typeIds.size());
-
-        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
-        assertTrue(typeIds.containsKey("gridportabletestclass2".hashCode()));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testClassNamesWithMapperJar() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
-            @SuppressWarnings("IfMayBeConditional")
-            @Override public int typeId(String clsName) {
-                if (clsName.endsWith("1"))
-                    return 300;
-                else if (clsName.endsWith("2"))
-                    return 400;
-                else
-                    return -500;
-            }
-
-            @Override public int fieldId(int typeId, String fieldName) {
-                return 0;
-            }
-        }, Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
-            new BinaryTypeConfiguration("unknown.*")
-        ));
-
-        BinaryContext ctx = portableContext(marsh);
-
-        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
-
-        assertEquals(3, typeMappers.size());
-
-        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTypeConfigurationsJar() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
-            new BinaryTypeConfiguration("unknown.*")
-        ));
-
-        BinaryContext ctx = portableContext(marsh);
-
-        Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
-
-        assertEquals(3, typeIds.size());
-
-        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
-        assertTrue(typeIds.containsKey("gridportabletestclass2".hashCode()));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTypeConfigurationsWithGlobalMapperJar() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
-            @SuppressWarnings("IfMayBeConditional")
-            @Override public int typeId(String clsName) {
-                if (clsName.endsWith("1"))
-                    return 300;
-                else if (clsName.endsWith("2"))
-                    return 400;
-                else
-                    return -500;
-            }
-
-            @Override public int fieldId(int typeId, String fieldName) {
-                return 0;
-            }
-        }, Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
-            new BinaryTypeConfiguration("unknown.*")
-        ));
-
-        BinaryContext ctx = portableContext(marsh);
-
-        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
-
-        assertEquals(3, typeMappers.size());
-
-        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTypeConfigurationsWithNonGlobalMapperJar() throws Exception {
-        BinaryMarshaller marsh = portableMarshaller(new BinaryIdMapper() {
-            @SuppressWarnings("IfMayBeConditional")
-            @Override public int typeId(String clsName) {
-                if (clsName.endsWith("1"))
-                    return 300;
-                else if (clsName.endsWith("2"))
-                    return 400;
-                else
-                    return -500;
-            }
-
-            @Override public int fieldId(int typeId, String fieldName) {
-                return 0;
-            }
-        }, Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
-            new BinaryTypeConfiguration("unknown.*")
-        ));
-
-        BinaryContext ctx = portableContext(marsh);
-
-        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
-
-        assertEquals(3, typeMappers.size());
-
-        assertEquals(300, typeMappers.get("GridPortableTestClass1").typeId("GridPortableTestClass1"));
-        assertEquals(400, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOverrideJar() throws Exception {
-        BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration(
-            "org.apache.ignite.binary.testjar.GridPortableTestClass2");
-
-        typeCfg.setIdMapper(new BinaryIdMapper() {
-            @Override public int typeId(String clsName) {
-                return 100;
-            }
-
-            @Override public int fieldId(int typeId, String fieldName) {
-                return 0;
-            }
-        });
-
-        BinaryMarshaller marsh = portableMarshaller(Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
-            typeCfg));
-
-        BinaryContext ctx = portableContext(marsh);
-
-        Map<Integer, Class> typeIds = U.field(ctx, "userTypes");
-
-        assertEquals(3, typeIds.size());
-
-        assertTrue(typeIds.containsKey("gridportabletestclass1".hashCode()));
-
-        Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
-
-        assertEquals(3, typeMappers.size());
-
-        assertEquals(100, typeMappers.get("GridPortableTestClass2").typeId("GridPortableTestClass2"));
-    }
-
-    /**
-     * @param marsh Marshaller.
-     * @return Portable context.
-     */
-    protected BinaryContext portableContext(BinaryMarshaller marsh) {
-        GridBinaryMarshaller impl = U.field(marsh, "impl");
-
-        return impl.context();
-    }
-
-    /**
-     *
-     */
-    protected BinaryMarshaller portableMarshaller()
-        throws IgniteCheckedException {
-        return portableMarshaller(null, null, null);
-    }
-
-    /**
-     *
-     */
-    protected BinaryMarshaller portableMarshaller(Collection<BinaryTypeConfiguration> cfgs)
-        throws IgniteCheckedException {
-        return portableMarshaller(null, null, cfgs);
-    }
-
-    /**
-     *
-     */
-    protected BinaryMarshaller portableMarshaller(BinaryIdMapper mapper, Collection<BinaryTypeConfiguration> cfgs)
-        throws IgniteCheckedException {
-        return portableMarshaller(mapper, null, cfgs);
-    }
-
-    /**
-     *
-     */
-    protected BinaryMarshaller portableMarshaller(BinarySerializer serializer, Collection<BinaryTypeConfiguration> cfgs)
-        throws IgniteCheckedException {
-        return portableMarshaller(null, serializer, cfgs);
-    }
-
-    protected BinaryMarshaller portableMarshaller(
-        BinaryIdMapper mapper,
-        BinarySerializer serializer,
-        Collection<BinaryTypeConfiguration> cfgs
-    ) throws IgniteCheckedException {
-        IgniteConfiguration iCfg = new IgniteConfiguration();
-
-        BinaryConfiguration bCfg = new BinaryConfiguration();
-
-        bCfg.setIdMapper(mapper);
-        bCfg.setSerializer(serializer);
-
-        bCfg.setTypeConfigurations(cfgs);
-
-        iCfg.setBinaryConfiguration(bCfg);
-
-        BinaryContext ctx = new BinaryContext(BinaryNoopMetadataHandler.instance(), iCfg);
-
-        BinaryMarshaller marsh = new BinaryMarshaller();
-
-        marsh.setContext(new MarshallerContextTestImpl(null));
-
-        IgniteUtils.invoke(BinaryMarshaller.class, marsh, "setPortableContext", ctx, iCfg);
-
-        return marsh;
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/mutabletest/GridBinaryTestClasses.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/mutabletest/GridBinaryTestClasses.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/mutabletest/GridBinaryTestClasses.java
new file mode 100644
index 0000000..0170f99
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/mutabletest/GridBinaryTestClasses.java
@@ -0,0 +1,484 @@
+/*
+ * 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.binary.mutabletest;
+
+import com.google.common.base.Throwables;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutput;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.UUID;
+
+import org.apache.ignite.binary.BinaryMapFactory;
+import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.binary.BinaryReader;
+import org.apache.ignite.binary.BinaryWriter;
+import org.apache.ignite.binary.Binarylizable;
+import org.apache.ignite.internal.util.lang.GridMapEntry;
+import org.apache.ignite.binary.BinaryObject;
+
+/**
+ *
+ */
+@SuppressWarnings({"PublicInnerClass", "PublicField"})
+public class GridBinaryTestClasses {
+    /**
+     *
+     */
+    public static class TestObjectContainer {
+        /** */
+        public Object foo;
+
+        /**
+         *
+         */
+        public TestObjectContainer() {
+            // No-op.
+        }
+
+        /**
+         * @param foo Object.
+         */
+        public TestObjectContainer(Object foo) {
+            this.foo = foo;
+        }
+    }
+
+    /**
+     *
+     */
+    public static class TestObjectOuter {
+        /** */
+        public TestObjectInner inner;
+
+        /** */
+        public String foo;
+
+        /**
+         *
+         */
+        public TestObjectOuter() {
+
+        }
+
+        /**
+         * @param inner Inner object.
+         */
+        public TestObjectOuter(TestObjectInner inner) {
+            this.inner = inner;
+        }
+    }
+
+    /** */
+    public static class TestObjectInner {
+        /** */
+        public Object foo;
+
+        /** */
+        public TestObjectOuter outer;
+    }
+
+    /** */
+    public static class TestObjectArrayList {
+        /** */
+        public List<String> list = new ArrayList<>();
+    }
+
+    /**
+     *
+     */
+    public static class TestObjectPlainPortable {
+        /** */
+        public BinaryObject plainPortable;
+
+        /**
+         *
+         */
+        public TestObjectPlainPortable() {
+            // No-op.
+        }
+
+        /**
+         * @param plainPortable Object.
+         */
+        public TestObjectPlainPortable(BinaryObject plainPortable) {
+            this.plainPortable = plainPortable;
+        }
+    }
+
+    /**
+     *
+     */
+    public static class TestObjectAllTypes implements Serializable {
+        /** */
+        public Byte b_;
+
+        /** */
+        public Short s_;
+
+        /** */
+        public Integer i_;
+
+        /** */
+        public Long l_;
+
+        /** */
+        public Float f_;
+
+        /** */
+        public Double d_;
+
+        /** */
+        public Character c_;
+
+        /** */
+        public Boolean z_;
+
+        /** */
+        public byte b;
+
+        /** */
+        public short s;
+
+        /** */
+        public int i;
+
+        /** */
+        public long l;
+
+        /** */
+        public float f;
+
+        /** */
+        public double d;
+
+        /** */
+        public char c;
+
+        /** */
+        public boolean z;
+
+        /** */
+        public String str;
+
+        /** */
+        public UUID uuid;
+
+        /** */
+        public Date date;
+
+        /** */
+        public Timestamp ts;
+
+        /** */
+        public byte[] bArr;
+
+        /** */
+        public short[] sArr;
+
+        /** */
+        public int[] iArr;
+
+        /** */
+        public long[] lArr;
+
+        /** */
+        public float[] fArr;
+
+        /** */
+        public double[] dArr;
+
+        /** */
+        public char[] cArr;
+
+        /** */
+        public boolean[] zArr;
+
+        /** */
+        public BigDecimal[] bdArr;
+
+        /** */
+        public String[] strArr;
+
+        /** */
+        public UUID[] uuidArr;
+
+        /** */
+        public Date[] dateArr;
+
+        /** */
+        public Timestamp[] tsArr;
+
+        /** */
+        public TestObjectEnum anEnum;
+
+        /** */
+        public TestObjectEnum[] enumArr;
+
+        /** */
+        public Map.Entry entry;
+
+        /**
+         * @return Array.
+         */
+        private byte[] serialize() {
+            ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
+
+            try {
+                ObjectOutput out = new ObjectOutputStream(byteOut);
+
+                out.writeObject(this);
+
+                out.close();
+            }
+            catch (IOException e) {
+                Throwables.propagate(e);
+            }
+
+            return byteOut.toByteArray();
+        }
+
+        /**
+         *
+         */
+        public void setDefaultData() {
+            b_ = 11;
+            s_ = 22;
+            i_ = 33;
+            l_ = 44L;
+            f_ = 55f;
+            d_ = 66d;
+            c_ = 'e';
+            z_ = true;
+
+            b = 1;
+            s = 2;
+            i = 3;
+            l = 4;
+            f = 5;
+            d = 6;
+            c = 7;
+            z = true;
+
+            str = "abc";
+            uuid = new UUID(1, 1);
+            date = new Date(1000000);
+            ts = new Timestamp(100020003);
+
+            bArr = new byte[] {1, 2, 3};
+            sArr = new short[] {1, 2, 3};
+            iArr = new int[] {1, 2, 3};
+            lArr = new long[] {1, 2, 3};
+            fArr = new float[] {1, 2, 3};
+            dArr = new double[] {1, 2, 3};
+            cArr = new char[] {1, 2, 3};
+            zArr = new boolean[] {true, false};
+
+            strArr = new String[] {"abc", "ab", "a"};
+            uuidArr = new UUID[] {new UUID(1, 1), new UUID(2, 2)};
+            bdArr = new BigDecimal[] {new BigDecimal(1000), BigDecimal.TEN};
+            dateArr = new Date[] {new Date(1000000), new Date(200000)};
+            tsArr = new Timestamp[] {new Timestamp(100020003), new Timestamp(200030004)};
+
+            anEnum = TestObjectEnum.A;
+
+            enumArr = new TestObjectEnum[] {TestObjectEnum.B};
+
+            entry = new GridMapEntry<>(1, "a");
+        }
+    }
+
+    /**
+     *
+     */
+    public enum TestObjectEnum {
+        A, B, C
+    }
+
+    /**
+     *
+     */
+    public static class Address implements Serializable {
+        /** SUID. */
+        private static final long serialVersionUID = 0L;
+
+        /** City. */
+        public String city;
+
+        /** Street. */
+        public String street;
+
+        /** Street number. */
+        public int streetNumber;
+
+        /** Flat number. */
+        public int flatNumber;
+
+        /**
+         * Default constructor.
+         */
+        public Address() {
+            // No-op.
+        }
+
+        /**
+         * Constructor.
+         *
+         * @param city City.
+         * @param street Street.
+         * @param streetNumber Street number.
+         * @param flatNumber Flat number.
+         */
+        public Address(String city, String street, int streetNumber, int flatNumber) {
+            this.city = city;
+            this.street = street;
+            this.streetNumber = streetNumber;
+            this.flatNumber = flatNumber;
+        }
+    }
+
+    /**
+     *
+     */
+    public static class Company implements Serializable {
+        /** SUID. */
+        private static final long serialVersionUID = 0L;
+
+        /** ID. */
+        public int id;
+
+        /** Name. */
+        public String name;
+
+        /** Size. */
+        public int size;
+
+        /** Address. */
+        public Address address;
+
+        /** Occupation. */
+        public String occupation;
+
+        /**
+         * Default constructor.
+         */
+        public Company() {
+            // No-op.
+        }
+
+        /**
+         * Constructor.
+         *
+         * @param id ID.
+         * @param name Name.
+         * @param size Size.
+         * @param address Address.
+         * @param occupation Occupation.
+         */
+        public Company(int id, String name, int size, Address address, String occupation) {
+            this.id = id;
+            this.name = name;
+            this.size = size;
+            this.address = address;
+            this.occupation = occupation;
+        }
+    }
+
+    /**
+     * Companies.
+     */
+    public static class Companies {
+        /** Companies. */
+        private List<Company> companies = new ArrayList<>();
+
+        /**
+         * @param idx Index.
+         * @return Company.
+         */
+        public Company get(int idx) {
+            return companies.get(idx);
+        }
+
+        /**
+         * @param company Company.
+         */
+        public void add(Company company) {
+            companies.add(company);
+        }
+
+        /**
+         * @return Size.
+         */
+        public int size() {
+            return companies.size();
+        }
+    }
+
+    /**
+     *
+     */
+    public static class Addresses implements Binarylizable {
+        /** */
+        private Map<String, Companies> companyByStreet = new TreeMap<>();
+
+        /**
+         * @param company Company.
+         */
+        public void addCompany(Company company) {
+            Companies list = companyByStreet.get(company.address.street);
+
+            if (list == null) {
+                list = new Companies();
+
+                companyByStreet.put(company.address.street, list);
+            }
+
+            list.add(company);
+        }
+
+        /**
+         * @return map
+         */
+        public Map<String, Companies> getCompanyByStreet() {
+            return companyByStreet;
+        }
+
+        /** {@inheritDoc} */
+        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
+            writer.writeMap("companyByStreet", companyByStreet);
+        }
+
+        /** {@inheritDoc} */
+        @SuppressWarnings("unchecked")
+        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
+            companyByStreet = reader.readMap("companyByStreet", new BinaryMapFactory<String, Companies>() {
+                @Override public Map<String, Companies> create(int size) {
+                    return new TreeMap<>();
+                }
+            });
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/mutabletest/GridPortableTestClasses.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/mutabletest/GridPortableTestClasses.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/mutabletest/GridPortableTestClasses.java
deleted file mode 100644
index 3a4a4b6..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/mutabletest/GridPortableTestClasses.java
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * 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.binary.mutabletest;
-
-import com.google.common.base.Throwables;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutput;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.UUID;
-
-import org.apache.ignite.binary.BinaryMapFactory;
-import org.apache.ignite.binary.BinaryObjectException;
-import org.apache.ignite.binary.BinaryReader;
-import org.apache.ignite.binary.BinaryWriter;
-import org.apache.ignite.binary.Binarylizable;
-import org.apache.ignite.internal.util.lang.GridMapEntry;
-import org.apache.ignite.binary.BinaryObject;
-
-/**
- *
- */
-@SuppressWarnings({"PublicInnerClass", "PublicField"})
-public class GridPortableTestClasses {
-    /**
-     *
-     */
-    public static class TestObjectContainer {
-        /** */
-        public Object foo;
-
-        /**
-         *
-         */
-        public TestObjectContainer() {
-            // No-op.
-        }
-
-        /**
-         * @param foo Object.
-         */
-        public TestObjectContainer(Object foo) {
-            this.foo = foo;
-        }
-    }
-
-    /**
-     *
-     */
-    public static class TestObjectOuter {
-        /** */
-        public TestObjectInner inner;
-
-        /** */
-        public String foo;
-
-        /**
-         *
-         */
-        public TestObjectOuter() {
-
-        }
-
-        /**
-         * @param inner Inner object.
-         */
-        public TestObjectOuter(TestObjectInner inner) {
-            this.inner = inner;
-        }
-    }
-
-    /** */
-    public static class TestObjectInner {
-        /** */
-        public Object foo;
-
-        /** */
-        public TestObjectOuter outer;
-    }
-
-    /** */
-    public static class TestObjectArrayList {
-        /** */
-        public List<String> list = new ArrayList<>();
-    }
-
-    /**
-     *
-     */
-    public static class TestObjectPlainPortable {
-        /** */
-        public BinaryObject plainPortable;
-
-        /**
-         *
-         */
-        public TestObjectPlainPortable() {
-            // No-op.
-        }
-
-        /**
-         * @param plainPortable Object.
-         */
-        public TestObjectPlainPortable(BinaryObject plainPortable) {
-            this.plainPortable = plainPortable;
-        }
-    }
-
-    /**
-     *
-     */
-    public static class TestObjectAllTypes implements Serializable {
-        /** */
-        public Byte b_;
-
-        /** */
-        public Short s_;
-
-        /** */
-        public Integer i_;
-
-        /** */
-        public Long l_;
-
-        /** */
-        public Float f_;
-
-        /** */
-        public Double d_;
-
-        /** */
-        public Character c_;
-
-        /** */
-        public Boolean z_;
-
-        /** */
-        public byte b;
-
-        /** */
-        public short s;
-
-        /** */
-        public int i;
-
-        /** */
-        public long l;
-
-        /** */
-        public float f;
-
-        /** */
-        public double d;
-
-        /** */
-        public char c;
-
-        /** */
-        public boolean z;
-
-        /** */
-        public String str;
-
-        /** */
-        public UUID uuid;
-
-        /** */
-        public Date date;
-
-        /** */
-        public Timestamp ts;
-
-        /** */
-        public byte[] bArr;
-
-        /** */
-        public short[] sArr;
-
-        /** */
-        public int[] iArr;
-
-        /** */
-        public long[] lArr;
-
-        /** */
-        public float[] fArr;
-
-        /** */
-        public double[] dArr;
-
-        /** */
-        public char[] cArr;
-
-        /** */
-        public boolean[] zArr;
-
-        /** */
-        public BigDecimal[] bdArr;
-
-        /** */
-        public String[] strArr;
-
-        /** */
-        public UUID[] uuidArr;
-
-        /** */
-        public Date[] dateArr;
-
-        /** */
-        public Timestamp[] tsArr;
-
-        /** */
-        public TestObjectEnum anEnum;
-
-        /** */
-        public TestObjectEnum[] enumArr;
-
-        /** */
-        public Map.Entry entry;
-
-        /**
-         * @return Array.
-         */
-        private byte[] serialize() {
-            ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
-
-            try {
-                ObjectOutput out = new ObjectOutputStream(byteOut);
-
-                out.writeObject(this);
-
-                out.close();
-            }
-            catch (IOException e) {
-                Throwables.propagate(e);
-            }
-
-            return byteOut.toByteArray();
-        }
-
-        /**
-         *
-         */
-        public void setDefaultData() {
-            b_ = 11;
-            s_ = 22;
-            i_ = 33;
-            l_ = 44L;
-            f_ = 55f;
-            d_ = 66d;
-            c_ = 'e';
-            z_ = true;
-
-            b = 1;
-            s = 2;
-            i = 3;
-            l = 4;
-            f = 5;
-            d = 6;
-            c = 7;
-            z = true;
-
-            str = "abc";
-            uuid = new UUID(1, 1);
-            date = new Date(1000000);
-            ts = new Timestamp(100020003);
-
-            bArr = new byte[] {1, 2, 3};
-            sArr = new short[] {1, 2, 3};
-            iArr = new int[] {1, 2, 3};
-            lArr = new long[] {1, 2, 3};
-            fArr = new float[] {1, 2, 3};
-            dArr = new double[] {1, 2, 3};
-            cArr = new char[] {1, 2, 3};
-            zArr = new boolean[] {true, false};
-
-            strArr = new String[] {"abc", "ab", "a"};
-            uuidArr = new UUID[] {new UUID(1, 1), new UUID(2, 2)};
-            bdArr = new BigDecimal[] {new BigDecimal(1000), BigDecimal.TEN};
-            dateArr = new Date[] {new Date(1000000), new Date(200000)};
-            tsArr = new Timestamp[] {new Timestamp(100020003), new Timestamp(200030004)};
-
-            anEnum = TestObjectEnum.A;
-
-            enumArr = new TestObjectEnum[] {TestObjectEnum.B};
-
-            entry = new GridMapEntry<>(1, "a");
-        }
-    }
-
-    /**
-     *
-     */
-    public enum TestObjectEnum {
-        A, B, C
-    }
-
-    /**
-     *
-     */
-    public static class Address implements Serializable {
-        /** SUID. */
-        private static final long serialVersionUID = 0L;
-
-        /** City. */
-        public String city;
-
-        /** Street. */
-        public String street;
-
-        /** Street number. */
-        public int streetNumber;
-
-        /** Flat number. */
-        public int flatNumber;
-
-        /**
-         * Default constructor.
-         */
-        public Address() {
-            // No-op.
-        }
-
-        /**
-         * Constructor.
-         *
-         * @param city City.
-         * @param street Street.
-         * @param streetNumber Street number.
-         * @param flatNumber Flat number.
-         */
-        public Address(String city, String street, int streetNumber, int flatNumber) {
-            this.city = city;
-            this.street = street;
-            this.streetNumber = streetNumber;
-            this.flatNumber = flatNumber;
-        }
-    }
-
-    /**
-     *
-     */
-    public static class Company implements Serializable {
-        /** SUID. */
-        private static final long serialVersionUID = 0L;
-
-        /** ID. */
-        public int id;
-
-        /** Name. */
-        public String name;
-
-        /** Size. */
-        public int size;
-
-        /** Address. */
-        public Address address;
-
-        /** Occupation. */
-        public String occupation;
-
-        /**
-         * Default constructor.
-         */
-        public Company() {
-            // No-op.
-        }
-
-        /**
-         * Constructor.
-         *
-         * @param id ID.
-         * @param name Name.
-         * @param size Size.
-         * @param address Address.
-         * @param occupation Occupation.
-         */
-        public Company(int id, String name, int size, Address address, String occupation) {
-            this.id = id;
-            this.name = name;
-            this.size = size;
-            this.address = address;
-            this.occupation = occupation;
-        }
-    }
-
-    /**
-     * Companies.
-     */
-    public static class Companies {
-        /** Companies. */
-        private List<Company> companies = new ArrayList<>();
-
-        /**
-         * @param idx Index.
-         * @return Company.
-         */
-        public Company get(int idx) {
-            return companies.get(idx);
-        }
-
-        /**
-         * @param company Company.
-         */
-        public void add(Company company) {
-            companies.add(company);
-        }
-
-        /**
-         * @return Size.
-         */
-        public int size() {
-            return companies.size();
-        }
-    }
-
-    /**
-     *
-     */
-    public static class Addresses implements Binarylizable {
-        /** */
-        private Map<String, Companies> companyByStreet = new TreeMap<>();
-
-        /**
-         * @param company Company.
-         */
-        public void addCompany(Company company) {
-            Companies list = companyByStreet.get(company.address.street);
-
-            if (list == null) {
-                list = new Companies();
-
-                companyByStreet.put(company.address.street, list);
-            }
-
-            list.add(company);
-        }
-
-        /**
-         * @return map
-         */
-        public Map<String, Companies> getCompanyByStreet() {
-            return companyByStreet;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeBinary(BinaryWriter writer) throws BinaryObjectException {
-            writer.writeMap("companyByStreet", companyByStreet);
-        }
-
-        /** {@inheritDoc} */
-        @SuppressWarnings("unchecked")
-        @Override public void readBinary(BinaryReader reader) throws BinaryObjectException {
-            companyByStreet = reader.readMap("companyByStreet", new BinaryMapFactory<String, Companies>() {
-                @Override public Map<String, Companies> create(int size) {
-                    return new TreeMap<>();
-                }
-            });
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridBinaryTestClass1.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridBinaryTestClass1.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridBinaryTestClass1.java
new file mode 100644
index 0000000..b861a75
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridBinaryTestClass1.java
@@ -0,0 +1,28 @@
+/*
+ * 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.binary.test;
+
+/**
+ */
+public class GridBinaryTestClass1 {
+    /**
+     */
+    private static class InnerClass {
+        // No-op.
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridBinaryTestClass2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridBinaryTestClass2.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridBinaryTestClass2.java
new file mode 100644
index 0000000..fc5e88c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridBinaryTestClass2.java
@@ -0,0 +1,24 @@
+/*
+ * 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.binary.test;
+
+/**
+ */
+public class GridBinaryTestClass2 {
+    // No-op.
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridPortableTestClass1.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridPortableTestClass1.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridPortableTestClass1.java
deleted file mode 100644
index 887134a..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridPortableTestClass1.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.binary.test;
-
-/**
- */
-public class GridPortableTestClass1 {
-    /**
-     */
-    private static class InnerClass {
-        // No-op.
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridPortableTestClass2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridPortableTestClass2.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridPortableTestClass2.java
deleted file mode 100644
index 3c1c506..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/test/GridPortableTestClass2.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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.binary.test;
-
-/**
- */
-public class GridPortableTestClass2 {
-    // No-op.
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/test/subpackage/GridBinaryTestClass3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/test/subpackage/GridBinaryTestClass3.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/test/subpackage/GridBinaryTestClass3.java
new file mode 100644
index 0000000..72a5a1e
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/test/subpackage/GridBinaryTestClass3.java
@@ -0,0 +1,24 @@
+/*
+ * 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.binary.test.subpackage;
+
+/**
+ */
+public class GridBinaryTestClass3 {
+    // No-op.
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/binary/test/subpackage/GridPortableTestClass3.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/test/subpackage/GridPortableTestClass3.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/test/subpackage/GridPortableTestClass3.java
deleted file mode 100644
index a04b586..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/test/subpackage/GridPortableTestClass3.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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.binary.test.subpackage;
-
-/**
- */
-public class GridPortableTestClass3 {
-    // No-op.
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreBinariesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreBinariesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreBinariesSelfTest.java
new file mode 100644
index 0000000..55f2da0
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStoreBinariesSelfTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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.processors.cache.binary;
+
+import java.util.Map;
+import org.apache.ignite.binary.BinaryObject;
+
+/**
+ * Tests for cache store with binary.
+ */
+public class GridCacheBinaryStoreBinariesSelfTest extends GridCacheBinaryStoreAbstractSelfTest {
+    /** {@inheritDoc} */
+    @Override protected boolean keepPortableInStore() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void populateMap(Map<Object, Object> map, int... idxs) {
+        assert map != null;
+        assert idxs != null;
+
+        for (int idx : idxs)
+            map.put(portable(new Key(idx)), portable(new Value(idx)));
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void checkMap(Map<Object, Object> map, int... idxs) {
+        assert map != null;
+        assert idxs != null;
+
+        assertEquals(idxs.length, map.size());
+
+        for (int idx : idxs) {
+            Object val = map.get(portable(new Key(idx)));
+
+            assertTrue(String.valueOf(val), val instanceof BinaryObject);
+
+            BinaryObject po = (BinaryObject)val;
+
+            assertEquals("Value", po.type().typeName());
+            assertEquals(new Integer(idx), po.field("idx"));
+        }
+    }
+
+    /**
+     * @param obj Object.
+     * @return Portable object.
+     */
+    private Object portable(Object obj) {
+        return grid().binary().toBinary(obj);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/469bf6d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStorePortablesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStorePortablesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStorePortablesSelfTest.java
deleted file mode 100644
index db15f08..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryStorePortablesSelfTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.processors.cache.binary;
-
-import java.util.Map;
-import org.apache.ignite.binary.BinaryObject;
-
-/**
- * Tests for cache store with binary.
- */
-public class GridCacheBinaryStorePortablesSelfTest extends GridCacheBinaryStoreAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected boolean keepPortableInStore() {
-        return true;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void populateMap(Map<Object, Object> map, int... idxs) {
-        assert map != null;
-        assert idxs != null;
-
-        for (int idx : idxs)
-            map.put(portable(new Key(idx)), portable(new Value(idx)));
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void checkMap(Map<Object, Object> map, int... idxs) {
-        assert map != null;
-        assert idxs != null;
-
-        assertEquals(idxs.length, map.size());
-
-        for (int idx : idxs) {
-            Object val = map.get(portable(new Key(idx)));
-
-            assertTrue(String.valueOf(val), val instanceof BinaryObject);
-
-            BinaryObject po = (BinaryObject)val;
-
-            assertEquals("Value", po.type().typeName());
-            assertEquals(new Integer(idx), po.field("idx"));
-        }
-    }
-
-    /**
-     * @param obj Object.
-     * @return Portable object.
-     */
-    private Object portable(Object obj) {
-        return grid().binary().toBinary(obj);
-    }
-}


[38/50] [abbrv] ignite git commit: ignite-1.5 Added waitForCondition in tests with TTL.

Posted by vo...@apache.org.
ignite-1.5 Added waitForCondition in tests with TTL.


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

Branch: refs/heads/ignite-2100
Commit: 484a3afd05b9ad5a524a28c517ddc0a6b9dffcbc
Parents: ec2a647
Author: sboikov <sb...@gridgain.com>
Authored: Mon Dec 14 10:58:57 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon Dec 14 10:58:57 2015 +0300

----------------------------------------------------------------------
 .../cache/GridCacheAbstractFullApiSelfTest.java | 23 +++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/484a3afd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index 41e9016..cbb19fb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -107,6 +107,7 @@ import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_SWAPPED;
 import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_UNLOCKED;
 import static org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_UNSWAPPED;
 import static org.apache.ignite.testframework.GridTestUtils.assertThrows;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
 import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
 import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
 import static org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
@@ -3216,9 +3217,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
      * @throws Exception In case of error.
      */
     public void testEvictExpired() throws Exception {
-        IgniteCache<String, Integer> cache = jcache();
+        final IgniteCache<String, Integer> cache = jcache();
 
-        String key = primaryKeysForCache(cache, 1).get(0);
+        final String key = primaryKeysForCache(cache, 1).get(0);
 
         cache.put(key, 1);
 
@@ -3230,7 +3231,13 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         grid(0).cache(null).withExpiryPolicy(expiry).put(key, 1);
 
-        Thread.sleep(ttl + 100);
+        boolean wait = waitForCondition(new GridAbsPredicate() {
+            @Override public boolean apply() {
+                return cache.localPeek(key, ONHEAP) == null;
+            }
+        }, ttl + 1000);
+
+        assertTrue("Failed to wait for entry expiration.", wait);
 
         // Expired entry should not be swapped.
         cache.localEvict(Collections.singleton(key));
@@ -3793,9 +3800,9 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
      * @throws Exception If failed.
      */
     public void testCompactExpired() throws Exception {
-        IgniteCache<String, Integer> cache = jcache();
+        final IgniteCache<String, Integer> cache = jcache();
 
-        String key = F.first(primaryKeysForCache(cache, 1));
+        final String key = F.first(primaryKeysForCache(cache, 1));
 
         cache.put(key, 1);
 
@@ -3805,7 +3812,11 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
 
         grid(0).cache(null).withExpiryPolicy(expiry).put(key, 1);
 
-        Thread.sleep(ttl + 100);
+        waitForCondition(new GridAbsPredicate() {
+            @Override public boolean apply() {
+                return cache.localPeek(key, ONHEAP) == null;
+            }
+        }, ttl + 1000);
 
         // Peek will actually remove entry from cache.
         assertNull(cache.localPeek(key, ONHEAP));


[32/50] [abbrv] ignite git commit: Fix to GridBinaryWildcardsSelfTest.

Posted by vo...@apache.org.
Fix to GridBinaryWildcardsSelfTest.


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

Branch: refs/heads/ignite-2100
Commit: 6d96bb6a3219255b62af826e6806b1aa564bb005
Parents: 6c61598
Author: vozerov-gridgain <vo...@gridgain.com>
Authored: Mon Dec 14 10:08:00 2015 +0300
Committer: vozerov-gridgain <vo...@gridgain.com>
Committed: Mon Dec 14 10:08:00 2015 +0300

----------------------------------------------------------------------
 .../binary/GridBinaryWildcardsSelfTest.java         | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/6d96bb6a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java
index dc70f4d..2887afa 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/binary/GridBinaryWildcardsSelfTest.java
@@ -213,7 +213,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
 
         assertTrue(typeIds.containsKey("gridbinarytestclass1".hashCode()));
         assertTrue(typeIds.containsKey("innerclass".hashCode()));
-        assertFalse(typeIds.containsKey("gridbinarytestclass2".hashCode()));
+        assertFalse(typeIds.containsKey(100));
 
         Map<String, BinaryIdMapper> typeMappers = U.field(ctx, "typeMappers");
 
@@ -225,7 +225,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
      */
     public void testClassNamesJar() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
+            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
             new BinaryTypeConfiguration("unknown.*")
         ));
 
@@ -258,7 +258,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
                 return 0;
             }
         }, Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
+            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
             new BinaryTypeConfiguration("unknown.*")
         ));
 
@@ -277,7 +277,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
      */
     public void testTypeConfigurationsJar() throws Exception {
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
+            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
             new BinaryTypeConfiguration("unknown.*")
         ));
 
@@ -310,7 +310,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
                 return 0;
             }
         }, Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
+            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
             new BinaryTypeConfiguration("unknown.*")
         ));
 
@@ -343,7 +343,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
                 return 0;
             }
         }, Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
+            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
             new BinaryTypeConfiguration("unknown.*")
         ));
 
@@ -362,7 +362,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
      */
     public void testOverrideJar() throws Exception {
         BinaryTypeConfiguration typeCfg = new BinaryTypeConfiguration(
-            "org.apache.ignite.binary.testjar.GridBinaryTestClass2");
+            "org.apache.ignite.internal.binary.test.GridBinaryTestClass2");
 
         typeCfg.setIdMapper(new BinaryIdMapper() {
             @Override public int typeId(String clsName) {
@@ -375,7 +375,7 @@ public class GridBinaryWildcardsSelfTest extends GridCommonAbstractTest {
         });
 
         BinaryMarshaller marsh = binaryMarshaller(Arrays.asList(
-            new BinaryTypeConfiguration("org.apache.ignite.binary.testjar.*"),
+            new BinaryTypeConfiguration("org.apache.ignite.internal.binary.test.*"),
             typeCfg));
 
         BinaryContext ctx = binaryContext(marsh);