示例#1
0
        /// <summary>
        /// Writes the policy factory.
        /// </summary>
        public static void WritePolicyFactory(IBinaryRawWriter writer, IFactory<IExpiryPolicy> factory)
        {
            Debug.Assert(writer != null);

            if (factory != null)
            {
                writer.WriteBoolean(true);
                var expiryPolicy = factory.CreateInstance();

                if (expiryPolicy == null)
                    throw new IgniteException("ExpiryPolicyFactory should return non-null result.");

                WritePolicy(writer, expiryPolicy);
            }
            else
                writer.WriteBoolean(false);
        }
示例#2
0
        /// <summary>
        /// Serializes content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteBoolean(Cut.HasValue);
            if (Cut.HasValue)
            {
                writer.WriteDouble(Cut.Value);
            }

            writer.WriteBoolean(Fill.HasValue);
            if (Fill.HasValue)
            {
                writer.WriteDouble(Fill.Value);
            }

            writer.WriteBoolean(TotalCoverageArea.HasValue);
            if (TotalCoverageArea.HasValue)
            {
                writer.WriteDouble(TotalCoverageArea.Value);
            }

            writer.WriteBoolean(CutArea.HasValue);
            if (CutArea.HasValue)
            {
                writer.WriteDouble(CutArea.Value);
            }

            writer.WriteBoolean(FillArea.HasValue);
            if (FillArea.HasValue)
            {
                writer.WriteDouble(FillArea.Value);
            }

            BoundingExtentGrid.ToBinary(writer);
            BoundingExtentLLH.ToBinary(writer);
        }
        /// <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);
            }
        }
示例#4
0
 /// <summary>
 /// Writes this instance to a writer.
 /// </summary>
 internal void Write(IBinaryRawWriter writer)
 {
     writer.WriteString(Name);
     writer.WriteLong(InitialSize);
     writer.WriteLong(MaxSize);
     writer.WriteString(SwapFilePath);
     writer.WriteInt((int)PageEvictionMode);
     writer.WriteDouble(EvictionThreshold);
     writer.WriteInt(EmptyPagesPoolSize);
     writer.WriteBoolean(MetricsEnabled);
     writer.WriteInt(SubIntervals);
     writer.WriteTimeSpanAsLong(RateTimeInterval);
 }
示例#5
0
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteGuid(ProjectUid);

            writer.WriteBoolean(ResponseItems != null);
            if (ResponseItems != null)
            {
                writer.WriteInt(ResponseItems.Length);
                ResponseItems.ForEach(x => x.ToBinary(writer));
            }
        }
        /// <summary>
        /// Writes to the specified writer.
        /// </summary>
        internal void Write(IBinaryRawWriter writer)
        {
            Debug.Assert(writer != null);

            writer.WriteString(Host);
            writer.WriteInt(Port);
            writer.WriteInt(PortRange);
            writer.WriteInt(SocketSendBufferSize);
            writer.WriteInt(SocketReceiveBufferSize);
            writer.WriteBoolean(TcpNoDelay);
            writer.WriteInt(MaxOpenCursorsPerConnection);
            writer.WriteInt(ThreadPoolSize);
        }
示例#7
0
        /// <summary>
        /// Writes this instance to the specified writer.
        /// </summary>
        internal void Write(IBinaryRawWriter writer)
        {
            var ipFinder = IpFinder;

            if (ipFinder != null)
            {
                writer.WriteBoolean(true);

                var finder = ipFinder as TcpDiscoveryIpFinderBase;

                if (finder == null)
                {
                    throw new InvalidOperationException("Unsupported IP finder: " + ipFinder.GetType());
                }

                finder.Write(writer);
            }
            else
            {
                writer.WriteBoolean(false);
            }

            writer.WriteLong((long)SocketTimeout.TotalMilliseconds);
            writer.WriteLong((long)AckTimeout.TotalMilliseconds);
            writer.WriteLong((long)MaxAckTimeout.TotalMilliseconds);
            writer.WriteLong((long)NetworkTimeout.TotalMilliseconds);
            writer.WriteLong((long)JoinTimeout.TotalMilliseconds);

            writer.WriteBoolean(ForceServerMode);
            writer.WriteBoolean(ClientReconnectDisabled);
            writer.WriteString(LocalAddress);
            writer.WriteInt(ReconnectCount);
            writer.WriteInt(LocalPort);
            writer.WriteInt(LocalPortRange);
            writer.WriteLong((long)StatisticsPrintFrequency.TotalMilliseconds);
            writer.WriteLong((long)IpFinderCleanFrequency.TotalMilliseconds);
            writer.WriteInt(ThreadPriority);
            writer.WriteInt(TopologyHistorySize);
        }
示例#8
0
        /// <summary>
        /// Serialises content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteInt(AboveMaxLevelColour.ToArgb());
            writer.WriteInt(WithinLevelsColour.ToArgb());
            writer.WriteInt(BelowMinLevelColour.ToArgb());

            writer.WriteBoolean(UseMachineTempWarningLevels);

            TemperatureLevels.ToBinary(writer);
        }
        /// <summary>
        /// Writes to the specified writer.
        /// </summary>
        internal void Write(ClientProtocolVersion ver, IBinaryRawWriter writer)
        {
            Debug.Assert(writer != null);

            writer.WriteString(Host);
            writer.WriteInt(Port);
            writer.WriteInt(PortRange);
            writer.WriteInt(SocketSendBufferSize);
            writer.WriteInt(SocketReceiveBufferSize);
            writer.WriteBoolean(TcpNoDelay);
            writer.WriteInt(MaxOpenCursorsPerConnection);
            writer.WriteInt(ThreadPoolSize);
            writer.WriteTimeSpanAsLong(IdleTimeout);

            writer.WriteBoolean(ThinClientEnabled);
            writer.WriteBoolean(OdbcEnabled);
            writer.WriteBoolean(JdbcEnabled);

            if (ver.CompareTo(ClientSocket.Ver130) >= 0)
            {
                writer.WriteTimeSpanAsLong(HandshakeTimeout);
            }
        }
示例#10
0
        /// <summary>
        /// Serialises content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteInt(AbovePassTargetRangeColour.ToArgb());
            writer.WriteInt(WithinPassTargetRangeColour.ToArgb());
            writer.WriteInt(BelowPassTargetRangeColour.ToArgb());

            writer.WriteBoolean(UseMachineTargetPass);

            TargetPassCountRange.ToBinary(writer);
        }
示例#11
0
        /// <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)VolumeType);

            writer.WriteBoolean(BaseDesign != null);
            BaseDesign?.ToBinary(writer);
            writer.WriteBoolean(TopDesign != null);
            TopDesign?.ToBinary(writer);

            WriteFilter(writer, AdditionalSpatialFilter);

            writer.WriteDouble(CutTolerance);
            writer.WriteDouble(FillTolerance);

            writer.WriteLong(StartDate.ToBinary());
            writer.WriteLong(EndDate.ToBinary());
            writer.WriteLong(Interval.Ticks);
        }
示例#12
0
        /// <summary>
        /// Writes the SSL context factory.
        /// </summary>
        internal static void Write(IBinaryRawWriter writer, ISslContextFactory factory)
        {
            Debug.Assert(writer != null);

            var contextFactory = factory as SslContextFactory;

            if (contextFactory != null)
            {
                writer.WriteBoolean(true);

                contextFactory.Write(writer);
            }
            else if (factory != null)
            {
                throw new NotSupportedException(
                          string.Format("Unsupported {0}: {1}. Only predefined implementations are supported: {2}",
                                        typeof(ISslContextFactory).Name, factory.GetType(), typeof(SslContextFactory).Name));
            }
            else
            {
                writer.WriteBoolean(false);
            }
        }
        /// <summary>
        /// Writes this instance to the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        internal void Write(IBinaryRawWriter writer)
        {
            Debug.Assert(writer != null);

            writer.WriteString(PersistentStorePath);
            writer.WriteTimeSpanAsLong(CheckpointingFrequency);
            writer.WriteLong(CheckpointingPageBufferSize);
            writer.WriteInt(CheckpointingThreads);
            writer.WriteTimeSpanAsLong(LockWaitTime);
            writer.WriteInt(WalHistorySize);
            writer.WriteInt(WalSegments);
            writer.WriteInt(WalSegmentSize);
            writer.WriteString(WalStorePath);
            writer.WriteString(WalArchivePath);
            writer.WriteInt((int)WalMode);
            writer.WriteInt(TlbSize);
            writer.WriteTimeSpanAsLong(WalFlushFrequency);
            writer.WriteLong(WalFsyncDelayNanos);
            writer.WriteInt(WalRecordIteratorBufferSize);
            writer.WriteBoolean(AlwaysWriteFullPages);
            writer.WriteBoolean(MetricsEnabled);
            writer.WriteInt(SubIntervals);
            writer.WriteTimeSpanAsLong(RateTimeInterval);
        }
示例#14
0
        /** <inheritdoc /> */
        internal override void Write(IBinaryRawWriter writer)
        {
            base.Write(writer);

            writer.WriteString(LocalAddress);
            writer.WriteString(MulticastGroup);
            writer.WriteInt(MulticastPort);
            writer.WriteInt(AddressRequestAttempts);
            writer.WriteInt((int) ResponseTimeout.TotalMilliseconds);

            writer.WriteBoolean(TimeToLive.HasValue);

            if (TimeToLive.HasValue)
                writer.WriteInt(TimeToLive.Value);
        }
示例#15
0
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteGuid(ProjectID);
            writer.WriteGuid(AssetID);
            writer.WriteString(TAGFileName);
            writer.WriteString(TCCOrgID);
            writer.WriteByteArray(TagFileContent);
            writer.WriteBoolean(TreatAsJohnDoe);
            writer.WriteInt((int)SubmissionFlags);
            writer.WriteInt((int)OriginSource);
        }
示例#16
0
        /// <summary>
        /// Serializes content of the cell to the writer
        /// </summary>
        public void ToBinary(IBinaryRawWriter writer)
        {
            writer.WriteInt(PassCount);

            writer.WriteBoolean(filteredPassData != null);
            if (filteredPassData != null)
            {
                writer.WriteInt(filteredPassData.Length);

                for (int i = 0; i < filteredPassData.Length; i++)
                {
                    filteredPassData[i].ToBinary(writer);
                }
            }
        }
示例#17
0
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteGuid(NodeId);
            writer.WriteGuid(RequestDescriptor);

            writer.WriteBoolean(Payload?.Bytes != null);
            if (Payload?.Bytes != null)
            {
                writer.WriteByteArray(Payload.Bytes);
            }
        }
示例#18
0
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteGuid(ID);
            writer.WriteLong(CreationDate.ToBinary());
            writer.WriteLong(LastModifiedDate.ToBinary());

            writer.WriteBoolean(SiteModelExtent != null);
            SiteModelExtent?.ToBinary(writer);

            writer.WriteInt(MachineCount);
            writer.WriteInt(DesignCount);
            writer.WriteInt(SurveyedSurfaceCount);
            writer.WriteInt(AlignmentCount);
        }
示例#19
0
        /// <summary>
        /// Serialises content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteBoolean(PaletteTransitions != null);

            if (PaletteTransitions != null)
            {
                writer.WriteInt(PaletteTransitions.Length);

                foreach (var transition in PaletteTransitions)
                {
                    transition.ToBinary(writer);
                }
            }
        }
示例#20
0
        /// <summary>
        /// Serialises content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteDouble(CellSize);
            writer.WriteDouble(MinElevation);
            writer.WriteDouble(MaxElevation);
            writer.WriteInt(CellsUsed);
            writer.WriteInt(CellsScanned);

            writer.WriteBoolean(BoundingExtents != null);

            BoundingExtents?.ToBinary(writer);
        }
示例#21
0
        /// <summary>
        /// Writes this instance.
        /// </summary>
        internal void Write(IBinaryRawWriter writer)
        {
            writer.WriteBoolean(TryStop);

            if (Timeout == TimeSpan.MaxValue)
            {
                writer.WriteLong(long.MaxValue);
            }
            else if (Timeout < TimeSpan.Zero)
            {
                writer.WriteLong(0);
            }
            else
            {
                writer.WriteLong((long)Timeout.TotalMilliseconds);
            }
        }
示例#22
0
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteBoolean(Boundary != null);

            if (Boundary != null)
            {
                writer.WriteInt(Boundary.Count);

                foreach (var fence in Boundary)
                {
                    fence.ToBinary(writer);
                }
            }
        }
示例#23
0
        /// <summary>
        /// Serializes content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteGuid(RequestID);
            writer.WriteInt((int)GridDataType);

            writer.WriteByteArray(ProdDataMaskBytes);
            writer.WriteByteArray(SurveyedSurfaceOnlyMaskBytes);

            writer.WriteBoolean(IncludeSurveyedSurfaceInformation);

            AreaControlSet.ToBinary(writer);

            writer.WriteInt((int)SubGridsRequestComputeStyle);
        }
示例#24
0
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteGuid(ProjectUID);
            writer.WriteLong(InsertUTCAsLong);

            writer.WriteBoolean(SegmentKeys != null);
            if (SegmentKeys != null)
            {
                writer.WriteInt(SegmentKeys.Length);

                for (var i = 0; i < SegmentKeys.Length; i++)
                {
                    ((IFromToBinary)SegmentKeys[i]).ToBinary(writer);
                }
            }
        }
示例#25
0
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            var count = Filters?.Length ?? 0;

            writer.WriteInt(count);

            if (count > 0)
            {
                foreach (var filter in Filters)
                {
                    // Handle cases where filter entry is null
                    writer.WriteBoolean(filter != null);
                    filter?.ToBinary(writer);
                }
            }
        }
示例#26
0
        /// <summary>
        /// Serializes content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteBoolean(ReportElevation);
            writer.WriteBoolean(ReportCmv);
            writer.WriteBoolean(ReportMdp);
            writer.WriteBoolean(ReportPassCount);
            writer.WriteBoolean(ReportTemperature);
            writer.WriteBoolean(ReportCutFill);
        }
示例#27
0
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteBoolean(Bits != null);

            if (Bits != null)
            {
                int[] buffer = new int[SubGridTreeConsts.SubGridTreeDimension];
                for (int i = 0; i < SubGridTreeConsts.SubGridTreeDimension; i++)
                {
                    buffer[i] = unchecked ((int)Bits.Bits[i]);
                }

                writer.WriteIntArray(buffer);
            }
        }
示例#28
0
        /// <summary>
        /// Serializes content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteDouble(GridDistanceBetweenProfilePoints);

            writer.WriteBoolean(ProfileCells != null);
            if (ProfileCells != null)
            {
                writer.WriteInt(ProfileCells.Count);

                foreach (var profileCell in ProfileCells)
                {
                    profileCell?.ToBinary(writer);
                }
            }
        }
示例#29
0
        /// <summary>
        /// Serialises content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteInt(TotalNumberOfPagesToCoverFilteredData);

            writer.WriteBoolean(SubGrids != null);
            if (SubGrids != null)
            {
                writer.WriteInt(SubGrids.Count);

                foreach (var subGrid in SubGrids)
                {
                    writer.WriteInt((int)subGrid.GridDataType);
                    writer.WriteByteArray(subGrid.ToBytes());
                }
            }
        }
示例#30
0
        /// <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);
            }
        }
示例#31
0
        /// <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>
        /// 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);
            }
        }
示例#33
0
        /// <summary>
        /// Writes this instane to the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        internal void Write(IBinaryRawWriter writer)
        {
            writer.WriteInt((int) AtomicityMode);
            writer.WriteInt((int) AtomicWriteOrderMode);
            writer.WriteInt(Backups);
            writer.WriteInt((int) CacheMode);
            writer.WriteBoolean(CopyOnRead);
            writer.WriteBoolean(EagerTtl);
            writer.WriteBoolean(EnableSwap);
            writer.WriteBoolean(EvictSynchronized);
            writer.WriteInt(EvictSynchronizedConcurrencyLevel);
            writer.WriteInt(EvictSynchronizedKeyBufferSize);
            writer.WriteLong((long) EvictSynchronizedTimeout.TotalMilliseconds);
            writer.WriteBoolean(Invalidate);
            writer.WriteBoolean(KeepBinaryInStore);
            writer.WriteBoolean(LoadPreviousValue);
            writer.WriteLong((long) LockTimeout.TotalMilliseconds);
            writer.WriteLong((long) LongQueryWarningTimeout.TotalMilliseconds);
            writer.WriteInt(MaxConcurrentAsyncOperations);
            writer.WriteFloat(MaxEvictionOverflowRatio);
            writer.WriteInt((int) MemoryMode);
            writer.WriteString(Name);
            writer.WriteLong(OffHeapMaxMemory);
            writer.WriteBoolean(ReadFromBackup);
            writer.WriteInt(RebalanceBatchSize);
            writer.WriteLong((long) RebalanceDelay.TotalMilliseconds);
            writer.WriteInt((int) RebalanceMode);
            writer.WriteLong((long) RebalanceThrottle.TotalMilliseconds);
            writer.WriteLong((long) RebalanceTimeout.TotalMilliseconds);
            writer.WriteBoolean(SqlEscapeAll);
            writer.WriteInt(SqlOnheapRowCacheSize);
            writer.WriteInt(StartSize);
            writer.WriteInt(WriteBehindBatchSize);
            writer.WriteBoolean(WriteBehindEnabled);
            writer.WriteLong((long) WriteBehindFlushFrequency.TotalMilliseconds);
            writer.WriteInt(WriteBehindFlushSize);
            writer.WriteInt(WriteBehindFlushThreadCount);
            writer.WriteInt((int) WriteSynchronizationMode);
            writer.WriteObject(CacheStoreFactory);

            if (QueryEntities != null)
            {
                writer.WriteInt(QueryEntities.Count);

                foreach (var entity in QueryEntities)
                {
                    if (entity == null)
                        throw new InvalidOperationException("Invalid cache configuration: QueryEntity can't be null.");

                    entity.Write(writer);
                }
            }
            else
                writer.WriteInt(0);
        }
        /** <inheritdoc /> */
        internal override void Write(IBinaryRawWriter writer)
        {
            base.Write(writer);

            writer.WriteString(LocalAddress);
            writer.WriteString(MulticastGroup);
            writer.WriteInt(MulticastPort);
            writer.WriteInt(AddressRequestAttempts);
            writer.WriteInt((int) ResponseTimeout.TotalMilliseconds);

            writer.WriteBoolean(TimeToLive.HasValue);

            if (TimeToLive.HasValue)
                writer.WriteInt(TimeToLive.Value);
        }
示例#35
0
        /// <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.
            }
        }
示例#36
0
        /// <summary>
        /// Writes this instance to the specified writer.
        /// </summary>
        internal void Write(IBinaryRawWriter writer)
        {
            var ipFinder = IpFinder;

            if (ipFinder != null)
            {
                writer.WriteBoolean(true);

                var finder = ipFinder as TcpDiscoveryIpFinderBase;

                if (finder == null)
                    throw new InvalidOperationException("Unsupported IP finder: " + ipFinder.GetType());

                finder.Write(writer);
            }
            else
                writer.WriteBoolean(false);

            writer.WriteLong((long) SocketTimeout.TotalMilliseconds);
            writer.WriteLong((long) AckTimeout.TotalMilliseconds);
            writer.WriteLong((long) MaxAckTimeout.TotalMilliseconds);
            writer.WriteLong((long) NetworkTimeout.TotalMilliseconds);
            writer.WriteLong((long) JoinTimeout.TotalMilliseconds);

            writer.WriteBoolean(ForceServerMode);
            writer.WriteBoolean(ClientReconnectDisabled);
            writer.WriteString(LocalAddress);
            writer.WriteInt(ReconnectCount);
            writer.WriteInt(LocalPort);
            writer.WriteInt(LocalPortRange);
            writer.WriteInt(MaxMissedHeartbeats);
            writer.WriteInt(MaxMissedClientHeartbeats);
            writer.WriteLong((long) StatisticsPrintFrequency.TotalMilliseconds);
            writer.WriteLong((long) IpFinderCleanFrequency.TotalMilliseconds);
            writer.WriteInt(ThreadPriority);
            writer.WriteLong((long) HeartbeatFrequency.TotalMilliseconds);
            writer.WriteInt(TopologyHistorySize);
        }
 /// <summary>
 /// Writes this instance to the specified writer.
 /// </summary>
 internal void Write(IBinaryRawWriter writer)
 {
     writer.WriteInt(AckSendThreshold);
     writer.WriteLong((long) ConnectTimeout.TotalMilliseconds);
     writer.WriteBoolean(DirectBuffer);
     writer.WriteBoolean(DirectSendBuffer);
     writer.WriteLong((long) IdleConnectionTimeout.TotalMilliseconds);
     writer.WriteString(LocalAddress);
     writer.WriteInt(LocalPort);
     writer.WriteInt(LocalPortRange);
     writer.WriteLong((long) MaxConnectTimeout.TotalMilliseconds);
     writer.WriteInt(MessageQueueLimit);
     writer.WriteInt(ReconnectCount);
     writer.WriteInt(SelectorsCount);
     writer.WriteInt(SlowClientQueueLimit);
     writer.WriteInt(SocketReceiveBufferSize);
     writer.WriteInt(SocketSendBufferSize);
     writer.WriteBoolean(TcpNoDelay);
     writer.WriteInt(UnacknowledgedMessagesBufferSize);
 }
示例#38
0
        /// <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);
        }
示例#39
0
        /// <summary>
        /// Writes this instance to the specified writer.
        /// </summary>
        internal void Write(IBinaryRawWriter writer)
        {
            var ipFinder = IpFinder;

            if (ipFinder != null)
            {
                writer.WriteBoolean(true);

                var finder = ipFinder as TcpDiscoveryIpFinderBase;

                if (finder == null)
                    throw new InvalidOperationException("Unsupported IP finder: " + ipFinder.GetType());

                finder.Write(writer);
            }
            else
                writer.WriteBoolean(false);

            writer.WriteLong((long) SocketTimeout.TotalMilliseconds);
            writer.WriteLong((long) AckTimeout.TotalMilliseconds);
            writer.WriteLong((long) MaxAckTimeout.TotalMilliseconds);
            writer.WriteLong((long) NetworkTimeout.TotalMilliseconds);
            writer.WriteLong((long) JoinTimeout.TotalMilliseconds);
        }