// Token: 0x06001190 RID: 4496 RVA: 0x00066CD0 File Offset: 0x00064ED0 private AssistantTaskContext TrainStep(AssistantTaskContext context) { Guid guid = Guid.Empty; MailboxTrainingState mailboxTrainingState = null; MailboxTruthLoggingState mailboxTruthLoggingState = null; AssistantTaskContext result; try { InferenceTrainingTaskContext assistantTaskContext = null; this.ValidateContext(context, delegate(AssistantTaskContext taskContext) { assistantTaskContext = (taskContext as InferenceTrainingTaskContext); ExAssert.RetailAssert(assistantTaskContext != null, "Assistant did not return InferenceTrainingTaskContext"); }); MailboxSession mailboxSession = assistantTaskContext.Args.StoreSession as MailboxSession; guid = assistantTaskContext.Args.StoreSession.MailboxGuid; mailboxTrainingState = assistantTaskContext.MailboxTrainingState; mailboxTruthLoggingState = assistantTaskContext.MailboxTruthLoggingState; if (mailboxTrainingState.PrepareNextTrainingStep()) { this.DiagnosticsSession.TraceDebug <IExchangePrincipal>("{0}: Begin process mailbox for training", mailboxSession.MailboxOwner); this.trainingFeeder.TrainMailbox(mailboxSession, mailboxTrainingState); this.DiagnosticsSession.TraceDebug <IExchangePrincipal>("{0}: End process mailbox for training", mailboxSession.MailboxOwner); mailboxTrainingState.MarkTrainingStepAsCompleted(); mailboxSession.Mailbox.Save(); result = new InferenceTrainingTaskContext(assistantTaskContext.MailboxData, assistantTaskContext.Job, new AssistantStep(this.TrainStep), mailboxTrainingState, mailboxTruthLoggingState); } else { this.DiagnosticsSession.LogEvent(MSExchangeInferenceEventLogConstants.Tuple_TrainingStatisticsForMailbox, new object[] { mailboxSession.MailboxGuid.ToString() }); result = new InferenceTrainingTaskContext(assistantTaskContext.MailboxData, assistantTaskContext.Job, new AssistantStep(this.TruthLogStep), mailboxTrainingState, mailboxTruthLoggingState); } } catch (Exception ex) { string text = string.Format("Reason=TrainStepFailed#Exception={0}", InferenceCommonUtility.StringizeException(ex)); this.trainingStatusLogger.LogStatus(guid, 3, new DateTime?((mailboxTrainingState == null) ? DateTime.UtcNow : mailboxTrainingState.CurrentAttemptTimestamp), (mailboxTrainingState == null) ? null : mailboxTrainingState.LastAttemptTimestamp, (mailboxTrainingState == null) ? null : mailboxTrainingState.LastSuccessTimestamp, text); this.truthLabelsStatusLogger.LogStatus(guid, 3, new DateTime?((mailboxTruthLoggingState == null) ? DateTime.UtcNow : mailboxTruthLoggingState.CurrentAttemptTimestamp), (mailboxTruthLoggingState == null) ? null : mailboxTruthLoggingState.LastAttemptTimestamp, (mailboxTruthLoggingState == null) ? null : mailboxTruthLoggingState.LastSuccessTimestamp, text); this.groupingModelTrainingStatusLogger.LogStatus(guid, 3, text); if (ex is AbortOnProcessingRequestedException) { result = null; } else { if (!(ex is QuotaExceededException)) { throw; } result = null; } } return(result); }
// Token: 0x06001191 RID: 4497 RVA: 0x00066F64 File Offset: 0x00065164 private AssistantTaskContext TruthLogStep(AssistantTaskContext context) { Guid guid = Guid.Empty; MailboxTruthLoggingState mailboxTruthLoggingState = null; AssistantTaskContext result; try { InferenceTrainingTaskContext assistantTaskContext = null; this.ValidateContext(context, delegate(AssistantTaskContext taskContext) { assistantTaskContext = (taskContext as InferenceTrainingTaskContext); ExAssert.RetailAssert(assistantTaskContext != null, "Assistant did not return InferenceTrainingTaskContext"); }); MailboxSession mailboxSession = assistantTaskContext.Args.StoreSession as MailboxSession; MailboxTrainingState mailboxTrainingState = assistantTaskContext.MailboxTrainingState; mailboxTruthLoggingState = assistantTaskContext.MailboxTruthLoggingState; guid = assistantTaskContext.Args.StoreSession.MailboxGuid; if (this.isTruthLabelsLoggingEnabled) { this.DiagnosticsSession.TraceDebug <IExchangePrincipal>("{0}: Begin process mailbox for truth labels logging", mailboxSession.MailboxOwner); this.trainingFeeder.LogTruthLabels(mailboxSession, mailboxTruthLoggingState); mailboxSession.Mailbox.Save(); this.DiagnosticsSession.TraceDebug <IExchangePrincipal>("{0}: End process mailbox for truth labels logging", mailboxSession.MailboxOwner); } else { this.truthLabelsStatusLogger.LogStatus(guid, 5, new DateTime?((mailboxTruthLoggingState == null) ? DateTime.UtcNow : mailboxTruthLoggingState.CurrentAttemptTimestamp), (mailboxTruthLoggingState == null) ? null : mailboxTruthLoggingState.LastAttemptTimestamp, (mailboxTruthLoggingState == null) ? null : mailboxTruthLoggingState.LastSuccessTimestamp, "Truth labels logging is disabled"); } result = new InferenceTrainingTaskContext(assistantTaskContext.MailboxData, assistantTaskContext.Job, new AssistantStep(this.GroupingModelTrainingStep), mailboxTrainingState, mailboxTruthLoggingState); } catch (Exception ex) { string text = string.Format("Reason=TruthLogStepFailed#Exception={0}", InferenceCommonUtility.StringizeException(ex)); this.truthLabelsStatusLogger.LogStatus(guid, 3, new DateTime?((mailboxTruthLoggingState == null) ? DateTime.UtcNow : mailboxTruthLoggingState.CurrentAttemptTimestamp), (mailboxTruthLoggingState == null) ? null : mailboxTruthLoggingState.LastAttemptTimestamp, (mailboxTruthLoggingState == null) ? null : mailboxTruthLoggingState.LastSuccessTimestamp, text); this.groupingModelTrainingStatusLogger.LogStatus(guid, 3, text); if (ex is OutOfMemoryException || ex is StackOverflowException || ex is AccessViolationException) { throw; } result = null; } return(result); }
// Token: 0x060011AB RID: 4523 RVA: 0x000677EE File Offset: 0x000659EE public InferenceTrainingTaskContext(MailboxData mailboxData, TimeBasedDatabaseJob job, AssistantStep step, MailboxTrainingState mailboxTrainingState, MailboxTruthLoggingState mailboxTruthLoggingState) : base(mailboxData, job, null) { base.Step = step; this.MailboxTrainingState = mailboxTrainingState; this.MailboxTruthLoggingState = mailboxTruthLoggingState; }