/// <summary> /// Writes the configuration to writer. /// </summary> public static void Write(IBinaryRawWriter writer, ISwapSpaceSpi spi) { Debug.Assert(writer != null); var fileSwap = spi as FileSwapSpaceSpi; if (spi == null) { writer.WriteByte((byte)Type.None); } else if (fileSwap != null) { writer.WriteByte((byte)Type.File); writer.WriteString(fileSwap.BaseDirectory); writer.WriteFloat(fileSwap.MaximumSparsity); writer.WriteInt(fileSwap.MaximumWriteQueueSize); writer.WriteInt(fileSwap.ReadStripesNumber); writer.WriteInt(fileSwap.WriteBufferSize); } else { throw new InvalidOperationException("Unsupported swap space SPI: " + spi.GetType()); } }
/// <summary> /// Writes the configuration to writer. /// </summary> public static void Write(IBinaryRawWriter writer, ISwapSpaceSpi spi) { Debug.Assert(writer != null); var fileSwap = spi as FileSwapSpaceSpi; if (spi == null) { writer.WriteByte((byte) Type.None); } else if (fileSwap != null) { writer.WriteByte((byte) Type.File); writer.WriteString(fileSwap.BaseDirectory); writer.WriteFloat(fileSwap.MaximumSparsity); writer.WriteInt(fileSwap.MaximumWriteQueueSize); writer.WriteInt(fileSwap.ReadStripesNumber); writer.WriteInt(fileSwap.WriteBufferSize); } else { throw new InvalidOperationException("Unsupported swap space SPI: " + spi.GetType()); } }
/// <summary> /// Writes the instance. /// </summary> internal static void Write(IBinaryRawWriter writer, IAffinityFunction fun) { if (fun == null) { writer.WriteByte(TypeCodeNull); return; } var p = fun as AffinityFunctionBase; if (p != null) { writer.WriteByte(p is FairAffinityFunction ? TypeCodeFair : TypeCodeRendezvous); writer.WriteInt(p.Partitions); writer.WriteBoolean(p.ExcludeNeighbors); } else { writer.WriteByte(TypeCodeUser); if (!fun.GetType().IsSerializable) { throw new IgniteException("AffinityFunction should be serializable."); } writer.WriteObject(fun); writer.WriteInt(fun.Partitions); // partition count is written once and can not be changed. } }
/// <summary> /// Writes an instance. /// </summary> public static void Write(IBinaryRawWriter writer, IBinaryEqualityComparer comparer) { if (comparer == null) { writer.WriteByte((byte)Type.None); return; } var arrCmp = comparer as BinaryArrayEqualityComparer; if (arrCmp != null) { writer.WriteByte((byte)Type.Array); return; } var fieldCmp = (BinaryFieldEqualityComparer)comparer; writer.WriteByte((byte)Type.Field); fieldCmp.Validate(); writer.WriteInt(fieldCmp.FieldNames.Count); foreach (var field in fieldCmp.FieldNames) { writer.WriteString(field); } }
/// <summary> /// Serializes content of the cell to the writer /// </summary> public void ToBinary(IBinaryRawWriter writer) { writer.WriteInt(StartCellPassIdx); writer.WriteInt(EndCellPassIdx); writer.WriteShort(MachineID); writer.WriteLong(LastLayerPassTime.ToBinary()); writer.WriteShort(CCV); writer.WriteLong(CCV_Time.ToBinary()); writer.WriteShort(CCV_MachineID); writer.WriteFloat(CCV_Elev); writer.WriteShort(TargetCCV); writer.WriteInt(CCV_CellPassIdx); writer.WriteShort(MDP); writer.WriteLong(MDP_Time.ToBinary()); writer.WriteShort(MDP_MachineID); writer.WriteFloat(MDP_Elev); writer.WriteShort(TargetMDP); writer.WriteByte(CCA); writer.WriteLong(CCA_Time.ToBinary()); writer.WriteShort(CCA_MachineID); writer.WriteFloat(CCA_Elev); writer.WriteShort(TargetCCA); writer.WriteByte(RadioLatency); writer.WriteInt(TargetPassCount); writer.WriteFloat(Thickness); writer.WriteFloat(TargetThickness); writer.WriteFloat(Height); writer.WriteShort(RMV); writer.WriteInt(Frequency); writer.WriteInt(Amplitude); writer.WriteInt(MaterialTemperature); writer.WriteLong(MaterialTemperature_Time.ToBinary()); writer.WriteShort(MaterialTemperature_MachineID); writer.WriteFloat(MaterialTemperature_Elev); writer.WriteInt((int)Status); writer.WriteFloat(MaxThickness); writer.WriteInt(FilteredPassCount); writer.WriteInt(FilteredHalfPassCount); writer.WriteFloat(MinimumPassHeight); writer.WriteFloat(MaximumPassHeight); writer.WriteFloat(FirstPassHeight); writer.WriteFloat(LastPassHeight); }
public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteGuid(SiteModelID); writer.WriteInt((int)OTGCellBottomLeftX); writer.WriteInt((int)OTGCellBottomLeftY); writer.WriteDouble(CellSize); writer.WriteByte((byte)SurveyedSurfacePatchType); writer.WriteBoolean(ProcessingMap != null); if (ProcessingMap != null) { writer.WriteByteArray(ProcessingMap.ToBytes()); } writer.WriteBoolean(IncludedSurveyedSurfaces != null); if (IncludedSurveyedSurfaces != null) { var count = IncludedSurveyedSurfaces.Length; writer.WriteInt(count); for (int i = 0; i < count; i++) { writer.WriteGuid(IncludedSurveyedSurfaces[i]); } } }
/// <summary> /// Writes the SQL fields query. /// </summary> private static void WriteSqlFieldsQuery(IBinaryRawWriter writer, SqlFieldsQuery qry, bool includeColumns = true) { Debug.Assert(qry != null); writer.WriteString(qry.Schema); writer.WriteInt(qry.PageSize); writer.WriteInt(-1); // maxRows: unlimited writer.WriteString(qry.Sql); QueryBase.WriteQueryArgs(writer, qry.Arguments); // .NET client does not discern between different statements for now. // We could have ExecuteNonQuery method, which uses StatementType.Update, for example. writer.WriteByte((byte)StatementType.Any); writer.WriteBoolean(qry.EnableDistributedJoins); writer.WriteBoolean(qry.Local); #pragma warning disable 618 writer.WriteBoolean(qry.ReplicatedOnly); #pragma warning restore 618 writer.WriteBoolean(qry.EnforceJoinOrder); writer.WriteBoolean(qry.Colocated); writer.WriteBoolean(qry.Lazy); writer.WriteTimeSpanAsLong(qry.Timeout); writer.WriteBoolean(includeColumns); }
/// <summary> /// Writes the peek modes. /// </summary> private static void WritePeekModes(ICollection <CachePeekMode> modes, IBinaryRawWriter w) { if (modes == null) { w.WriteInt(0); } else { w.WriteInt(modes.Count); foreach (var m in modes) { // Convert bit flag to ordinal. byte val = 0; var flagVal = (int)m; while ((flagVal = flagVal >> 1) > 0) { val++; } w.WriteByte(val); } } }
/// <summary> /// Serializes content to the writer /// </summary> public override void InternalToBinary(IBinaryRawWriter writer) { VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteByte((byte)Result); writer.WriteLong(NumRemovedElements); }
/// <summary> /// Serializes content to the writer /// </summary> public override void InternalToBinary(IBinaryRawWriter writer) { VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteGuid(ProjectUid); writer.WriteByte((byte)RebuildResult); }
/// <summary> /// Serializes content of the cell to the writer /// </summary> public void ToBinary(IBinaryRawWriter writer) { writer.WriteByte((byte)MachineType); FilteredPass.ToBinary(writer); TargetValues.ToBinary(writer); EventValues.ToBinary(writer); }
/// <summary> /// Serialises content to the writer /// </summary> public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteByte(LastTargetCCA); }
/// <summary> /// Serializes content to the writer /// </summary> public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteGuid(ProjectID); writer.WriteInt((int)DeletionSelectivity); writer.WriteByte((byte)OriginS3TransferProxy); }
//Procedure ReadFromStream(const Stream : TStream); //Procedure WriteToStream(const Stream : TStream); /// <summary> /// Serializes content of the cell to the writer /// </summary> public void ToBinary(IBinaryRawWriter writer) { writer.WriteShort(TargetCCV); writer.WriteShort(TargetMDP); writer.WriteFloat(TargetLiftThickness); writer.WriteInt(TargetPassCount); writer.WriteInt(TempWarningLevelMin); writer.WriteInt(TempWarningLevelMax); writer.WriteByte(TargetCCA); }
public override void InternalToBinary(IBinaryRawWriter writer) { VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteByte((byte)CalcResult); writer.WriteBoolean(Heights != null); if (Heights != null) { writer.WriteByteArray(Heights.ToBytes()); } }
/// <summary> /// Writes the instance. /// </summary> internal static void Write(IBinaryRawWriter writer, IAffinityFunction fun, object userFuncOverride = null) { Debug.Assert(writer != null); if (fun == null) { writer.WriteByte(TypeCodeNull); return; } // 1) Type code // 2) Partitions // 3) ExcludeNeighbors // 4) Override flags // 5) User object var p = fun as RendezvousAffinityFunction; if (p != null) { writer.WriteByte(TypeCodeRendezvous); writer.WriteInt(p.Partitions); writer.WriteBoolean(p.ExcludeNeighbors); var overrideFlags = GetOverrideFlags(p.GetType()); writer.WriteByte((byte)overrideFlags); // Do not write user func if there is nothing overridden WriteUserFunc(writer, overrideFlags != UserOverrides.None ? fun : null, userFuncOverride); WriteBackupFilter(writer, p); } else { writer.WriteByte(TypeCodeUser); writer.WriteInt(fun.Partitions); writer.WriteBoolean(false); // Exclude neighbors writer.WriteByte((byte)UserOverrides.All); WriteUserFunc(writer, fun, userFuncOverride); } }
/// <summary> /// Serializes content to the writer /// </summary> public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteByte((byte)ProfileStyle); writer.WriteByte((byte)ProfileTypeRequired); var count = NEECoords?.Length ?? 0; writer.WriteInt(count); for (int i = 0; i < count; i++) { NEECoords[i].ToBinary(writer); } writer.WriteBoolean(ReturnAllPassesAndLayers); writer.WriteInt((int)VolumeType); }
/// <summary> /// Serializes content of the cell to the writer /// </summary> public void ToBinary(IBinaryRawWriter writer) { writer.WriteByte((byte)EventElevationMappingMode); writer.WriteByte(EventInAvoidZoneState); writer.WriteInt(EventDesignNameID); writer.WriteByte((byte)EventVibrationState); writer.WriteByte((byte)EventAutoVibrationState); writer.WriteByte((byte)EventMachineGear); writer.WriteShort(EventMachineRMVThreshold); writer.WriteByte((byte)EventMachineAutomatics); writer.WriteByte((byte)PositioningTechnology); writer.WriteInt(GPSTolerance); writer.WriteByte((byte)GPSAccuracy); writer.WriteLong(MapReset_PriorDate.ToBinary()); writer.WriteInt(MapReset_DesignNameID); writer.WriteInt(LayerID); writer.WriteByte(EventFlags); }
/// <summary> /// Writes the instance. /// </summary> internal static void Write(IBinaryRawWriter writer, IAffinityFunction fun, object userFuncOverride = null) { Debug.Assert(writer != null); if (fun == null) { writer.WriteByte(TypeCodeNull); return; } // 1) Type code // 2) Partitions // 3) ExcludeNeighbors // 4) Override flags // 5) User object var p = fun as AffinityFunctionBase; if (p != null) { writer.WriteByte(p is FairAffinityFunction ? TypeCodeFair : TypeCodeRendezvous); writer.WriteInt(p.Partitions); writer.WriteBoolean(p.ExcludeNeighbors); var overrideFlags = GetOverrideFlags(p.GetType()); writer.WriteByte((byte) overrideFlags); // Do not write user func if there is nothing overridden WriteUserFunc(writer, overrideFlags != UserOverrides.None ? fun : null, userFuncOverride); } else { writer.WriteByte(TypeCodeUser); writer.WriteInt(fun.Partitions); writer.WriteBoolean(false); // Exclude neighbors writer.WriteByte((byte) UserOverrides.All); WriteUserFunc(writer, fun, userFuncOverride); } }
public override void InternalToBinary(IBinaryRawWriter writer) { VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteGuid(ProjectUID); writer.WriteByte((byte)Flags); writer.WriteInt((int)DeletionSelectivity); writer.WriteByte((byte)OriginS3TransferProxy); writer.WriteInt(NumberOfTAGFilesFromS3); writer.WriteInt(NumberOfTAGFileKeyCollections); writer.WriteInt(NumberOfTAGFilesSubmitted); writer.WriteInt(NumberOfTAGFilesProcessed); writer.WriteLong(LastUpdateUtcTicks); writer.WriteByte((byte)Phase); writer.WriteString(LastSubmittedTagFile); writer.WriteString(LastProcessedTagFile); writer.WriteByte((byte)DeletionResult); writer.WriteByte((byte)RebuildResult); }
/// <summary> /// Writes to the specified writer. /// </summary> internal static void Write(IBinaryRawWriter writer, IEvictionPolicy policy) { if (policy == null) { writer.WriteByte(0); return; } var p = policy as EvictionPolicyBase; if (p == null) { throw new NotSupportedException( string.Format("Unsupported Eviction Policy: {0}. Only predefined eviction policy types " + "are supported: {1}, {2}", policy.GetType(), typeof(LruEvictionPolicy), typeof(FifoEvictionPolicy))); } writer.WriteByte(p is FifoEvictionPolicy ? (byte)1 : (byte)2); writer.WriteInt(p.BatchSize); writer.WriteInt(p.MaxSize); writer.WriteLong(p.MaxMemorySize); }
/// <summary> /// Serializes content to the writer /// </summary> public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); writer.WriteInt((int)Mode); writer.WriteBoolean(Palette != null); Palette?.ToBinary(writer); writer.WriteBoolean(Extents != null); Extents.ToBinary(writer); writer.WriteBoolean(CoordsAreGrid); writer.WriteInt(PixelsX); writer.WriteInt(PixelsY); writer.WriteByte((byte)VolumeType); }
/// <summary> /// Writes this instance. /// </summary> internal void Write(IBinaryRawWriter writer) { writer.WriteString(Name); writer.WriteByte((byte)IndexType); if (Fields != null) { writer.WriteInt(Fields.Count); foreach (var field in Fields) { writer.WriteString(field.Name); writer.WriteBoolean(field.IsDescending); } } else { writer.WriteInt(0); } }
/// <summary> /// Writes this instance to the specified writer. /// </summary> /// <param name="writer">The writer.</param> internal virtual void Write(IBinaryRawWriter writer) { writer.WriteByte(TypeCode); }
/// <summary> /// Serializes content to the writer /// </summary> public override void InternalToBinary(IBinaryRawWriter writer) { base.InternalToBinary(writer); VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER); int count = Layers?.Count() ?? 0; writer.WriteInt(count); for (int i = 0; i < count; i++) { Layers[i].ToBinary(writer); } writer.WriteFloat(CellLowestElev); writer.WriteFloat(CellHighestElev); writer.WriteFloat(CellLastElev); writer.WriteFloat(CellFirstElev); writer.WriteFloat(CellLowestCompositeElev); writer.WriteFloat(CellHighestCompositeElev); writer.WriteFloat(CellLastCompositeElev); writer.WriteFloat(CellFirstCompositeElev); writer.WriteShort(CellCCV); writer.WriteShort(CellTargetCCV); writer.WriteShort(CellPreviousMeasuredCCV); writer.WriteShort(CellPreviousMeasuredTargetCCV); writer.WriteFloat(CellCCVElev); writer.WriteShort(CellMDP); writer.WriteShort(CellTargetMDP); writer.WriteFloat(CellMDPElev); writer.WriteByte(CellCCA); writer.WriteShort(CellTargetCCA); writer.WriteFloat(CellCCAElev); writer.WriteFloat(CellTopLayerThickness); writer.WriteBoolean(IncludesProductionData); writer.WriteInt(TopLayerPassCount); writer.WriteInt(TopLayerPassCountTargetRangeMin); writer.WriteInt(TopLayerPassCountTargetRangeMax); writer.WriteInt(CellMaxSpeed); writer.WriteInt(CellMinSpeed); Passes.ToBinary(writer); writer.WriteBooleanArray(FilteredPassFlags); writer.WriteInt(FilteredPassCount); writer.WriteInt(FilteredHalfPassCount); writer.WriteInt((int)AttributeExistenceFlags); writer.WriteInt(CellMaterialTemperature); writer.WriteInt(CellMaterialTemperatureWarnMin); writer.WriteInt(CellMaterialTemperatureWarnMax); writer.WriteFloat(CellMaterialTemperatureElev); }
/// <summary> /// Writes the instance. /// </summary> internal static void Write(IBinaryRawWriter writer, IAffinityFunction fun) { if (fun == null) { writer.WriteByte(TypeCodeNull); return; } var p = fun as AffinityFunctionBase; if (p != null) { ValidateAffinityFunctionType(p.GetType()); writer.WriteByte(p is FairAffinityFunction ? TypeCodeFair : TypeCodeRendezvous); writer.WriteInt(p.Partitions); writer.WriteBoolean(p.ExcludeNeighbors); } else { writer.WriteByte(TypeCodeUser); if (!fun.GetType().IsSerializable) throw new IgniteException("AffinityFunction should be serializable."); writer.WriteObject(fun); writer.WriteInt(fun.Partitions); // partition count is written once and can not be changed. } }
/// <summary> /// Writes to the specified writer. /// </summary> internal static void Write(IBinaryRawWriter writer, IEvictionPolicy policy) { if (policy == null) { writer.WriteByte(0); return; } var p = policy as EvictionPolicyBase; if (p == null) { throw new NotSupportedException( string.Format("Unsupported Eviction Policy: {0}. Only predefined eviction policy types " + "are supported: {1}, {2}", policy.GetType(), typeof (LruEvictionPolicy), typeof (FifoEvictionPolicy))); } writer.WriteByte(p is FifoEvictionPolicy ? (byte) 1 : (byte) 2); writer.WriteInt(p.BatchSize); writer.WriteInt(p.MaxSize); writer.WriteLong(p.MaxMemorySize); }
public static void EmitVersionByte(IBinaryRawWriter writer, byte version) { writer.WriteByte(version); }
/// <summary> /// Writes this instance. /// </summary> internal void Write(IBinaryRawWriter writer) { writer.WriteString(Name); writer.WriteByte((byte) IndexType); if (Fields != null) { writer.WriteInt(Fields.Count); foreach (var field in Fields) { writer.WriteString(field.Name); writer.WriteBoolean(field.IsDescending); } } else writer.WriteInt(0); }
/// <summary> /// Writes this instance to the specified writer. /// </summary> /// <param name="writer">The writer.</param> internal virtual void Write(IBinaryRawWriter writer) { writer.WriteByte(TypeCode); }