Ejemplo n.º 1
0
 // Token: 0x0600046A RID: 1130 RVA: 0x00016C07 File Offset: 0x00014E07
 internal TimeBasedStoreDatabaseDriver(ThrottleGovernor parentGovernor, DatabaseInfo databaseInfo, ITimeBasedAssistantType timeBasedAssistantType, PoisonMailboxControl poisonControl, PerformanceCountersPerDatabaseInstance databaseCounters) : base(parentGovernor, databaseInfo, timeBasedAssistantType, poisonControl, databaseCounters)
 {
 }
Ejemplo n.º 2
0
        public void Start()
        {
            ExTraceGlobals.OnlineDatabaseTracer.TraceDebug <OnlineDatabase>((long)this.GetHashCode(), "{0}: Starting", this);
            bool flag  = false;
            bool flag2 = false;
            bool flag3 = false;
            EventBasedAssistantCollection eventBasedAssistantCollection = null;

            try
            {
                PoisonEventControl   poisonControl  = new PoisonEventControl(this.databaseManager.PoisonControlMaster, this.DatabaseInfo);
                PoisonMailboxControl poisonControl2 = new PoisonMailboxControl(this.databaseManager.PoisonControlMaster, this.DatabaseInfo);
                string text = this.databaseManager.ServiceName + "-" + this.DatabaseInfo.DatabaseName;
                ExTraceGlobals.OnlineDatabaseTracer.TraceDebug <OnlineDatabase, string>((long)this.GetHashCode(), "{0}: Creating performance counters instance {1}", this, text);
                this.performanceCounters = new PerformanceCountersPerDatabaseInstance(text, this.databaseManager.PerformanceCountersTotal);
                this.performanceCounters.Reset();
                if (this.databaseManager.AssistantTypes != null)
                {
                    eventBasedAssistantCollection = EventBasedAssistantCollection.Create(this.databaseInfo, this.databaseManager.AssistantTypes);
                    if (eventBasedAssistantCollection != null)
                    {
                        if (this.databaseInfo.IsPublic)
                        {
                            this.eventController = new EventControllerPublic(this.databaseInfo, eventBasedAssistantCollection, poisonControl, this.performanceCounters, this.databaseManager.EventGovernor);
                        }
                        else
                        {
                            this.eventController = new EventControllerPrivate(this.databaseInfo, eventBasedAssistantCollection, poisonControl, this.performanceCounters, this.databaseManager.EventGovernor);
                        }
                        eventBasedAssistantCollection = null;
                        this.eventController.Start();
                        flag2 = true;
                    }
                }
                if (!this.databaseInfo.IsPublic && this.databaseManager.TimeBasedDriverManager != null)
                {
                    this.databaseManager.TimeBasedDriverManager.StartDatabase(this.databaseInfo, poisonControl2, this.performanceCounters);
                    flag3 = true;
                }
                flag = true;
            }
            finally
            {
                if (eventBasedAssistantCollection != null)
                {
                    eventBasedAssistantCollection.Dispose();
                }
                if (!flag)
                {
                    ExTraceGlobals.OnlineDatabaseTracer.TraceError <OnlineDatabase>((long)this.GetHashCode(), "{0}: unable to start", this);
                    if (this.eventController != null)
                    {
                        if (flag2)
                        {
                            this.eventController.Stop();
                        }
                        this.eventController.Dispose();
                        this.eventController = null;
                    }
                }
                if (!flag3 && !flag2)
                {
                    this.DisposePerformanceCounters();
                }
            }
            base.TracePfd("PFS AIS {0} {1}: Started", new object[]
            {
                20567,
                this
            });
        }
 // Token: 0x060003C8 RID: 968 RVA: 0x00011DC8 File Offset: 0x0000FFC8
 internal TimeBasedDatabaseDriver(ThrottleGovernor parentGovernor, DatabaseInfo databaseInfo, ITimeBasedAssistantType timeBasedAssistantType, PoisonMailboxControl poisonControl, PerformanceCountersPerDatabaseInstance databaseCounters)
 {
     this.databaseInfo        = databaseInfo;
     this.performanceCounters = databaseCounters;
     this.governor            = new DatabaseGovernor("time based for '" + databaseInfo.DisplayName + "'", parentGovernor, new Throttle("TimeBasedDatabaseDriver", parentGovernor.Throttle.OpenThrottleValue, parentGovernor.Throttle));
     this.assistant           = timeBasedAssistantType.CreateInstance(databaseInfo);
     if (this.assistant == null)
     {
         throw new ApplicationException(string.Format("Assistant failed to create instance, assistant type {0}", timeBasedAssistantType.NonLocalizedName));
     }
     this.poisonControl          = poisonControl;
     this.assistantType          = timeBasedAssistantType;
     this.assistantWorkloadState = TimeBasedDatabaseDriver.AssistantWorkloadStateOnDatabase.Enabled;
     this.windowJobHistory       = new DiagnosticsHistoryQueue <DiagnosticsSummaryJobWindow>(100);
 }
Ejemplo n.º 4
0
 protected TimeBasedDatabaseJob(TimeBasedDatabaseDriver driver, List <MailboxData> queue, PoisonMailboxControl poisonControl, PerformanceCountersPerDatabaseInstance databaseCounters)
 {
     this.Finished = false;
     if (driver == null)
     {
         throw new ArgumentNullException("driver", "Time based Database Job can not be started with a null driver");
     }
     this.Driver = driver;
     this.SetPendingQueue(queue);
     this.poisonControl                          = poisonControl;
     this.performanceCounters                    = databaseCounters;
     this.initialPendingQueueCount               = this.pendingQueue.Count;
     this.OnDemandMailboxCount                   = 0;
     this.mailboxesProcessedFailureCount         = 0;
     this.mailboxesProcessedSuccessfullyCount    = 0;
     this.mailboxesFailedToOpenStoreSessionCount = 0;
     this.mailboxesRetriedCount                  = 0;
 }