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

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


        BlockMgrTracker.verbose = b ;
    }   
   
    @Test public void track_01()
    {
        BlockMgr mgr = BlockMgrFactory.createMem("BPTRecord", 4) ;
        mgr = BlockMgrFactory.tracker(mgr) ;
        mgr.beginUpdate() ;
        Block block = mgr.allocate(4) ;
        ByteBuffer bb = block.getByteBuffer() ;
        bb.putInt(0,1234) ;
        mgr.write(block) ;
        mgr.release(block) ;
        // -----
        Block block2 = mgr.getRead(block.getId()) ;
        ByteBuffer bb2 = block2.getByteBuffer() ;
        assertArrayEquals(bb.array(), bb2.array()) ;
        mgr.release(block2) ;
        mgr.endUpdate() ;
    }
View Full Code Here


    }

    // Multiple overlapping read operations.
    static BlockMgr setup()
    {
        BlockMgr mgr = BlockMgrFactory.createMem("BPTRecord", 4) ;
        mgr = BlockMgrFactory.tracker(mgr) ;
        return mgr ;
    }
View Full Code Here

        mgr.endUpdate() ;
    }
   
    @Test public void track_02()
    {
        BlockMgr mgr = setup() ;
        write(mgr, 1234) ;
        write(mgr, 5678) ;

        mgr.beginRead() ;
        mgr.beginRead() ;

        Block b0 = mgr.getRead(0) ;
        Block b1 = mgr.getRead(1) ;
       
        mgr.release(b1) ;
        mgr.release(b0) ;
       
        mgr.endRead() ;
        mgr.endRead() ;
    }
View Full Code Here

    }
   
    @Test(expected=BlockException.class)
    public void track_03()
    {
        BlockMgr mgr = setup() ;
        write(mgr, 1234) ;
        write(mgr, 5678) ;

        mgr.beginRead() ;
        Block b0 = mgr.getWrite(0) ;
        mgr.endRead() ;
    }
View Full Code Here

    }

    @Test(expected=BlockException.class)
    public void track_04()
    {
        BlockMgr mgr = setup() ;
        write(mgr, 1234) ;
        mgr.beginRead() ;
        Block b0 = mgr.getRead(0) ;
        mgr.promote(b0) ;
        mgr.endRead() ;
    }
View Full Code Here

    }

    @Test(expected=BlockException.class)
    public void track_05()
    {
        BlockMgr mgr = setup() ;
        mgr.beginRead() ;
        mgr.endUpdate() ;
    }
View Full Code Here

    }

    @Test(expected=BlockException.class)
    public void track_06()
    {
        BlockMgr mgr = setup() ;
        mgr.beginUpdate() ;
        mgr.endRead() ;
    }
View Full Code Here

        }
       
        @Override
        public BlockMgr buildBlockMgr(FileSet fileSet, String ext, int blockSize)
        {
            BlockMgr blkMgr = builder.buildBlockMgr(fileSet, ext, blockSize) ;
            FileRef ref = FileRef.create(fileSet, ext) ;
            recorder.record(ref, blkMgr) ;
            return blkMgr ;
        }
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

    int order = BPlusTreeParams.calcOrder(SystemTDB.BlockSize, recordFactory) ;
    BPlusTreeParams bptParams = new BPlusTreeParams(order, recordFactory) ;
    int readCacheSize = 10 ;
    int writeCacheSize = 100 ;
    FileSet destination = new FileSet(location, 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(sortedDataBag.iterator()).map(transformPair2Record) ;
      BPlusTree bpt2 = BPlusTreeRewriter.packIntoBPlusTree(iter2, bptParams, recordFactory, blkMgrNodes, blkMgrRecords) ;
      bpt2.sync() ;
      bpt2.close() ;
   
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.