Search in sources :

Example 1 with ComponentIdMgr

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;
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams) ReorderTransformation(org.apache.jena.sparql.engine.optimizer.reorder.ReorderTransformation) StoragePrefixes(org.apache.jena.dboe.storage.StoragePrefixes) ComponentIdMgr(org.apache.jena.tdb2.sys.ComponentIdMgr)

Aggregations

StoragePrefixes (org.apache.jena.dboe.storage.StoragePrefixes)1 ReorderTransformation (org.apache.jena.sparql.engine.optimizer.reorder.ReorderTransformation)1 StoreParams (org.apache.jena.tdb2.params.StoreParams)1 ComponentIdMgr (org.apache.jena.tdb2.sys.ComponentIdMgr)1