コード例 #1
0
ファイル: ServerCore.cs プロジェクト: illinar/BrightstarDB
        public Guid ReExecuteTransaction(string storeId, ulong dataStartPosition, TransactionType transactionType)
        {
            var storeWorker    = GetStoreWorker(storeId);
            var transactionLog = _storeManager.GetTransactionLog(_baseLocation + "\\" + storeId);

            var jobId = Guid.NewGuid();

            switch (transactionType)
            {
            case TransactionType.ImportJob:
                var importJob = new ImportJob(jobId, storeWorker);
                importJob.ReadTransactionDataFromStream(transactionLog.GetTransactionData(dataStartPosition));
                storeWorker.QueueJob(importJob);
                break;

            case TransactionType.UpdateTransaction:
                var updateJob = new UpdateTransaction(jobId, storeWorker);
                updateJob.ReadTransactionDataFromStream(transactionLog.GetTransactionData(dataStartPosition));
                break;

            case TransactionType.SparqlUpdateTransaction:
                var sparqlUpdateJob = new SparqlUpdateJob(jobId, storeWorker, null);
                sparqlUpdateJob.ReadTransactionDataFromStream(transactionLog.GetTransactionData(dataStartPosition));
                break;
            }
            return(jobId);
        }
コード例 #2
0
ファイル: ServerCore.cs プロジェクト: Garwin4j/BrightstarDB
        public Guid ReExecuteTransaction(string storeId, ulong dataStartPosition, TransactionType transactionType)
        {
            var storeWorker = GetStoreWorker(storeId);
            var transactionLog = _storeManager.GetTransactionLog(_baseLocation + "\\" + storeId);

            var jobId = Guid.NewGuid();
            switch (transactionType)
            {
                case TransactionType.ImportJob:
                    var importJob = new ImportJob(jobId, storeWorker);
                    importJob.ReadTransactionDataFromStream(transactionLog.GetTransactionData(dataStartPosition));
                    storeWorker.QueueJob(importJob);
                    break;
                case TransactionType.UpdateTransaction:
                    var updateJob = new UpdateTransaction(jobId, storeWorker);
                    updateJob.ReadTransactionDataFromStream(transactionLog.GetTransactionData(dataStartPosition));
                    break;
                case TransactionType.SparqlUpdateTransaction:
                    var sparqlUpdateJob = new SparqlUpdateJob(jobId, storeWorker, null);
                    sparqlUpdateJob.ReadTransactionDataFromStream(transactionLog.GetTransactionData(dataStartPosition));
                    break;
            }
            return jobId;
        }