/// <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(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.WriteLong(SystemRegionInitialSize);
            writer.WriteLong(SystemRegionMaxSize);
            writer.WriteInt(PageSize);
            writer.WriteInt(ConcurrencyLevel);

            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);
                }
            }
            else
            {
                writer.WriteInt(0);
            }

            if (DefaultDataRegionConfiguration != null)
            {
                writer.WriteBoolean(true);
                DefaultDataRegionConfiguration.Write(writer);
            }
            else
            {
                writer.WriteBoolean(false);
            }
        }
예제 #2
0
        /// <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);
            writer.WriteInt((int)CheckpointWriteOrder);
        }
예제 #3
0
        /// <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);
            writer.WriteTimeSpanAsLong(IdleTimeout);

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

            writer.WriteTimeSpanAsLong(HandshakeTimeout);

            // Thin client configuration.
            if (ThinClientConfiguration != null)
            {
                writer.WriteBoolean(true);
                writer.WriteInt(ThinClientConfiguration.MaxActiveTxPerConnection);
            }
            else
            {
                writer.WriteBoolean(false);
            }
        }
예제 #4
0
        /// <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 nullable boolean.
 /// </summary>
 public static void WriteTimeSpanAsLongNullable(this IBinaryRawWriter writer, TimeSpan?value)
 {
     if (value != null)
     {
         writer.WriteBoolean(true);
         writer.WriteTimeSpanAsLong(value.Value);
     }
     else
     {
         writer.WriteBoolean(false);
     }
 }
예제 #6
0
        /// <summary>
        /// Writes the SQL query.
        /// </summary>
        private static void WriteSqlQuery(IBinaryRawWriter writer, SqlQuery qry)
        {
            Debug.Assert(qry != null);

            writer.WriteString(qry.QueryType);
            writer.WriteString(qry.Sql);
            QueryBase.WriteQueryArgs(writer, qry.Arguments);
            writer.WriteBoolean(qry.EnableDistributedJoins);
            writer.WriteBoolean(qry.Local);
            writer.WriteBoolean(qry.ReplicatedOnly);
            writer.WriteInt(qry.PageSize);
            writer.WriteTimeSpanAsLong(qry.Timeout);
        }
 /// <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);
 }
        /// <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);
            }
        }
        /// <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);
            writer.WriteTimeSpanAsLong(IdleTimeout);
        }
예제 #10
0
 /// <summary>
 /// Writes this instance to a writer.
 /// </summary>
 internal void Write(IBinaryRawWriter writer)
 {
     writer.WriteString(Name);
     writer.WriteBoolean(PersistenceEnabled);
     writer.WriteLong(InitialSize);
     writer.WriteLong(MaxSize);
     writer.WriteString(SwapPath);
     writer.WriteInt((int)PageEvictionMode);
     writer.WriteDouble(EvictionThreshold);
     writer.WriteInt(EmptyPagesPoolSize);
     writer.WriteBoolean(MetricsEnabled);
     writer.WriteInt(MetricsSubIntervalCount);
     writer.WriteTimeSpanAsLong(MetricsRateTimeInterval);
     writer.WriteLong(CheckpointPageBufferSize);
 }
예제 #11
0
        /// <summary>
        /// Writes this instance to a writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        /// <param name="srvVer">Server version.</param>
        internal void Write(IBinaryRawWriter writer, ClientProtocolVersion srvVer)
        {
            writer.WriteString(Name);
            writer.WriteBoolean(PersistenceEnabled);
            writer.WriteLong(InitialSize);
            writer.WriteLong(MaxSize);
            writer.WriteString(SwapPath);
            writer.WriteInt((int)PageEvictionMode);
            writer.WriteDouble(EvictionThreshold);
            writer.WriteInt(EmptyPagesPoolSize);
            writer.WriteBoolean(MetricsEnabled);
            writer.WriteInt(MetricsSubIntervalCount);
            writer.WriteTimeSpanAsLong(MetricsRateTimeInterval);
            writer.WriteLong(CheckpointPageBufferSize);

            if (srvVer.CompareTo(ClientSocket.Ver130) >= 0)
            {
                writer.WriteBoolean(LazyMemoryAllocation);
            }
        }