private async Task OpenPreDefinedServiceHosts() { var startInfo = this.sharedData.StartInfo; if (startInfo != null) { await((ISchedulerNotify)this).TaskStateChanged(SvcHostRestModule.CreateDummyTaskInfos(startInfo.IpAddress)); } }
/// <summary> /// Override Start method and start dummy service job monitor /// </summary> /// <param name="startInfo"></param> /// <param name="dispatcherManager"></param> /// <param name="observer"></param> /// <returns></returns> public override async Task Start(SessionStartInfoContract startInfo, DispatcherManager dispatcherManager, BrokerObserver observer) { BrokerTracing.TraceVerbose("[ServiceJobMonitor].Start: Enter"); this.dispatcherManager = dispatcherManager; this.observer = observer; this.gracefulPreemptionHandler = new GracefulPreemptionHandler(this.dispatcherManager, this.sharedData.BrokerInfo.SessionId, taskId => this.FinishTask(taskId, isRunAwayTask: true)); this.schedulerAdapterClientFactory = new SchedulerAdapterClientFactory(this.sharedData, this, dispatcherManager, this.context); if (this.sharedData.Config.Monitor.AllocationAdjustInterval != Timeout.Infinite && this.sharedData.StartInfo.EprList == null) { BrokerTracing.TraceVerbose("[ServiceJobMonitor].Start: start the allocation adjust thread, interval={0}", this.sharedData.Config.Monitor.AllocationAdjustInterval); this.allocationAdjustThread.Start(); } // await SvcHostRestModule.OpenSvcHostsAsync(this.sharedData.BrokerInfo.SessionId, startInfo, ((ISchedulerNotify)this).TaskStateChanged); await((ISchedulerNotify)this).TaskStateChanged(SvcHostRestModule.CreateDummyTaskInfos(startInfo.IpAddress)); }