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

Examples of com.hp.hpl.jena.tdb.base.recordbuffer.RecordBufferPage


       
        @Override
        protected Record rebalance(int id1, Record r1, int id2, Record r2)
        {
            RecordBufferPageMgr mgr = bpt.getRecordsMgr().getRecordBufferPageMgr() ;
            RecordBufferPage page1 = mgr.getWrite(id1) ;
            RecordBufferPage page2 = mgr.getWrite(id2) ;
           
            // Wrong calculatation.
            for ( int i = page2.getCount() ; i <  page1.getMaxSize()/2 ; i++ )
            {
                //shiftOneup(node1, node2) ;
                Record r = page1.getRecordBuffer().getHigh() ;
                page1.getRecordBuffer().removeTop() ;

                page2.getRecordBuffer().add(0, r) ;
            }

            mgr.put(page1) ;
            mgr.put(page2) ;
           
View Full Code Here


    @Test public void recBufferPage01()
    {
        BlockMgr blkMgr = makeBlockMgr() ;
        blkMgr.beginUpdate() ;
        RecordBufferPageMgr rpm = new RecordBufferPageMgr(factory, blkMgr) ;
        RecordBufferPage page = rpm.create() ;
        fill(page.getRecordBuffer(), 10, 20, 30) ;
        assertEquals(10, get(page, 0)) ;
        assertEquals(20, get(page, 1)) ;
        assertEquals(30, get(page, 2)) ;
        rpm.release(page) ;
        blkMgr.endUpdate() ;
View Full Code Here

        BlockMgr blkMgr = makeBlockMgr() ;
        blkMgr.beginUpdate() ;
        RecordBufferPageMgr rpm = new RecordBufferPageMgr(factory, blkMgr) ;
        int x = -99 ;
        {
            RecordBufferPage page1 = rpm.create() ;
            fill(page1.getRecordBuffer(), 10, 20, 30) ;
            x = page1.getId() ;
            rpm.put(page1) ;
            page1 = null ;
        }
        blkMgr.endUpdate() ;
        blkMgr.beginRead() ;
        {
            RecordBufferPage page2 = rpm.getRead(x) ;
            assertEquals(10, get(page2, 0)) ;
            assertEquals(20, get(page2, 1)) ;
            assertEquals(30, get(page2, 2)) ;
            rpm.release(page2) ;
        }
View Full Code Here

            assertTrue(Record.compareByKeyValue(RecordLib.intToRecord(values[i]),bpr.getRecordBuffer().get(i)) == 0 ) ;
    }

    private static BPTreeRecords make()
    {
        RecordBufferPage page = recordBufferPageMgr.create() ;
        return new BPTreeRecords(bPlusTree, page) ;
    }
View Full Code Here

            assertTrue(Record.compareByKeyValue(RecordLib.intToRecord(values[i]),bpr.getRecordBuffer().get(i)) == 0 ) ;
    }

    private static BPTreeRecords make()
    {
        RecordBufferPage page = recordBufferPageMgr.create() ;
        return new BPTreeRecords(bPlusTree, page) ;
    }
View Full Code Here

    @Test public void recBufferPage01()
    {
        BlockMgr blkMgr = makeBlockMgr() ;
        blkMgr.beginUpdate() ;
        RecordBufferPageMgr rpm = new RecordBufferPageMgr(factory, blkMgr) ;
        RecordBufferPage page = rpm.create() ;
        fill(page.getRecordBuffer(), 10, 20, 30) ;
        assertEquals(10, get(page, 0)) ;
        assertEquals(20, get(page, 1)) ;
        assertEquals(30, get(page, 2)) ;
        rpm.release(page) ;
        blkMgr.endUpdate() ;
View Full Code Here

        BlockMgr blkMgr = makeBlockMgr() ;
        blkMgr.beginUpdate() ;
        RecordBufferPageMgr rpm = new RecordBufferPageMgr(factory, blkMgr) ;
        int x = -99 ;
        {
            RecordBufferPage page1 = rpm.create() ;
            fill(page1.getRecordBuffer(), 10, 20, 30) ;
            x = page1.getId() ;
            rpm.put(page1) ;
            page1 = null ;
        }
        blkMgr.endUpdate() ;
        blkMgr.beginRead() ;
        {
            RecordBufferPage page2 = rpm.getRead(x) ;
            assertEquals(10, get(page2, 0)) ;
            assertEquals(20, get(page2, 1)) ;
            assertEquals(30, get(page2, 2)) ;
            rpm.release(page2) ;
        }
View Full Code Here

       
        @Override
        protected Record rebalance(int id1, Record r1, int id2, Record r2)
        {
            RecordBufferPageMgr mgr = bpt.getRecordsMgr().getRecordBufferPageMgr() ;
            RecordBufferPage page1 = mgr.getWrite(id1) ;
            RecordBufferPage page2 = mgr.getWrite(id2) ;
           
            // Wrong calculatation.
            for ( int i = page2.getCount() ; i <  page1.getMaxSize()/2 ; i++ )
            {
                //shiftOneup(node1, node2) ;
                Record r = page1.getRecordBuffer().getHigh() ;
                page1.getRecordBuffer().removeTop() ;

                page2.getRecordBuffer().add(0, r) ;
            }

            mgr.put(page1) ;
            mgr.put(page2) ;
           
View Full Code Here

    {
        divider() ;
        List<Pair<Integer, Record>> x = Iter.toList(iter) ;
        for (Pair<Integer, Record> pair : x )
        {
            RecordBufferPage rbp = recordPageMgr.getRead(pair.car()) ;
            System.out.printf("%s -- RecordBufferPage[id=%d,link=%d] (%d) -> [%s]\n", pair, rbp.getId(), rbp.getLink(), rbp.getCount(), rbp.getRecordBuffer().getHigh() ) ;
            recordPageMgr.release(rbp) ;
        }
        return x.iterator() ;
    }
View Full Code Here

        List<Pair<Integer, Record>> x = Iter.toList(iter) ;
        System.out.printf(">>Packed data blocks\n") ;
        for (Pair<Integer, Record> pair : x )
        {
            System.out.printf("  %s\n",pair) ;
            RecordBufferPage rbp = recordPageMgr.getRead(pair.car()) ;
            //System.out.printf("RecordBufferPage[id=%d,link=%d] %d\n", rbp.getId(), rbp.getLink(), rbp.getCount() ) ;
            System.out.println(rbp) ;
            recordPageMgr.release(rbp) ;
        }
        System.out.printf("<<Packed data blocks\n") ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.tdb.base.recordbuffer.RecordBufferPage

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.