예제 #1
0
        private DbHealthInfo AddNewDbHealthInfo(Guid dbGuid, string dbName)
        {
            DbHealthInfo dbHealthInfo = new DbHealthInfo(dbGuid, dbName);

            this.m_dbServerInfos[dbGuid] = dbHealthInfo;
            return(dbHealthInfo);
        }
 // Token: 0x060011C8 RID: 4552 RVA: 0x00049A30 File Offset: 0x00047C30
 public void ReportDbCopyFoundInAD(IADDatabase db, AmServerName serverName)
 {
     base.WriterLockedOperation(delegate
     {
         DbHealthInfo orAddDbHealthInfo = this.GetOrAddDbHealthInfo(db.Guid, db.Name);
         this.ReportTransition(orAddDbHealthInfo.DbFoundInAD, true);
         bool conditionMet = !DatabaseHealthMonitor.ShouldMonitorDatabase(db);
         this.ReportTransition(orAddDbHealthInfo.SkippedFromMonitoring, conditionMet);
         DbCopyHealthInfo orAddDbCopy = orAddDbHealthInfo.GetOrAddDbCopy(serverName);
         DateTime utcNow             = DateTime.UtcNow;
         orAddDbCopy.LastTouchedTime = utcNow;
         this.ReportTransition(orAddDbCopy.CopyFoundInAD, true);
     });
 }
예제 #3
0
        // Token: 0x060011FA RID: 4602 RVA: 0x0004AC4C File Offset: 0x00048E4C
        public void Update()
        {
            DbHealthInfo dbInfo = this.DbInfo;

            if (!dbInfo.DbFoundInAD.IsSuccess || dbInfo.DbServerInfos.Count == 0)
            {
                this.AvailabilityInfo.UpdateStates(0);
                this.RedundancyInfo.UpdateStates(0);
                return;
            }
            this.AvailabilityCount = this.GetHealthyCopyCount((DbCopyHealthInfo copyInfo) => copyInfo.CopyIsAvailable);
            this.RedundancyCount   = this.GetHealthyCopyCount((DbCopyHealthInfo copyInfo) => copyInfo.CopyIsRedundant);
            this.AvailabilityInfo.UpdateStates(this.AvailabilityCount);
            this.RedundancyInfo.UpdateStates(this.RedundancyCount);
        }
        // Token: 0x060011D4 RID: 4564 RVA: 0x0004A808 File Offset: 0x00048A08
        private DbHealthInfo GetOrAddDbHealthInfo(Guid dbGuid, string dbName)
        {
            DbHealthInfo dbHealthInfo;

            if (!this.m_dbServerInfos.ContainsKey(dbGuid))
            {
                dbHealthInfo = new DbHealthInfo(dbGuid, dbName);
                this.m_dbServerInfos[dbGuid] = dbHealthInfo;
            }
            else
            {
                dbHealthInfo        = this.m_dbServerInfos[dbGuid];
                dbHealthInfo.DbName = dbName;
            }
            return(dbHealthInfo);
        }
 // Token: 0x060011CF RID: 4559 RVA: 0x0004A708 File Offset: 0x00048908
 public void InitializeFromHealthInfoPersisted(HealthInfoPersisted hip)
 {
     if (hip == null)
     {
         DbCopyHealthInfoInternalTable.Tracer.TraceDebug((long)this.GetHashCode(), "InitializeFromHealthInfoPersisted() received <NULL> for 'hip'. Ignoring and starting a new health info table.");
         return;
     }
     base.WriterLockedOperation(delegate
     {
         this.CreateTimeUtc     = this.ParseIntoDateTime(hip.CreateTimeUtcStr);
         this.LastUpdateTimeUtc = this.ParseIntoDateTime(hip.LastUpdateTimeUtcStr);
         DbCopyHealthInfoInternalTable.Tracer.TraceDebug <string, string>((long)this.GetHashCode(), "InitializeHealthInfoFromXML: LastUpdateTimeUtc from XML file: {0}, CreateTimeUtc: {1}", DateTimeHelper.ToStringInvariantCulture(this.LastUpdateTimeUtc), DateTimeHelper.ToStringInvariantCulture(this.CreateTimeUtc));
         foreach (DbHealthInfoPersisted dbHealthInfoPersisted in hip.Databases)
         {
             DbHealthInfo dbHealthInfo = this.AddNewDbHealthInfo(dbHealthInfoPersisted.DbGuid, dbHealthInfoPersisted.DbName);
             dbHealthInfo.InitializeFromSerializable(dbHealthInfoPersisted);
         }
         foreach (ServerHealthInfoPersisted serverHealthInfoPersisted in hip.Servers)
         {
             ServerHealthInfo serverHealthInfo = this.AddNewServerHealthInfo(serverHealthInfoPersisted.ServerFqdn);
             serverHealthInfo.InitializeFromSerializable(serverHealthInfoPersisted);
         }
     });
 }
        // Token: 0x060011D1 RID: 4561 RVA: 0x0004A778 File Offset: 0x00048978
        private DbCopyHealthInfo GetOrAddDbCopyHealthInfo(Guid dbGuid, string dbName, AmServerName serverName)
        {
            DbHealthInfo orAddDbHealthInfo = this.GetOrAddDbHealthInfo(dbGuid, dbName);

            return(orAddDbHealthInfo.GetOrAddDbCopy(serverName));
        }
 // Token: 0x060011CA RID: 4554 RVA: 0x00049F40 File Offset: 0x00048140
 public void PossiblyReportObjectsNotFoundInAD(IMonitoringADConfig adConfig)
 {
     base.WriterLockedOperation(delegate
     {
         List <AmServerName> list = new List <AmServerName>();
         List <Guid> list2        = new List <Guid>();
         List <Tuple <DbHealthInfo, DbCopyHealthInfo> > list3 = new List <Tuple <DbHealthInfo, DbCopyHealthInfo> >();
         foreach (ServerHealthInfo serverHealthInfo in this.m_serverInfos.Values)
         {
             if (adConfig.LookupMiniServerByName(serverHealthInfo.ServerName) == null)
             {
                 this.ReportTransition(serverHealthInfo.ServerFoundInAD, false);
                 if (this.IsADObjectMissingTooLong(serverHealthInfo.ServerFoundInAD.FailedDuration))
                 {
                     list.Add(serverHealthInfo.ServerName);
                 }
             }
         }
         foreach (KeyValuePair <Guid, DbHealthInfo> keyValuePair in this.m_dbServerInfos)
         {
             Guid key                = keyValuePair.Key;
             DbHealthInfo value      = keyValuePair.Value;
             IADDatabase iaddatabase = null;
             bool flag               = true;
             if (adConfig.DatabaseByGuidMap.TryGetValue(key, out iaddatabase))
             {
                 flag = false;
             }
             foreach (DbCopyHealthInfo dbCopyHealthInfo in value.DbServerInfos.Values)
             {
                 bool flag2 = true;
                 if (!flag)
                 {
                     IADDatabaseCopy databaseCopy = iaddatabase.GetDatabaseCopy(dbCopyHealthInfo.ServerName.NetbiosName);
                     if (databaseCopy != null)
                     {
                         flag2 = false;
                     }
                 }
                 if (flag2)
                 {
                     this.ReportTransition(dbCopyHealthInfo.CopyFoundInAD, false);
                     if (this.IsADObjectMissingTooLong(dbCopyHealthInfo.CopyFoundInAD.FailedDuration))
                     {
                         list3.Add(new Tuple <DbHealthInfo, DbCopyHealthInfo>(value, dbCopyHealthInfo));
                     }
                 }
             }
             if (flag)
             {
                 this.ReportTransition(value.DbFoundInAD, false);
                 if (this.IsADObjectMissingTooLong(value.DbFoundInAD.FailedDuration))
                 {
                     list2.Add(key);
                 }
             }
         }
         if (list.Count > 0)
         {
             foreach (AmServerName key2 in list)
             {
                 this.m_serverInfos.Remove(key2);
             }
         }
         if (list3.Count > 0)
         {
             foreach (Tuple <DbHealthInfo, DbCopyHealthInfo> tuple in list3)
             {
                 tuple.Item1.RemoveDbCopy(tuple.Item2.ServerName);
             }
         }
         if (list2.Count > 0)
         {
             foreach (Guid key3 in list2)
             {
                 this.m_dbServerInfos.Remove(key3);
             }
         }
     });
 }
예제 #8
0
 // Token: 0x060011F9 RID: 4601 RVA: 0x0004AC15 File Offset: 0x00048E15
 public DbAvailabilityRedundancyInfo(DbHealthInfo dbInfo)
 {
     this.DbInfo           = dbInfo;
     this.RedundancyInfo   = new DbAvailabilityRedundancyInfo.NCopyStateTransitionInfo();
     this.AvailabilityInfo = new DbAvailabilityRedundancyInfo.NCopyStateTransitionInfo();
 }