Search in sources :

Example 21 with Block

use of org.apache.jena.tdb.base.block.Block in project jena by apache.

the class PageBlockMgr method release.

public void release(Page page) {
    Block block = page.getBackingBlock();
    blockMgr.release(block);
}
Also used : Block(org.apache.jena.tdb.base.block.Block)

Example 22 with Block

use of org.apache.jena.tdb.base.block.Block in project jena by apache.

the class PageBlockMgr method getWrite.

public T getWrite(int id) {
    Block block = blockMgr.getWrite(id);
    block.setModified(true);
    T page = pageFactory.fromBlock(block);
    return page;
}
Also used : Block(org.apache.jena.tdb.base.block.Block)

Example 23 with Block

use of org.apache.jena.tdb.base.block.Block in project jena by apache.

the class PageBlockMgr method create.

//    /** Allocate an uninitialized slot.  Fill with a .put later */ 
//    public int allocateId()           { return blockMgr.allocateId() ; }
/** Allocate a new thing */
public T create(BlockType bType) {
    Block block = blockMgr.allocate(-1);
    block.setModified(true);
    T page = pageFactory.createFromBlock(block, bType);
    return page;
}
Also used : Block(org.apache.jena.tdb.base.block.Block)

Example 24 with Block

use of org.apache.jena.tdb.base.block.Block in project jena by apache.

the class PageBlockMgr method getRead.

public T getRead(int id) {
    Block block = blockMgr.getRead(id);
    T page = pageFactory.fromBlock(block);
    return page;
}
Also used : Block(org.apache.jena.tdb.base.block.Block)

Example 25 with Block

use of org.apache.jena.tdb.base.block.Block in project jena by apache.

the class PageBlockMgr method write.

public void write(T page) {
    // Catch updates to non-transactioned datasetgraph.  Check in BlockMgrJournal instead.
    //        if ( ! page.getBackingBlock().isModified() )
    //            warn("Page for block "+page.getBackingBlock().getId()+" not modified") ;
    Block blk = pageFactory.toBlock(page);
    blockMgr.write(blk);
}
Also used : Block(org.apache.jena.tdb.base.block.Block)

Aggregations

Block (org.apache.jena.tdb.base.block.Block)42 ByteBuffer (java.nio.ByteBuffer)15 Test (org.junit.Test)11 BaseTest (org.apache.jena.atlas.junit.BaseTest)10 MappedByteBuffer (java.nio.MappedByteBuffer)2 TDBException (org.apache.jena.tdb.TDBException)2 Adler32 (java.util.zip.Adler32)1 BlockException (org.apache.jena.tdb.base.block.BlockException)1 BlockAccess (org.apache.jena.tdb.base.file.BlockAccess)1 ObjectFile (org.apache.jena.tdb.base.objectfile.ObjectFile)1 RecordBufferPage (org.apache.jena.tdb.base.recordbuffer.RecordBufferPage)1 FileRef (org.apache.jena.tdb.sys.FileRef)1