Example #1
0
        // Token: 0x060001A5 RID: 421 RVA: 0x0000A400 File Offset: 0x00008600
        internal AmDbStatusInfo2 AmServerGetServerForDatabase(Guid mdbGuid)
        {
            ActiveManagerServerPerfmon.GetServerForDatabaseServerCalls.Increment();
            ActiveManagerServerPerfmon.GetServerForDatabaseServerCallsPerSec.Increment();
            AmServerDbStatusInfoCache statusInfoCache = AmSystemManager.Instance.StatusInfoCache;

            return(statusInfoCache.GetEntry(mdbGuid));
        }
Example #2
0
        internal static AmDbStatusInfo2 GetServerForDatabase(Guid mdbGuid)
        {
            AmConfig config = AmSystemManager.Instance.Config;

            if (config.IsUnknown)
            {
                AmTrace.Error("GetSFD: Invalid configuration (db={0})", new object[]
                {
                    mdbGuid
                });
                throw new AmInvalidConfiguration(config.LastError);
            }
            AmDbStateInfo stateInfo = config.DbState.Read(mdbGuid);

            return(AmServerDbStatusInfoCache.ConvertToDbStatusInfo(stateInfo));
        }
Example #3
0
        internal AmDbStatusInfo2 GetEntry(Guid databaseGuid)
        {
            AmConfig config = AmSystemManager.Instance.Config;

            if (config.IsUnknown)
            {
                AmTrace.Error("GetSFD: Invalid configuration (db={0})", new object[]
                {
                    databaseGuid
                });
                throw new AmInvalidConfiguration(config.LastError);
            }
            string text = config.DbState.ReadStateString(databaseGuid);

            AmServerDbStatusInfoCache.StringStatusInfoPair stringStatusInfoPair = null;
            AmDbStatusInfo2 amDbStatusInfo = null;

            lock (this.m_locker)
            {
                this.m_cacheMap.TryGetValue(databaseGuid, out stringStatusInfoPair);
            }
            if (stringStatusInfoPair != null && text != null && string.Equals(text, stringStatusInfoPair.RawStateString))
            {
                amDbStatusInfo = stringStatusInfoPair.StatusInfo;
            }
            else
            {
                AmDbStateInfo stateInfo = AmDbStateInfo.Parse(databaseGuid, text);
                amDbStatusInfo       = AmServerDbStatusInfoCache.ConvertToDbStatusInfo(stateInfo);
                stringStatusInfoPair = new AmServerDbStatusInfoCache.StringStatusInfoPair(text, amDbStatusInfo);
                lock (this.m_locker)
                {
                    AmTrace.Debug("Updating cache for database {0}.", new object[]
                    {
                        databaseGuid
                    });
                    this.m_cacheMap[databaseGuid] = stringStatusInfoPair;
                }
            }
            return(amDbStatusInfo);
        }