use of org.apache.jena.tdb2.store.StoragePrefixesTDB in project jena by apache.
the class LoaderMain method executeData.
/**
* Create data ingestion and primary index building of a {@link LoaderPlan}.
* In phase 1, separate threads for parsing, node table loading and primary index building,
*
* Used by {@link InputStage#MULTI}.
*/
private static StreamRDFCounting executeData(LoaderPlan loaderPlan, DatasetGraphTDB dsgtdb, Map<String, TupleIndex> indexMap, List<BulkStartFinish> dataProcess, MonitorOutput output) {
StoragePrefixesTDB dps = (StoragePrefixesTDB) dsgtdb.getStoragePrefixes();
PrefixHandlerBulk prefixHandler = new PrefixHandlerBulk(dps, output);
dataProcess.add(prefixHandler);
// -- Phase 2 block. Indexer and Destination (blocks of Tuple<NodeId>)
TupleIndex[] idx3 = PhasedOps.indexSetFromNames(loaderPlan.primaryLoad3(), indexMap);
Indexer indexer3 = new Indexer(output, idx3);
TupleIndex[] idx4 = PhasedOps.indexSetFromNames(loaderPlan.primaryLoad4(), indexMap);
Indexer indexer4 = new Indexer(output, idx4);
dataProcess.add(indexer3);
dataProcess.add(indexer4);
Destination<Tuple<NodeId>> functionIndexer3 = indexer3.index();
Destination<Tuple<NodeId>> functionIndexer4 = indexer4.index();
// -- Phase 2 block.
// -- Phase 1.
// This is the other way round to AsyncParser.
// Here, we return a StreamRDF to pump data into and the rest of the
// processing is on other threads. AsyncParser has the processing on the caller thread
// and so the current thread continues when the processing from the parser is finished.
DataToTuples dtt = new DataToTuples(dsgtdb, functionIndexer3, functionIndexer4, output);
DataBatcher dataBatcher = new DataBatcher(dtt.data(), prefixHandler.handler(), output);
dataProcess.add(dtt);
dataProcess.add(dataBatcher);
return dataBatcher;
}
use of org.apache.jena.tdb2.store.StoragePrefixesTDB in project jena by apache.
the class TDB2StorageBuilder method buildPrefixes.
private StoragePrefixes buildPrefixes() {
NodeTable nodeTablePrefixes = buildNodeTable(params.getPrefixTableBaseName(), false);
StoragePrefixesTDB prefixes = buildPrefixTable(nodeTablePrefixes);
return prefixes;
}
use of org.apache.jena.tdb2.store.StoragePrefixesTDB in project jena by apache.
the class TDB2StorageBuilder method buildPrefixTable.
private StoragePrefixesTDB buildPrefixTable(NodeTable prefixNodes) {
String primary = params.getPrimaryIndexPrefix();
String[] indexes = params.getPrefixIndexes();
TupleIndex[] prefixIndexes = makeTupleIndexes(primary, indexes);
if (prefixIndexes.length != 1)
error(log, "Wrong number of triple table tuples indexes: " + prefixIndexes.length);
// No cache - the prefix mapping is a cache
// NodeTable prefixNodes = makeNodeTable(location, pnNode2Id, pnId2Node, -1, -1, -1);
NodeTupleTable prefixTable = new NodeTupleTableConcrete(primary.length(), prefixIndexes, prefixNodes);
StoragePrefixesTDB x = new StoragePrefixesTDB(txnSystem, prefixTable);
// DatasetPrefixesTDB prefixes = new DatasetPrefixesTDB(prefixTable);
log.debug("Prefixes: " + primary + " :: " + String.join(",", indexes));
return x;
}
Aggregations