public static bool TryGetReplicationEventInfo(int momEventId, out MomEventInfo eventInfo)
 {
     eventInfo = null;
     if (ReplicationEventLookupTable.s_momEventsTable.ContainsKey(momEventId))
     {
         eventInfo = ReplicationEventLookupTable.s_momEventsTable[momEventId];
         return(true);
     }
     return(false);
 }
Example #2
0
        public MonitoringEvent ConvertToMonitoringEvent(string momEventSource, bool appendMachineInfo)
        {
            if (!this.IsMomEvent)
            {
                return(null);
            }
            string eventMessage = this.GetEventMessage(appendMachineInfo);

            if (eventMessage == null)
            {
                return(null);
            }
            MomEventInfo momEventInfo = (MomEventInfo)this.m_EventInfo;

            return(new MonitoringEvent(momEventSource, momEventInfo.MomEventId, momEventInfo.MomEventType, eventMessage));
        }
Example #3
0
        public void LogEvent(int momEventId, string eventMessage)
        {
            ReplicationEvent replicationEvent;

            if (this.m_MomEvents.TryGetValue(momEventId, out replicationEvent))
            {
                ExTraceGlobals.HealthChecksTracer.TraceDebug <int>((long)this.GetHashCode(), "LogEvent(): Attempting to add another eventId {0}, having logged it already.", momEventId);
                replicationEvent.AddEvent(eventMessage);
                return;
            }
            MomEventInfo eventInfo = null;

            if (!ReplicationEventLookupTable.TryGetReplicationEventInfo(momEventId, out eventInfo))
            {
                ExTraceGlobals.HealthChecksTracer.TraceDebug <int>((long)this.GetHashCode(), "LogEvent(): Couldn't find MOM EventInfo for MOM Event ID {0}.", momEventId);
                return;
            }
            ExTraceGlobals.HealthChecksTracer.TraceDebug <int>((long)this.GetHashCode(), "LogEvent(): Attempting to add eventId {0} for the first time.", momEventId);
            replicationEvent = new ReplicationEvent(eventInfo);
            replicationEvent.AddEvent(eventMessage);
            this.m_MomEvents[momEventId] = replicationEvent;
        }