コード例 #1
0
ファイル: ServerCore.cs プロジェクト: rexwhitten/BrightstarDB
        public Job LoadTransaction(string storeId, ITransactionInfo txn)
        {
            var transactionLog = _storeManager.GetTransactionLog(_baseLocation + "\\" + storeId);

            var jobId = Guid.NewGuid();

            switch (txn.TransactionType)
            {
            case TransactionType.ImportJob:
                var importJob = new ImportJob(jobId, null);
                importJob.ReadTransactionDataFromStream(transactionLog.GetTransactionData(txn.DataStartPosition));
                return(importJob);

            case TransactionType.UpdateTransaction:
                var updateJob = new UpdateTransaction(jobId, null);
                updateJob.ReadTransactionDataFromStream(transactionLog.GetTransactionData(txn.DataStartPosition));
                return(updateJob);

            case TransactionType.SparqlUpdateTransaction:
                var sparqlUpdateJob = new SparqlUpdateJob(jobId, null, null);
                sparqlUpdateJob.ReadTransactionDataFromStream(transactionLog.GetTransactionData(txn.DataStartPosition));
                return(sparqlUpdateJob);
            }
            return(null);
        }
コード例 #2
0
ファイル: ServerCore.cs プロジェクト: rexwhitten/BrightstarDB
        public Job LoadTransaction(string storeId, ITransactionInfo txn)
        {
            var transactionLog = _storeManager.GetTransactionLog(_baseLocation + "\\" + storeId);

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