use of org.apache.jena.tdb.store.DatasetGraphTDB in project jena by apache.
the class DatasetBuilderTxn method buildReadonly.
private DatasetGraphTDB buildReadonly() {
BlockMgrBuilder blockMgrBuilder = new BlockMgrBuilderReadonly();
NodeTableBuilder nodeTableBuilder = new NodeTableBuilderReadonly();
DatasetBuilderStd x = new DatasetBuilderStd(blockMgrBuilder, nodeTableBuilder);
DatasetGraphTDB dsg2 = x._build(dsg.getLocation(), dsg.getConfig().params, false, dsg.getReorderTransform());
return dsg2;
}
use of org.apache.jena.tdb.store.DatasetGraphTDB in project jena by apache.
the class DatasetBuilderTxn method buildWritable.
private DatasetGraphTDB buildWritable() {
BlockMgrBuilder blockMgrBuilder = new BlockMgrBuilderTx();
NodeTableBuilder nodeTableBuilder = new NodeTableBuilderTx();
DatasetBuilderStd x = new DatasetBuilderStd(blockMgrBuilder, nodeTableBuilder);
DatasetGraphTDB dsg2 = x._build(dsg.getLocation(), dsg.getConfig().params, true, dsg.getReorderTransform());
dsg2.getContext().putAll(dsg.getContext());
return dsg2;
}
use of org.apache.jena.tdb.store.DatasetGraphTDB in project jena by apache.
the class DatasetBuilderTxn method build.
public DatasetGraphTxn build(Transaction transaction, ReadWrite mode, DatasetGraphTDB dsg) {
this.blockMgrs = dsg.getConfig().blockMgrs;
this.nodeTables = dsg.getConfig().nodeTables;
this.txn = transaction;
this.dsg = dsg;
DatasetGraphTDB dsgTDB;
switch(mode) {
case READ:
dsgTDB = buildReadonly();
break;
case WRITE:
dsgTDB = buildWritable();
break;
// Silly Java.
default:
dsgTDB = null;
}
DatasetGraphTxn dsgTxn = new DatasetGraphTxn(dsgTDB, txn);
// Copy context. Changes not propagated back to the base dataset.
dsgTxn.getContext().putAll(dsg.getContext());
return dsgTxn;
}
use of org.apache.jena.tdb.store.DatasetGraphTDB in project jena by apache.
the class DatasetGraphTransaction method _close.
@Override
protected void _close() {
if (isClosed)
return;
if (!sConn.haveUsedInTransaction()) {
synchronized (this) {
if (isClosed)
return;
isClosed = true;
if (!sConn.isValid()) {
// the StoreConnection.
return;
}
DatasetGraphTDB dsg = sConn.getBaseDataset();
dsg.sync();
dsg.close();
StoreConnection.release(getLocation());
return;
}
}
if (isInTransaction()) {
TDB.logInfo.warn("Attempt to close a DatasetGraphTransaction while a transaction is active - ignored close (" + getLocation() + ")");
return;
}
txn.remove();
inTransaction.remove();
isClosed = true;
}
use of org.apache.jena.tdb.store.DatasetGraphTDB in project jena by apache.
the class JournalControl method replay.
public static void replay(Transaction transaction) {
if (syslog.isDebugEnabled())
syslog.debug("Replay " + transaction.getLabel());
Journal journal = transaction.getJournal();
DatasetGraphTDB dsg = transaction.getBaseDataset();
// Currently, we (crudely) replay the whole journal.
replay(journal, dsg.getConfig());
}
Aggregations