Package com.hp.hpl.jena.tdb

Examples of com.hp.hpl.jena.tdb.TDBException


    static final Logger log = TDB.logInfo ;
    public static void error(Logger log, String msg)
    {
        if ( log != null )
            log.error(msg) ;
        throw new TDBException(msg) ;
    }
View Full Code Here


        {
            Node n = iter1.next() ;
           
            NodeId nId = node2id_Cache.get(n) ;
            if ( !id2node_Cache.containsKey(nId) )
                throw new TDBException("Inconsistent: "+n+" => "+nId) ;
            if ( notPresent.contains(n) )
                throw new TDBException("Inconsistent: "+n+" in notPresent cache (1)") ;
        }
        Iterator<NodeId> iter2 = Iter.toList(id2node_Cache.keys()).iterator() ; ;
        for ( ; iter2.hasNext() ; )
        {
            NodeId nId = iter2.next() ;
            Node n =  id2node_Cache.get(nId) ;
            if ( !node2id_Cache.containsKey(n) )
                throw new TDBException("Inconsistent: "+nId+" => "+n) ;
            if ( notPresent.contains(n) )
                throw new TDBException("Inconsistent: "+n+" in notPresent cache (2)") ;
        }
       
       
    }
View Full Code Here

        boolean anyGraph = (graphNode==null ? false : (Node.ANY.equals(graphNode))) ;
       
        int tupleLen = nodeTupleTable.getTupleTable().getTupleLen() ;
        if ( graphNode == null ) {
            if ( 3 != tupleLen )
                throw new TDBException("SolverLib: Null graph node but tuples are of length "+tupleLen) ;
        } else {
            if ( 4 != tupleLen )
                throw new TDBException("SolverLib: Graph node specified but tuples are of length "+tupleLen) ;
        }
       
        // Convert from a QueryIterator (Bindings of Var/Node) to BindingNodeId
        NodeTable nodeTable = nodeTupleTable.getNodeTable() ;
       
View Full Code Here

    private static void error(Logger log, String msg)
    {
        if ( log != null )
            log.error(msg) ;
        throw new TDBException(msg) ;
    }
View Full Code Here

    public TupleTable(int tupleLen, TupleIndex[] indexes)
    {
        this.tupleLen = tupleLen ;
        this.indexes = indexes ;
        if ( indexes[0] == null )
            throw new TDBException("TupleTable: no primary index") ;
        for ( TupleIndex index : indexes )
        {
            if ( index != null && index.getTupleLength() != tupleLen )
                throw new TDBException("Incompatible index: "+index.getMapping()) ;
        }
        scanAllIndex = chooseScanAllIndex(tupleLen, indexes) ;
    }
View Full Code Here

    /** Insert a tuple - return true if it was really added, false if it was a duplicate */
    public boolean add(Tuple<NodeId> t)
    {
        if ( tupleLen != t.size() )
            throw new TDBException(format("Mismatch: inserting tuple of length %d into a table of tuples of length %d", t.size(), tupleLen)) ;

        for ( int i = 0 ; i < indexes.length ; i++ )
        {
            if ( indexes[i] == null ) continue ;
           
            if ( ! indexes[i].add(t) )
            {
                if ( i == 0 )
                {
                    duplicate(t) ;
                    return false ;
                }
                unexpectedDuplicate(t, i) ;
                throw new TDBException(format("Secondary index duplicate: %s -> %s",indexes[i].getMapping(), t)) ;
            }
            syncNeeded = true ;
        }
        return true ;
    }
View Full Code Here

    /** Delete a tuple - return true if it was deleted, false if it didn't exist */
    public boolean delete( Tuple<NodeId> t )
    {
        if ( tupleLen != t.size() )
            throw new TDBException(format("Mismatch: deleting tuple of length %d from a table of tuples of length %d", t.size(), tupleLen)) ;

        boolean rc = false ;
        for ( int i = 0 ; i < indexes.length ; i++ )
        {
            if ( indexes[i] == null ) continue ;
View Full Code Here

//            if ( n == null )
//                log.warn("find(Tuple<NodeId> pattern): Null found: "+pattern) ;
//        }
       
        if ( tupleLen != pattern.size() )
            throw new TDBException(format("Mismatch: finding tuple of length %d in a table of tuples of length %d", pattern.size(), tupleLen)) ;
       
        int numSlots = 0 ;
        // Canonical form.
        for ( int i = 0 ; i < tupleLen ; i++ )
        {
View Full Code Here

    /** Set index - for code that maipulates internal structures directly - use with care */
    public void setTupleIndex(int i, TupleIndex index)
    {
        if ( index != null && index.getTupleLength() != tupleLen )
            throw new TDBException("Incompatible index: "+index.getMapping()) ;
        indexes[i] = index ;
    }
View Full Code Here

        if ( node.isLiteral() && node.getLiteralLanguage() != null )
        {
            // Check syntactcally valid.
            String lang = node.getLiteralLanguage() ;
            if ( ! LangTag.check(lang) )
                throw new TDBException("bad language tag: "+node) ;
        }
       
        // Node->String
        String str = NodeFmtLib.serialize(node) ;
        // String -> bytes ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.tdb.TDBException

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.