Package com.hp.hpl.jena.tdb.base.record

Examples of com.hp.hpl.jena.tdb.base.record.Record


            //warning("Runt node: %s", this) ;
            error("Runt node: %s", this) ;
        }
        if ( !isRoot() && count > maxRecords() ) error("Over full node: %s", this) ;
        if ( ! isLeaf && parent == id ) error("Parent same as id: %s", this)
        Record k = min ;
   
        // Test records in the allocated area
        for ( int i = 0 ; i < count ; i++ )
        {
            if ( records.get(i) == null ) error("Node: %d : Invalid record @%d :: %s",id, i, this) ;
            if ( k != null && keyGT(k, records.get(i)) )
            {
                Record r = records.get(i) ;
                //keyGT(k, r) ;
                error("Node: %d: Not sorted (%d) (%s, %s) :: %s ", id, i, k, r, this) ;
            }
            k = records.get(i) ;
        }
View Full Code Here


        // Check pointers.
        int limit = (count == 0) ? 0 : count+1 ;
       
        for ( int i = 0 ; i < limit ; i++ )
        {
            Record min1 = min ;
            Record max1 = max ;
            BPTreePage n = get(i, READ) ;
           
            if ( i != count )
            {
                Record keySubTree = n.getHighRecord() ;     // high key in immediate child
                Record keyHere = records.get(i) ;           // key in this
               
                if ( keySubTree == null )
                    error("Node: %d: Can't get high record from %d", id, n.getId()) ;
               
                if ( keySubTree.getKey() == null )
                    error("Node: %d: Can't get high record is missing it's key from %d", id, n.getId()) ;
                   
                if ( keyHere == null )
                    error("Node: %d: record is null", id) ;
               
                if ( keyHere.getKey() == null )
                    error("Node: %d: Record key is null", id) ;
               
                if ( keyGT(keySubTree, keyHere) )
                    error("Node: %d: Child key %s is greater than this key %s", id, keySubTree, keyHere) ;
               
                Record keyMax = n.maxRecord() ;             // max key in subTree
                Record keyMin = n.minRecord() ;
               
                if ( keyNE(keyHere, keyMax) )
                    error("Node: %d: Key %s is not the max [%s] of the sub-tree idx=%d", id, keyHere, keyMax, i) ;
               
                if ( min != null && keyGT(min, keyMin) )
View Full Code Here

    {
        Hash hash = new Hash(nodeHashToId.getRecordFactory().keyLength()) ;
        setHash(hash, node) ;
        byte k[] = hash.getBytes() ;       
        // Key only.
        Record r = nodeHashToId.getRecordFactory().create(k) ;
       
        synchronized (this// Pair to readNodeFromTable.
        {
            // Key and value, or null
            Record r2 = nodeHashToId.find(r) ;
            if ( r2 != null )
            {
                // Found.  Get the NodeId.
                NodeId id = NodeId.create(r2.getValue(), 0) ;
                return id ;
            }

            // Not found.
            if ( ! create )
View Full Code Here

            if ( currentPage != null )
                pageMgr.release(currentPage) ;
           
            RecordBufferPage nextPage = pageMgr.getReadIterator(link) ;
            // Check currentPage -> nextPage is strictly increasing keys.
            Record r1 = currentPage.getRecordBuffer().getHigh() ;
            Record r2 = nextPage.getRecordBuffer().getLow() ;
            if ( Record.keyGE(r1, r2) )
                throw new StorageException("RecordRangeIterator: records not strictly increasing: "+r1+" // "+r2) ;
            currentPage = nextPage ;
            countBlocks++ ;
            currentIdx = 0 ;
View Full Code Here

    public Record next()
    {
        if ( ! hasNext() )
            throw new NoSuchElementException() ;
       
        Record x = slot ;
        slot = null ;
        return x ;
    }
View Full Code Here

   
    /** Insert a tuple - return true if it was really added, false if it was a duplicate */
    @Override
    protected boolean performAdd(Tuple<NodeId> tuple)
    {
        Record r = TupleLib.record(factory, tuple, colMap) ;
        return index.add(r) ;
    }
View Full Code Here

   
    /** Delete a tuple - return true if it was deleted, false if it didn't exist */
    @Override
    protected boolean performDelete(Tuple<NodeId> tuple)
    {
        Record r = TupleLib.record(factory, tuple, colMap) ;
        return index.delete(r) ;
    }
View Full Code Here

        int numSlots = 0 ;
        int leadingIdx = -2;    // Index of last leading pattern NodeId.  Start less than numSlots-1
        boolean leading = true ;
       
        // Records.
        Record minRec = factory.createKeyOnly() ;
        Record maxRec = factory.createKeyOnly() ;
       
        // Set the prefixes.
        for ( int i = 0 ; i < pattern.size() ; i++ )
        {
            NodeId X = pattern.get(i) ;
            if ( NodeId.isAny(X) )
            {
                X = null ;
                // No longer seting leading key slots.
                leading = false ;
                continue ;
            }

            numSlots++ ;
            if ( leading )
            {
                leadingIdx = i ;
                Bytes.setLong(X.getId(), minRec.getKey(), i*SizeOfNodeId) ;
                Bytes.setLong(X.getId(), maxRec.getKey(), i*SizeOfNodeId) ;
            }
        }
       
        // Is it a simple existence test?
        if ( numSlots == pattern.size() )
        {
            if ( index.contains(minRec) )
                return new SingletonIterator<Tuple<NodeId>>(pattern)
            else
                return new NullIterator<Tuple<NodeId>>() ;
        }
       
        Iterator<Record> iter = null ;
       
        if ( leadingIdx < 0 )
        {
            if ( ! fullScanAllowed )
                return null ;
            //System.out.println("Full scan") ;
            // Full scan necessary
            iter = index.iterator() ;
        }
        else
        {
            // Adjust the maxRec.
            NodeId X = pattern.get(leadingIdx) ;
            // Set the max Record to the leading NodeIds, +1.
            // Example, SP? inclusive to S(P+1)? exclusive where ? is zero.
            Bytes.setLong(X.getId()+1, maxRec.getKey(), leadingIdx*SizeOfNodeId) ;
            iter = index.iterator(minRec, maxRec) ;
        }
       
        Iterator<Tuple<NodeId>> tuples = Iter.map(iter, transformToTuple) ;
       
View Full Code Here

    public Record find(Record key)
    {
        if ( logging() ) log(">> get(%s)", key) ;
        int blockId = bucketId(key, bitLen) ;
        HashBucket bucket = hashBucketMgr.get(blockId) ;
        Record value = bucket.find(key) ;
        if ( logging() ) log("<< get(%s) -> %s", key.getKey(), value) ;
        return value ;
    }
View Full Code Here

        int idx1 = 0 // Destination indexes into the above
        int idx2 = 0 ;
       
        for ( int i = 0 ; i < rBuff1.size() ; i++ )
        {
            Record r = rBuff1.get(i) ;
            int x = trieKey(r, bucket.getTrieBitLen()) // Incremented bit length
            if ( x == hash1 )
            {
                if ( logging() )
                    log("Allocate index %d to bucket1", i) ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.tdb.base.record.Record

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.