public UpdateTransaction(Guid jobId, StoreWorker storeWorker, string preconditionData, string deletePatterns, string insertData, string defaultGraphUri) : base(jobId, storeWorker) { _defaultGraphUri = defaultGraphUri ?? Constants.DefaultGraphUri; _deletePatterns = deletePatterns ?? ""; _insertData = insertData ?? ""; _preconditions = preconditionData ?? ""; }
public override void Run() { try { Logging.LogInfo("SPARQL update job being run on expression '{0}'", _updateExpression); StoreWorker.TransactionLog.LogStartTransaction(this); var processor = new BrightstarUpdateProcessor(new BrightstarIOManager(StoreWorker.WriteStore)); var cmds = _parser.ParseFromString(_updateExpression); processor.ProcessCommandSet(cmds); StoreWorker.WriteStore.Commit(JobId); StoreWorker.InvalidateReadStore(); Logging.LogInfo("SPARQL update job completed successfully"); StoreWorker.TransactionLog.LogEndSuccessfulTransaction(this); } catch (RdfException ex) { StoreWorker.TransactionLog.LogEndFailedTransaction(this); Logging.LogInfo("Error processing SPARQL update expression '{0}'. Error Message: {1} Stack Trace: {2}", _updateExpression, ex.Message, ex.StackTrace); ErrorMessage = String.Format("Error processing SPARQL update expression. {0}", ex.Message); throw; } catch (Exception ex) { StoreWorker.TransactionLog.LogEndFailedTransaction(this); Logging.LogInfo("Error processing SPARQL update expression '{0}'. Error Message: {1} Stack Trace: {2}", _updateExpression, ex.Message, ex.StackTrace); throw; } }
public void TestExportJob() { var sid = Guid.NewGuid().ToString(); using (var store = _storeManager.CreateStore(Configuration.StoreLocation + "\\" + sid)) { store.InsertTriple("http://www.example.org/alice", "http://xmlns.org/foaf/0.1/knows", "http://www.example.org/bob", false, null, null, Constants.DefaultGraphUri); store.InsertTriple("http://www.example.org/bob", "http://xmlns.org/foaf/0.1/knows", "http://www.example.org/alice", false, null, null, Constants.DefaultGraphUri); store.Commit(Guid.NewGuid()); } var storeWorker = new StoreWorker(Configuration.StoreLocation , sid); storeWorker.Start(); var jobId = storeWorker.Export(sid + "_export.nt", null, RdfFormat.NQuads); JobExecutionStatus status = storeWorker.GetJobStatus(jobId.ToString()); while (status.JobStatus != JobStatus.CompletedOk) { Thread.Sleep(1000); status = storeWorker.GetJobStatus(jobId.ToString()); if (status.JobStatus == JobStatus.TransactionError) { Assert.Fail("Export job failed with a transaction error. Message={0}. Exception Detail={1}", status.Information, status.ExceptionDetail); } } }
public ExportJob(Guid jobId, StoreWorker storeWorker, string outputFileName, string graphUri) { _jobId = jobId; _storeWorker = storeWorker; _outputFileName = outputFileName; _graphUri = graphUri; }
public void TestTransactionWithPreconditionFails() { // create a store var sid = CreateStore(); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); // execute transactions const string preconds = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/core/version> ""1""^^<http://www.w3.org/2000/01/rdf-schema#integer>"; // execute transactions const string data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; var jobId = storeWorker.ProcessTransaction(preconds, "", data, Constants.DefaultGraphUri, "nt"); JobExecutionStatus jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.TransactionError) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } Assert.AreEqual(jobStatus.JobStatus, JobStatus.TransactionError); }
public override void Run() { try { var jobStatus = StoreWorker.GetJobStatus(JobId.ToString()); var predicateTripleCounts = new Dictionary <string, ulong>(); ulong totalTripleCount = 0; List <string> predicates = StoreWorker.ReadStore.GetPredicates().ToList(); for (int i = 0; i < predicates.Count; i++) { var tripleCount = StoreWorker.ReadStore.GetTripleCount(predicates[i]); totalTripleCount += tripleCount; predicateTripleCounts[predicates[i]] = tripleCount; jobStatus.Information = String.Format("Count completed for {0}/{1} predicates. Approximately {2:P1} percent complete", i + 1, predicates.Count, (i + 1) * 100.0 / predicates.Count); } var currentCommitPoint = StoreWorker.ReadStore.GetCommitPoints().First(); StoreWorker.StoreStatistics.AppendStatistics( new StoreStatistics( currentCommitPoint.LocationOffset, currentCommitPoint.CommitTime, totalTripleCount, predicateTripleCounts)); } catch (Exception ex) { ErrorMessage = "Error reading store triple statistics. Cause: " + ex.Message; Logging.LogError(BrightstarEventId.StatsUpdateError, "Error reading store triple statistics for store. Cause: {0}", ex); } }
public ImportJob(Guid jobId, string label, StoreWorker storeWorker, string contentFileName, RdfFormat importFormat, string graphUri) : base(jobId, label, storeWorker) { _contentFileName = contentFileName; _importFormat = importFormat; _graphUri = graphUri; }
public ImportJob(Guid jobId, string label, StoreWorker storeWorker, string contentFileName, RdfFormat importFormat, string graphUri) : base(jobId, label, storeWorker) { _contentFileName = contentFileName; _importFormat = importFormat; _graphUri = graphUri; }
public UpdateTransaction(Guid jobId, StoreWorker storeWorker, string preconditionData, string deletePatterns, string insertData, string defaultGraphUri) : base(jobId, storeWorker) { _defaultGraphUri = defaultGraphUri ?? Constants.DefaultGraphUri; _deletePatterns = deletePatterns ?? ""; _insertData = insertData ?? ""; _preconditions = preconditionData ?? ""; }
public ExportJob(Guid jobId, StoreWorker storeWorker, string outputFileName, string graphUri) { _jobId = jobId; _storeWorker = storeWorker; _outputFileName = outputFileName; _graphUri = graphUri; }
public GuardedUpdateTransaction(Guid jobId, string label, StoreWorker storeWorker, string existsPreconditions, string notExistsPreconditions, string deletePatterns, string insertData, string defaultGraphUri) : base(jobId, label, storeWorker) { _defaultGraphUri = defaultGraphUri ?? Constants.DefaultGraphUri; DeletePatterns = deletePatterns ?? String.Empty; InsertData = insertData ?? String.Empty; ExistsPreconditions = existsPreconditions ?? String.Empty; NotExistsPreconditions = notExistsPreconditions ?? String.Empty; }
public ExportJob(Guid jobId, string label, StoreWorker storeWorker, string outputFileName, string graphUri, RdfFormat exportFormat) { _jobId = jobId; _label = label; _storeWorker = storeWorker; _outputFileName = outputFileName; _graphUri = graphUri; _exportFormat = exportFormat; }
public ExportJob(Guid jobId, string label, StoreWorker storeWorker, string outputFileName, string graphUri, RdfFormat exportFormat) { _jobId = jobId; _label = label; _storeWorker = storeWorker; _outputFileName = outputFileName; _graphUri = graphUri; _exportFormat = exportFormat; }
public GuardedUpdateTransaction(Guid jobId, string label, StoreWorker storeWorker, string existsPreconditions, string notExistsPreconditions, string deletePatterns, string insertData, string defaultGraphUri) : base(jobId, label, storeWorker) { _defaultGraphUri = defaultGraphUri ?? Constants.DefaultGraphUri; DeletePatterns = deletePatterns ?? String.Empty; InsertData = insertData ?? String.Empty; ExistsPreconditions = existsPreconditions ?? String.Empty; NotExistsPreconditions = notExistsPreconditions ?? String.Empty; }
public override void Run() { try { Logging.LogInfo("Import job being run on file " + _contentFileName); StoreWorker.TransactionLog.LogStartTransaction(this); var parser = GetParser(_contentFileName); var storeDirectory = StoreWorker.WriteStore.DirectoryPath; var filePath = Path.Combine(storeDirectory, ".." + Path.DirectorySeparatorChar + "import" + Path.DirectorySeparatorChar + _contentFileName); var profiler = new BrightstarProfiler("Import " + _contentFileName); // TODO : Conditionally create this if profiling is enabled Logging.LogDebug("Import file path calculated as '{0}'", filePath); if (!File.Exists(filePath)) { ErrorMessage = String.Format("Cannot find file {0} in import directory", _contentFileName); throw new FileNotFoundException(ErrorMessage); } using (_fileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read)) { _importTripleSink = new StoreTripleSink(StoreWorker.WriteStore, JobId, Configuration.TransactionFlushTripleCount, profiler: profiler); parser.Parse(_fileStream, this, _graphUri); } StoreWorker.WriteStore.Commit(JobId, profiler); StoreWorker.InvalidateReadStore(); Logging.LogInfo("Import job completed successfully for " + _contentFileName); if (profiler != null) { Logging.LogInfo(profiler.GetLogString()); } StoreWorker.TransactionLog.LogEndSuccessfulTransaction(this); } catch (RdfParserException parserException) { ErrorMessage = parserException.Message; ExceptionDetail = new ExceptionDetail(parserException); Logging.LogInfo("Parser error processing import job on file " + _contentFileName + ". " + parserException.Message); throw; } catch (Exception ex) { ErrorMessage = "Error importing file " + _contentFileName + ". " + ex.Message; StoreWorker.TransactionLog.LogEndFailedTransaction(this); Logging.LogInfo("Error processing import job on file " + _contentFileName + ". Error Message: " + ex.Message + " Stack trace: " + ex.StackTrace); throw; } }
/// <summary> /// Handler method for an individual RDF statement /// </summary> /// <param name="subject">The statement subject resource URI</param> /// <param name="subjectIsBNode">True if the value of <paramref name="subject"/> is a BNode identifier</param> /// <param name="predicate">The predicate resource URI</param> /// <param name="predicateIsBNode">True if the value of <paramref name="predicate"/> is a BNode identifier.</param> /// <param name="obj">The object of the statement</param> /// <param name="objIsBNode">True if the value of <paramref name="obj"/> is a BNode identifier.</param> /// <param name="objIsLiteral">True if the value of <paramref name="obj"/> is a literal string</param> /// <param name="dataType">The datatype URI for the object literal or null if the object is not a literal</param> /// <param name="langCode">The language code for the object literal or null if the object is not a literal</param> /// <param name="graphUri">The graph URI for the statement</param> public void Triple(string subject, bool subjectIsBNode, string predicate, bool predicateIsBNode, string obj, bool objIsBNode, bool objIsLiteral, string dataType, string langCode, string graphUri) { _importTripleSink.Triple(subject, subjectIsBNode, predicate, predicateIsBNode, obj, objIsBNode, objIsLiteral, dataType, langCode, graphUri); _tripleCount++; if (_tripleCount % 1000 == 0) { var percentComplete = ((double)_fileStream.Position / (_fileStream.Length)); var jobStatus = StoreWorker.GetJobStatus(JobId.ToString()); if (jobStatus != null) { jobStatus.Information = String.Format("Imported {0:N0} triples. Approximately {1:P1} complete", _tripleCount, percentComplete); } } }
private StoreWorker GetStoreWorker(string storeName) { lock (_stores) { if (_stores.ContainsKey(_baseLocation + "\\" + storeName)) { return(_stores[_baseLocation + "\\" + storeName]); } // create store manager var storeWorker = new StoreWorker(_baseLocation, storeName); storeWorker.JobCompleted += HandleStoreWorkerJobCompleted; _stores.Add(_baseLocation + "\\" + storeName, storeWorker); storeWorker.Start(); return(storeWorker); } }
public override void Run() { try { Logging.LogInfo("Import job being run on file " + _contentFileName); StoreWorker.TransactionLog.LogStartTransaction(this); var parser = GetParser(_contentFileName); var storeDirectory = StoreWorker.WriteStore.DirectoryPath; var importDirectory = Path.Combine(Path.GetDirectoryName(storeDirectory), "import"); var filePath = Path.Combine(importDirectory, _contentFileName); var profiler = Logging.IsProfilingEnabled ? new BrightstarProfiler("Import " + _contentFileName) : null; Logging.LogDebug("Import file path calculated as '{0}'", filePath); using (_fileStream = GetImportFileStream(filePath)) { _importTripleSink = new StoreTripleSink(StoreWorker.WriteStore, JobId, Configuration.TransactionFlushTripleCount, profiler: profiler); parser.Parse(_fileStream, this, _graphUri); } StoreWorker.WriteStore.Commit(JobId, profiler); StoreWorker.InvalidateReadStore(); Logging.LogInfo("Import job completed successfully for " + _contentFileName); if (profiler != null) { Logging.LogInfo(profiler.GetLogString()); } StoreWorker.TransactionLog.LogEndSuccessfulTransaction(this); } catch (RdfParserException parserException) { ErrorMessage = parserException.Message; ExceptionDetail = new ExceptionDetailObject(parserException); Logging.LogInfo("Parser error processing import job on file " + _contentFileName + ". " + parserException.Message); throw; } catch (Exception ex) { ErrorMessage = "Error importing file " + _contentFileName + ". " + ex.Message; StoreWorker.TransactionLog.LogEndFailedTransaction(this); Logging.LogInfo("Error processing import job on file " + _contentFileName + ". Error Message: " + ex.Message + " Stack trace: " + ex.StackTrace); throw; } }
public void TestTransaction() { // create a store var sid = CreateStore(); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); // execute transactions const string data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; var jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt"); JobExecutionStatus status = storeWorker.GetJobStatus(jobId.ToString()); while (status.JobStatus != JobStatus.CompletedOk) { Thread.Sleep(1000); status = storeWorker.GetJobStatus(jobId.ToString()); } }
private StoreWorker GetStoreWorker(string storeName) { lock (_stores) { StoreWorker result = null; if (_stores.TryGetValue(_baseLocation + "\\" + storeName, out result)) { return(result); } if (!DoesStoreExist(storeName)) { throw new NoSuchStoreException(storeName); } // create store manager var storeWorker = new StoreWorker(_baseLocation, storeName); storeWorker.JobCompleted += HandleStoreWorkerJobCompleted; _stores.Add(_baseLocation + "\\" + storeName, storeWorker); storeWorker.Start(); return(storeWorker); } }
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) ); } }
public void TestTouchingTransactionHeadersEnablesLogging() { // create a store with logging disabled var sid = CreateStore(withTransactionLog: false); var txnHeadersFile = Path.Combine(Configuration.StoreLocation, sid, "transactionheaders.bs"); var txnLogFile = Path.Combine(Configuration.StoreLocation, sid, "transactions.bs"); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); // Should be no transaction files because we created the store with logging disabled Assert.IsFalse(File.Exists(txnHeadersFile)); Assert.IsFalse(File.Exists(txnLogFile)); // But now "touch" the header file to create it File.Create(txnHeadersFile).Close(); // execute a transaction that logs data const string data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; var jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt"); AssertJobCompletedOk(storeWorker, jobId); // Transaction files should now both be there Assert.IsTrue(File.Exists(txnHeadersFile)); Assert.IsTrue(File.Exists(txnLogFile)); // There should also be some content in both files using (var txnStream = File.OpenRead(txnHeadersFile)) { Assert.Greater(txnStream.Length, 0L); } using (var txnStream = File.OpenRead(txnLogFile)) { Assert.Greater(txnStream.Length, 0L); } }
private static void AssertJobCompletedOk(StoreWorker storeWorker, Guid jobId) { var jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk && jobStatus.JobStatus != JobStatus.TransactionError) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } Assert.That(jobStatus.JobStatus, Is.EqualTo(JobStatus.CompletedOk), "Unexpected job failure: " + jobStatus.Information + " - " + jobStatus.ExceptionDetail); }
public UpdateStatsJob(Guid jobId, StoreWorker storeWorker) : base(jobId, storeWorker) { }
public void TestTransactionLogCreatedWhenLoggingEnabled() { // create a store var sid = CreateStore(withTransactionLog: true); var txnHeadersFile = Path.Combine(Configuration.StoreLocation, sid, "transactionheaders.bs"); var txnLogFile = Path.Combine(Configuration.StoreLocation, sid, "transactions.bs"); // Creating the store should create the files Assert.IsTrue(File.Exists(txnHeadersFile), "Expected transactionheaders.bs file to be created when store is initially created"); Assert.IsTrue(File.Exists(txnLogFile), "Expected transactions.bs file to be created when store is initially created"); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); // execute transactions const string data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; var jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt"); JobExecutionStatus jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } // Transaction files should still be there Assert.IsTrue(File.Exists(txnHeadersFile)); Assert.IsTrue(File.Exists(txnLogFile)); // There should also be some content in both files using (var txnStream = File.OpenRead(txnHeadersFile)) { Assert.Greater(txnStream.Length, 0L); } using (var txnStream = File.OpenRead(txnLogFile)) { Assert.Greater(txnStream.Length, 0L); } }
public ImportJob(Guid jobId, string label, StoreWorker storeWorker) : base(jobId, label, storeWorker) { }
public ConsolidateJob(Guid jobId, string label, StoreWorker storeWorker) : base(jobId, label, storeWorker) { }
protected UpdateJob(Guid jobId, string label, StoreWorker storeWorker) : base(jobId, label, storeWorker) { }
public SnapshotJob(Guid jobId, string label, StoreWorker storeWorker, string destinationStoreName, PersistenceType persistenceType, ulong sourceCommitPointId) : base(jobId, label, storeWorker) { _destinationStoreName = destinationStoreName; _sourceCommitPointId = sourceCommitPointId; _persistenceType = persistenceType; }
public UpdateTransaction(Guid jobId, StoreWorker storeWorker) : base(jobId, storeWorker) { }
public ImportJob(Guid jobId, StoreWorker storeWorker) : base(jobId, storeWorker) { }
public SparqlUpdateJob(Guid jobId, string label, StoreWorker storeWorker, string updateExpression) : base(jobId, label, storeWorker) { _updateExpression = updateExpression; }
protected Job(Guid jobId, string label, StoreWorker storeWorker) { _jobId = jobId; _label = String.IsNullOrEmpty(label) ? DefaultJobLabel : label; StoreWorker = storeWorker; }
public UpdateStatsJob(Guid jobId, string label, StoreWorker storeWorker) : base(jobId, label, storeWorker) { }
protected Job(Guid jobId, StoreWorker storeWorker) { _jobId = jobId; StoreWorker = storeWorker; }
public void TestFailedTransactionAppearsInTransactionList() { // create a store var sid = CreateStore(); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); // execute transaction with bad data var data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np"; var jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt"); JobExecutionStatus jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk && jobStatus.JobStatus != JobStatus.TransactionError) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } var transactionLog = storeWorker.TransactionLog; var transactionList = transactionLog.GetTransactionList(); var i = 0; while (transactionList.MoveNext()) { i++; } Assert.AreEqual(1, i); var txnList = storeWorker.TransactionLog.GetTransactionList(); txnList.MoveNext(); var tinfo = txnList.Current; Assert.IsNotNull(tinfo); Assert.AreEqual(TransactionType.GuardedUpdateTransaction, tinfo.TransactionType); Assert.AreEqual(TransactionStatus.Failed, tinfo.TransactionStatus); data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt"); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } transactionList.Reset(); i = 0; while (transactionList.MoveNext()) { i++; } Assert.AreEqual(2, i); }
public ImportJob(Guid jobId, StoreWorker storeWorker) : base(jobId, storeWorker) { }
public void TestDeleteStoreAfterUpdate() { // create a store var sid = CreateStore(); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); // execute transactions const string data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; var jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt"); JobExecutionStatus jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } // var queryResult = storeWorker.Query("select * where { ?s ?p ?o }"); storeWorker.Shutdown(true, () => _storeManager.DeleteStore(Configuration.StoreLocation +"\\" + sid)); }
public override void Run() { StoreWorker.CreateSnapshot(_destinationStoreName, _persistenceType, _sourceCommitPointId); }
public override void Run() { StoreWorker.Consolidate(JobId); }
public void TestGetErrorMessage() { // create a store var sid = CreateStore(); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); // execute transactions const string data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies"; var jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt"); JobExecutionStatus jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.TransactionError) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } Assert.IsTrue(jobStatus.Information.Contains("Job Error"), "Unexpected job message: '{0}'", jobStatus.Information); Assert.IsTrue(jobStatus.ExceptionDetail.Message.Contains("Syntax error in triples to add."), "Unexpected job message: '{0}'", jobStatus.ExceptionDetail.Message); }
public UpdateTransaction(Guid jobId, StoreWorker storeWorker, string preconditionData, string deletePatterns, string insertData) : base(jobId, storeWorker) { _deletePatterns = deletePatterns ?? ""; _insertData = insertData ?? ""; _preconditions = preconditionData ?? ""; }
public void TestConsolidateStore() { // create a store var sid = CreateStore(); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); // execute transactions var data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; var jobId = storeWorker.ProcessTransaction("","", "", data, Constants.DefaultGraphUri, "nt"); JobExecutionStatus jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } jobId = Guid.NewGuid(); storeWorker.QueueJob(new ConsolidateJob(jobId, null, storeWorker)); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk && jobStatus.JobStatus != JobStatus.TransactionError) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } Assert.AreEqual(JobStatus.CompletedOk, jobStatus.JobStatus); // open store and find all triples var results = storeWorker.Query("select * where { ?a ?b ?c }", SparqlResultsFormat.Xml, new[] { Constants.DefaultGraphUri }); var doc = XDocument.Parse(results); XNamespace sparqlNs = "http://www.w3.org/2005/sparql-results#"; Assert.AreEqual(1, doc.Descendants(sparqlNs + "result").Count()); data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; jobId = storeWorker.ProcessTransaction("", "", data, "", Constants.DefaultGraphUri, "nt"); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } Assert.AreEqual(JobStatus.CompletedOk, jobStatus.JobStatus); // consolidate again jobId = Guid.NewGuid(); storeWorker.QueueJob(new ConsolidateJob(jobId, null, storeWorker)); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk && jobStatus.JobStatus != JobStatus.TransactionError) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } Assert.AreEqual(JobStatus.CompletedOk, jobStatus.JobStatus); results = storeWorker.Query("select * where { ?a ?b ?c }", SparqlResultsFormat.Xml, new[] { Constants.DefaultGraphUri }); doc = XDocument.Parse(results); Assert.AreEqual(0, doc.Descendants(sparqlNs + "result").Count()); }
public override void Run() { try { StoreWorker.TransactionLog.LogStartTransaction(this); var writeStore = StoreWorker.WriteStore; // process preconditions Logging.LogInfo("UpdateTransaction {0} - processing preconditions", JobId); try { var preconditionSink = new PreconditionSink(writeStore, PreconditionSink.PreconditionType.ExistsPrecondition); var parser = new NTriplesParser(); parser.Parse(new StringReader(_preconditions), preconditionSink, _defaultGraphUri); if (preconditionSink.FailedPreconditionCount > 0) { throw new PreconditionFailedException(preconditionSink.FailedPreconditionCount, preconditionSink.GetFailedPreconditions(), 0, String.Empty); } } catch (RdfParserException parserException) { throw new BrightstarClientException("Syntax error in preconditions.", parserException); } // process deletes Logging.LogInfo("UpdateTransaction {0} - processing deletes", JobId); try { var delSink = new DeletePatternSink(writeStore); var parser = new NTriplesParser(); parser.Parse(new StringReader(_deletePatterns), delSink, _defaultGraphUri); } catch (RdfParserException parserException) { throw new BrightstarClientException("Syntax error in delete patterns.", parserException); } try { // insert data Logging.LogInfo("UpdateTransaction {0} - processing inserts", JobId); var parser = new NTriplesParser(); parser.Parse(new StringReader(_insertData), new StoreTripleSink(writeStore, JobId, Configuration.TransactionFlushTripleCount), _defaultGraphUri); } catch (RdfParserException parserException) { throw new BrightstarClientException("Syntax error in triples to add.", parserException); } // commit changes Logging.LogInfo("UpdateTransaction {0} - committing changes", JobId); writeStore.Commit(JobId); // change read store Logging.LogInfo("UpdateTransaction {0} - invalidating read store", JobId); StoreWorker.InvalidateReadStore(); // log txn completed Logging.LogInfo("UpdateTransaction {0} - logging completion", JobId); StoreWorker.TransactionLog.LogEndSuccessfulTransaction(this); Logging.LogInfo("UpdateTransaction {0} - done", JobId); } catch (PreconditionFailedException ex) { StoreWorker.TransactionLog.LogEndFailedTransaction(this); Logging.LogInfo("Preconditions failed in UpdateTransaction ({0}): Count={1}, Triples={2}", JobId, ex.ExistenceFailureCount, ex.ExistenceFailedTriples); throw; } catch (BrightstarClientException ex) { StoreWorker.TransactionLog.LogEndFailedTransaction(this); Logging.LogError(BrightstarEventId.TransactionClientError, "Client error reported in UpdateTransaction ({0}): {1}", JobId, ex.InnerException.ToString()); throw; } catch (Exception ex) { StoreWorker.TransactionLog.LogEndFailedTransaction(this); Logging.LogError(BrightstarEventId.TransactionServerError, "Unexpected exception caught in UpdateTransaction ({0}): {1}", JobId, ex); throw; } }
public void TestQueryCaching() { Configuration.EnableQueryCache = true; // create a store var sid = CreateStore(); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); // execute transactions const string data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; var jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt"); JobExecutionStatus jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk && jobStatus.JobStatus != JobStatus.TransactionError) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } Assert.AreEqual(JobStatus.CompletedOk, jobStatus.JobStatus, "Import failed: {0} : {1}", jobStatus.Information, jobStatus.ExceptionDetail); var sw = new Stopwatch(); sw.Start(); var queryResult = storeWorker.Query("select * where { ?a ?b ?c }", SparqlResultsFormat.Xml, new[] { Constants.DefaultGraphUri }); sw.Stop(); Console.WriteLine("initial query took : " + sw.ElapsedMilliseconds); var initTime = sw.ElapsedMilliseconds; sw = new Stopwatch(); sw.Start(); var cachedResult = storeWorker.Query("select * where { ?a ?b ?c }", SparqlResultsFormat.Xml, new[] { Constants.DefaultGraphUri }); sw.Stop(); Console.WriteLine("warm query took : " + sw.ElapsedMilliseconds); Thread.Sleep(1000); sw = new Stopwatch(); sw.Start(); cachedResult = storeWorker.Query("select * where { ?a ?b ?c }", SparqlResultsFormat.Xml, new[] { Constants.DefaultGraphUri }); sw.Stop(); Console.WriteLine("cached query took : " + sw.ElapsedMilliseconds); var cachedTime = sw.ElapsedMilliseconds; Assert.AreEqual(queryResult, cachedResult); if (cachedTime >= initTime) { Assert.Inconclusive( "Expected time to read from cache ({0}ms) to be less than time to execute query ({1}ms).", cachedTime, initTime); } Configuration.EnableQueryCache = false; }
public UpdateTransaction(Guid jobId, string label, StoreWorker storeWorker) : base(jobId, label, storeWorker) {}
public void TestNoTransactionLogWhenLoggingDisabled() { // create a store var sid = CreateStore(withTransactionLog:false); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); Assert.IsFalse(File.Exists(Path.Combine(Configuration.StoreLocation, sid, "transactionheaders.bs"))); Assert.IsFalse(File.Exists(Path.Combine(Configuration.StoreLocation, sid, "transactions.bs"))); // execute transactions const string data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; var jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt"); var jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } Assert.IsFalse(File.Exists(Path.Combine(Configuration.StoreLocation, sid, "transactionheaders.bs"))); Assert.IsFalse(File.Exists(Path.Combine(Configuration.StoreLocation, sid, "transactions.bs"))); }
private StoreWorker GetStoreWorker(string storeName) { lock (_stores) { if (_stores.ContainsKey(_baseLocation + "\\" + storeName)) { return _stores[_baseLocation + "\\" + storeName]; } if (!DoesStoreExist(storeName)) { throw new NoSuchStoreException(storeName); } // create store manager var storeWorker = new StoreWorker(_baseLocation , storeName); storeWorker.JobCompleted += HandleStoreWorkerJobCompleted; _stores.Add(_baseLocation + "\\" + storeName, storeWorker); storeWorker.Start(); return storeWorker; } }
public void TestDeletingTransactionHeadersDisablesLogging() { // create a store var sid = CreateStore(withTransactionLog: true); var txnHeadersFile = Path.Combine(Configuration.StoreLocation, sid, "transactionheaders.bs"); var txnLogFile = Path.Combine(Configuration.StoreLocation, sid, "transactions.bs"); // Creating the store should create the files Assert.IsTrue(File.Exists(txnHeadersFile), "Expected transactionheaders.bs file to be created when store is initially created"); Assert.IsTrue(File.Exists(txnLogFile), "Expected transactions.bs file to be created when store is initially created"); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); // execute transactions const string data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; var jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt"); AssertJobCompletedOk(storeWorker, jobId); long logLength; using (var txnStream = File.OpenRead(txnLogFile)) { logLength = txnStream.Length; Assert.Greater(logLength, 0L); } // Remove the transaction headers file File.Delete(txnHeadersFile); // Execute a second transaction const string data2 = @"<http://www.networkedplanet.com/people/kal> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; jobId = storeWorker.ProcessTransaction("", "", "", data2, Constants.DefaultGraphUri, "nt"); AssertJobCompletedOk(storeWorker, jobId); Assert.IsFalse(File.Exists(txnHeadersFile), "Did not expect transactionheaders.bs to reappear after second transaction"); Assert.IsTrue(File.Exists(txnLogFile), "Expected transactions.bs file to remain untouched after second transaction"); using (var txnStream = File.OpenRead(txnLogFile)) { Assert.AreEqual(logLength, txnStream.Length, "Expected transaction log file to be unchanged in size by second transaction"); } }
public void TestTransactionWithPrecondition() { // create a store var sid = CreateStore(); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); // execute transactions var data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np> .\n <http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/core/version> ""1""^^<http://www.w3.org/2000/01/rdf-schema#integer> ."; var jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt"); JobExecutionStatus jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk && jobStatus.JobStatus != JobStatus.TransactionError) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } Assert.IsTrue(jobStatus.JobStatus == JobStatus.CompletedOk, "Initial insert failed: {0} : {1}", jobStatus.Information, jobStatus.ExceptionDetail); // now test precondition const string preconds = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/core/version> ""1""^^<http://www.w3.org/2000/01/rdf-schema#integer>"; data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; jobId = storeWorker.ProcessTransaction(preconds,"", "", data, Constants.DefaultGraphUri, "nt"); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk && jobStatus.JobStatus != JobStatus.TransactionError) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } Assert.IsTrue(jobStatus.JobStatus == JobStatus.CompletedOk, "Transaction execution failed: {0} : {1}", jobStatus.Information, jobStatus.ExceptionDetail); }
public void TestStatsJob() { var sid = "StatsJob_" + DateTime.Now.Ticks; using (var store = _storeManager.CreateStore(Configuration.StoreLocation + "\\" + sid)) { store.InsertTriple("http://www.example.org/alice", "http://xmlns.org/foaf/0.1/knows", "http://www.example.org/bob", false, null, null, Constants.DefaultGraphUri); store.InsertTriple("http://www.example.org/alice", "http://xmlns.org/foaf/0.1/name", "Alice", true, RdfDatatypes.String, null, Constants.DefaultGraphUri); store.InsertTriple("http://www.example.org/bob", "http://xmlns.org/foaf/0.1/knows", "http://www.example.org/alice", false, null, null, Constants.DefaultGraphUri); store.Commit(Guid.NewGuid()); } var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); var jobId = storeWorker.UpdateStatistics(); var status = storeWorker.GetJobStatus(jobId.ToString()); while (status.JobStatus != JobStatus.CompletedOk && status.JobStatus != JobStatus.TransactionError) { Thread.Sleep(1000); status = storeWorker.GetJobStatus(jobId.ToString()); } Assert.AreEqual(JobStatus.CompletedOk, status.JobStatus, "Expected UpdateStatsJob to complete OK"); var latestStats = storeWorker.StoreStatistics.GetStatistics().FirstOrDefault(); Assert.IsNotNull(latestStats); Assert.AreEqual(3, latestStats.TripleCount); Assert.AreEqual(2, latestStats.PredicateTripleCounts.Count); Assert.IsTrue(latestStats.PredicateTripleCounts.ContainsKey("http://xmlns.org/foaf/0.1/knows")); Assert.AreEqual(2, latestStats.PredicateTripleCounts["http://xmlns.org/foaf/0.1/knows"]); Assert.IsTrue(latestStats.PredicateTripleCounts.ContainsKey("http://xmlns.org/foaf/0.1/name")); Assert.AreEqual(1, latestStats.PredicateTripleCounts["http://xmlns.org/foaf/0.1/name"]); }
public void TestTransactionWithNonExistsancePreconditionFails() { var storeId = CreateStore(); var storeWorker = new StoreWorker(Configuration.StoreLocation, storeId); storeWorker.Start(); const string data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np> .\n <http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/core/version> ""1""^^<http://www.w3.org/2000/01/rdf-schema#integer> ."; const string notExistsPrecondition = @"<http://www.networkedplanet.com/people/gra> <" + Constants.WildcardUri + "> <" + Constants.WildcardUri + ">."; const string insertData = @"<http://www.networkedplanet.com/people/kal> <http://www.newtorkedplanet.com/types/worksfor> <http://wwww.networkedplanet.com/companies/np> .\n <http://www.networkedplanet.com/people/kal> <http://www.networkedplanet.com/core/version> ""1""^^<http://wwww.w3.org/2000/01/rdf-schema#integer> ."; var jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt", "UpdateTransaction"); AssertJobCompleted(storeWorker, jobId, JobStatus.CompletedOk); jobId = storeWorker.ProcessTransaction("", notExistsPrecondition, "", insertData, Constants.DefaultGraphUri, "nt", "UpdateTransaction2"); var jobStatus = AssertJobCompleted(storeWorker, jobId, JobStatus.TransactionError); Assert.IsTrue(jobStatus.ExceptionDetail.Message.Contains("Transaction preconditions failed"), "Unexpected job exception message: {0}", jobStatus.ExceptionDetail.Message); }
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); }
private static JobExecutionStatus AssertJobCompleted(StoreWorker storeWorker, Guid jobId, JobStatus expectedStatus) { JobExecutionStatus jobStatus; do { Thread.Sleep(250); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } while (jobStatus.JobStatus != JobStatus.CompletedOk && jobStatus.JobStatus != JobStatus.TransactionError); Assert.AreEqual(expectedStatus, jobStatus.JobStatus, "Job completed with an unexpected status"); return jobStatus; }
public ConsolidateJob(Guid jobId, string label, StoreWorker storeWorker) : base(jobId, label, storeWorker) { }
public void TestReadTransactionList() { // create a store var sid = CreateStore(); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); // execute transactions var data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; var jobId = storeWorker.ProcessTransaction("","", "", data, Constants.DefaultGraphUri, "nt"); JobExecutionStatus jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } var transactionLog = storeWorker.TransactionLog; var transactionList = transactionLog.GetTransactionList(); var i = 0; while (transactionList.MoveNext()) { i++; } Assert.AreEqual(1, i); data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt"); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } transactionList.Reset(); i = 0; while (transactionList.MoveNext()) { i++; } Assert.AreEqual(2, i); }
public ImportJob(Guid jobId, StoreWorker storeWorker, string contentFileName, string graphUri) : base(jobId, storeWorker) { _contentFileName = contentFileName; _graphUri = graphUri; }
public void TestRecoverTransactionData() { // create a store var sid = CreateStore(); // initialise and start the store worker var storeWorker = new StoreWorker(Configuration.StoreLocation, sid); storeWorker.Start(); // execute transactions const string data = @"<http://www.networkedplanet.com/people/gra> <http://www.networkedplanet.com/types/worksfor> <http://www.networkedplanet.com/companies/np>"; var jobId = storeWorker.ProcessTransaction("", "", "", data, Constants.DefaultGraphUri, "nt"); JobExecutionStatus jobStatus = storeWorker.GetJobStatus(jobId.ToString()); while (jobStatus.JobStatus != JobStatus.CompletedOk) { Thread.Sleep(1000); jobStatus = storeWorker.GetJobStatus(jobId.ToString()); } var transactionLog = storeWorker.TransactionLog; var transactionList = transactionLog.GetTransactionList(); var i = 0; while (transactionList.MoveNext()) { i++; } Assert.AreEqual(1, i); // now get txn data var txnList = storeWorker.TransactionLog.GetTransactionList(); txnList.MoveNext(); var tinfo = txnList.Current; Assert.IsNotNull(tinfo); Assert.AreEqual(TransactionType.GuardedUpdateTransaction, tinfo.TransactionType); Assert.AreEqual(TransactionStatus.CompletedOk, tinfo.TransactionStatus); Assert.IsTrue(tinfo.TransactionStartTime < DateTime.UtcNow); var job = new GuardedUpdateTransaction(Guid.NewGuid(), null, storeWorker); using (var tdStream = storeWorker.TransactionLog.GetTransactionData(tinfo.DataStartPosition)) { job.ReadTransactionDataFromStream(tdStream); } Assert.IsNotNull(job); Assert.AreEqual(data, job.InsertData); }
public UpdateTransaction(Guid jobId, string label, StoreWorker storeWorker) : base(jobId, label, storeWorker) { }
public ConsolidateJob(Guid jobId, StoreWorker storeWorker) : base(jobId, storeWorker) { }