Search in sources :

Example 1 with BlockAccess

use of org.apache.jena.tdb.base.file.BlockAccess in project jena by apache.

the class TestBlockMgrDirect method make.

@Override
protected BlockMgr make() {
    // Make directly - no wrapper, no cache, no free block mgt.
    FileOps.delete(filename);
    BlockAccess file = new BlockAccessDirect(filename, BlkSize);
    BlockMgr mgr = new BlockMgrFileAccess(file, BlkSize);
    if (BlockMgrFactory.AddTracker)
        mgr = BlockMgrFactory.tracker(mgr);
    return mgr;
}
Also used : BlockMgr(org.apache.jena.tdb.base.block.BlockMgr) BlockAccessDirect(org.apache.jena.tdb.base.file.BlockAccessDirect) BlockAccess(org.apache.jena.tdb.base.file.BlockAccess) BlockMgrFileAccess(org.apache.jena.tdb.base.block.BlockMgrFileAccess)

Example 2 with BlockAccess

use of org.apache.jena.tdb.base.file.BlockAccess in project jena by apache.

the class TestBlockMgrMapped method make.

@Override
protected BlockMgr make() {
    clearBlockMgr();
    BlockAccess file = new BlockAccessMapped(filename, BlkSize);
    return new BlockMgrFileAccess(file, BlkSize);
}
Also used : BlockAccessMapped(org.apache.jena.tdb.base.file.BlockAccessMapped) BlockAccess(org.apache.jena.tdb.base.file.BlockAccess) BlockMgrFileAccess(org.apache.jena.tdb.base.block.BlockMgrFileAccess)

Example 3 with BlockAccess

use of org.apache.jena.tdb.base.file.BlockAccess 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);
}
Also used : BlockAccess(org.apache.jena.tdb.base.file.BlockAccess) Block(org.apache.jena.tdb.base.block.Block) Test(org.junit.Test)

Aggregations

BlockAccess (org.apache.jena.tdb.base.file.BlockAccess)3 BlockMgrFileAccess (org.apache.jena.tdb.base.block.BlockMgrFileAccess)2 Block (org.apache.jena.tdb.base.block.Block)1 BlockMgr (org.apache.jena.tdb.base.block.BlockMgr)1 BlockAccessDirect (org.apache.jena.tdb.base.file.BlockAccessDirect)1 BlockAccessMapped (org.apache.jena.tdb.base.file.BlockAccessMapped)1 Test (org.junit.Test)1