use of org.apache.jena.dboe.base.record.Record in project jena by apache.
the class BPTreeNode method shiftLeft.
private void shiftLeft(BPTreePage left, BPTreePage right, int i) {
if (logging(log)) {
log(log, ">> shiftLeft: this: %s", this);
log(log, ">> shiftLeft: left: %s", left);
log(log, ">> shiftLeft: right: %s", right);
}
Record r1 = records.get(i);
Record r2 = left.shiftLeft(right, r1);
r2 = keyRecord(r2);
this.records.set(i, r2);
left.write();
right.write();
// Do this later - this.put();
if (logging(log)) {
log(log, "<< shiftLeft: this: %s", this);
log(log, "<< shiftLeft: left: %s", left);
log(log, "<< shiftLeft: right: %s", right);
}
}
use of org.apache.jena.dboe.base.record.Record in project jena by apache.
the class BPTreeNode method getSplitKey.
@Override
final Record getSplitKey() {
int ix = params.SplitIndex;
Record split = records.get(ix);
return split;
}
use of org.apache.jena.dboe.base.record.Record in project jena by apache.
the class BPTreeNode method shiftLeft.
@Override
Record shiftLeft(BPTreePage other, Record splitKey) {
BPTreeNode node = cast(other);
if (BPT.CheckingNode) {
if (count == 0)
BPT.error("Node is empty - can't shift a slot out");
if (isFull())
BPT.error("Destination node is full");
}
Record r = node.records.getLow();
// Records: promote moving element, replace with splitKey
this.records.add(splitKey);
node.records.shiftDown(0);
// Pointers just shift
this.ptrs.shiftLeft(node.ptrs);
this.count++;
node.count--;
return r;
}
use of org.apache.jena.dboe.base.record.Record in project jena by apache.
the class BPTreeNode method internalSearch.
// ============ SEARCH
/*
* Do a (binary) search of the node to find the record.
* Returns:
* +ve or 0 => the index of the record
* -ve => The insertion point : the immediate higher record or length as (-i-1)
* Convert to +ve and decend to find the RecordBuffer with the record in it.
*/
@Override
final Record internalSearch(AccessPath path, Record rec) {
if (BPT.CheckingNode)
internalCheckNode();
BPTreePage page = findHere(path, rec);
Record r = page.internalSearch(path, rec);
page.release();
return r;
}
use of org.apache.jena.dboe.base.record.Record in project jena by apache.
the class BPTreeRecords method internalDelete.
@Override
Record internalDelete(AccessPath path, Record record) {
int i = rBuff.find(record);
if (i < 0)
return null;
promotePage(path, this);
Record r2 = rBuff.get(i);
rBuff.remove(i);
write();
return r2;
}
Aggregations