// Token: 0x060000B7 RID: 183 RVA: 0x00005EFC File Offset: 0x000040FC private void RefreshViewOfDirectory() { ExTraceGlobals.ServiceTracer.TraceDebug((long)this.GetHashCode(), "MsExchangeLogSearch LogMonitor ReadDirectory"); Exception ex = null; FileInfo[] source = null; try { DirectoryInfo directoryInfo = new DirectoryInfo(this.path); source = directoryInfo.GetFiles(this.pattern, SearchOption.TopDirectoryOnly); } catch (UnauthorizedAccessException ex2) { ex = ex2; } catch (SecurityException ex3) { ex = ex3; } catch (IOException ex4) { ex = ex4; } catch (ArgumentException ex5) { ex = ex5; } if (ex != null) { ExTraceGlobals.ServiceTracer.TraceDebug <string, string>((long)this.GetHashCode(), "Could not open directory {0}, files will not be refreshed, exception: {1}", this.path, ex.ToString()); return; } IOrderedEnumerable <FileInfo> source2 = from fileInfo in source orderby fileInfo.CreationTimeUtc descending select fileInfo; ulong indexSizeLimit = LogSearchIndexingParameters.GetIndexLimit(this.prefix); ulong accumulatedIndexSize = 0UL; IEnumerable <FileInfo> source3 = source2.TakeWhile((FileInfo fileInfo) => this.IsIndexUnderLimit(fileInfo, indexSizeLimit, ref accumulatedIndexSize)); Dictionary <string, List <FileInfo> > dictionary = new Dictionary <string, List <FileInfo> >(); foreach (FileInfo fileInfo2 in source3.Reverse <FileInfo>()) { if (fileInfo2.Exists) { string fullPrefix = LogMonitor.GetFullPrefix(fileInfo2.FullName); List <FileInfo> list; if (!dictionary.TryGetValue(fullPrefix, out list)) { dictionary[fullPrefix] = new List <FileInfo>(); } dictionary[fullPrefix].Add(fileInfo2); } } this.ProcessNewFiles(dictionary); this.RetireUnusedFiles(dictionary); }
// Token: 0x060000C1 RID: 193 RVA: 0x000067B4 File Offset: 0x000049B4 private double GetIndexPercentage(FileInfo fileInfo) { string fullPrefix = LogMonitor.GetFullPrefix(fileInfo.FullName); double result; if (this.indexPercentageByPrefix != null && this.indexPercentageByPrefix.TryGetValue(fullPrefix, out result)) { return(result); } return(LogSearchIndexingParameters.GetDefaultIndexPercentage(this.prefix)); }
// Token: 0x06000073 RID: 115 RVA: 0x000044D4 File Offset: 0x000026D4 public LogFileInfo(string fullName, long length, DateTime startTime, CsvTable csvTable, bool isActive) { ExTraceGlobals.ServiceTracer.TraceDebug <string, long, string>((long)this.GetHashCode(), "MsExchangeLogSearch constructs LogFileInfo with FilePath {0}, FileLength {1}, FileCreateTime {2}", fullName, length, startTime.ToString()); this.fullName = fullName.ToLower(); this.length = length; this.startTime = startTime; this.prefix = LogMonitor.GetFullPrefix(this.fullName); this.csvTable = csvTable; this.isActive = isActive; this.needsTimeCheck = true; if (LogFileInfo.LogFileOpened != null) { LogFileInfo.LogFileOpened(new LogFile(this), null); } }