Search in sources :

Example 11 with NodeTable

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;
}
Also used : NodeTableTRDF(org.apache.jena.tdb2.store.nodetable.NodeTableTRDF) RecordFactory(org.apache.jena.dboe.base.record.RecordFactory) RangeIndex(org.apache.jena.dboe.index.RangeIndex) Index(org.apache.jena.dboe.index.Index) NodeTable(org.apache.jena.tdb2.store.nodetable.NodeTable)

Example 12 with NodeTable

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;
}
Also used : NodeTable(org.apache.jena.tdb2.store.nodetable.NodeTable)

Example 13 with NodeTable

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);
}
Also used : StoreParams(org.apache.jena.tdb2.params.StoreParams)

Example 14 with NodeTable

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);
}
Also used : Node(org.apache.jena.graph.Node) NodeId(org.apache.jena.tdb2.store.NodeId)

Example 15 with NodeTable

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;
}
Also used : Node(org.apache.jena.graph.Node) NodeTable(org.apache.jena.tdb2.store.nodetable.NodeTable)

Aggregations

NodeId (org.apache.jena.tdb2.store.NodeId)21 NodeTable (org.apache.jena.tdb2.store.nodetable.NodeTable)16 Node (org.apache.jena.graph.Node)14 Tuple (org.apache.jena.atlas.lib.tuple.Tuple)6 Quad (org.apache.jena.sparql.core.Quad)6 NodeTupleTable (org.apache.jena.tdb2.store.nodetupletable.NodeTupleTable)6 ArrayList (java.util.ArrayList)5 Triple (org.apache.jena.graph.Triple)5 NodeTableTRDF (org.apache.jena.tdb2.store.nodetable.NodeTableTRDF)5 Iterator (java.util.Iterator)3 Predicate (java.util.function.Predicate)3 RecordFactory (org.apache.jena.dboe.base.record.RecordFactory)3 Index (org.apache.jena.dboe.index.Index)3 RangeIndex (org.apache.jena.dboe.index.RangeIndex)3 Binding (org.apache.jena.sparql.engine.binding.Binding)3 TupleIndex (org.apache.jena.tdb2.store.tupletable.TupleIndex)3 Function (java.util.function.Function)2 Iter (org.apache.jena.atlas.iterator.Iter)2 InternalErrorException (org.apache.jena.atlas.lib.InternalErrorException)2 TupleFactory (org.apache.jena.atlas.lib.tuple.TupleFactory)2