当前位置: 首页>>代码示例>>C#>>正文


C# StoreWorker.Import方法代码示例

本文整理汇总了C#中BrightstarDB.Server.StoreWorker.Import方法的典型用法代码示例。如果您正苦于以下问题:C# StoreWorker.Import方法的具体用法?C# StoreWorker.Import怎么用?C# StoreWorker.Import使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BrightstarDB.Server.StoreWorker的用法示例。


在下文中一共展示了StoreWorker.Import方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestImportPerformance25M

 public void TestImportPerformance25M()
 {
     const string fileName = "bsbm_25m.nt";
     if (!File.Exists(BrightstarDB.Configuration.StoreLocation + "\\import\\" + fileName))
     {
         Assert.Inconclusive("Cannot locate required test file at {0}. Test will not run.",
             BrightstarDB.Configuration.StoreLocation + "\\import\\"+fileName);
         return;
     }
     var storeId = Guid.NewGuid().ToString();
     _storeManager.CreateStore(BrightstarDB.Configuration.StoreLocation + "\\" + storeId);
     var timer = new Stopwatch();
     var storeWorker = new StoreWorker(BrightstarDB.Configuration.StoreLocation, storeId);
     storeWorker.Start();
     timer.Start();
     var jobId = storeWorker.Import(fileName, Constants.DefaultGraphUri).ToString();
     JobExecutionStatus jobStatus = storeWorker.GetJobStatus(jobId);
     while (jobStatus.JobStatus == JobStatus.Pending || jobStatus.JobStatus == JobStatus.Started)
     {
         Thread.Sleep(100);
         jobStatus = storeWorker.GetJobStatus(jobId);
     }
     timer.Stop();
     Console.WriteLine("Time to import test file '" + fileName + "': " + timer.ElapsedMilliseconds);
 }
开发者ID:phatcher,项目名称:BrightstarDB,代码行数:25,代码来源:ScalingTests.cs

示例2: TestImportAndLookupPerformance

            public void TestImportAndLookupPerformance()
            {
                if (!File.Exists(BrightstarDB.Configuration.StoreLocation + "\\import\\bsbm_5m.nt"))
                {
                    Assert.Inconclusive("Cannot locate required test file at {0}. Test will not run.",
                        BrightstarDB.Configuration.StoreLocation + "\\import\\bsbm_5m.nt");
                    return;
                }
                var storeId = Guid.NewGuid().ToString();
                _storeManager.CreateStore(BrightstarDB.Configuration.StoreLocation + "\\" + storeId);
                var timer = new Stopwatch();
                var storeWorker = new StoreWorker(BrightstarDB.Configuration.StoreLocation, storeId);
                storeWorker.Start();
                timer.Start();
                var jobId = storeWorker.Import("bsbm_5m.nt", Constants.DefaultGraphUri).ToString();
                JobExecutionStatus jobStatus = storeWorker.GetJobStatus(jobId.ToString());
                while (jobStatus.JobStatus == JobStatus.Pending || jobStatus.JobStatus == JobStatus.Started)
                {
                    Thread.Sleep(100);
                    jobStatus = storeWorker.GetJobStatus(jobId.ToString());
                }

                timer.Stop();
                Console.WriteLine("Time to import 5M triples test file: " + timer.ElapsedMilliseconds);

                var store = _storeManager.OpenStore(BrightstarDB.Configuration.StoreLocation + "\\" + storeId);
                var validator = new TriplesValidator(store, BrightstarDB.Configuration.StoreLocation + "\\import\\bsbm_5m.nt" );
                timer.Reset();
                timer.Start();
                validator.Run();
                timer.Stop();
                Console.WriteLine("Time to validate 5M triples test file:" + timer.ElapsedMilliseconds);
                if(validator.UnmatchedTriples.Any())
                {
                    Assert.Fail("Validator failed to match {0} triples:\n",
                        validator.UnmatchedTriples.Count,
                        String.Join("\n", validator.UnmatchedTriples)
                        );
                }
            }
开发者ID:phatcher,项目名称:BrightstarDB,代码行数:40,代码来源:ScalingTests.cs


注:本文中的BrightstarDB.Server.StoreWorker.Import方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。