Class NodeTableCache

java.lang.Object
org.apache.jena.tdb1.store.nodetable.NodeTableCache
All Implemented Interfaces:
org.apache.jena.atlas.lib.Closeable, org.apache.jena.atlas.lib.Sync, NodeTable

public class NodeTableCache extends Object implements NodeTable
Cache wrapper around a NodeTable. Assumes all access goes through this wrapper. Read-cache - write caching is done via the object file used by the base NodeTable.
  • Method Details

    • create

      public static NodeTable create(NodeTable nodeTable, StoreParams params)
    • create

      public static NodeTable create(NodeTable nodeTable, int nodeToIdCacheSize, int idToNodeCacheSize, int nodeMissesCacheSize)
    • wrapped

      public final NodeTable wrapped()
      Description copied from interface: NodeTable
      Return a NodeTable if this instance wraps another, else return null
      Specified by:
      wrapped in interface NodeTable
    • getNodeForNodeId

      public org.apache.jena.graph.Node getNodeForNodeId(NodeId id)
      Get the Node for this NodeId, or null if none
      Specified by:
      getNodeForNodeId in interface NodeTable
    • getNodeIdForNode

      public NodeId getNodeIdForNode(org.apache.jena.graph.Node node)
      Find the NodeId for a node, or return NodeId.NodeDoesNotExist
      Specified by:
      getNodeIdForNode in interface NodeTable
    • getAllocateNodeId

      public NodeId getAllocateNodeId(org.apache.jena.graph.Node node)
      Find the NodeId for a node, allocating a new NodeId if the Node does not yet have a NodeId
      Specified by:
      getAllocateNodeId in interface NodeTable
    • containsNode

      public boolean containsNode(org.apache.jena.graph.Node node)
      Description copied from interface: NodeTable
      Test whether the node table contains an entry for node
      Specified by:
      containsNode in interface NodeTable
    • containsNodeId

      public boolean containsNodeId(NodeId nodeId)
      Description copied from interface: NodeTable
      Test whether the node table contains an entry for node
      Specified by:
      containsNodeId in interface NodeTable
    • allocOffset

      public NodeId allocOffset()
      Description copied from interface: NodeTable
      The offset needed to predicate allocation difference between persistent tables - internal function
      Specified by:
      allocOffset in interface NodeTable
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: NodeTable
      Anything there?
      Specified by:
      isEmpty in interface NodeTable
    • close

      public void close()
      Specified by:
      close in interface org.apache.jena.atlas.lib.Closeable
    • sync

      public void sync()
      Specified by:
      sync in interface org.apache.jena.atlas.lib.Sync
    • all

      public Iterator<org.apache.jena.atlas.lib.Pair<NodeId,org.apache.jena.graph.Node>> all()
      Description copied from interface: NodeTable
      Iterate over all nodes (not necessarily fast). Does not include inlined NodeIds
      Specified by:
      all in interface NodeTable
    • toString

      public String toString()
      Overrides:
      toString in class Object