本文整理汇总了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);
}
示例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)
);
}
}