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

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


       
        BPlusTreeParams params = new BPlusTreeParams(order, factory) ;
        if ( params.getCalcBlockSize() > blockSize )
            throw new TDBException("Calculated block size is greater than required size") ;
       
        BlockMgr blkMgrNodes = createBlockMgr(fileset, Names.bptExtTree, blockSize) ;
        BlockMgr blkMgrRecords = createBlockMgr(fileset, Names.bptExtRecords, blockSize) ;
        return BPlusTree.create(params, blkMgrNodes, blkMgrRecords) ;
    }
View Full Code Here


    {
        String fnDictionary = fileset.filename(Names.extHashExt) ;
        PlainFile dictionary = FileFactory.createPlainFileDisk(fnDictionary) ;
       
        String fnBuckets = fileset.filename(Names.extHashBucketExt) ;
        BlockMgr mgr =  createBlockMgr(fnBuckets, blockSize) ;
        ExtHash eHash = new ExtHash(dictionary, recordFactory, mgr) ;
        return eHash ;
    }
View Full Code Here

            // Only in-memory.
            blockSize = BPlusTreeParams.calcBlockSize(order, factory) ;
        }
   
        BPlusTreeParams params = new BPlusTreeParams(order, factory) ;
        BlockMgr blkMgrNodes = BlockMgrFactory.create(fileset, Names.bptExtTree, blockSize, readCacheSize, writeCacheSize) ;
        BlockMgr blkMgrRecords = BlockMgrFactory.create(fileset, Names.bptExtRecords, blockSize, readCacheSize, writeCacheSize) ;
        return BPlusTree.create(params, blkMgrNodes, blkMgrRecords) ;
    }
View Full Code Here

        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

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.