http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs new file mode 100644 index 0000000..967aa52 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeConfiguration.cs @@ -0,0 +1,116 @@ +/* + * 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.Binary +{ + using System; + + /// <summary> + /// Binary type configuration. + /// </summary> + public class BinaryTypeConfiguration + { + /// <summary> + /// Constructor. + /// </summary> + public BinaryTypeConfiguration() + { + // No-op. + } + + /// <summary> + /// Constructor. + /// </summary> + /// <param name="typeName">Type name.</param> + public BinaryTypeConfiguration(string typeName) + { + TypeName = typeName; + } + + /// <summary> + /// Constructor. + /// </summary> + /// <param name="type">Type.</param> + public BinaryTypeConfiguration(Type type) + { + TypeName = type.AssemblyQualifiedName; + } + + /// <summary> + /// Copying constructor. + /// </summary> + /// <param name="cfg">Configuration to copy.</param> + public BinaryTypeConfiguration(BinaryTypeConfiguration cfg) + { + AffinityKeyFieldName = cfg.AffinityKeyFieldName; + IdMapper = cfg.IdMapper; + NameMapper = cfg.NameMapper; + Serializer = cfg.Serializer; + TypeName = cfg.TypeName; + KeepDeserialized = cfg.KeepDeserialized; + } + + /// <summary> + /// Fully qualified type name. + /// </summary> + public string TypeName { get; set; } + + /// <summary> + /// Name mapper for the given type. + /// </summary> + public IBinaryNameMapper NameMapper { get; set; } + + /// <summary> + /// ID mapper for the given type. When it is necessary to resolve class (field) ID, then + /// this property will be checked first. + /// Otherwise, ID will be hash code of the class (field) simple name in lower case. + /// </summary> + public IBinaryIdMapper IdMapper { get; set; } + + /// <summary> + /// Serializer for the given type. If not provided and class implements <see cref="IBinarizable" /> + /// then its custom logic will be used. If not provided and class doesn't implement <see cref="IBinarizable" /> + /// then all fields of the class except of those with [NotSerialized] attribute will be serialized + /// with help of reflection. + /// </summary> + public IBinarySerializer Serializer { get; set; } + + /// <summary> + /// Affinity key field name. + /// </summary> + public string AffinityKeyFieldName { get; set; } + + /// <summary> + /// Keep deserialized flag. If set to non-null value, overrides default value set in + /// <see cref="BinaryTypeConfiguration"/>. + /// </summary> + public bool? KeepDeserialized { get; set; } + + /// <summary> + /// Returns a string that represents the current object. + /// </summary> + /// <returns> + /// A string that represents the current object. + /// </returns> + public override string ToString() + { + return typeof (BinaryTypeConfiguration).Name + " [TypeName=" + TypeName + + ", NameMapper=" + NameMapper + ", IdMapper=" + IdMapper + ", Serializer=" + Serializer + + ", AffinityKeyFieldName=" + AffinityKeyFieldName + ']'; + } + } +}
http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeNames.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeNames.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeNames.cs new file mode 100644 index 0000000..f3d4ea6 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/BinaryTypeNames.cs @@ -0,0 +1,121 @@ +/* + * 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.Binary +{ + /// <summary> + /// Binary type name constants. + /// </summary> + public static class BinaryTypeNames + { + /** Type name: boolean. */ + public const string TypeNameBool = "boolean"; + + /** Type name: byte. */ + public const string TypeNameByte = "byte"; + + /** Type name: short. */ + public const string TypeNameShort = "short"; + + /** Type name: char. */ + public const string TypeNameChar = "char"; + + /** Type name: int. */ + public const string TypeNameInt = "int"; + + /** Type name: long. */ + public const string TypeNameLong = "long"; + + /** Type name: float. */ + public const string TypeNameFloat = "float"; + + /** Type name: double. */ + public const string TypeNameDouble = "double"; + + /** Type name: decimal. */ + public const string TypeNameDecimal = "decimal"; + + /** Type name: String. */ + public const string TypeNameString = "String"; + + /** Type name: UUID. */ + public const string TypeNameGuid = "UUID"; + + /** Type name: date. */ + public const string TypeNameDate = "Date"; + + /** Type name: timestamp. */ + public const string TypeNameTimestamp = "Timestamp"; + + /** Type name: Enum. */ + public const string TypeNameEnum = "Enum"; + + /** Type name: Object. */ + public const string TypeNameObject = "Object"; + + /** Type name: boolean array. */ + public const string TypeNameArrayBool = "boolean[]"; + + /** Type name: byte array. */ + public const string TypeNameArrayByte = "byte[]"; + + /** Type name: short array. */ + public const string TypeNameArrayShort = "short[]"; + + /** Type name: char array. */ + public const string TypeNameArrayChar = "char[]"; + + /** Type name: int array. */ + public const string TypeNameArrayInt = "int[]"; + + /** Type name: long array. */ + public const string TypeNameArrayLong = "long[]"; + + /** Type name: float array. */ + public const string TypeNameArrayFloat = "float[]"; + + /** Type name: double array. */ + public const string TypeNameArrayDouble = "double[]"; + + /** Type name: decimal array. */ + public const string TypeNameArrayDecimal = "decimal[]"; + + /** Type name: String array. */ + public const string TypeNameArrayString = "String[]"; + + /** Type name: UUID array. */ + public const string TypeNameArrayGuid = "UUID[]"; + + /** Type name: timestamp array. */ + public const string TypeNameArrayDate = "Date[]"; + + /** Type name: timestamp array. */ + public const string TypeNameArrayTimestamp = "Timestamp[]"; + + /** Type name: Enum array. */ + public const string TypeNameArrayEnum = "Enum[]"; + + /** Type name: Object array. */ + public const string TypeNameArrayObject = "Object[]"; + + /** Type name: Collection. */ + public const string TypeNameCollection = "Collection"; + + /** Type name: Map. */ + public const string TypeNameMap = "Map"; + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinarizable.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinarizable.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinarizable.cs new file mode 100644 index 0000000..98cc8c2 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinarizable.cs @@ -0,0 +1,39 @@ +/* + * 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.Binary +{ + /// <summary> + /// Interface to implement custom serialization logic. + /// </summary> + public interface IBinarizable + { + /// <summary> + /// Writes this object to the given writer. + /// </summary> + /// <param name="writer">Writer.</param> + /// <exception cref="System.IO.IOException">If write failed.</exception> + void WriteBinary(IBinaryWriter writer); + + /// <summary> + /// Reads this object from the given reader. + /// </summary> + /// <param name="reader">Reader.</param> + /// <exception cref="System.IO.IOException">If read failed.</exception> + void ReadBinary(IBinaryReader reader); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryIdMapper.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryIdMapper.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryIdMapper.cs new file mode 100644 index 0000000..9081512 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryIdMapper.cs @@ -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. + */ + +namespace Apache.Ignite.Core.Binary +{ + /// <summary> + /// Maps class name and class field names to integer identifiers. + /// </summary> + public interface IBinaryIdMapper + { + /// <summary> + /// Gets type ID for the given type. + /// </summary> + /// <param name="typeName">Full type name.</param> + /// <returns>ID of the class or 0 in case hash code is to be used.</returns> + int GetTypeId(string typeName); + + /// <summary> + /// Gets field ID for the given field of the given class. + /// </summary> + /// <param name="typeId">Type ID.</param> + /// <param name="fieldName">Field name.</param> + /// <returns>ID of the field or null in case hash code is to be used.</returns> + int GetFieldId(int typeId, string fieldName); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryNameMapper.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryNameMapper.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryNameMapper.cs new file mode 100644 index 0000000..f616ab7 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryNameMapper.cs @@ -0,0 +1,39 @@ +/* + * 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.Binary +{ + /// <summary> + /// Maps type and field names to different names. + /// </summary> + public interface IBinaryNameMapper + { + /// <summary> + /// Gets the type name. + /// </summary> + /// <param name="name">The name.</param> + /// <returns>Type name.</returns> + string GetTypeName(string name); + + /// <summary> + /// Gets the field name. + /// </summary> + /// <param name="name">The name.</param> + /// <returns>Field name.</returns> + string GetFieldName(string name); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryObject.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryObject.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryObject.cs new file mode 100644 index 0000000..bd60e28 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryObject.cs @@ -0,0 +1,60 @@ +/* + * 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.Binary +{ + using System.Diagnostics.CodeAnalysis; + + /// <summary> + /// Wrapper for serialized objects. + /// </summary> + public interface IBinaryObject + { + /// <summary> + /// Gets binary object type ID. + /// </summary> + /// <value> + /// Type ID. + /// </value> + int TypeId { get; } + + /// <summary> + /// Gets object metadata. + /// </summary> + /// <returns>Metadata.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", + Justification = "Expensive operation.")] + IBinaryType GetBinaryType(); + + /// <summary> + /// Gets field value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns> + /// Field value. + /// </returns> + TF GetField<TF>(string fieldName); + + /// <summary> + /// Gets fully deserialized instance of binary object. + /// </summary> + /// <returns> + /// Fully deserialized instance of binary object. + /// </returns> + T Deserialize<T>(); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryObjectBuilder.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryObjectBuilder.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryObjectBuilder.cs new file mode 100644 index 0000000..abb9149 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryObjectBuilder.cs @@ -0,0 +1,310 @@ +/* + * 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.Binary +{ + using System; + using System.Collections; + + /// <summary> + /// binary object builder. Provides ability to build binary objects dynamically + /// without having class definitions. + /// <para /> + /// Note that type ID is required in order to build binary object. Usually it is + /// enough to provide a simple type name and Ignite will generate the type ID + /// automatically. + /// </summary> + public interface IBinaryObjectBuilder + { + /// <summary> + /// Get object field value. If value is another binary object, then + /// builder for this object will be returned. If value is a container + /// for other objects (array, ICollection, IDictionary), then container + /// will be returned with primitive types in deserialized form and + /// binary objects as builders. Any change in builder or collection + /// returned through this method will be reflected in the resulting + /// binary object after build. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Field value.</returns> + T GetField<T>(string fieldName); + + /// <summary> + /// Set object field value. Value can be of any type including other + /// <see cref="IBinaryObject"/> and other builders. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Field value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetField<T>(string fieldName, T val); + + /// <summary> + /// Remove object field. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder RemoveField(string fieldName); + + /// <summary> + /// Set explicit hash code. If builder creating object from scratch, + /// then hash code initially set to 0. If builder is created from + /// exising binary object, then hash code of that object is used + /// as initial value. + /// </summary> + /// <param name="hashCode">Hash code.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetHashCode(int hashCode); + + /// <summary> + /// Build the object. + /// </summary> + /// <returns>Resulting binary object.</returns> + IBinaryObject Build(); + + /// <summary> + /// Sets the array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetArrayField<T>(string fieldName, T[] val); + + /// <summary> + /// Sets the boolean field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetBooleanField(string fieldName, bool val); + + /// <summary> + /// Sets the boolean array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetBooleanArrayField(string fieldName, bool[] val); + + /// <summary> + /// Sets the byte field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetByteField(string fieldName, byte val); + + /// <summary> + /// Sets the byte array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetByteArrayField(string fieldName, byte[] val); + + /// <summary> + /// Sets the char field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetCharField(string fieldName, char val); + + /// <summary> + /// Sets the char array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetCharArrayField(string fieldName, char[] val); + + /// <summary> + /// Sets the collection field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetCollectionField(string fieldName, ICollection val); + + /// <summary> + /// Sets the decimal field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetDecimalField(string fieldName, decimal? val); + + /// <summary> + /// Sets the decimal array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetDecimalArrayField(string fieldName, decimal?[] val); + + /// <summary> + /// Sets the dictionary field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetDictionaryField(string fieldName, IDictionary val); + + /// <summary> + /// Sets the double field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetDoubleField(string fieldName, double val); + + /// <summary> + /// Sets the double array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetDoubleArrayField(string fieldName, double[] val); + + /// <summary> + /// Sets the enum field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetEnumField<T>(string fieldName, T val); + + /// <summary> + /// Sets the enum array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetEnumArrayField<T>(string fieldName, T[] val); + + /// <summary> + /// Sets the float field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetFloatField(string fieldName, float val); + + /// <summary> + /// Sets the float array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetFloatArrayField(string fieldName, float[] val); + + /// <summary> + /// Sets the guid field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetGuidField(string fieldName, Guid? val); + + /// <summary> + /// Sets the guid array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetGuidArrayField(string fieldName, Guid?[] val); + + /// <summary> + /// Sets the int field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetIntField(string fieldName, int val); + + /// <summary> + /// Sets the int array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetIntArrayField(string fieldName, int[] val); + + /// <summary> + /// Sets the long field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetLongField(string fieldName, long val); + + /// <summary> + /// Sets the long array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetLongArrayField(string fieldName, long[] val); + + /// <summary> + /// Sets the short field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetShortField(string fieldName, short val); + + /// <summary> + /// Sets the short array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetShortArrayField(string fieldName, short[] val); + + /// <summary> + /// Sets the string field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetStringField(string fieldName, string val); + + /// <summary> + /// Sets the string array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetStringArrayField(string fieldName, string[] val); + + /// <summary> + /// Sets the timestamp field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetTimestampField(string fieldName, DateTime? val); + + /// <summary> + /// Sets the timestamp array field. + /// </summary> + /// <param name="fieldName">Name of the field.</param> + /// <param name="val">The value.</param> + /// <returns>Current builder instance.</returns> + IBinaryObjectBuilder SetTimestampArrayField(string fieldName, DateTime?[] val); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryRawReader.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryRawReader.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryRawReader.cs new file mode 100644 index 0000000..a719e36 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryRawReader.cs @@ -0,0 +1,223 @@ +/* + * 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.Binary +{ + using System; + using System.Collections; + + /// <summary> + /// Raw reader for binary objects. + /// </summary> + public interface IBinaryRawReader + { + /// <summary> + /// Read byte value. + /// </summary> + /// <returns>Byte value.</returns> + byte ReadByte(); + + /// <summary> + /// Read byte array. + /// </summary> + /// <returns>Byte array.</returns> + byte[] ReadByteArray(); + + /// <summary> + /// Read char value. + /// </summary> + /// <returns>Char value.</returns> + char ReadChar(); + + /// <summary> + /// Read char array. + /// </summary> + /// <returns>Char array.</returns> + char[] ReadCharArray(); + + /// <summary> + /// Read short value. + /// </summary> + /// <returns>Short value.</returns> + short ReadShort(); + + /// <summary> + /// Read short array. + /// </summary> + /// <returns>Short array.</returns> + short[] ReadShortArray(); + + /// <summary> + /// Read int value. + /// </summary> + /// <returns>Int value.</returns> + int ReadInt(); + + /// <summary> + /// Read int array. + /// </summary> + /// <returns>Int array.</returns> + int[] ReadIntArray(); + + /// <summary> + /// Read long value. + /// </summary> + /// <returns>Long value.</returns> + long ReadLong(); + + /// <summary> + /// Read long array. + /// </summary> + /// <returns>Long array.</returns> + long[] ReadLongArray(); + + /// <summary> + /// Read boolean value. + /// </summary> + /// <returns>Boolean value.</returns> + bool ReadBoolean(); + + /// <summary> + /// Read boolean array. + /// </summary> + /// <returns>Boolean array.</returns> + bool[] ReadBooleanArray(); + + /// <summary> + /// Read float value. + /// </summary> + /// <returns>Float value.</returns> + float ReadFloat(); + + /// <summary> + /// Read float array. + /// </summary> + /// <returns>Float array.</returns> + float[] ReadFloatArray(); + + /// <summary> + /// Read double value. + /// </summary> + /// <returns>Double value.</returns> + double ReadDouble(); + + /// <summary> + /// Read double array. + /// </summary> + /// <returns>Double array.</returns> + double[] ReadDoubleArray(); + + /// <summary> + /// Read decimal value. + /// </summary> + /// <returns>Decimal value.</returns> + decimal? ReadDecimal(); + + /// <summary> + /// Read decimal array. + /// </summary> + /// <returns>Decimal array.</returns> + decimal?[] ReadDecimalArray(); + + /// <summary> + /// Read date value in UTC form. Shortcut for <c>ReadTimestamp(false)</c>. + /// </summary> + /// <returns>Date value.</returns> + DateTime? ReadTimestamp(); + + /// <summary> + /// Read date array in UTC form. Shortcut for <c>ReadTimestampArray(false)</c>. + /// </summary> + /// <returns>Date array.</returns> + DateTime?[] ReadTimestampArray(); + + /// <summary> + /// Read string value. + /// </summary> + /// <returns>String value.</returns> + string ReadString(); + + /// <summary> + /// Read string array. + /// </summary> + /// <returns>String array.</returns> + string[] ReadStringArray(); + + /// <summary> + /// Read GUID value. + /// </summary> + /// <returns>GUID value.</returns> + Guid? ReadGuid(); + + /// <summary> + /// Read GUID array. + /// </summary> + /// <returns>GUID array.</returns> + Guid?[] ReadGuidArray(); + + /// <summary> + /// Read enum value. + /// </summary> + /// <returns>Enum value.</returns> + T ReadEnum<T>(); + + /// <summary> + /// Read enum array. + /// </summary> + /// <returns>Enum array.</returns> + T[] ReadEnumArray<T>(); + + /// <summary> + /// Read object. + /// </summary> + /// <returns>Object.</returns> + T ReadObject<T>(); + + /// <summary> + /// Read object array. + /// </summary> + /// <returns>Object array.</returns> + T[] ReadArray<T>(); + + /// <summary> + /// Read collection. + /// </summary> + /// <returns>Collection.</returns> + ICollection ReadCollection(); + + /// <summary> + /// Read collection. + /// </summary> + /// <param name="factory">Factory.</param> + /// <param name="adder">Adder.</param> + /// <returns>Collection.</returns> + ICollection ReadCollection(CollectionFactory factory, CollectionAdder adder); + + /// <summary> + /// Read dictionary. + /// </summary> + /// <returns>Dictionary.</returns> + IDictionary ReadDictionary(); + + /// <summary> + /// Read dictionary. + /// </summary> + /// <param name="factory">Factory.</param> + /// <returns>Dictionary.</returns> + IDictionary ReadDictionary(DictionaryFactory factory); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryRawWriter.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryRawWriter.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryRawWriter.cs new file mode 100644 index 0000000..00b49f5 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryRawWriter.cs @@ -0,0 +1,220 @@ +/* + * 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.Binary +{ + using System; + using System.Collections; + + /// <summary> + /// Raw writer for binary objects. + /// </summary> + public interface IBinaryRawWriter + { + /// <summary> + /// Write byte value. + /// </summary> + /// <param name="val">Byte value.</param> + void WriteByte(byte val); + + /// <summary> + /// Write byte array. + /// </summary> + /// <param name="val">Byte array.</param> + void WriteByteArray(byte[] val); + + /// <summary> + /// Write char value. + /// </summary> + /// <param name="val">Char value.</param> + void WriteChar(char val); + + /// <summary> + /// Write char array. + /// </summary> + /// <param name="val">Char array.</param> + void WriteCharArray(char[] val); + + /// <summary> + /// Write short value. + /// </summary> + /// <param name="val">Short value.</param> + void WriteShort(short val); + + /// <summary> + /// Write short array. + /// </summary> + /// <param name="val">Short array.</param> + void WriteShortArray(short[] val); + + /// <summary> + /// Write int value. + /// </summary> + /// <param name="val">Int value.</param> + void WriteInt(int val); + + /// <summary> + /// Write int array. + /// </summary> + /// <param name="val">Int array.</param> + void WriteIntArray(int[] val); + + /// <summary> + /// Write long value. + /// </summary> + /// <param name="val">Long value.</param> + void WriteLong(long val); + + /// <summary> + /// Write long array. + /// </summary> + /// <param name="val">Long array.</param> + void WriteLongArray(long[] val); + + /// <summary> + /// Write boolean value. + /// </summary> + /// <param name="val">Boolean value.</param> + void WriteBoolean(bool val); + + /// <summary> + /// Write boolean array. + /// </summary> + /// <param name="val">Boolean array.</param> + void WriteBooleanArray(bool[] val); + + /// <summary> + /// Write float value. + /// </summary> + /// <param name="val">Float value.</param> + void WriteFloat(float val); + + /// <summary> + /// Write float array. + /// </summary> + /// <param name="val">Float array.</param> + void WriteFloatArray(float[] val); + + /// <summary> + /// Write double value. + /// </summary> + /// <param name="val">Double value.</param> + void WriteDouble(double val); + + /// <summary> + /// Write double array. + /// </summary> + /// <param name="val">Double array.</param> + void WriteDoubleArray(double[] val); + + /// <summary> + /// Write decimal value. + /// </summary> + /// <param name="val">Decimal value.</param> + void WriteDecimal(decimal? val); + + /// <summary> + /// Write decimal array. + /// </summary> + /// <param name="val">Decimal array.</param> + void WriteDecimalArray(decimal?[] val); + + /// <summary> + /// Write date value. + /// </summary> + /// <param name="val">Date value.</param> + void WriteTimestamp(DateTime? val); + + /// <summary> + /// Write date array. + /// </summary> + /// <param name="val">Date array.</param> + void WriteTimestampArray(DateTime?[] val); + + /// <summary> + /// Write string value. + /// </summary> + /// <param name="val">String value.</param> + void WriteString(string val); + + /// <summary> + /// Write string array. + /// </summary> + /// <param name="val">String array.</param> + void WriteStringArray(string[] val); + + /// <summary> + /// Write GUID value. + /// </summary> + /// <param name="val">GUID value.</param> + void WriteGuid(Guid? val); + + /// <summary> + /// Write GUID array. + /// </summary> + /// <param name="val">GUID array.</param> + void WriteGuidArray(Guid?[] val); + + /// <summary> + /// Write enum value. + /// </summary> + /// <param name="val">Enum value.</param> + void WriteEnum<T>(T val); + + /// <summary> + /// Write enum array. + /// </summary> + /// <param name="val">Enum array.</param> + void WriteEnumArray<T>(T[] val); + + /// <summary> + /// Write object value. + /// </summary> + /// <param name="val">Object value.</param> + void WriteObject<T>(T val); + + /// <summary> + /// Write object array. + /// </summary> + /// <param name="val">Object array.</param> + void WriteArray<T>(T[] val); + + /// <summary> + /// Writes a collection in interoperable form. + /// + /// Use this method to communicate with other platforms + /// or with nodes that need to read collection elements in binary form. + /// + /// When there is no need for binarization or interoperability, please use <see cref="WriteObject{T}" />, + /// which will properly preserve generic collection type. + /// </summary> + /// <param name="val">Collection.</param> + void WriteCollection(ICollection val); + + /// <summary> + /// Writes a dictionary in interoperable form. + /// + /// Use this method to communicate with other platforms + /// or with nodes that need to read dictionary elements in binary form. + /// + /// When there is no need for binarization or interoperability, please use <see cref="WriteObject{T}" />, + /// which will properly preserve generic dictionary type. + /// </summary> + /// <param name="val">Dictionary.</param> + void WriteDictionary(IDictionary val); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryReader.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryReader.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryReader.cs new file mode 100644 index 0000000..2ccbbc0 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryReader.cs @@ -0,0 +1,279 @@ +/* + * 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.Binary +{ + using System; + using System.Collections; + + /// <summary> + /// Delegate for collection creation. + /// </summary> + /// <param name="size">Collection size.</param> + /// <returns>Collection.</returns> + public delegate ICollection CollectionFactory(int size); + + /// <summary> + /// Delegate for adding element to collection. + /// </summary> + /// <param name="col">Collection.</param> + /// <param name="elem">Element to add.</param> + public delegate void CollectionAdder(ICollection col, object elem); + + /// <summary> + /// Delegate for dictionary creation. + /// </summary> + /// <param name="size">Dictionary size.</param> + /// <returns>Dictionary.</returns> + public delegate IDictionary DictionaryFactory(int size); + + /// <summary> + /// Reader for binary objects. + /// </summary> + public interface IBinaryReader + { + /// <summary> + /// Read named byte value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Byte value.</returns> + byte ReadByte(string fieldName); + + /// <summary> + /// Read named byte array. + /// </summary> + /// <returns>Byte array.</returns> + byte[] ReadByteArray(string fieldName); + + /// <summary> + /// Read named char value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Char value.</returns> + char ReadChar(string fieldName); + + /// <summary> + /// Read named char array. + /// </summary> + /// <returns>Char array.</returns> + char[] ReadCharArray(string fieldName); + + /// <summary> + /// Read named short value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Short value.</returns> + short ReadShort(string fieldName); + + /// <summary> + /// Read named short array. + /// </summary> + /// <returns>Short array.</returns> + short[] ReadShortArray(string fieldName); + + /// <summary> + /// Read named int value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Int value.</returns> + int ReadInt(string fieldName); + + /// <summary> + /// Read named int array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Int array.</returns> + int[] ReadIntArray(string fieldName); + + /// <summary> + /// Read named long value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Long value.</returns> + long ReadLong(string fieldName); + + /// <summary> + /// Read named long array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Long array.</returns> + long[] ReadLongArray(string fieldName); + + /// <summary> + /// Read named boolean value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Boolean value.</returns> + bool ReadBoolean(string fieldName); + + /// <summary> + /// Read named boolean array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Boolean array.</returns> + bool[] ReadBooleanArray(string fieldName); + + /// <summary> + /// Read named float value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Float value.</returns> + float ReadFloat(string fieldName); + + /// <summary> + /// Read named float array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Float array.</returns> + float[] ReadFloatArray(string fieldName); + + /// <summary> + /// Read named double value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Double value.</returns> + double ReadDouble(string fieldName); + + /// <summary> + /// Read named double array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Double array.</returns> + double[] ReadDoubleArray(string fieldName); + + /// <summary> + /// Read named decimal value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Decimal value.</returns> + decimal? ReadDecimal(string fieldName); + + /// <summary> + /// Read named decimal array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Decimal array.</returns> + decimal?[] ReadDecimalArray(string fieldName); + + /// <summary> + /// Read named date value in UTC form. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Date value.</returns> + DateTime? ReadTimestamp(string fieldName); + + /// <summary> + /// Read named date array in UTC form. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Date array.</returns> + DateTime?[] ReadTimestampArray(string fieldName); + + /// <summary> + /// Read named string value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>String value.</returns> + string ReadString(string fieldName); + + /// <summary> + /// Read named string array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>String array.</returns> + string[] ReadStringArray(string fieldName); + + /// <summary> + /// Read named GUID value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>GUID value.</returns> + Guid? ReadGuid(string fieldName); + + /// <summary> + /// Read named GUID array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>GUID array.</returns> + Guid?[] ReadGuidArray(string fieldName); + + /// <summary> + /// Read named enum value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Enum value.</returns> + T ReadEnum<T>(string fieldName); + + /// <summary> + /// Read named enum array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Enum array.</returns> + T[] ReadEnumArray<T>(string fieldName); + + /// <summary> + /// Read named object. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Object.</returns> + T ReadObject<T>(string fieldName); + + /// <summary> + /// Read named object array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Object array.</returns> + T[] ReadArray<T>(string fieldName); + + /// <summary> + /// Read named collection. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Collection.</returns> + ICollection ReadCollection(string fieldName); + + /// <summary> + /// Read named collection. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="factory">Factory.</param> + /// <param name="adder">Adder.</param> + /// <returns>Collection.</returns> + ICollection ReadCollection(string fieldName, CollectionFactory factory, CollectionAdder adder); + + /// <summary> + /// Read named dictionary. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Dictionary.</returns> + IDictionary ReadDictionary(string fieldName); + + /// <summary> + /// Read named dictionary. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="factory">Factory.</param> + /// <returns>Dictionary.</returns> + IDictionary ReadDictionary(string fieldName, DictionaryFactory factory); + + /// <summary> + /// Get raw reader. + /// </summary> + /// <returns>Raw reader.</returns> + IBinaryRawReader GetRawReader(); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinarySerializer.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinarySerializer.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinarySerializer.cs new file mode 100644 index 0000000..23dc811 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinarySerializer.cs @@ -0,0 +1,39 @@ +/* + * 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.Binary +{ + /// <summary> + /// Binary serializer. + /// </summary> + public interface IBinarySerializer + { + /// <summary> + /// Write portalbe object. + /// </summary> + /// <param name="obj">Object.</param> + /// <param name="writer">Poratble writer.</param> + void WriteBinary(object obj, IBinaryWriter writer); + + /// <summary> + /// Read binary object. + /// </summary> + /// <param name="obj">Instantiated empty object.</param> + /// <param name="reader">Poratble reader.</param> + void ReadBinary(object obj, IBinaryReader reader); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryType.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryType.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryType.cs new file mode 100644 index 0000000..7b34e07 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryType.cs @@ -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. + */ + +namespace Apache.Ignite.Core.Binary +{ + using System.Collections.Generic; + + /// <summary> + /// Binary type metadata. + /// </summary> + public interface IBinaryType + { + /// <summary> + /// Gets type name. + /// </summary> + /// <returns>Type name.</returns> + string TypeName { get; } + + /// <summary> + /// Gets field names for that type. + /// </summary> + /// <returns>Field names.</returns> + ICollection<string> Fields { get; } + + /// <summary> + /// Gets field type for the given field name. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <returns>Field type.</returns> + string GetFieldTypeName(string fieldName); + + /// <summary> + /// Gets optional affinity key field name. + /// </summary> + /// <returns>Affinity key field name or null in case it is not provided.</returns> + string AffinityKeyFieldName { get; } + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryWriter.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryWriter.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryWriter.cs new file mode 100644 index 0000000..87454a9 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IBinaryWriter.cs @@ -0,0 +1,256 @@ +/* + * 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.Binary +{ + using System; + using System.Collections; + + /// <summary> + /// Writer for binary objects. + /// </summary> + public interface IBinaryWriter + { + /// <summary> + /// Write named byte value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Byte value.</param> + void WriteByte(string fieldName, byte val); + + /// <summary> + /// Write named byte array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Byte array.</param> + void WriteByteArray(string fieldName, byte[] val); + + /// <summary> + /// Write named char value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Char value.</param> + void WriteChar(string fieldName, char val); + + /// <summary> + /// Write named char array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Char array.</param> + void WriteCharArray(string fieldName, char[] val); + + /// <summary> + /// Write named short value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Short value.</param> + void WriteShort(string fieldName, short val); + + /// <summary> + /// Write named short array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Short array.</param> + void WriteShortArray(string fieldName, short[] val); + + /// <summary> + /// Write named int value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Int value.</param> + void WriteInt(string fieldName, int val); + + /// <summary> + /// Write named int array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Int array.</param> + void WriteIntArray(string fieldName, int[] val); + + /// <summary> + /// Write named long value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Long value.</param> + void WriteLong(string fieldName, long val); + + /// <summary> + /// Write named long array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Long array.</param> + void WriteLongArray(string fieldName, long[] val); + + /// <summary> + /// Write named boolean value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Boolean value.</param> + void WriteBoolean(string fieldName, bool val); + + /// <summary> + /// Write named boolean array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Boolean array.</param> + void WriteBooleanArray(string fieldName, bool[] val); + + /// <summary> + /// Write named float value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Float value.</param> + void WriteFloat(string fieldName, float val); + + /// <summary> + /// Write named float array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Float array.</param> + void WriteFloatArray(string fieldName, float[] val); + + /// <summary> + /// Write named double value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Double value.</param> + void WriteDouble(string fieldName, double val); + + /// <summary> + /// Write named double array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Double array.</param> + void WriteDoubleArray(string fieldName, double[] val); + + /// <summary> + /// Write named decimal value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Decimal value.</param> + void WriteDecimal(string fieldName, decimal? val); + + /// <summary> + /// Write named decimal array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Decimal array.</param> + void WriteDecimalArray(string fieldName, decimal?[] val); + + /// <summary> + /// Write named date value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Date value.</param> + void WriteTimestamp(string fieldName, DateTime? val); + + /// <summary> + /// Write named date array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Date array.</param> + void WriteTimestampArray(string fieldName, DateTime?[] val); + + /// <summary> + /// Write named string value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">String value.</param> + void WriteString(string fieldName, string val); + + /// <summary> + /// Write named string array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">String array.</param> + void WriteStringArray(string fieldName, string[] val); + + /// <summary> + /// Write named GUID value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">GUID value.</param> + void WriteGuid(string fieldName, Guid? val); + + /// <summary> + /// Write named GUID array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">GUID array.</param> + void WriteGuidArray(string fieldName, Guid?[] val); + + /// <summary> + /// Write named enum value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Enum value.</param> + void WriteEnum<T>(string fieldName, T val); + + /// <summary> + /// Write named enum array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Enum array.</param> + void WriteEnumArray<T>(string fieldName, T[] val); + + /// <summary> + /// Write named object value. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Object value.</param> + void WriteObject<T>(string fieldName, T val); + + /// <summary> + /// Write named object array. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Object array.</param> + void WriteArray<T>(string fieldName, T[] val); + + /// <summary> + /// Writes a named collection in interoperable form. + /// + /// Use this method to communicate with other platforms + /// or with nodes that need to read collection elements in binary form. + /// + /// When there is no need for binarization or interoperability, please use <see cref="WriteObject{T}" />, + /// which will properly preserve generic collection type. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Collection.</param> + void WriteCollection(string fieldName, ICollection val); + + /// <summary> + /// Writes a named dictionary in interoperable form. + /// + /// Use this method to communicate with other platforms + /// or with nodes that need to read dictionary elements in binary form. + /// + /// When there is no need for binarization or interoperability, please use <see cref="WriteObject{T}" />, + /// which will properly preserve generic dictionary type. + /// </summary> + /// <param name="fieldName">Field name.</param> + /// <param name="val">Dictionary.</param> + void WriteDictionary(string fieldName, IDictionary val); + + /// <summary> + /// Get raw writer. + /// </summary> + /// <returns>Raw writer.</returns> + IBinaryRawWriter GetRawWriter(); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IIgniteBinary.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IIgniteBinary.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IIgniteBinary.cs new file mode 100644 index 0000000..25ea981 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Binary/IIgniteBinary.cs @@ -0,0 +1,120 @@ +/* + * 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.Binary +{ + using System; + using System.Collections.Generic; + + /// <summary> + /// Defines binary objects functionality. With binary objects you are able to: + /// <list type="bullet"> + /// <item> + /// <description>Seamlessly interoperate between Java, .NET, and C++.</description> + /// </item> + /// <item> + /// <description>Make any object binary with zero code change to your existing code.</description> + /// </item> + /// <item> + /// <description>Nest binary objects within each other.</description> + /// </item> + /// <item> + /// <description>Automatically handle <c>circular</c> or <c>null</c> references.</description> + /// </item> + /// <item> + /// <description>Automatically convert collections and maps between Java, .NET, and C++.</description> + /// </item> + /// <item> + /// <description>Optionally avoid deserialization of objects on the server side.</description> + /// </item> + /// <item> + /// <description>Avoid need to have concrete class definitions on the server side.</description> + /// </item> + /// <item> + /// <description>Dynamically change structure of the classes without having to restart the cluster.</description> + /// </item> + /// <item> + /// <description>Index into binary objects for querying purposes.</description> + /// </item> + /// </list> + /// </summary> + public interface IIgniteBinary + { + /// <summary> + /// Converts provided object to binary form. + /// <para /> + /// Note that object's type needs to be configured in <see cref="BinaryConfiguration"/>. + /// </summary> + /// <param name="obj">Object to convert.</param> + /// <returns>Converted object.</returns> + T ToBinary<T>(object obj); + + /// <summary> + /// Create builder for the given binary object type. Note that this + /// type must be specified in <see cref="BinaryConfiguration"/>. + /// </summary> + /// <param name="type"></param> + /// <returns>Builder.</returns> + IBinaryObjectBuilder GetBuilder(Type type); + + /// <summary> + /// Create builder for the given binary object type name. Note that this + /// type name must be specified in <see cref="BinaryConfiguration"/>. + /// </summary> + /// <param name="typeName">Type name.</param> + /// <returns>Builder.</returns> + IBinaryObjectBuilder GetBuilder(string typeName); + + /// <summary> + /// Create builder over existing binary object. + /// </summary> + /// <param name="obj"></param> + /// <returns>Builder.</returns> + IBinaryObjectBuilder GetBuilder(IBinaryObject obj); + + /// <summary> + /// Gets type id for the given type name. + /// </summary> + /// <param name="typeName">Type name.</param> + /// <returns>Type id.</returns> + int GetTypeId(string typeName); + + /// <summary> + /// Gets metadata for all known types. + /// </summary> + /// <returns>Metadata.</returns> + ICollection<IBinaryType> GetBinaryTypes(); + + /// <summary> + /// Gets metadata for specified type id. + /// </summary> + /// <returns>Metadata.</returns> + IBinaryType GetBinaryType(int typeId); + + /// <summary> + /// Gets metadata for specified type name. + /// </summary> + /// <returns>Metadata.</returns> + IBinaryType GetBinaryType(string typeName); + + /// <summary> + /// Gets metadata for specified type. + /// </summary> + /// <returns>Metadata.</returns> + IBinaryType GetBinaryType(Type type); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs index 48bc695..192dabf 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/ICache.cs @@ -73,9 +73,9 @@ namespace Apache.Ignite.Core.Cache bool IsEmpty(); /// <summary> - /// Gets a value indicating whether to keep values in portable form. + /// Gets a value indicating whether to keep values in binary form. /// </summary> - bool IsKeepPortable { get; } + bool IsKeepBinary { get; } /// <summary> /// Get another cache instance with read-through and write-through behavior disabled. @@ -95,14 +95,14 @@ namespace Apache.Ignite.Core.Cache ICache<TK, TV> WithExpiryPolicy(IExpiryPolicy plc); /// <summary> - /// Gets cache with KeepPortable mode enabled, changing key and/or value types if necessary. - /// You can only change key/value types when transitioning from non-portable to portable cache; - /// Changing type of portable cache is not allowed and will throw an <see cref="InvalidOperationException"/> + /// Gets cache with KeepBinary mode enabled, changing key and/or value types if necessary. + /// You can only change key/value types when transitioning from non-binary to binary cache; + /// Changing type of binary cache is not allowed and will throw an <see cref="InvalidOperationException"/> /// </summary> - /// <typeparam name="TK1">Key type in portable mode.</typeparam> - /// <typeparam name="TV1">Value type in protable mode.</typeparam> - /// <returns>Cache instance with portable mode enabled.</returns> - ICache<TK1, TV1> WithKeepPortable<TK1, TV1>(); + /// <typeparam name="TK1">Key type in binary mode.</typeparam> + /// <typeparam name="TV1">Value type in binary mode.</typeparam> + /// <returns>Cache instance with binary mode enabled.</returns> + ICache<TK1, TV1> WithKeepBinary<TK1, TV1>(); /// <summary> /// Executes <see cref="LocalLoadCache"/> on all cache nodes. http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs index 8f297a2..dbf6c97 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/Continuous/ContinuousQuery.cs @@ -115,7 +115,7 @@ namespace Apache.Ignite.Core.Cache.Query.Continuous /// returns <c>false</c>, then cache entry event will not be sent to a node where /// continuous query has been started. /// <para /> - /// Must be either portable or serializable in case query is not local. + /// Must be either binary or serializable in case query is not local. /// </summary> public ICacheEntryEventFilter<TK, TV> Filter { get; set; } http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs index 3cb9e58..1464589 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/QueryBase.cs @@ -17,8 +17,8 @@ namespace Apache.Ignite.Core.Cache.Query { + using Apache.Ignite.Core.Impl.Binary; using Apache.Ignite.Core.Impl.Cache; - using Apache.Ignite.Core.Impl.Portable; /// <summary> /// Base class for all Ignite cache entry queries. @@ -53,8 +53,8 @@ namespace Apache.Ignite.Core.Cache.Query /// Writes this instance to a stream created with a specified delegate. /// </summary> /// <param name="writer">Writer.</param> - /// <param name="keepPortable">Keep portable flag.</param> - internal abstract void Write(PortableWriterImpl writer, bool keepPortable); + /// <param name="keepBinary">Keep binary flag.</param> + internal abstract void Write(BinaryWriter writer, bool keepBinary); /// <summary> /// Gets the interop opcode. @@ -66,7 +66,7 @@ namespace Apache.Ignite.Core.Cache.Query /// </summary> /// <param name="writer">Writer.</param> /// <param name="args">Arguments.</param> - internal static void WriteQueryArgs(PortableWriterImpl writer, object[] args) + internal static void WriteQueryArgs(BinaryWriter writer, object[] args) { if (args == null) writer.WriteInt(0); http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs index 44f8486..e1478f3 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/ScanQuery.cs @@ -17,8 +17,8 @@ namespace Apache.Ignite.Core.Cache.Query { + using Apache.Ignite.Core.Impl.Binary; using Apache.Ignite.Core.Impl.Cache; - using Apache.Ignite.Core.Impl.Portable; /// <summary> /// Scan query over cache entries. Will accept all the entries if no predicate was set. @@ -46,7 +46,7 @@ namespace Apache.Ignite.Core.Cache.Query public int? Partition { get; set; } /** <inheritDoc /> */ - internal override void Write(PortableWriterImpl writer, bool keepPortable) + internal override void Write(BinaryWriter writer, bool keepBinary) { writer.WriteBoolean(Local); writer.WriteInt(PageSize); @@ -61,7 +61,7 @@ namespace Apache.Ignite.Core.Cache.Query else { var holder = new CacheEntryFilterHolder(Filter, (key, val) => Filter.Invoke( - new CacheEntry<TK, TV>((TK) key, (TV) val)), writer.Marshaller, keepPortable); + new CacheEntry<TK, TV>((TK) key, (TV) val)), writer.Marshaller, keepBinary); writer.WriteObject(holder); writer.WriteLong(holder.Handle); http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs index 52efc26..69dc7ee 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/SqlQuery.cs @@ -19,8 +19,8 @@ namespace Apache.Ignite.Core.Cache.Query { using System; using System.Diagnostics.CodeAnalysis; + using Apache.Ignite.Core.Impl.Binary; using Apache.Ignite.Core.Impl.Cache; - using Apache.Ignite.Core.Impl.Portable; /// <summary> /// SQL Query. @@ -94,7 +94,7 @@ namespace Apache.Ignite.Core.Cache.Query public object[] Arguments { get; set; } /** <inheritDoc /> */ - internal override void Write(PortableWriterImpl writer, bool keepPortable) + internal override void Write(BinaryWriter writer, bool keepBinary) { if (string.IsNullOrEmpty(Sql)) throw new ArgumentException("Sql cannot be null or empty"); http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs index 3f52f6f..8c7880f 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Query/TextQuery.cs @@ -18,8 +18,8 @@ namespace Apache.Ignite.Core.Cache.Query { using System; + using Apache.Ignite.Core.Impl.Binary; using Apache.Ignite.Core.Impl.Cache; - using Apache.Ignite.Core.Impl.Portable; /// <summary> /// Text query. @@ -81,7 +81,7 @@ namespace Apache.Ignite.Core.Cache.Query public string Text { get; set; } /** <inheritDoc /> */ - internal override void Write(PortableWriterImpl writer, bool keepPortable) + internal override void Write(BinaryWriter writer, bool keepBinary) { if (string.IsNullOrEmpty(Text)) throw new ArgumentException("Text cannot be null or empty"); http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs index 60a5839..10fbb2e 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Common/IgniteGuid.cs @@ -19,7 +19,7 @@ namespace Apache.Ignite.Core.Common { using System; using System.Globalization; - using Apache.Ignite.Core.Portable; + using Apache.Ignite.Core.Binary; /// <summary> /// Ignite guid with additional local ID. @@ -93,7 +93,7 @@ namespace Apache.Ignite.Core.Common /// Reads this object from the given reader. /// </summary> /// <param name="r">Reader.</param> - internal static IgniteGuid? ReadPortable(IPortableRawReader r) + internal static IgniteGuid? Read(IBinaryRawReader r) { var guid = r.ReadGuid(); http://git-wip-us.apache.org/repos/asf/ignite/blob/894057e5/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs index ad7bbb5..d818153 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ICompute.cs @@ -70,12 +70,12 @@ namespace Apache.Ignite.Core.Compute ICompute WithTimeout(long timeout); /// <summary> - /// Sets keep-portable flag for the next executed Java task on this projection in the current + /// Sets keep-binary flag for the next executed Java task on this projection in the current /// thread so that task argument passed to Java and returned task results will not be /// deserialized. /// </summary> /// <returns>This compute instance for chaining calls.</returns> - ICompute WithKeepPortable(); + ICompute WithKeepBinary(); /// <summary> /// Executes given Java task on the grid projection. If task for given name has not been deployed yet,
