use of org.apache.jena.tdb.store.NodeId in project jena by apache.
the class NodeTableLib method print.
public static void print(String label, NodeTable nodeTable) {
if (label != null)
System.out.println(label);
Iterator<Pair<NodeId, Node>> iter = nodeTable.all();
for (; iter.hasNext(); ) {
Pair<NodeId, Node> x = iter.next();
NodeId nodeId = x.getLeft();
Node node = x.getRight();
System.out.println(nodeId + " " + node);
}
}
use of org.apache.jena.tdb.store.NodeId in project jena by apache.
the class NodeTableLogger method getAllocateNodeId.
@Override
public NodeId getAllocateNodeId(Node node) {
//info("getAllocateNodeId("+node+") =>") ;
NodeId nId = nodeTable.getAllocateNodeId(node);
info("getAllocateNodeId(" + node + ") => " + nId);
return nId;
}
use of org.apache.jena.tdb.store.NodeId in project jena by apache.
the class NodeTableLogger method allocOffset.
@Override
public NodeId allocOffset() {
NodeId nodeId = nodeTable.allocOffset();
info("allocOffset() => " + nodeId);
return nodeId;
}
use of org.apache.jena.tdb.store.NodeId in project jena by apache.
the class BindingNodeId method putAll.
public void putAll(BindingNodeId other) {
Iterator<Var> vIter = other.iterator();
for (; vIter.hasNext(); ) {
Var v = vIter.next();
if (v == null)
throw new IllegalArgumentException("Null key");
NodeId n = other.get(v);
if (n == null)
throw new IllegalArgumentException("(" + v + "," + n + ")");
super.put(v, n);
}
}
use of org.apache.jena.tdb.store.NodeId in project jena by apache.
the class BindingTDB method get1.
@Override
public Node get1(Var var) {
try {
Node n = cacheGet(var);
if (n != null)
return n;
NodeId id = idBinding.get(var);
if (id == null)
return null;
n = nodeTable.getNodeForNodeId(id);
// Update cache.
cachePut(var, n);
return n;
} catch (Exception ex) {
Log.error(this, String.format("get1(%s)", var), ex);
return null;
}
}
Aggregations