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

Examples of com.hp.hpl.jena.tdb.base.StorageException


    @Override
    synchronized public void position(long pos) {
        checkIfClosed() ;
        if ( pos < 0 || pos > bytes.capacity() )
            throw new StorageException("Out of range: " + pos) ;
        bytes.position((int)pos) ;
    }
View Full Code Here


    synchronized public int read(ByteBuffer buffer, long loc) {
        checkIfClosed() ;
        if ( TRACKING )
            log("read<<@" + loc) ;
        if ( loc < 0 || loc > bytes.limit() )
            throw new StorageException("Out of range(" + name + "[read]): " + loc + " [0," + bytes.limit() + ")") ;
        if ( loc == bytes.limit() )
            log.warn("At the limit(" + name + "[read]): " + loc) ;
        int x = bytes.position() ;
        bytes.position((int)loc) ;
        int len = read(buffer) ;
View Full Code Here

        checkIfClosed() ;
        if ( TRACKING )
            log("write<<@" + loc) ;
        if ( loc < 0 || loc > bytes.limit() )
            // Can write at loc = bytes()
            throw new StorageException("Out of range(" + name + "[write]): " + loc + " [0," + bytes.limit() + ")") ;
        int x = bytes.position() ;
        bytes.position((int)loc) ;
        int len = write(buffer) ;
        bytes.position(x) ;
        if ( TRACKING )
View Full Code Here

    @Override
    synchronized public void truncate(long size) {
        checkIfClosed() ;
        int x = (int)size ;
        if ( x < 0 )
            throw new StorageException("Out of range: " + size) ;
        if ( x > bytes.limit() )
            return ;

        if ( bytes.position() > x )
            bytes.position(x) ;
View Full Code Here

        bytes = null ;
    }

    private void checkIfClosed() {
        if ( bytes == null )
            throw new StorageException("Closed: " + name) ;
    }
View Full Code Here

            RecordBufferPage nextPage = pageMgr.getReadIterator(link) ;
            // Check currentPage -> nextPage is strictly increasing keys.
            Record r1 = currentPage.getRecordBuffer().getHigh() ;
            Record r2 = nextPage.getRecordBuffer().getLow() ;
            if ( Record.keyGE(r1, r2) )
                throw new StorageException("RecordRangeIterator: records not strictly increasing: "+r1+" // "+r2) ;
            currentPage = nextPage ;
            countBlocks++ ;
            currentIdx = 0 ;
        }
           
View Full Code Here

    private void error(String msg, Object... args)
    {
        msg = format(msg, args) ;
        log.error(msg) ;
        throw new StorageException(msg) ;
    }
View Full Code Here

        Record r2 = null ;
        if ( i < 0 )
        {
            i = decodeIndex(i) ;
            if ( rBuff.size() >= rBuff.maxSize()) 
                throw new StorageException("RecordBlock.put overflow") ;
            rBuff.add(i, record) ;
        }
        else
        {
            r2 = rBuff.get(i) ;
View Full Code Here

            getRecordBuffer().set(i, record) ;
            return true ;
        }
       
        if ( getRecordBuffer().isFull() )
            throw new StorageException("Bucket overflow") ;
       
        getRecordBuffer().add(i, record) ;
        return true ;
    }         
View Full Code Here

            RecordBufferPage nextPage = pageMgr.getReadIterator(link) ;
            // Check currentPage -> nextPage is strictly increasing keys.
            Record r1 = currentPage.getRecordBuffer().getHigh() ;
            Record r2 = nextPage.getRecordBuffer().getLow() ;
            if ( Record.keyGE(r1, r2) )
                throw new StorageException("RecordRangeIterator: records not strictly increasing: "+r1+" // "+r2) ;
            currentPage = nextPage ;
            countBlocks++ ;
            currentIdx = 0 ;
        }
           
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.tdb.base.StorageException

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.