コード例 #1
0
        private void WaitForAnExportToComplete()
        {
            var toRemove = new List <string>();

            while (toRemove.Count == 0 && _activeJobList.Count >= MaxExportJobCount)
            {
                foreach (var jobId in _activeJobList)
                {
                    var jobInfo = _brightstar.GetJobInfo(_storeName, jobId);
                    if (jobInfo.JobCompletedWithErrors)
                    {
                        BenchmarkLogging.Error("Export {0} failed. Cause: {1}. Detail {2}", jobInfo.Label,
                                               jobInfo.StatusMessage, jobInfo.ExceptionInfo);
                        toRemove.Add(jobId);
                    }
                    if (jobInfo.JobCompletedOk)
                    {
                        ReportCompletedJob(jobInfo);
                        toRemove.Add(jobId);
                    }
                }
                if (toRemove.Count == 0)
                {
                    BenchmarkLogging.Debug("Waiting for export jobs...");
                    Thread.Sleep(5000);
                }
            }
            foreach (var id in toRemove)
            {
                _activeJobList.Remove(id);
            }
        }
コード例 #2
0
 private void WaitForAllExportsToComplete()
 {
     BenchmarkLogging.Info("Waiting for final export jobs to complete.");
     while (_activeJobList.Count > 0)
     {
         var toRemove = new List <string>();
         foreach (var jobId in _activeJobList)
         {
             var jobInfo = _brightstar.GetJobInfo(_storeName, jobId);
             if (jobInfo.JobCompletedWithErrors)
             {
                 BenchmarkLogging.Error("Export {0} failed. Cause: {1}. Detail {2}", jobInfo.Label,
                                        jobInfo.StatusMessage, jobInfo.ExceptionInfo);
                 toRemove.Add(jobId);
             }
             if (jobInfo.JobCompletedOk)
             {
                 ReportCompletedJob(jobInfo);
                 toRemove.Add(jobId);
             }
         }
         foreach (var r in toRemove)
         {
             _activeJobList.Remove(r);
         }
         Thread.Sleep(5000);
     }
 }
コード例 #3
0
        private void ReportCompletedJob(IJobInfo jobInfo)
        {
            var expectedCount = Int32.Parse(jobInfo.Label.Split('_').Last());

            BenchmarkLogging.Info("EXPORT {0}, {1}", expectedCount, jobInfo.EndTime.Subtract(jobInfo.StartTime).TotalMilliseconds);
            var actualCount = CountLines("import" + Path.DirectorySeparatorChar + jobInfo.Label + ".nt");

            if (expectedCount == actualCount)
            {
                BenchmarkLogging.Info("Validated expected number of triples exported in {0}.nt", jobInfo.Label);
            }
            else
            {
                BenchmarkLogging.Error("Exported triple count in file {0}.nt does not match the expected count. (Expected: {1}, Counted: {2})",
                                       jobInfo.Label, expectedCount, actualCount);
            }
        }