Search in sources :

Example 1 with BlockException

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

the class BlockMgrJournal method getReadIterator.

@Override
public Block getReadIterator(long id) {
    // logState() ;
    checkIfClosed();
    Block block = localBlock(id);
    if (block == null)
        block = blockMgr.getReadIterator(id);
    if (block == null)
        throw new BlockException("No such block: " + getLabel() + " " + id);
    if (active)
        iteratorBlocks.add(block.getId());
    return block;
}
Also used : BlockException(org.apache.jena.tdb.base.block.BlockException) Block(org.apache.jena.tdb.base.block.Block)

Example 2 with BlockException

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

the class BlockAccessBase method check.

protected final void check(Block block) {
    check(block.getId());
    ByteBuffer bb = block.getByteBuffer();
    if (bb.capacity() != blockSize)
        throw new BlockException(format("BlockMgrFile: Wrong size block.  Expected=%d : actual=%d", blockSize, bb.capacity()));
    if (bb.order() != SystemTDB.NetworkOrder)
        throw new BlockException("BlockMgrFile: Wrong byte order");
}
Also used : BlockException(org.apache.jena.tdb.base.block.BlockException) ByteBuffer(java.nio.ByteBuffer)

Aggregations

BlockException (org.apache.jena.tdb.base.block.BlockException)2 ByteBuffer (java.nio.ByteBuffer)1 Block (org.apache.jena.tdb.base.block.Block)1