Exemplo n.º 1
0
        /// <summary>
        /// Writes this instance to the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="srvVer">Server version.</param>
        internal void Write(IBinaryRawWriter writer, ClientProtocolVersion srvVer)
        {
            Debug.Assert(writer != null);

            writer.WriteString(StoragePath);
            writer.WriteTimeSpanAsLong(CheckpointFrequency);
            writer.WriteInt(CheckpointThreads);
            writer.WriteTimeSpanAsLong(LockWaitTime);
            writer.WriteInt(WalHistorySize);
            writer.WriteInt(WalSegments);
            writer.WriteInt(WalSegmentSize);
            writer.WriteString(WalPath);
            writer.WriteString(WalArchivePath);
            writer.WriteInt((int)WalMode);
            writer.WriteInt(WalThreadLocalBufferSize);
            writer.WriteTimeSpanAsLong(WalFlushFrequency);
            writer.WriteLong(WalFsyncDelayNanos);
            writer.WriteInt(WalRecordIteratorBufferSize);
            writer.WriteBoolean(AlwaysWriteFullPages);
            writer.WriteBoolean(MetricsEnabled);
            writer.WriteInt(MetricsSubIntervalCount);
            writer.WriteTimeSpanAsLong(MetricsRateTimeInterval);
            writer.WriteInt((int)CheckpointWriteOrder);
            writer.WriteBoolean(WriteThrottlingEnabled);
            writer.WriteBoolean(WalCompactionEnabled);
            writer.WriteLong(MaxWalArchiveSize);

            writer.WriteLong(SystemRegionInitialSize);
            writer.WriteLong(SystemRegionMaxSize);
            writer.WriteInt(PageSize);
            writer.WriteInt(ConcurrencyLevel);
            writer.WriteTimeSpanAsLong(WalAutoArchiveAfterInactivity);
            writer.WriteTimeSpanAsLongNullable(CheckpointReadLockTimeout);
            writer.WriteInt((int)WalPageCompression);
            writer.WriteIntNullable(WalPageCompressionLevel);

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

                foreach (var region in DataRegionConfigurations)
                {
                    if (region == null)
                    {
                        throw new IgniteException(
                                  "DataStorageConfiguration.DataRegionConfigurations must not contain null items.");
                    }

                    region.Write(writer, srvVer);
                }
            }
            else
            {
                writer.WriteInt(0);
            }

            if (DefaultDataRegionConfiguration != null)
            {
                writer.WriteBoolean(true);
                DefaultDataRegionConfiguration.Write(writer, srvVer);
            }
            else
            {
                writer.WriteBoolean(false);
            }
        }