예제 #1
0
        private List <AmServerName> DetermineServersToContact()
        {
            Guid        guid = this.Database.Guid;
            IADDatabase db   = this.Database;

            IADDatabaseCopy[] databaseCopies = AmBestCopySelectionHelper.GetDatabaseCopies(guid, ref db);
            if (db != null)
            {
                this.Database = db;
            }
            AmConfig amConfig = AmSystemManager.Instance.Config;

            if (amConfig.IsUnknown)
            {
                AmTrace.Error("AmMultiNodeRpcNotifier: DB {0}: Invalid AM configuration", new object[]
                {
                    db.Name
                });
                throw new AmInvalidConfiguration(amConfig.LastError ?? string.Empty);
            }
            IAmBcsErrorLogger errorLogger = new AmBcsSingleCopyFailureLogger();
            AmBcsServerChecks checksToRun = AmBcsServerChecks.ClusterNodeUp;

            if (this.ActionCode.IsAutomaticOperation)
            {
                checksToRun |= AmBcsServerChecks.DebugOptionDisabled;
            }
            IEnumerable <AmServerName> source = from dbCopy in databaseCopies
                                                where this.ValidateServer(new AmServerName(dbCopy.HostServerName), db, amConfig, checksToRun, errorLogger)
                                                select new AmServerName(dbCopy.HostServerName);

            return(source.ToList <AmServerName>());
        }
예제 #2
0
        protected virtual Dictionary <AmServerName, int> BuildActivationPreferenceCache(Guid dbGuid, ref IADDatabase database)
        {
            IADDatabaseCopy[] databaseCopies          = AmBestCopySelectionHelper.GetDatabaseCopies(dbGuid, ref database);
            Dictionary <AmServerName, int> dictionary = new Dictionary <AmServerName, int>(databaseCopies.Length);

            foreach (IADDatabaseCopy iaddatabaseCopy in databaseCopies)
            {
                AmServerName key = new AmServerName(iaddatabaseCopy.HostServerName);
                dictionary[key] = iaddatabaseCopy.ActivationPreference;
            }
            return(dictionary);
        }
예제 #3
0
        // Token: 0x060006F3 RID: 1779 RVA: 0x00021310 File Offset: 0x0001F510
        private void PopulateDatabaseCopiesIfNecessary()
        {
            if (this.m_dbCopies != null)
            {
                return;
            }
            IADDatabaseCopy[] dbCopies = null;
            Guid        dbGuid         = this.m_bcsContext.DatabaseGuid;
            IADDatabase database       = this.m_bcsContext.Database;

            this.m_perfTracker.RunTimedOperation(BcsOperation.GetDatabaseCopies, delegate
            {
                dbCopies = AmBestCopySelectionHelper.GetDatabaseCopies(dbGuid, ref database);
            });
            if (database != null)
            {
                this.m_bcsContext.Database = database;
            }
            this.m_dbCopies = dbCopies;
        }