Package com.hp.hpl.jena.tdb.base.block

Examples of com.hp.hpl.jena.tdb.base.block.BlockException


        if ( numFileBlocks > Integer.MAX_VALUE )
            getLog().warn(format("File size (%d) exceeds tested block number limits (%d)", filesize, blockSize)) ;

        if ( filesize%longBlockSize != 0 )
            throw new BlockException(format("File size (%d) not a multiple of blocksize (%d)", filesize, blockSize)) ;

        if ( filesize == 0 )
            isEmpty = true ;
    }
View Full Code Here


    final
    protected void check(long id)
    {
        if ( id > Integer.MAX_VALUE )
            throw new BlockException(format("BlockAccessBase: Id (%d) too large", id )) ;
       
        // Access to numFileBlocks not synchronized - it's only a check
        if ( id < 0 || id >= numFileBlocks )
        {
            // Do it properly!
            synchronized(this)
            {
                if ( id < 0 || id >= numFileBlocks )
                    throw new BlockException(format("BlockAccessBase: Bounds exception: %s: (%d,%d)", file.filename, id, numFileBlocks)) ;
            }
        }
    }
View Full Code Here

    final protected 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") ;
    }
View Full Code Here

        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 ;
    }
View Full Code Here

    {
        if ( ! pageMgr.valid(pageId) ) {
            String msg = "RecordRangeIterator.iterator -- No such block (pageId="+pageId+", fromRec="+fromRec+", toRec="+toRec+ ")" ;
            System.err.println(msg) ;
            System.exit(0) ;
            throw new BlockException(msg) ;
        }
        return new RecordRangeIterator(pageId, fromRec, toRec, pageMgr) ;
    }
View Full Code Here

        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 ;
    }
View Full Code Here

{
    /** Iterate over a range of fromRec (inclusive) to toRec (exclusive) */
    public static Iterator<Record> iterator(int pageId, Record fromRec, Record toRec, RecordBufferPageMgr pageMgr)
    {
        if ( ! pageMgr.valid(pageId) )
            throw new BlockException("No such block") ;
        return new RecordRangeIterator(pageId, fromRec, toRec, pageMgr) ;
    }
View Full Code Here

        if ( numFileBlocks > Integer.MAX_VALUE )
            getLog().warn(format("File size (%d) exceeds tested block number limits (%d)", filesize, blockSize)) ;

        if ( filesize%longBlockSize != 0 )
            throw new BlockException(format("File size (%d) not a multiple of blocksize (%d)", filesize, blockSize)) ;

        if ( filesize == 0 )
            isEmpty = true ;
    }
View Full Code Here

    final
    protected void check(long id)
    {
        if ( id > Integer.MAX_VALUE )
            throw new BlockException(format("BlockAccessBase: Id (%d) too large", id )) ;
       
        // Access to numFileBlocks not synchronized - it's only a check
        if ( id < 0 || id >= numFileBlocks )
        {
            // Do it properly!
            synchronized(this)
            {
                if ( id < 0 || id >= numFileBlocks )
                    throw new BlockException(format("BlockAccessBase: Bounds exception: %s: (%d,%d)", file.filename, id, numFileBlocks)) ;
            }
        }
    }
View Full Code Here

    final protected 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") ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.tdb.base.block.BlockException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.