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

Examples of com.hp.hpl.jena.tdb.base.block.BlockMgr


        SystemTDB.NullOut = originalNullOut ;   
    }

    @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


        blkMgr.endUpdate() ;
    }
   
    @Test public void recBufferPage02()
    {
        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) ;
        }
        blkMgr.endRead() ;
    }
View Full Code Here

    @Override
    protected Index makeIndex(int kLen, int vLen)
    {
        RecordFactory factory = new RecordFactory(kLen, vLen) ;
        BlockMgr mgr = BlockMgrFactory.createMem("EXT", 32) ;
        ExtHash eHash = new ExtHash(new PlainFileMem(), factory, mgr) ;
        return eHash ;
    }
View Full Code Here

       
        int readCacheSize = 10 ;
        int writeCacheSize = 100 ;
       
        FileSet destination = new FileSet(location, indexName) ;
        BlockMgr blkMgrNodes = BlockMgrFactory.create(destination, Names.bptExtTree, SystemTDB.BlockSize, readCacheSize, writeCacheSize) ;
        BlockMgr blkMgrRecords = BlockMgrFactory.create(destination, Names.bptExtRecords, SystemTDB.BlockSize, readCacheSize, writeCacheSize) ;
       
        cmdLog.info("Index: creating " + indexName + " index...") ;
        final ProgressLogger monitor = new ProgressLogger(cmdLog, "records to " + indexName, BulkLoader.DataTickPoint,BulkLoader.superTick) ;
        monitor.start() ;
       
View Full Code Here

            return ;
        }
       
        RecordFactory recordFactory = null ;
        BPlusTreeParams bptParams = null ;
        BlockMgr blkMgrNodes ;
        BlockMgr blkMgrRecords ;
        int blockSize = SystemTDB.BlockSize ;
        Iterator<Record> iterator ;
       
        RangeIndex rangeIndex = SetupTDB.makeRangeIndex(srcLoc, indexName, dftKeyLength, dftValueLength, readCacheSize, writeCacheSize) ;
        BPlusTree bpt = (BPlusTree)rangeIndex ;
View Full Code Here

        int blockSizeNodes = blockSize ;
        int blockSizeRecords = blockSize ;

        FileSet destination = new FileSet(location, indexName) ;

        BlockMgr blkMgrNodes = BlockMgrFactory.create(destination, Names.bptExtTree, blockSizeNodes, readCacheSize, writeCacheSize) ;
        BlockMgr blkMgrRecords = BlockMgrFactory.create(destination, Names.bptExtRecords, blockSizeRecords, readCacheSize, writeCacheSize) ;
       
        int rowBlock = 1000 ;
        Iterator<Record> iter = new RecordsFromInput(input, tupleLength, colMap, rowBlock) ;
        BPlusTree bpt2 = BPlusTreeRewriter.packIntoBPlusTree(iter, bptParams, recordFactory, blkMgrNodes, blkMgrRecords) ;
        bpt2.close() ;
View Full Code Here

            int order = BPlusTreeParams.calcOrder(SystemTDB.BlockSize, recordFactory) ;
            BPlusTreeParams bptParams = new BPlusTreeParams(order, recordFactory) ;
            int readCacheSize = 10 ;
            int writeCacheSize = 100 ;
            FileSet destination = new FileSet(dsg.getLocation(), Names.indexNode2Id) ;
            BlockMgr blkMgrNodes = BlockMgrFactory.create(destination, Names.bptExtTree, SystemTDB.BlockSize, readCacheSize, writeCacheSize) ;
            BlockMgr blkMgrRecords = BlockMgrFactory.create(destination, Names.bptExtRecords, SystemTDB.BlockSize, readCacheSize, writeCacheSize) ;
            Iterator<Record> iter2 = Iter.iter(sdb03.iterator()).map(transformPair2Record) ;
            BPlusTree bpt2 = BPlusTreeRewriter.packIntoBPlusTree(iter2, bptParams, recordFactory, blkMgrNodes, blkMgrRecords) ;
            bpt2.sync() ;

            ProgressLogger.print ( log, monitor03 ) ;
View Full Code Here

        List<Record> originaldata = TestBPlusTreeRewriter.createData(N, recordFactory) ;

        FileSet destination = FileSet.mem() ;
        // ---- Rewrite
        // Write leaves to ...
        BlockMgr blkMgr1 = BlockMgrFactory.create(destination, Names.bptExtTree, bptParams.getCalcBlockSize(), 10, 10) ;
        // Write nodes to ...
        BlockMgr blkMgr2 = BlockMgrFactory.create(destination, Names.bptExtTree, bptParams.getCalcBlockSize(), 10, 10) ;
       
        BPlusTree bpt2 = BPlusTreeRewriter.packIntoBPlusTree(originaldata.iterator(), bptParams,
                                                             recordFactory, blkMgr1, blkMgr2) ;

        if ( debug )
View Full Code Here

        SystemTDB.NullOut = originalNullOut ;   
    }

    @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

        blkMgr.endUpdate() ;
    }
   
    @Test public void recBufferPage02()
    {
        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) ;
        }
        blkMgr.endRead() ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.tdb.base.block.BlockMgr

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.