use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class TestRecordBuffer method recBufferIterate03.
@Test
public void recBufferIterate03() {
RecordBuffer rb = make(3, 5);
Iterator<Record> iter = rb.iterator(intToRecord(4), null);
same(iter, 4, 6);
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class NodeTableTrans method dump.
// Debugging only
private void dump() {
System.err.println(">>>>>>>>>>");
System.err.println("label = " + label);
System.err.println("txn = " + txn);
System.err.println("offset = " + allocOffset);
System.err.println("journalStartOffset = " + journalObjFileStartOffset);
System.err.println("journal = " + journalObjFile.getLabel());
if (true)
return;
System.err.println("nodeTableJournal >>>");
Iterator<Pair<NodeId, Node>> iter = nodeTableJournal.all();
for (; iter.hasNext(); ) {
Pair<NodeId, Node> x = iter.next();
NodeId nodeId = x.getLeft();
Node node = x.getRight();
NodeId mapped = mapFromJournal(nodeId);
//debug("append: %s -> %s", x, mapFromJournal(nodeId)) ;
// This does the write.
NodeId nodeId2 = base.getAllocateNodeId(node);
System.err.println(x + " mapped=" + mapped + " getAlloc=" + nodeId2);
}
System.err.println("journal >>>");
Iterator<Pair<Long, ByteBuffer>> iter1 = this.journalObjFile.all();
for (; iter1.hasNext(); ) {
Pair<Long, ByteBuffer> p = iter1.next();
System.err.println(p.getLeft() + " : " + p.getRight());
ByteBufferLib.print(System.err, p.getRight());
}
System.err.println("nodeIndex >>>");
Iterator<Record> iter2 = this.nodeIndex.iterator();
for (; iter2.hasNext(); ) {
Record r = iter2.next();
System.err.println(r);
}
System.err.println("<<<<<<<<<<");
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class BPTreeRecords method checkNode.
@Override
public final void checkNode() {
if (!CheckingNode)
return;
if (rBuff.size() < 0 || rBuff.size() > rBuff.maxSize())
error("Misized: %s", this);
for (int i = 1; i < getCount(); i++) {
Record r1 = rBuff.get(i - 1);
Record r2 = rBuff.get(i);
if (Record.keyGT(r1, r2))
error("Not sorted: %s", this);
}
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class BPTreeRecords method internalDelete.
@Override
public Record internalDelete(Record record) {
promote();
int i = rBuff.find(record);
if (i < 0)
return null;
Record r2 = rBuff.get(i);
rBuff.remove(i);
write();
return r2;
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class BPlusTree method maxKey.
@Override
public Record maxKey() {
startReadBlkMgr();
BPTreeNode root = getRoot();
Record r = root.maxRecord();
releaseRoot(root);
finishReadBlkMgr();
return r;
}
Aggregations