use of org.apache.jena.tdb2.sys.ComponentIdMgr in project jena by apache.
the class TDB2StorageBuilder method build.
// public static DatasetGraphTxn build(Location location, StoreParams appParams) {
// StoreParams locParams = StoreParamsCodec.read(location);
// StoreParams dftParams = StoreParams.getDftStoreParams();
// boolean newArea = isNewDatabaseArea(location);
// if ( newArea ) {
// }
// // This can write the chosen parameters if necessary (new database, appParams != null, locParams == null)
// StoreParams params = StoreParamsFactory.decideStoreParams(location, newArea, appParams, locParams, dftParams);
// return create(location, params).build$();
// }
public static DatasetGraphTDB build(Location location, StoreParams appParams) {
StoreParams locParams = StoreParamsCodec.read(location);
StoreParams dftParams = StoreParams.getDftStoreParams();
boolean newArea = isNewDatabaseArea(location);
if (newArea) {
}
// This can write the chosen parameters if necessary (new database, appParams != null, locParams == null)
StoreParams params = StoreParamsFactory.decideStoreParams(location, newArea, appParams, locParams, dftParams);
// Builder pattern for adding components.
TransactionCoordinator txnCoord = buildTransactionCoordinator(location);
TransactionalSystem txnSystem = new TransactionalBase(txnCoord);
TDB2StorageBuilder builder = new TDB2StorageBuilder(txnSystem, location, params, new ComponentIdMgr(UUID.randomUUID()));
StorageTDB storage = builder.buildStorage();
StoragePrefixes prefixes = builder.buildPrefixes();
// Finalize.
builder.components.forEach(txnCoord::add);
builder.listeners.forEach(txnCoord::addListener);
// Freezes the TransactionCoordinator components
txnCoord.start();
ReorderTransformation reorderTranform = chooseReorderTransformation(location);
DatasetGraphTDB dsg = new DatasetGraphTDB(location, params, reorderTranform, storage, prefixes, txnSystem);
// Enable query processing.
QC.setFactory(dsg.getContext(), OpExecutorTDB2.OpExecFactoryTDB);
return dsg;
}
Aggregations