private void Initialize(InformationEvent infoEvent) { this.informationEvent = infoEvent; // All information records are currently barrier records this.isBarrierRecord = true; }
private static void RaiseInformationEvent(string eventName) { // Usamos el nombre "_event" porque "event" es una keyword. InformationEvent _event = new InformationEvent(); _event.EventName = eventName; _event.Notify(); }
internal InformationLogRecord( LogicalSequenceNumber lsn, PhysicalLogRecord linkedPhysicalRecord, InformationEvent informationEvent) : base(LogRecordType.Information, lsn, linkedPhysicalRecord) { this.Initialize(informationEvent); this.UpdateApproximateDiskSize(); }
/// <summary> /// Append information record /// </summary> public void Information(InformationEvent informationEvent) { lock (lsnOrderingLock) { this.LastInformationRecord = new InformationLogRecord( this.CurrentLogTailLsn, this.LastLinkedPhysicalRecord, informationEvent); this.LogManager.PhysicalLogWriter.InsertBufferedRecord(this.LastInformationRecord); } }
private void AnalysePacket(MCPPacket packet) { lock (ipCounterTable) { IPAddress ipKey = packet.IpAddress; bool isNew = false; if (ipCounterTable.ContainsKey(ipKey)) { if (ipCounterTable[ipKey] < packet.Number || packet.State == MCPState.Reset) { ipCounterTable[ipKey] = packet.Number; isNew = true; } } else { ipCounterTable.Add(ipKey, packet.Number); isNew = true; } if (isNew) { switch (packet.State) { case MCPState.Information: InformationEvent?.Invoke(this, new InformationEventArgs() { Address = packet.IpAddress, Port = packet.Port, Information = packet.Information }); break; case MCPState.MaintainConnection: MaintainEvent?.Invoke(this, new MaintainEventArgs() { Address = packet.IpAddress, Port = packet.Port }); break; case MCPState.Close: CloseEvent?.Invoke(this, new CloseEventArgs() { Address = packet.IpAddress, Port = packet.Port }); ipCounterTable.Remove(ipKey); break; default: break; } } } }
public async Task FlushInformationRecordAsync( InformationEvent type, bool closeLog, string flushInitiator) { lock (lsnOrderingLock) { this.Information(type); if (closeLog) { this.LogManager.PrepareToClose(); } } await this.LogManager.FlushAsync(flushInitiator).ConfigureAwait(false); }
/// ------------------------------------------------------------------------------------------------------------------------------------------------------------- /// Awake /// ------------------------------------------------------------------------------------------------------------------------------------------------------------- /// <summary> The Awake method of MonoBehaviour interface. </summary> private void Awake() { // Event instances are created. EventSetCamera = new CameraEvent(); EventSetInformation = new InformationEvent(); }
private InformationLogRecord() : base() { this.informationEvent = InformationEvent.Invalid; this.isBarrierRecord = false; }
internal InformationLogRecord(LogRecordType recordType, ulong recordPosition, long lsn) : base(recordType, recordPosition, lsn) { Utility.Assert(recordType == LogRecordType.Information, "recordType == LogRecordType.Information"); this.informationEvent = InformationEvent.Invalid; }