private ExDateTime GetQueryWindowStartTime(PeopleModelItem modelItem) { if (!modelItem.IsDefaultModel) { return(this.LastProcessedTime(modelItem)); } return(ExDateTime.UtcNow - SentItemsTrainingSubDocumentGenerator.DefaultTimeSpanBacklogToProcess); }
internal IDocument RunTrainingQuery(MailboxSession session, PeopleModelItem modelItem) { int num = this.IsDefaultModel(modelItem) ? this.ItemsToFetchForDefaultModel : this.ItemsToFetchForTrainedModel; this.InitializeForQuery(num); ExDateTime queryWindowStartTime = this.GetQueryWindowStartTime(modelItem); ExDateTime queryWindowEndTime = this.GetQueryWindowEndTime(modelItem); IDocument document = MdbInferenceFactory.Current.CreateTrainingSubDocument(this.GetItems(session, queryWindowStartTime, queryWindowEndTime, modelItem), num, session.MailboxGuid, session.MdbGuid); this.DiagnosticsSession.TraceDebug <int>("CrawlerItemIterator returned the following number of items for training {0}", document.NestedDocuments.Count); return(document); }
private ExDateTime LastProcessedTime(PeopleModelItem modelItem) { return(new ExDateTime(ExTimeZone.UtcTimeZone, modelItem.LastProcessedMessageSentTime.ToUniversalTime())); }
private bool IsDefaultModel(PeopleModelItem modelItem) { return(modelItem.IsDefaultModel); }
private ExDateTime GetQueryWindowEndTime(PeopleModelItem modelItem) { return(ExDateTime.UtcNow.AddDays((double)(-(double)this.NumberOfDaysToSkip)).ToUtc()); }
private IEnumerable <MdbCompositeItemIdentity> GetItems(MailboxSession session, ExDateTime startTime, ExDateTime endTime, PeopleModelItem modelItem) { return(this.ItemIterator.GetItems(session, startTime, endTime)); }