Пример #1
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);
        }
Пример #2
0
 /// <summary>
 /// Writes this instance to the specified writer.
 /// </summary>
 internal void Write(IBinaryRawWriter writer)
 {
     writer.WriteInt(AckSendThreshold);
     writer.WriteInt(ConnectionsPerNode);
     writer.WriteLong((long)ConnectTimeout.TotalMilliseconds);
     writer.WriteBoolean(DirectBuffer);
     writer.WriteBoolean(DirectSendBuffer);
     writer.WriteBoolean(FilterReachableAddresses);
     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.WriteLong(SelectorSpins);
     writer.WriteInt(-1);
     writer.WriteInt(SlowClientQueueLimit);
     writer.WriteInt(SocketReceiveBufferSize);
     writer.WriteInt(SocketSendBufferSize);
     writer.WriteLong(SocketWriteTimeout);
     writer.WriteBoolean(TcpNoDelay);
     writer.WriteInt(UnacknowledgedMessagesBufferSize);
     writer.WriteBoolean(UsePairedConnections);
 }
Пример #3
0
        /// <summary>
        /// Writes this instance to a writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        internal void Write(IBinaryRawWriter writer)
        {
            Debug.Assert(writer != null);

            writer.WriteLong(SystemCacheInitialSize);
            writer.WriteLong(SystemCacheMaxSize);
            writer.WriteInt(PageSize);
            writer.WriteInt(ConcurrencyLevel);
            writer.WriteString(DefaultMemoryPolicyName);

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

                foreach (var policy in MemoryPolicies)
                {
                    if (policy == null)
                    {
                        throw new IgniteException("MemoryConfiguration.MemoryPolicies must not contain null items.");
                    }

                    policy.Write(writer);
                }
            }
            else
            {
                writer.WriteInt(0);
            }
        }
Пример #4
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.WriteLong(InitialSize);
            writer.WriteLong(MaxSize);
        }
        /// <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);
            }
        }
Пример #6
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);
        }
Пример #7
0
        /// <summary>
        /// Writes the policy.
        /// </summary>
        public static void WritePolicy(IBinaryRawWriter writer, IExpiryPolicy plc)
        {
            Debug.Assert(plc != null);
            Debug.Assert(writer != null);

            writer.WriteLong(ConvertDuration(plc.GetExpiryForCreate()));
            writer.WriteLong(ConvertDuration(plc.GetExpiryForUpdate()));
            writer.WriteLong(ConvertDuration(plc.GetExpiryForAccess()));
        }
Пример #8
0
        /// <summary>
        /// Writes the policy.
        /// </summary>
        public static void WritePolicy(IBinaryRawWriter writer, IExpiryPolicy plc)
        {
            Debug.Assert(plc != null);
            Debug.Assert(writer != null);

            writer.WriteLong(ConvertDuration(plc.GetExpiryForCreate()));
            writer.WriteLong(ConvertDuration(plc.GetExpiryForUpdate()));
            writer.WriteLong(ConvertDuration(plc.GetExpiryForAccess()));
        }
Пример #9
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);
 }
Пример #10
0
        /// <summary>
        /// Serializes content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteLong(StartDate.ToBinary());
            writer.WriteLong(EndDate.ToBinary());
            writer.WriteLong(Interval.Ticks);
        }
 /// <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);
 }
Пример #12
0
        /// <summary>
        /// Writes this instance.
        /// </summary>
        internal void Write(IBinaryRawWriter writer)
        {
            writer.WriteLong(MaxEventCount);

            if (ExpirationTimeout == TimeSpan.MaxValue || ExpirationTimeout < TimeSpan.Zero)
            {
                writer.WriteLong(long.MaxValue);
            }
            else
            {
                writer.WriteLong((long)ExpirationTimeout.TotalMilliseconds);
            }
        }
Пример #13
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);
            }
        }
Пример #14
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);
 }
Пример #15
0
        /// <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);
        }
Пример #16
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);
        }
Пример #17
0
        /// <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);
        }
Пример #18
0
        public void ToBinary(IBinaryRawWriter writer)
        {
            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteGuid(ProjectUID);
            writer.WriteLong(InsertUTCTicks);
        }
Пример #19
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);
            }
        }
Пример #20
0
        /// <summary>
        /// Serializes content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteLong(Date.ToBinary());
            writer.WriteBoolean(Volume != null);
            Volume?.ToBinary(writer);
        }
Пример #21
0
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteGuid(OriginatingIgniteNodeId);
            writer.WriteGuid(ExternalDescriptor);
            writer.WriteLong(RequestEmissionDateUtc.ToBinary());
        }
Пример #22
0
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            base.InternalToBinary(writer);

            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteBoolean(Undo);
            writer.WriteGuid(ProjectID);
            writer.WriteGuid(AssetID);
            writer.WriteLong(StartUTC.ToBinary());
            writer.WriteLong(EndUTC.ToBinary());
            writer.WriteString(MachineDesignName);
            writer.WriteBoolean(LayerID.HasValue);
            if (LayerID.HasValue)
            {
                writer.WriteInt(LayerID.Value);
            }
        }
        /// <summary>
        /// Writes this object to the given writer.
        /// </summary>
        public void WriteBinary(IBinaryRawWriter writer, bool changesOnly)
        {
            ((IgniteSessionStateItemCollection)Items).WriteBinary(writer, changesOnly);
            writer.WriteByteArray(SerializeStaticObjects());
            writer.WriteInt(Timeout);

            writer.WriteGuid(LockNodeId);
            writer.WriteLong(LockId);
            writer.WriteTimestamp(LockTime);
        }
Пример #24
0
        /// <summary>
        /// Writes this object to the given writer.
        /// </summary>
        public void WriteBinary(IBinaryRawWriter writer, bool changesOnly)
        {
            ((IgniteSessionStateItemCollection)Items).WriteBinary(writer, changesOnly);
            writer.WriteByteArray(SerializeStaticObjects());
            writer.WriteInt(Timeout);

            writer.WriteGuid(LockNodeId);
            writer.WriteLong(LockId);
            writer.WriteTimestamp(LockTime);
        }
Пример #25
0
        /// <summary>
        /// Writes the lock info.
        /// </summary>
        private void WriteLockInfo(IBinaryRawWriter writer, long lockId, bool writeTime = false)
        {
            writer.WriteGuid(Cache.Ignite.GetCluster().GetLocalNode().Id);
            writer.WriteLong(lockId);

            if (writeTime)
            {
                writer.WriteTimestamp(DateTime.UtcNow);
            }
        }
Пример #26
0
        /// <summary>
        /// Writes the remote query.
        /// </summary>
        /// <param name="filter">The filter.</param>
        /// <param name="timeout">The timeout.</param>
        /// <param name="types">The types.</param>
        /// <param name="writer">The writer.</param>
        private static void WriteRemoteQuery <T>(IEventFilter <T> filter, TimeSpan?timeout, int[] types,
                                                 IBinaryRawWriter writer)
            where T : IEvent
        {
            writer.WriteObject(filter);

            writer.WriteLong((long)(timeout == null ? 0 : timeout.Value.TotalMilliseconds));

            WriteEventTypes(types, writer);
        }
Пример #27
0
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteLong(InsertUTC.ToBinary());
            writer.WriteByteArray(Content);
            writer.WriteGuid(ProjectUID);
            writer.WriteGuid(MachineUid);
            writer.WriteInt((int)Operation);
            writer.WriteInt((int)Origin);
        }
Пример #28
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);
            }
        }
 /// <summary>
 /// Writes the nullable long.
 /// </summary>
 public static void WriteLongNullable(this IBinaryRawWriter writer, long?value)
 {
     if (value != null)
     {
         writer.WriteBoolean(true);
         writer.WriteLong(value.Value);
     }
     else
     {
         writer.WriteBoolean(false);
     }
 }
Пример #30
0
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteLong(InsertUTC.ToBinary());
            writer.WriteString(FileName);
            writer.WriteByteArray(Content);
            writer.WriteGuid(ProjectID);
            writer.WriteGuid(AssetID);
            writer.WriteBoolean(IsJohnDoe);
            writer.WriteInt((int)SubmissionFlags);
            writer.WriteInt((int)OriginSource);
        }
Пример #31
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);
        }
Пример #32
0
        /// <summary>
        /// Serialises content to the writer
        /// </summary>
        public override void InternalToBinary(IBinaryRawWriter writer)
        {
            VersionSerializationHelper.EmitVersionByte(writer, VERSION_NUMBER);

            writer.WriteInt((int)ReturnCode);
            writer.WriteBoolean(Value.HasValue);
            if (Value.HasValue)
            {
                writer.WriteDouble(Value.Value);
            }
            writer.WriteBoolean(TimeStampUTC.HasValue);
            if (TimeStampUTC.HasValue)
            {
                writer.WriteLong(TimeStampUTC.Value.ToBinary());
            }
        }
Пример #33
0
 /// <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);
 }
Пример #34
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);
        }
Пример #35
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);
        }
Пример #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);
        }
Пример #37
0
        /// <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);
        }
Пример #38
0
        /// <summary>
        /// Writes the key.
        /// </summary>
        private static void WriteKey(DbCacheKey key, IBinaryRawWriter writer, bool includeNames)
        {
            writer.WriteString(key.Key);

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

                // Versions should be in the same order, so we can't iterate over the dictionary.
                foreach (var entitySet in key.EntitySets)
                {
                    writer.WriteLong(key.EntitySetVersions[entitySet.Name]);

                    if (includeNames)
                        writer.WriteString(entitySet.Name);
                }
            }
            else
            {
                writer.WriteInt(-1);
            }
        }