Package com.hp.hpl.jena.tdb.store

Examples of com.hp.hpl.jena.tdb.store.NodeId


        int N = r.getKey().length/SizeOfLong ;
        NodeId[] nodeIds = new NodeId[N] ;
        for ( int i = 0 ; i < N ; i++ )
        {
            long x = Bytes.getLong(r.getKey(), i*SizeOfLong) ;
            NodeId id = NodeId.create(x) ;
            int j = i ;
            if ( cMap != null )
                j = cMap.fetchSlotIdx(i) ;
            nodeIds[j] = id ;
        }
View Full Code Here


        Iterator<Pair<NodeId, Node>> iter = nodeTable.all() ;
        for ( ; iter.hasNext() ; )
        {
            Pair<NodeId, Node> pair = iter.next() ;
            NodeId nid = pair.car() ;
            Node n = pair.cdr();
            String x = NodeFmtLib.serialize(n) ;
            System.out.printf("%016X %s\n", nid.getId(), x) ;
        }
        dumpedNodeTables.add(nodeTable) ;
    }
View Full Code Here

   
    @Override
    public NodeId getAllocateNodeId(Node node)
    {
        if ( passthrough ) return base.getAllocateNodeId(node) ;
        NodeId nodeId = getNodeIdForNode(node) ;
        if ( ! NodeId.isDoesNotExist(nodeId) )
            return nodeId ;
        // add to journal
        nodeId = allocate(node) ;
        return nodeId ;
View Full Code Here

    public NodeId getNodeIdForNode(Node node)
    {
        if ( node == Node.ANY )
            return NodeId.NodeIdAny ;
        if ( passthrough ) return base.getNodeIdForNode(node) ;
        NodeId nodeId = nodeTableJournal.getNodeIdForNode(node) ;
        if ( ! NodeId.isDoesNotExist(nodeId) )
            return mapFromJournal(nodeId) ;
        nodeId = base.getNodeIdForNode(node) ;
        return nodeId ;
    }
View Full Code Here

        return NodeId.create(id.getId()+allocOffset) ;
    }
   
    private NodeId allocate(Node node)
    {
        NodeId nodeId = nodeTableJournal.getAllocateNodeId(node) ;
        nodeId = mapFromJournal(nodeId) ;
        return nodeId ;
    }
View Full Code Here

    public NodeId allocOffset()
    {
        if ( passthrough ) return base.allocOffset() ;
        // If we have done the append stage, this is invalid as the base may change under our feet
        // Would need to track base operations.
        NodeId x1 = nodeTableJournal.allocOffset() ;
        NodeId x2 = mapFromJournal(x1) ;
        return x2 ;
    }
View Full Code Here

           
            if ( firstPair == null )
                firstPair = x ;
            lastPair = x ;
           
            NodeId nodeId = x.getLeft() ;
            Node node = x.getRight() ;
            debug("  append: %s -> %s", x, mapFromJournal(nodeId)) ;
            // This does the write.
            NodeId nodeId2 = base.getAllocateNodeId(node) ;
            if ( ! nodeId2.equals(mapFromJournal(nodeId)) )
                inconsistent(node, nodeId, nodeId2) ;
        }
    }
View Full Code Here

        System.err.println("nodeTableJournal >>>") ;
        Iterator<Pair<NodeId, Node>> iter = nodeTableJournal.all() ;
        for ( ; iter.hasNext() ; )
        {
            Pair<NodeId, Node> x = iter.next() ;
            NodeId nodeId = x.getLeft() ;
            Node node = x.getRight() ;
            NodeId mapped = mapFromJournal(nodeId) ;
            //debug("append: %s -> %s", x, mapFromJournal(nodeId)) ;
            // This does the write.
            NodeId nodeId2 = base.getAllocateNodeId(node) ;
            System.err.println(x + "  mapped=" + mapped + " getAlloc="+nodeId2) ;
        }
       
        System.err.println("journal >>>") ;
        Iterator<Pair<Long, ByteBuffer>> iter1 = this.journalObjFile.all() ;
View Full Code Here

public class DebugTDB
{
    public static NodeId lookup(DatasetGraphTDB dsg, Node n)
    {
        NodeTable nt = dsg.getTripleTable().getNodeTupleTable().getNodeTable() ;
        NodeId nid = nt.getNodeIdForNode(n) ;
        return nid ;
    }
View Full Code Here

   
    public BindingNodeId getBindingId() { return idBinding ; }
   
    public NodeId getNodeId(Var var)
    {
        NodeId id = idBinding.get(var) ;
        if ( id != null )
            return id ;
       
        if ( parent == null )
            return null ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.tdb.store.NodeId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.