use of org.apache.jena.tdb.base.block.Block in project jena by apache.
the class RecordBufferPageMgr method getReadIterator.
public RecordBufferPage getReadIterator(int id) {
Block block = blockMgr.getReadIterator(id);
RecordBufferPage page = pageFactory.fromBlock(block);
return page;
}
use of org.apache.jena.tdb.base.block.Block in project jena by apache.
the class BlockAccessMem method read.
@Override
public Block read(long id) {
check(id);
Block blk = blocks.get((int) id);
if (safeModeThisMgr)
return blk.replicate();
else
return blk;
}
use of org.apache.jena.tdb.base.block.Block in project jena by apache.
the class BlockAccessDirect method allocate.
@Override
public Block allocate(int blkSize) {
if (blkSize > 0 && blkSize != this.blockSize)
throw new FileException("Fixed blocksize only: request= " + blkSize + "fixed size=" + this.blockSize);
int x = allocateId();
ByteBuffer bb = ByteBuffer.allocate(blkSize);
Block block = new Block(x, bb);
return block;
}
use of org.apache.jena.tdb.base.block.Block in project jena by apache.
the class BlockAccessDirect method read.
@Override
public Block read(long id) {
check(id);
checkIfClosed();
ByteBuffer bb = ByteBuffer.allocate(blockSize);
readByteBuffer(id, bb);
bb.rewind();
Block block = new Block(id, bb);
return block;
}
use of org.apache.jena.tdb.base.block.Block in project jena by apache.
the class PageBlockMgr method promote.
public void promote(Page page) {
// Replace, reset Block in page.
Block block = page.getBackingBlock();
Block block2 = blockMgr.promote(block);
if (block2 != block) {
block2.setModified(true);
// Change - reset Block in page.
page.reset(block2);
}
}
Aggregations