Search in sources :

Example 46 with InternalErrorException

use of org.apache.jena.atlas.lib.InternalErrorException in project jena by apache.

the class AccessPath method reset.

public void reset(BPTreeNode node, int idx, BPTreePage page) {
    AccessStep s = traversed.remove(traversed.size() - 1);
    AccessStep s2 = new AccessStep(node, idx, page);
    if (s.node != s2.node)
        throw new InternalErrorException("Bad attempt to reset: " + this + " with " + s2);
    traversed.add(new AccessStep(node, idx, page));
}
Also used : InternalErrorException(org.apache.jena.atlas.lib.InternalErrorException)

Example 47 with InternalErrorException

use of org.apache.jena.atlas.lib.InternalErrorException in project jena by apache.

the class TransInteger method read.

// -- Read/write the value
// This should really be checksum'ed or other internal check to make sure IO worked.
private static long read(String filename) {
    try {
        String str = IO.readWholeFileAsUTF8(filename);
        if (str.endsWith("\n")) {
            str = str.substring(0, str.length() - 1);
        }
        str = str.trim();
        return Long.parseLong(str);
    } catch (RuntimeIOException ex) {
        Log.error(TransInteger.class, "IOException: " + ex.getMessage(), ex);
        throw ex;
    } catch (NumberFormatException ex) {
        Log.error(TransInteger.class, "NumberformatException: " + ex.getMessage());
        throw new InternalErrorException(ex);
    }
}
Also used : RuntimeIOException(org.apache.jena.atlas.RuntimeIOException) InternalErrorException(org.apache.jena.atlas.lib.InternalErrorException)

Example 48 with InternalErrorException

use of org.apache.jena.atlas.lib.InternalErrorException in project jena by apache.

the class BPTreeRangeIterator method loadStack.

private BPTreeRecords loadStack(BPTreeNode node) {
    AccessPath path = new AccessPath(null);
    node.bpTree.startReadBlkMgr();
    if (minRecord == null)
        node.internalMinRecord(path);
    else
        node.internalSearch(path, minRecord);
    List<AccessStep> steps = path.getPath();
    for (AccessStep step : steps) {
        BPTreeNode n = step.node;
        Iterator<BPTreePage> it = n.iterator(minRecord, maxRecord);
        if (it == null || !it.hasNext())
            continue;
        BPTreePage p = it.next();
        stack.push(it);
    }
    BPTreePage p = steps.get(steps.size() - 1).page;
    if (!(p instanceof BPTreeRecords))
        throw new InternalErrorException("Last path step not to a records block");
    node.bpTree.finishReadBlkMgr();
    return (BPTreeRecords) p;
}
Also used : InternalErrorException(org.apache.jena.atlas.lib.InternalErrorException) AccessStep(org.apache.jena.dboe.trans.bplustree.AccessPath.AccessStep)

Aggregations

InternalErrorException (org.apache.jena.atlas.lib.InternalErrorException)48 Node (org.apache.jena.graph.Node)14 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)4 AccessStep (org.apache.jena.dboe.trans.bplustree.AccessPath.AccessStep)3 Graph (org.apache.jena.graph.Graph)3 Triple (org.apache.jena.graph.Triple)3 Var (org.apache.jena.sparql.core.Var)3 StringReader (java.io.StringReader)2 DataAccessPoint (org.apache.jena.fuseki.server.DataAccessPoint)2 Dataset (org.apache.jena.query.Dataset)2 Model (org.apache.jena.rdf.model.Model)2 Lang (org.apache.jena.riot.Lang)2 RiotException (org.apache.jena.riot.RiotException)2 ARQInternalErrorException (org.apache.jena.sparql.ARQInternalErrorException)2 Table (org.apache.jena.sparql.algebra.Table)2 OpGraph (org.apache.jena.sparql.algebra.op.OpGraph)2 TableEmpty (org.apache.jena.sparql.algebra.table.TableEmpty)2 ExecutionContext (org.apache.jena.sparql.engine.ExecutionContext)2 QueryIterator (org.apache.jena.sparql.engine.QueryIterator)2 Binding (org.apache.jena.sparql.engine.binding.Binding)2