Beispiel #1
0
        public ReplicationCheckOutcome GetCheckOutcome()
        {
            ReplicationCheckResultEnum checkResultEnum         = this.GetCheckResultEnum();
            ReplicationCheckOutcome    replicationCheckOutcome = new ReplicationCheckOutcome(this.m_check);

            if (checkResultEnum == ReplicationCheckResultEnum.Passed)
            {
                replicationCheckOutcome.Update(new ReplicationCheckResult(checkResultEnum), null);
                return(replicationCheckOutcome);
            }
            string newErrorMessage = this.BuildErrorMessageForOutcome();

            replicationCheckOutcome.Update(new ReplicationCheckResult(checkResultEnum), newErrorMessage);
            return(replicationCheckOutcome);
        }
 public static bool TryGetReplicationEventInfo(CheckId checkId, ReplicationCheckResultEnum result, out ReplicationEventBaseInfo eventInfo)
 {
     eventInfo = null;
     if (ReplicationEventLookupTable.s_checksEventTable.ContainsKey((int)checkId))
     {
         if (ReplicationEventLookupTable.s_checksEventTable[(int)checkId].ContainsKey((int)result))
         {
             eventInfo = ReplicationEventLookupTable.s_checksEventTable[(int)checkId][(int)result];
             return(true);
         }
         DiagCore.RetailAssert(false, "Missing event entry for CheckId {0} and result {1}.", new object[]
         {
             checkId,
             result
         });
     }
     return(false);
 }
Beispiel #3
0
        public void LogEvents(CheckId checkId, ReplicationCheckResultEnum result, List <MessageInfo> messages)
        {
            ReplicationEventBaseInfo replicationEventBaseInfo = null;

            if (!ReplicationEventLookupTable.TryGetReplicationEventInfo(checkId, result, out replicationEventBaseInfo))
            {
                ExTraceGlobals.HealthChecksTracer.TraceDebug <CheckId, ReplicationCheckResultEnum>((long)this.GetHashCode(), "LogEvents(): Could not find ReplicationEventBaseInfo for Check '{0}' with Result '{1}'.", checkId, result);
                return;
            }
            if (replicationEventBaseInfo.EventType == ReplicationEventType.Null)
            {
                ExTraceGlobals.HealthChecksTracer.TraceDebug <CheckId, ReplicationCheckResultEnum>((long)this.GetHashCode(), "LogEvents(): NullEventInfo encountered for check {0} and result {1}. No event will be logged.", checkId, result);
                return;
            }
            if (replicationEventBaseInfo.EventType != ReplicationEventType.MOM)
            {
                if (replicationEventBaseInfo.EventType == ReplicationEventType.AppLog)
                {
                    bool flag = false;
                    Dictionary <string, ReplicationEvent> dictionary = null;
                    if (!this.m_AppLogSingleEvents.TryGetValue((int)checkId, out dictionary))
                    {
                        dictionary = new Dictionary <string, ReplicationEvent>();
                        flag       = true;
                    }
                    foreach (MessageInfo messageInfo in messages)
                    {
                        if (messageInfo.IsTransitioningState)
                        {
                            ReplicationEvent replicationEvent = new ReplicationEvent(replicationEventBaseInfo);
                            replicationEvent.AddEvent(messageInfo.Message);
                            dictionary[messageInfo.InstanceIdentity] = replicationEvent;
                        }
                    }
                    if (flag)
                    {
                        this.m_AppLogSingleEvents[(int)checkId] = dictionary;
                        return;
                    }
                }
                else
                {
                    DiagCore.RetailAssert(false, "Unhandled ReplicationEventType!", new object[0]);
                }
                return;
            }
            int              momEventId   = ((MomEventInfo)replicationEventBaseInfo).MomEventId;
            string           eventMessage = this.BuildErrorMessageForMomEvent(messages);
            ReplicationEvent replicationEvent2;

            if (this.m_MomEvents.TryGetValue(momEventId, out replicationEvent2))
            {
                ExTraceGlobals.HealthChecksTracer.TraceDebug <int>((long)this.GetHashCode(), "LogEvent(): Attempting to add another eventId {0}, having logged it already.", momEventId);
                replicationEvent2.AddEvent(eventMessage);
                return;
            }
            ExTraceGlobals.HealthChecksTracer.TraceDebug <int>((long)this.GetHashCode(), "LogEvent(): Attempting to add eventId {0} for the first time.", momEventId);
            replicationEvent2 = new ReplicationEvent(replicationEventBaseInfo);
            replicationEvent2.AddEvent(eventMessage);
            this.m_MomEvents[momEventId] = replicationEvent2;
        }
Beispiel #4
0
 internal ReplicationCheckResult(ReplicationCheckResultEnum result) : base(new SimpleProviderPropertyBag())
 {
     this.Value = result;
 }
Beispiel #5
0
 public ReplicationCheckResultToStringCaseNotHandled(ReplicationCheckResultEnum result, Exception innerException) : base(Strings.ReplicationCheckResultToStringCaseNotHandled(result), innerException)
 {
     this.result = result;
 }
Beispiel #6
0
 public ReplicationCheckResultToStringCaseNotHandled(ReplicationCheckResultEnum result) : base(Strings.ReplicationCheckResultToStringCaseNotHandled(result))
 {
     this.result = result;
 }