// Token: 0x06001218 RID: 4632 RVA: 0x0004AFF8 File Offset: 0x000491F8 public DbCopyHealthInfo AddNewDbCopy(AmServerName serverName) { DbCopyHealthInfo dbCopyHealthInfo = new DbCopyHealthInfo(this.DbGuid, this.DbName, serverName); this.DbServerInfos[serverName] = dbCopyHealthInfo; return(dbCopyHealthInfo); }
// Token: 0x060011D8 RID: 4568 RVA: 0x0004A898 File Offset: 0x00048A98 private bool DatabaseMatchPredicateWrapper(IADDatabase db, AmServerName serverName, Func <DbHealthInfo, DbCopyHealthInfo, bool> matchPredicate) { DbHealthInfo dbHealthInfo = this.m_dbServerInfos[db.Guid]; DbCopyHealthInfo dbCopy = dbHealthInfo.GetDbCopy(serverName); return(!dbHealthInfo.SkippedFromMonitoring.IsSuccess && matchPredicate(dbHealthInfo, dbCopy)); }
// 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); }); }
// Token: 0x060011FC RID: 4604 RVA: 0x0004AD70 File Offset: 0x00048F70 public bool IsCopyHealthy(DbCopyHealthInfo copyInfo, Func <DbCopyHealthInfo, StateTransitionInfo> healthCheckStateGetter) { if (!copyInfo.CopyFoundInAD.IsSuccess) { return(false); } if (!copyInfo.CopyStatusRetrieved.IsSuccess) { return(false); } StateTransitionInfo stateTransitionInfo = healthCheckStateGetter(copyInfo); return(stateTransitionInfo.IsSuccess); }
// Token: 0x06001217 RID: 4631 RVA: 0x0004AFB0 File Offset: 0x000491B0 public DbCopyHealthInfo GetOrAddDbCopy(AmServerName serverName) { DbCopyHealthInfo dbCopyHealthInfo; if (!this.ContainsDbCopy(serverName)) { dbCopyHealthInfo = new DbCopyHealthInfo(this.DbGuid, this.DbName, serverName); this.DbServerInfos[serverName] = dbCopyHealthInfo; } else { dbCopyHealthInfo = this.DbServerInfos[serverName]; } return(dbCopyHealthInfo); }
// Token: 0x060011C9 RID: 4553 RVA: 0x00049B94 File Offset: 0x00047D94 public void ReportDbCopyStatusFound(Guid dbGuid, string dbName, AmServerName serverName, CopyStatusClientCachedEntry status) { base.WriterLockedOperation(delegate { DbCopyHealthInfo orAddDbCopyHealthInfo = this.GetOrAddDbCopyHealthInfo(dbGuid, dbName, serverName); orAddDbCopyHealthInfo.LastTouchedTime = DateTime.UtcNow; if (status.Result == CopyStatusRpcResult.Success) { orAddDbCopyHealthInfo.CopyStatusRetrieved.ReportSuccess(); orAddDbCopyHealthInfo.LastCopyStatusTransitionTime = status.CopyStatus.LastStatusTransitionTime; this.ReportTransition(orAddDbCopyHealthInfo.CopyIsAvailable, status.CopyStatus.IsLastCopyAvailabilityChecksPassed); this.ReportTransition(orAddDbCopyHealthInfo.CopyIsRedundant, status.CopyStatus.IsLastCopyRedundancyChecksPassed); this.ReportTransition(orAddDbCopyHealthInfo.CopyStatusHealthy, status.CopyStatus.CopyStatus == CopyStatusEnum.Healthy); this.ReportTransition(orAddDbCopyHealthInfo.CopyStatusActive, status.CopyStatus.IsActiveCopy()); this.ReportTransition(orAddDbCopyHealthInfo.CopyStatusMounted, status.CopyStatus.CopyStatus == CopyStatusEnum.Mounted); return; } orAddDbCopyHealthInfo.CopyStatusRetrieved.ReportFailure(); }); }
// Token: 0x0600121B RID: 4635 RVA: 0x0004B194 File Offset: 0x00049394 public void InitializeFromSerializable(DbHealthInfoPersisted dbHip) { this.DbFoundInAD = StateTransitionInfo.ConstructFromPersisted(dbHip.DbFoundInAD); this.SkippedFromMonitoring = StateTransitionInfo.ConstructFromPersisted(dbHip.SkippedFromMonitoring); if (dbHip.DbCopies != null) { foreach (DbCopyHealthInfoPersisted dbCopyHealthInfoPersisted in dbHip.DbCopies) { AmServerName serverName = new AmServerName(dbCopyHealthInfoPersisted.ServerFqdn); DbCopyHealthInfo dbCopyHealthInfo = this.AddNewDbCopy(serverName); dbCopyHealthInfo.InitializeFromSerializable(dbCopyHealthInfoPersisted); } } DbAvailabilityRedundancyInfo dbAvailabilityRedundancyInfo = this.DbAvailabilityRedundancyInfo; dbAvailabilityRedundancyInfo.AvailabilityInfo[1] = StateTransitionInfo.ConstructFromPersisted(dbHip.IsAtLeast1AvailableCopy); dbAvailabilityRedundancyInfo.AvailabilityInfo[2] = StateTransitionInfo.ConstructFromPersisted(dbHip.IsAtLeast2AvailableCopy); dbAvailabilityRedundancyInfo.AvailabilityInfo[3] = StateTransitionInfo.ConstructFromPersisted(dbHip.IsAtLeast3AvailableCopy); dbAvailabilityRedundancyInfo.AvailabilityInfo[4] = StateTransitionInfo.ConstructFromPersisted(dbHip.IsAtLeast4AvailableCopy); dbAvailabilityRedundancyInfo.RedundancyInfo[1] = StateTransitionInfo.ConstructFromPersisted(dbHip.IsAtLeast1RedundantCopy); dbAvailabilityRedundancyInfo.RedundancyInfo[2] = StateTransitionInfo.ConstructFromPersisted(dbHip.IsAtLeast2RedundantCopy); dbAvailabilityRedundancyInfo.RedundancyInfo[3] = StateTransitionInfo.ConstructFromPersisted(dbHip.IsAtLeast3RedundantCopy); dbAvailabilityRedundancyInfo.RedundancyInfo[4] = StateTransitionInfo.ConstructFromPersisted(dbHip.IsAtLeast4RedundantCopy); }