ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [1/2] ignite git commit: IGNITE-6258: Thin client: binary metadata protocol. This closes #2662. This closes #2667.
Date Thu, 14 Sep 2017 18:43:29 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-5896 54b1cc233 -> d22d6ec4b


IGNITE-6258: Thin client: binary metadata protocol. This closes #2662. This closes #2667.


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

Branch: refs/heads/ignite-5896
Commit: db88d6ba39920ace74720f7dc0e0741cfb38c450
Parents: e4e0a28
Author: Pavel Tupitsyn <ptupitsyn@apache.org>
Authored: Thu Sep 14 21:40:48 2017 +0300
Committer: devozerov <ppozerov@gmail.com>
Committed: Thu Sep 14 21:40:48 2017 +0300

----------------------------------------------------------------------
 .../platform/PlatformContextImpl.java           | 125 +-----------
 .../platform/client/ClientMessageParser.java    |  28 +++
 .../platform/client/ClientStringResponse.java   |  47 +++++
 .../binary/ClientBinaryTypeGetRequest.java      |  50 +++++
 .../binary/ClientBinaryTypeGetResponse.java     |  51 +++++
 .../binary/ClientBinaryTypeNameGetRequest.java  |  61 ++++++
 .../binary/ClientBinaryTypeNamePutRequest.java  |  65 ++++++
 .../binary/ClientBinaryTypePutRequest.java      |  56 +++++
 .../platform/utils/PlatformUtils.java           | 204 +++++++++++++++++--
 .../Apache.Ignite.Core.csproj                   |   1 +
 .../Impl/Binary/BinaryProcessor.cs              | 155 +++++++-------
 .../Impl/Binary/IBinaryProcessor.cs             |  73 +++++++
 .../Impl/Binary/Marshaller.cs                   |   6 +-
 .../Impl/Binary/Metadata/BinaryType.cs          |  24 ++-
 .../Apache.Ignite.Core/Impl/IIgniteInternal.cs  |   2 +-
 .../dotnet/Apache.Ignite.Core/Impl/Ignite.cs    |   2 +-
 16 files changed, 741 insertions(+), 209 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/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 f115a9c..b141313 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
@@ -34,13 +34,10 @@ import org.apache.ignite.events.JobEvent;
 import org.apache.ignite.events.TaskEvent;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.binary.BinaryContext;
-import org.apache.ignite.internal.binary.BinaryFieldMetadata;
 import org.apache.ignite.internal.binary.BinaryMetadata;
 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.BinarySchema;
-import org.apache.ignite.internal.binary.BinarySchemaRegistry;
 import org.apache.ignite.internal.binary.BinaryTypeImpl;
 import org.apache.ignite.internal.binary.GridBinaryMarshaller;
 import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
@@ -69,21 +66,15 @@ import org.apache.ignite.internal.processors.platform.memory.PlatformMemoryManag
 import org.apache.ignite.internal.processors.platform.memory.PlatformOutputStream;
 import org.apache.ignite.internal.processors.platform.message.PlatformMessageFilter;
 import org.apache.ignite.internal.processors.platform.messaging.PlatformMessageFilterImpl;
-import org.apache.ignite.internal.processors.platform.utils.PlatformReaderBiClosure;
-import org.apache.ignite.internal.processors.platform.utils.PlatformReaderClosure;
 import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
-import org.apache.ignite.lang.IgniteBiTuple;
 import org.jetbrains.annotations.Nullable;
 
 import java.sql.Timestamp;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
@@ -353,62 +344,7 @@ public class PlatformContextImpl implements PlatformContext {
     /** {@inheritDoc} */
     @SuppressWarnings("ConstantConditions")
     @Override public void processMetadata(BinaryRawReaderEx reader) {
-        Collection<BinaryMetadata> metas = PlatformUtils.readCollection(reader,
-            new PlatformReaderClosure<BinaryMetadata>() {
-                @Override public BinaryMetadata read(BinaryRawReaderEx reader) {
-                    int typeId = reader.readInt();
-                    String typeName = reader.readString();
-                    String affKey = reader.readString();
-
-                    Map<String, BinaryFieldMetadata> fields = PlatformUtils.readLinkedMap(reader,
-                        new PlatformReaderBiClosure<String, BinaryFieldMetadata>() {
-                            @Override public IgniteBiTuple<String, BinaryFieldMetadata> read(BinaryRawReaderEx reader) {
-                                String name = reader.readString();
-                                int typeId = reader.readInt();
-                                int fieldId = reader.readInt();
-
-                                return new IgniteBiTuple<String, BinaryFieldMetadata>(name,
-                                        new BinaryFieldMetadata(typeId, fieldId));
-                            }
-                        });
-
-                    Map<String, Integer> enumMap = null;
-
-                    boolean isEnum = reader.readBoolean();
-
-                    if (isEnum) {
-                        int size = reader.readInt();
-
-                        enumMap = new LinkedHashMap<>(size);
-
-                        for (int idx = 0; idx < size; idx++)
-                            enumMap.put(reader.readString(), reader.readInt());
-                    }
-
-                    // Read schemas
-                    int schemaCnt = reader.readInt();
-
-                    List<BinarySchema> schemas = null;
-
-                    if (schemaCnt > 0) {
-                        schemas = new ArrayList<>(schemaCnt);
-
-                        for (int i = 0; i < schemaCnt; i++) {
-                            int id = reader.readInt();
-                            int fieldCnt = reader.readInt();
-                            List<Integer> fieldIds = new ArrayList<>(fieldCnt);
-
-                            for (int j = 0; j < fieldCnt; j++)
-                                fieldIds.add(reader.readInt());
-
-                            schemas.add(new BinarySchema(id, fieldIds));
-                        }
-                    }
-
-                    return new BinaryMetadata(typeId, typeName, fields, affKey, schemas, isEnum, enumMap);
-                }
-            }
-        );
+        Collection<BinaryMetadata> metas = PlatformUtils.readBinaryMetadataCollection(reader);
 
         BinaryContext binCtx = cacheObjProc.binaryContext();
 
@@ -418,7 +354,7 @@ public class PlatformContextImpl implements PlatformContext {
 
     /** {@inheritDoc} */
     @Override public void writeMetadata(BinaryRawWriterEx writer, int typeId) {
-        writeMetadata0(writer, typeId, cacheObjProc.metadata(typeId));
+        writeMetadata0(writer, cacheObjProc.metadata(typeId));
     }
 
     /** {@inheritDoc} */
@@ -428,78 +364,29 @@ public class PlatformContextImpl implements PlatformContext {
         writer.writeInt(metas.size());
 
         for (BinaryType m : metas)
-            writeMetadata0(writer, cacheObjProc.typeId(m.typeName()), m);
+            writeMetadata0(writer, m);
     }
 
     /** {@inheritDoc} */
     @Override public void writeSchema(BinaryRawWriterEx writer, int typeId, int schemaId) {
-        BinarySchemaRegistry schemaReg = cacheObjProc.binaryContext().schemaRegistry(typeId);
-        BinarySchema schema = schemaReg.schema(schemaId);
-
-        if (schema == null) {
-            BinaryTypeImpl meta = (BinaryTypeImpl)cacheObjProc.metadata(typeId);
-
-            if (meta != null) {
-                for (BinarySchema typeSchema : meta.metadata().schemas()) {
-                    if (schemaId == typeSchema.schemaId()) {
-                        schema = typeSchema;
-                        break;
-                    }
-                }
-            }
-
-            if (schema != null)
-                schemaReg.addSchema(schemaId, schema);
-        }
-
-        int[] fieldIds = schema == null ? null : schema.fieldIds();
-
-        writer.writeIntArray(fieldIds);
+        writer.writeIntArray(PlatformUtils.getSchema(cacheObjProc, typeId, schemaId));
     }
 
     /**
      * Write binary metadata.
      *
      * @param writer Writer.
-     * @param typeId Type id.
      * @param meta Metadata.
      */
-    private void writeMetadata0(BinaryRawWriterEx writer, int typeId, BinaryType meta) {
+    private void writeMetadata0(BinaryRawWriterEx writer, BinaryType meta) {
         if (meta == null)
             writer.writeBoolean(false);
         else {
             writer.writeBoolean(true);
 
             BinaryMetadata meta0 = ((BinaryTypeImpl) meta).metadata();
-            Map<String, BinaryFieldMetadata> fields = meta0.fieldsMap();
-
-            writer.writeInt(typeId);
-            writer.writeString(meta.typeName());
-            writer.writeString(meta.affinityKeyFieldName());
-
-            writer.writeInt(fields.size());
 
-            for (Map.Entry<String, BinaryFieldMetadata> e : fields.entrySet()) {
-                writer.writeString(e.getKey());
-
-                writer.writeInt(e.getValue().typeId());
-                writer.writeInt(e.getValue().fieldId());
-            }
-
-            if (meta.isEnum()) {
-                writer.writeBoolean(true);
-
-                Map<String, Integer> enumMap = meta0.enumMap();
-
-                writer.writeInt(enumMap.size());
-
-                for (Map.Entry<String, Integer> e: enumMap.entrySet()) {
-                    writer.writeString(e.getKey());
-                    writer.writeInt(e.getValue());
-                }
-            }
-            else
-                writer.writeBoolean(false);
+            PlatformUtils.writeBinaryMetadata(writer, meta0, false);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientMessageParser.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientMessageParser.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientMessageParser.java
index 3626de8..f098383 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientMessageParser.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientMessageParser.java
@@ -29,6 +29,10 @@ import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProce
 import org.apache.ignite.internal.processors.odbc.SqlListenerMessageParser;
 import org.apache.ignite.internal.processors.odbc.SqlListenerRequest;
 import org.apache.ignite.internal.processors.odbc.SqlListenerResponse;
+import org.apache.ignite.internal.processors.platform.client.binary.ClientBinaryTypeNameGetRequest;
+import org.apache.ignite.internal.processors.platform.client.binary.ClientBinaryTypeGetRequest;
+import org.apache.ignite.internal.processors.platform.client.binary.ClientBinaryTypePutRequest;
+import org.apache.ignite.internal.processors.platform.client.binary.ClientBinaryTypeNamePutRequest;
 import org.apache.ignite.internal.processors.platform.client.cache.ClientCacheGetRequest;
 import org.apache.ignite.internal.processors.platform.client.cache.ClientCachePutRequest;
 
@@ -40,8 +44,20 @@ public class ClientMessageParser implements SqlListenerMessageParser {
     private static final short OP_CACHE_GET = 1;
 
     /** */
+    private static final short OP_GET_BINARY_TYPE_NAME = 2;
+
+    /** */
+    private static final short OP_GET_BINARY_TYPE = 3;
+
+    /** */
     private static final short OP_CACHE_PUT = 4;
 
+    /** */
+    private static final short OP_REGISTER_BINARY_TYPE_NAME = 5;
+
+    /** */
+    private static final short OP_PUT_BINARY_TYPE = 6;
+
     /** Marshaller. */
     private final GridBinaryMarshaller marsh;
 
@@ -70,8 +86,20 @@ public class ClientMessageParser implements SqlListenerMessageParser {
             case OP_CACHE_GET:
                 return new ClientCacheGetRequest(reader);
 
+            case OP_GET_BINARY_TYPE_NAME:
+                return new ClientBinaryTypeNameGetRequest(reader);
+
+            case OP_GET_BINARY_TYPE:
+                return new ClientBinaryTypeGetRequest(reader);
+
             case OP_CACHE_PUT:
                 return new ClientCachePutRequest(reader);
+
+            case OP_REGISTER_BINARY_TYPE_NAME:
+                return new ClientBinaryTypeNamePutRequest(reader);
+
+            case OP_PUT_BINARY_TYPE:
+                return new ClientBinaryTypePutRequest(reader);
         }
 
         throw new IgniteException("Invalid operation: " + opCode);

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientStringResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientStringResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientStringResponse.java
new file mode 100644
index 0000000..d9f955d
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/ClientStringResponse.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.platform.client;
+
+import org.apache.ignite.binary.BinaryRawWriter;
+
+/**
+ * Single string response.
+ */
+public class ClientStringResponse extends ClientResponse {
+    /** Value. */
+    private final String val;
+
+    /**
+     * Constructor.
+     *
+     * @param reqId Request id.
+     * @param val Value.
+     */
+    public ClientStringResponse(long reqId, String val) {
+        super(reqId);
+
+        this.val = val;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void encode(BinaryRawWriter writer) {
+        super.encode(writer);
+
+        writer.writeString(val);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetRequest.java
new file mode 100644
index 0000000..be64e91
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetRequest.java
@@ -0,0 +1,50 @@
+/*
+ * 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.platform.client.binary;
+
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.binary.BinaryTypeImpl;
+import org.apache.ignite.internal.processors.platform.client.ClientRequest;
+import org.apache.ignite.internal.processors.platform.client.ClientResponse;
+
+/**
+ * Binary type schema request.
+ */
+public class ClientBinaryTypeGetRequest extends ClientRequest {
+    /** Type id. */
+    private final int typeId;
+
+    /**
+     * Constructor.
+     *
+     * @param reader Reader.
+     */
+    public ClientBinaryTypeGetRequest(BinaryRawReader reader) {
+        super(reader);
+
+        typeId = reader.readInt();
+    }
+
+    /** {@inheritDoc} */
+    @Override public ClientResponse process(GridKernalContext ctx) {
+        BinaryTypeImpl type = (BinaryTypeImpl) ctx.cacheObjects().binary().type(typeId);
+
+        return new ClientBinaryTypeGetResponse(requestId(), type.metadata());
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetResponse.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetResponse.java
new file mode 100644
index 0000000..0f44cbf
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeGetResponse.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.platform.client.binary;
+
+import org.apache.ignite.binary.BinaryRawWriter;
+import org.apache.ignite.internal.binary.BinaryMetadata;
+import org.apache.ignite.internal.processors.platform.client.ClientResponse;
+import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
+
+/**
+ * Binary meta response.
+ */
+public class ClientBinaryTypeGetResponse extends ClientResponse {
+    /** Meta. */
+    private final BinaryMetadata meta;
+
+    /**
+     * Constructor.
+     *
+     * @param requestId Request id.
+     */
+    ClientBinaryTypeGetResponse(long requestId, BinaryMetadata meta) {
+        super(requestId);
+
+        assert meta != null;
+
+        this.meta = meta;
+    }
+
+    /** {@inheritDoc} */
+    @Override public void encode(BinaryRawWriter writer) {
+        super.encode(writer);
+
+        PlatformUtils.writeBinaryMetadata(writer, meta, true);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeNameGetRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeNameGetRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeNameGetRequest.java
new file mode 100644
index 0000000..37f4d9e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeNameGetRequest.java
@@ -0,0 +1,61 @@
+/*
+ * 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.platform.client.binary;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.platform.client.ClientRequest;
+import org.apache.ignite.internal.processors.platform.client.ClientResponse;
+import org.apache.ignite.internal.processors.platform.client.ClientStringResponse;
+
+/**
+ * Gets binary type name by id.
+ */
+public class ClientBinaryTypeNameGetRequest extends ClientRequest {
+    /** Platform ID, see org.apache.ignite.internal.MarshallerPlatformIds. */
+    private final byte platformId;
+
+    /** Type id. */
+    private final int typeId;
+
+    /**
+     * Constructor.
+     *
+     * @param reader Reader.
+     */
+    public ClientBinaryTypeNameGetRequest(BinaryRawReader reader) {
+        super(reader);
+
+        platformId = reader.readByte();
+        typeId = reader.readInt();
+    }
+
+    /** {@inheritDoc} */
+    @Override public ClientResponse process(GridKernalContext ctx) {
+        try {
+            String typeName = ctx.marshallerContext().getClassName(platformId, typeId);
+
+            return new ClientStringResponse(requestId(), typeName);
+        }
+        catch (ClassNotFoundException | IgniteCheckedException e) {
+            throw new IgniteException(e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeNamePutRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeNamePutRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeNamePutRequest.java
new file mode 100644
index 0000000..268e13b
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypeNamePutRequest.java
@@ -0,0 +1,65 @@
+/*
+ * 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.platform.client.binary;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.binary.BinaryRawReader;
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.processors.platform.client.ClientBooleanResponse;
+import org.apache.ignite.internal.processors.platform.client.ClientRequest;
+import org.apache.ignite.internal.processors.platform.client.ClientResponse;
+
+/**
+ * Gets binary type name by id.
+ */
+public class ClientBinaryTypeNamePutRequest extends ClientRequest {
+    /** Platform ID, see org.apache.ignite.internal.MarshallerPlatformIds. */
+    private final byte platformId;
+
+    /** Type id. */
+    private final int typeId;
+
+    /** Type name. */
+    private final String typeName;
+
+    /**
+     * Constructor.
+     *
+     * @param reader Reader.
+     */
+    public ClientBinaryTypeNamePutRequest(BinaryRawReader reader) {
+        super(reader);
+
+        platformId = reader.readByte();
+        typeId = reader.readInt();
+        typeName = reader.readString();
+    }
+
+    /** {@inheritDoc} */
+    @Override public ClientResponse process(GridKernalContext ctx) {
+        try {
+            boolean res = ctx.marshallerContext().registerClassName(platformId, typeId, typeName);
+
+            return new ClientBooleanResponse(requestId(), res);
+        }
+        catch (IgniteCheckedException e) {
+            throw new IgniteException(e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypePutRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypePutRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypePutRequest.java
new file mode 100644
index 0000000..aeb6e02
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/binary/ClientBinaryTypePutRequest.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.platform.client.binary;
+
+import org.apache.ignite.internal.GridKernalContext;
+import org.apache.ignite.internal.binary.BinaryContext;
+import org.apache.ignite.internal.binary.BinaryMetadata;
+import org.apache.ignite.internal.binary.BinaryRawReaderEx;
+import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
+import org.apache.ignite.internal.processors.platform.client.ClientRequest;
+import org.apache.ignite.internal.processors.platform.client.ClientResponse;
+import org.apache.ignite.internal.processors.platform.utils.PlatformUtils;
+
+/**
+ * Binary types update request.
+ */
+public class ClientBinaryTypePutRequest extends ClientRequest {
+    /** Meta. */
+    private final BinaryMetadata meta;
+
+    /**
+     * Constructor.
+     *
+     * @param reader Reader.
+     */
+    public ClientBinaryTypePutRequest(BinaryRawReaderEx reader) {
+        super(reader);
+
+        meta = PlatformUtils.readBinaryMetadata(reader);
+    }
+
+    /** {@inheritDoc} */
+    @SuppressWarnings("unchecked")
+    @Override public ClientResponse process(GridKernalContext ctx) {
+        BinaryContext binCtx = ((CacheObjectBinaryProcessorImpl) ctx.cacheObjects()).binaryContext();
+
+        binCtx.updateMetadata(meta.typeId(), meta);
+
+        return super.process(ctx);
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
index 2f7e782..aa11dfa 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformUtils.java
@@ -17,39 +17,30 @@
 
 package org.apache.ignite.internal.processors.platform.utils;
 
-import java.lang.reflect.Field;
-import java.math.BigDecimal;
-import java.security.Timestamp;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import javax.cache.CacheException;
-import javax.cache.event.CacheEntryEvent;
-import javax.cache.event.CacheEntryListenerException;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.binary.BinaryObject;
+import org.apache.ignite.binary.BinaryRawWriter;
 import org.apache.ignite.cache.CachePeekMode;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.IgniteKernal;
 import org.apache.ignite.internal.MarshallerContextImpl;
 import org.apache.ignite.internal.binary.BinaryContext;
+import org.apache.ignite.internal.binary.BinaryFieldMetadata;
 import org.apache.ignite.internal.binary.BinaryMarshaller;
+import org.apache.ignite.internal.binary.BinaryMetadata;
 import org.apache.ignite.internal.binary.BinaryNoopMetadataHandler;
 import org.apache.ignite.internal.binary.BinaryRawReaderEx;
 import org.apache.ignite.internal.binary.BinaryRawWriterEx;
+import org.apache.ignite.internal.binary.BinarySchema;
+import org.apache.ignite.internal.binary.BinarySchemaRegistry;
+import org.apache.ignite.internal.binary.BinaryTypeImpl;
 import org.apache.ignite.internal.binary.BinaryUtils;
 import org.apache.ignite.internal.binary.GridBinaryMarshaller;
+import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl;
 import org.apache.ignite.internal.processors.platform.PlatformContext;
 import org.apache.ignite.internal.processors.platform.PlatformExtendedException;
 import org.apache.ignite.internal.processors.platform.PlatformNativeException;
@@ -68,6 +59,23 @@ import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.logger.NullLogger;
 import org.jetbrains.annotations.Nullable;
 
+import javax.cache.CacheException;
+import javax.cache.event.CacheEntryEvent;
+import javax.cache.event.CacheEntryListenerException;
+import java.lang.reflect.Field;
+import java.math.BigDecimal;
+import java.security.Timestamp;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_PREFIX;
 
 /**
@@ -1053,6 +1061,170 @@ public class PlatformUtils {
     }
 
     /**
+     * Gets the schema.
+     *
+     * @param cacheObjProc Cache object processor.
+     * @param typeId Type id.
+     * @param schemaId Schema id.
+     */
+    public static int[] getSchema(CacheObjectBinaryProcessorImpl cacheObjProc, int typeId, int schemaId) {
+        assert cacheObjProc != null;
+
+        BinarySchemaRegistry schemaReg = cacheObjProc.binaryContext().schemaRegistry(typeId);
+        BinarySchema schema = schemaReg.schema(schemaId);
+
+        if (schema == null) {
+            BinaryTypeImpl meta = (BinaryTypeImpl)cacheObjProc.metadata(typeId);
+
+            if (meta != null) {
+                for (BinarySchema typeSchema : meta.metadata().schemas()) {
+                    if (schemaId == typeSchema.schemaId()) {
+                        schema = typeSchema;
+                        break;
+                    }
+                }
+            }
+
+            if (schema != null) {
+                schemaReg.addSchema(schemaId, schema);
+            }
+        }
+
+        return schema == null ? null : schema.fieldIds();
+    }
+
+    /**
+     * Writes the binary metadata to a writer.
+     *
+     * @param writer Writer.
+     * @param meta Meta.
+     */
+    public static void writeBinaryMetadata(BinaryRawWriter writer, BinaryMetadata meta, boolean includeSchemas) {
+        assert meta != null;
+
+        Map<String, BinaryFieldMetadata> fields = meta.fieldsMap();
+
+        writer.writeInt(meta.typeId());
+        writer.writeString(meta.typeName());
+        writer.writeString(meta.affinityKeyFieldName());
+
+        writer.writeInt(fields.size());
+
+        for (Map.Entry<String, BinaryFieldMetadata> e : fields.entrySet()) {
+            writer.writeString(e.getKey());
+
+            writer.writeInt(e.getValue().typeId());
+            writer.writeInt(e.getValue().fieldId());
+        }
+
+        if (meta.isEnum()) {
+            writer.writeBoolean(true);
+
+            Map<String, Integer> enumMap = meta.enumMap();
+
+            writer.writeInt(enumMap.size());
+
+            for (Map.Entry<String, Integer> e: enumMap.entrySet()) {
+                writer.writeString(e.getKey());
+                writer.writeInt(e.getValue());
+            }
+        }
+        else {
+            writer.writeBoolean(false);
+        }
+
+        if (!includeSchemas) {
+            return;
+        }
+
+        // Schemas.
+        Collection<BinarySchema> schemas = meta.schemas();
+
+        writer.writeInt(schemas.size());
+
+        for (BinarySchema schema : schemas) {
+            writer.writeInt(schema.schemaId());
+            writer.writeIntArray(schema.fieldIds());
+        }
+    }
+
+    /**
+     * Reads the binary metadata.
+     *
+     * @param reader Reader.
+     * @return Collection of metas.
+     */
+    public static Collection<BinaryMetadata> readBinaryMetadataCollection(BinaryRawReaderEx reader) {
+        return readCollection(reader,
+                new PlatformReaderClosure<BinaryMetadata>() {
+                    @Override public BinaryMetadata read(BinaryRawReaderEx reader) {
+                        return readBinaryMetadata(reader);
+                    }
+                }
+        );
+    }
+
+    /**
+     * Reads the binary metadata.
+     *
+     * @param reader Reader.
+     * @return Binary type metadata.
+     */
+    public static BinaryMetadata readBinaryMetadata(BinaryRawReaderEx reader) {
+        int typeId = reader.readInt();
+        String typeName = reader.readString();
+        String affKey = reader.readString();
+
+        Map<String, BinaryFieldMetadata> fields = readLinkedMap(reader,
+                new PlatformReaderBiClosure<String, BinaryFieldMetadata>() {
+                    @Override
+                    public IgniteBiTuple<String, BinaryFieldMetadata> read(BinaryRawReaderEx reader) {
+                        String name = reader.readString();
+                        int typeId = reader.readInt();
+                        int fieldId = reader.readInt();
+
+                        return new IgniteBiTuple<String, BinaryFieldMetadata>(name,
+                                new BinaryFieldMetadata(typeId, fieldId));
+                    }
+                });
+
+        Map<String, Integer> enumMap = null;
+
+        boolean isEnum = reader.readBoolean();
+
+        if (isEnum) {
+            int size = reader.readInt();
+
+            enumMap = new LinkedHashMap<>(size);
+
+            for (int idx = 0; idx < size; idx++)
+                enumMap.put(reader.readString(), reader.readInt());
+        }
+
+        // Read schemas
+        int schemaCnt = reader.readInt();
+
+        List<BinarySchema> schemas = null;
+
+        if (schemaCnt > 0) {
+            schemas = new ArrayList<>(schemaCnt);
+
+            for (int i = 0; i < schemaCnt; i++) {
+                int id = reader.readInt();
+                int fieldCnt = reader.readInt();
+                List<Integer> fieldIds = new ArrayList<>(fieldCnt);
+
+                for (int j = 0; j < fieldCnt; j++)
+                    fieldIds.add(reader.readInt());
+
+                schemas.add(new BinarySchema(id, fieldIds));
+            }
+        }
+
+        return new BinaryMetadata(typeId, typeName, fields, affKey, schemas, isEnum, enumMap);
+    }
+
+    /**
      * Private constructor.
      */
     private PlatformUtils() {

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
index 0a100f7..65b8372 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj
@@ -101,6 +101,7 @@
     <Compile Include="Configuration\Package-Info.cs" />
     <Compile Include="Impl\Binary\BinaryTypeId.cs" />
     <Compile Include="Impl\Cache\Query\PlatformQueryQursorBase.cs" />
+    <Compile Include="Impl\Binary\IBinaryProcessor.cs" />
     <Compile Include="Impl\IIgniteInternal.cs" />
     <Compile Include="Impl\IPlatformTargetInternal.cs" />
     <Compile Include="Impl\PersistentStore\PersistentStoreMetrics.cs" />

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryProcessor.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryProcessor.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryProcessor.cs
index 26b3f15..318fd07 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryProcessor.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryProcessor.cs
@@ -25,7 +25,7 @@ namespace Apache.Ignite.Core.Impl.Binary
     /// <summary>
     /// Binary metadata processor, delegates to PlatformBinaryProcessor in Java.
     /// </summary>
-    internal class BinaryProcessor : PlatformTargetAdapter
+    internal class BinaryProcessor : PlatformTargetAdapter, IBinaryProcessor
     {
         /// <summary>
         /// Op codes.
@@ -104,74 +104,7 @@ namespace Apache.Ignite.Core.Impl.Binary
         /// <param name="types">Binary types.</param>
         public void PutBinaryTypes(ICollection<BinaryType> types)
         {
-            DoOutOp((int) Op.PutMeta, w =>
-            {
-                w.WriteInt(types.Count);
-
-                foreach (var meta in types)
-                {
-                    w.WriteInt(meta.TypeId);
-                    w.WriteString(meta.TypeName);
-                    w.WriteString(meta.AffinityKeyFieldName);
-
-                    var fields = meta.GetFieldsMap();
-
-                    w.WriteInt(fields.Count);
-
-                    foreach (var field in fields)
-                    {
-                        w.WriteString(field.Key);
-                        w.WriteInt(field.Value.TypeId);
-                        w.WriteInt(field.Value.FieldId);
-                    }
-
-                    // Enum data
-                    w.WriteBoolean(meta.IsEnum);
-
-                    if (meta.IsEnum)
-                    {
-                        if (meta.EnumValuesMap != null)
-                        {
-                            w.WriteInt(meta.EnumValuesMap.Count);
-
-                            foreach (var pair in meta.EnumValuesMap)
-                            {
-                                w.WriteString(pair.Key);
-                                w.WriteInt(pair.Value);
-                            }
-                        }
-                        else
-                        {
-                            w.WriteInt(0);
-                        }
-                    }
-
-                    // Send schemas
-                    var desc = meta.Descriptor;
-                    Debug.Assert(desc != null);
-
-                    var count = 0;
-                    var countPos = w.Stream.Position;
-                    w.WriteInt(0); // Reserve for count
-
-                    foreach (var schema in desc.Schema.GetAll())
-                    {
-                        w.WriteInt(schema.Key);
-
-                        var ids = schema.Value;
-                        w.WriteInt(ids.Length);
-
-                        foreach (var id in ids)
-                            w.WriteInt(id);
-
-                        count++;
-                    }
-
-                    w.Stream.WriteInt(countPos, count);
-                }
-            });
-
-            Marshaller.OnBinaryTypesSent(types);
+            DoOutOp((int) Op.PutMeta, w => WriteBinaryTypes(w, types));
         }
 
         /// <summary>
@@ -238,5 +171,89 @@ namespace Apache.Ignite.Core.Impl.Binary
         {
             return DoOutInOp((int) Op.GetType, w => w.WriteInt(id), r => Marshaller.StartUnmarshal(r).ReadString());
         }
+
+        /// <summary>
+        /// Writes the binary types.
+        /// </summary>
+        public static void WriteBinaryTypes(BinaryWriter w, ICollection<BinaryType> types)
+        {
+            Debug.Assert(w != null);
+            Debug.Assert(types != null);
+
+            w.WriteInt(types.Count);
+
+            foreach (var meta in types)
+            {
+                WriteBinaryType(w, meta);
+            }
+        }
+
+        /// <summary>
+        /// Writes the binary type.
+        /// </summary>
+        public static void WriteBinaryType(BinaryWriter w, BinaryType meta)
+        {
+            Debug.Assert(w != null);
+            Debug.Assert(meta != null);
+
+            w.WriteInt(meta.TypeId);
+            w.WriteString(meta.TypeName);
+            w.WriteString(meta.AffinityKeyFieldName);
+
+            var fields = meta.GetFieldsMap();
+
+            w.WriteInt(fields.Count);
+
+            foreach (var field in fields)
+            {
+                w.WriteString(field.Key);
+                w.WriteInt(field.Value.TypeId);
+                w.WriteInt(field.Value.FieldId);
+            }
+
+            // Enum data
+            w.WriteBoolean(meta.IsEnum);
+
+            if (meta.IsEnum)
+            {
+                if (meta.EnumValuesMap != null)
+                {
+                    w.WriteInt(meta.EnumValuesMap.Count);
+
+                    foreach (var pair in meta.EnumValuesMap)
+                    {
+                        w.WriteString(pair.Key);
+                        w.WriteInt(pair.Value);
+                    }
+                }
+                else
+                {
+                    w.WriteInt(0);
+                }
+            }
+
+            // Send schemas
+            var desc = meta.Descriptor;
+            Debug.Assert(desc != null);
+
+            var count = 0;
+            var countPos = w.Stream.Position;
+            w.WriteInt(0); // Reserve for count
+
+            foreach (var schema in desc.Schema.GetAll())
+            {
+                w.WriteInt(schema.Key);
+
+                var ids = schema.Value;
+                w.WriteInt(ids.Length);
+
+                foreach (var id in ids)
+                    w.WriteInt(id);
+
+                count++;
+            }
+
+            w.Stream.WriteInt(countPos, count);
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/IBinaryProcessor.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/IBinaryProcessor.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/IBinaryProcessor.cs
new file mode 100644
index 0000000..c626c76
--- /dev/null
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/IBinaryProcessor.cs
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+
+namespace Apache.Ignite.Core.Impl.Binary
+{
+    using System.Collections.Generic;
+    using Apache.Ignite.Core.Binary;
+    using Apache.Ignite.Core.Impl.Binary.Metadata;
+
+    /// <summary>
+    /// Binary processor.
+    /// </summary>
+    internal interface IBinaryProcessor
+    {
+        /// <summary>
+        /// Gets metadata for specified type.
+        /// </summary>
+        BinaryType GetBinaryType(int typeId);
+
+        /// <summary>
+        /// Gets metadata for all known types.
+        /// </summary>
+        List<IBinaryType> GetBinaryTypes();
+
+        /// <summary>
+        /// Gets the schema.
+        /// </summary>
+        int[] GetSchema(int typeId, int schemaId);
+
+        /// <summary>
+        /// Put binary types to Grid.
+        /// </summary>
+        /// <param name="types">Binary types.</param>
+        void PutBinaryTypes(ICollection<BinaryType> types);
+
+        /// <summary>
+        /// Registers the type.
+        /// </summary>
+        /// <param name="id">The identifier.</param>
+        /// <param name="typeName">The type name.</param>
+        /// <returns>True if registration succeeded; otherwise, false.</returns>
+        bool RegisterType(int id, string typeName);
+
+        /// <summary>
+        /// Registers the enum.
+        /// </summary>
+        /// <param name="typeName">Name of the type.</param>
+        /// <param name="values">The values.</param>
+        /// <returns>Resulting binary type.</returns>
+        BinaryType RegisterEnum(string typeName, IEnumerable<KeyValuePair<string, int>> values);
+
+        /// <summary>
+        /// Gets the type name by id.
+        /// </summary>
+        /// <param name="id">The identifier.</param>
+        /// <returns>Type or null.</returns>
+        string GetTypeName(int id);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
index 1f11e9e..e68aa0b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Marshaller.cs
@@ -185,6 +185,7 @@ namespace Apache.Ignite.Core.Impl.Binary
             if (ignite != null && metas != null && metas.Count > 0)
             {
                 ignite.BinaryProcessor.PutBinaryTypes(metas);
+                OnBinaryTypesSent(metas);
             }
         }
 
@@ -300,8 +301,9 @@ namespace Apache.Ignite.Core.Impl.Binary
 
             if (Ignite != null)
             {
-                ICollection<BinaryType> metas = new[] {new BinaryType(desc, this)};
+                var metas = new[] {new BinaryType(desc, this)};
                 Ignite.BinaryProcessor.PutBinaryTypes(metas);
+                OnBinaryTypesSent(metas);
             }
         }
 
@@ -349,7 +351,7 @@ namespace Apache.Ignite.Core.Impl.Binary
         /// Callback invoked when metadata has been sent to the server and acknowledged by it.
         /// </summary>
         /// <param name="newMetas">Binary types.</param>
-        public void OnBinaryTypesSent(IEnumerable<BinaryType> newMetas)
+        private void OnBinaryTypesSent(IEnumerable<BinaryType> newMetas)
         {
             foreach (var meta in newMetas)
             {

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Metadata/BinaryType.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Metadata/BinaryType.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Metadata/BinaryType.cs
index 7306474..514f2e2 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Metadata/BinaryType.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Metadata/BinaryType.cs
@@ -70,6 +70,9 @@ namespace Apache.Ignite.Core.Impl.Binary.Metadata
         /** Marshaller. */
         private readonly Marshaller _marshaller;
 
+        /** Schema. */
+        private readonly BinaryObjectSchema _schema = new BinaryObjectSchema();
+
         /// <summary>
         /// Initializes the <see cref="BinaryType"/> class.
         /// </summary>
@@ -128,7 +131,8 @@ namespace Apache.Ignite.Core.Impl.Binary.Metadata
         /// Initializes a new instance of the <see cref="BinaryType" /> class.
         /// </summary>
         /// <param name="reader">The reader.</param>
-        public BinaryType(BinaryReader reader)
+        /// <param name="readSchemas">Whether to read schemas.</param>
+        public BinaryType(BinaryReader reader, bool readSchemas = false)
         {
             _typeId = reader.ReadInt();
             _typeName = reader.ReadString();
@@ -162,6 +166,16 @@ namespace Apache.Ignite.Core.Impl.Binary.Metadata
                 _enumValueToName = _enumNameToValue.ToDictionary(x => x.Value, x => x.Key);
             }
 
+            if (readSchemas)
+            {
+                var cnt = reader.ReadInt();
+
+                for (var i = 0; i < cnt; i++)
+                {
+                    _schema.Add(reader.ReadInt(), reader.ReadIntArray());
+                }
+            }
+
             _marshaller = reader.Marshaller;
         }
 
@@ -319,6 +333,14 @@ namespace Apache.Ignite.Core.Impl.Binary.Metadata
         }
 
         /// <summary>
+        /// Gets the schema.
+        /// </summary>
+        public BinaryObjectSchema Schema
+        {
+            get { return _schema; }
+        }
+
+        /// <summary>
         /// Updates the fields.
         /// </summary>
         public void UpdateFields(IDictionary<string, BinaryField> fields)

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IIgniteInternal.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IIgniteInternal.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IIgniteInternal.cs
index 789633b..5fd6faa 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IIgniteInternal.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/IIgniteInternal.cs
@@ -32,7 +32,7 @@ namespace Apache.Ignite.Core.Impl
         /// <summary>
         /// Gets the binary processor.
         /// </summary>
-        BinaryProcessor BinaryProcessor { get; }
+        IBinaryProcessor BinaryProcessor { get; }
 
         /// <summary>
         /// Configuration.

http://git-wip-us.apache.org/repos/asf/ignite/blob/db88d6ba/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 630aa85..59dfe2a 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Ignite.cs
@@ -804,7 +804,7 @@ namespace Apache.Ignite.Core.Impl
         /// <summary>
         /// Gets the binary processor.
         /// </summary>
-        public BinaryProcessor BinaryProcessor
+        public IBinaryProcessor BinaryProcessor
         {
             get { return _binaryProc; }
         }


Mime
View raw message