use of org.apache.jena.dboe.base.block.Block in project jena by apache.
the class PageBlockMgr method create.
/**
* 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;
}
use of org.apache.jena.dboe.base.block.Block in project jena by apache.
the class PageBlockMgr method free.
public void free(Page page) {
Block block = page.getBackingBlock();
blockMgr.free(block);
}
use of org.apache.jena.dboe.base.block.Block in project jena by apache.
the class AbstractTestBlockAccessFixedSize method fileaccess_03.
@Test
public void fileaccess_03() {
Block b1 = data(file, blkSize);
file.write(b1);
long x = b1.getId();
Block b9 = file.read(x);
assertNotSame(b1, b9);
assertTrue(sameValue(b1, b9));
b9 = file.read(x);
assertNotSame(b1, b9);
assertTrue(sameValue(b1, b9));
}
use of org.apache.jena.dboe.base.block.Block in project jena by apache.
the class AbstractTestBlockAccessFixedSize method fileaccess_02.
@Test
public void fileaccess_02() {
Block b = data(file, blkSize);
file.write(b);
}
use of org.apache.jena.dboe.base.block.Block in project jena by apache.
the class AbstractTestBlockAccessVarSize method fileaccess_50.
@Test
public void fileaccess_50() {
BlockAccess file = make();
Block b1 = data(file, 10);
Block b2 = data(file, 20);
file.write(b1);
file.write(b2);
Block b1a = file.read(b1.getId());
Block b2a = file.read(b2.getId());
assertNotSame(b1a, b1);
assertNotSame(b2a, b2);
sameValue(b1, b1a);
sameValue(b2, b2a);
}
Aggregations