use of org.apache.jena.tdb2.store.nodetable.NodeTable in project jena by apache.
the class BuildTestLib method makeNodeTableBase.
public static NodeTable makeNodeTableBase(Location location, String basename, StoreParams params) {
RecordFactory recordFactory = new RecordFactory(SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId);
FileSet fs = new FileSet(location, basename);
Index index = buildRangeIndex(fs, recordFactory, params);
BinaryDataFile bdf = createBinaryDataFile(location, basename + "-data");
NodeTable nt = new NodeTableTRDF(index, bdf);
return nt;
}
use of org.apache.jena.tdb2.store.nodetable.NodeTable in project jena by apache.
the class BuildTestLib method makeNodeTable.
public static NodeTable makeNodeTable(Location location, String basename, StoreParams params) {
NodeTable nt = makeNodeTableBase(location, basename, params);
nt = NodeTableCache.create(nt, params);
nt = NodeTableInline.create(nt);
return nt;
}
use of org.apache.jena.tdb2.store.nodetable.NodeTable in project jena by apache.
the class TestNodeTableStoredBase method createEmptyNodeTable.
@Override
protected NodeTable createEmptyNodeTable() {
FileOps.ensureDir(location.getDirectoryPath());
FileOps.clearDirectory(location.getDirectoryPath());
StoreParams params = StoreParamsBuilder.create().nodeId2NodeCacheSize(-1).node2NodeIdCacheSize(-1).nodeMissCacheSize(-1).build();
return BuildTestLib.makeNodeTableBase(location, "test", params);
}
use of org.apache.jena.tdb2.store.nodetable.NodeTable in project jena by apache.
the class AbstractTestNodeTable method writeNode.
protected static void writeNode(NodeTable nt, Node n) {
NodeId nodeId = nt.getAllocateNodeId(n);
assertNotNull(nodeId);
assertNotEquals(NodeId.NodeDoesNotExist, nodeId);
assertNotEquals(NodeId.NodeIdAny, nodeId);
Node n2 = nt.getNodeForNodeId(nodeId);
assertEquals(n, n2);
NodeId nodeId2 = nt.getNodeIdForNode(n);
assertEquals(nodeId, nodeId2);
}
use of org.apache.jena.tdb2.store.nodetable.NodeTable in project jena by apache.
the class TDBInternal method getNode.
/**
* Return the node for a NodeId (if any). Returns null if the NodeId does not exist in
* the dataset.
*/
public static Node getNode(DatasetGraphTDB dsg, NodeId nodeId) {
if (dsg == null)
return null;
NodeTable nodeTable = dsg.getQuadTable().getNodeTupleTable().getNodeTable();
Node node = nodeTable.getNodeForNodeId(nodeId);
return node;
}
Aggregations