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));
}
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);
}
}
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;
}
Aggregations