use of org.apache.jena.dboe.base.record.Record in project jena by apache.
the class BPTreeRangeIterator method next.
@Override
public Record next() {
if (!hasNext())
throw new NoSuchElementException();
Record r = slot;
if (r == null)
throw new InternalErrorException("Null slot after hasNext is true");
slot = null;
return r;
}
use of org.apache.jena.dboe.base.record.Record in project jena by apache.
the class RangeIndexLogger method find.
@Override
public Record find(Record record) {
log.info("Find: " + record);
Record r2 = super.find(record);
log.info("Find: " + record + " ==> " + r2);
return r2;
}
use of org.apache.jena.dboe.base.record.Record in project jena by apache.
the class RecordRangeIterator method hasNext.
@Override
public boolean hasNext() {
if (slot != null)
return true;
if (currentPage == null)
return false;
// Set slot.
while (currentIdx >= currentPage.getCount()) {
// Move to next.
int link = currentPage.getLink();
if (link < 0) {
close();
return false;
}
if (currentPage != null)
pageMgr.release(currentPage);
RecordBufferPage nextPage = pageMgr.getRead(link);
// Check currentPage -> nextPage is strictly increasing keys.
if (false) {
Record r1 = currentPage.getRecordBuffer().getHigh();
Record r2 = nextPage.getRecordBuffer().getLow();
if (Record.keyGE(r1, r2))
throw new StorageException("RecordRangeIterator: records not strictly increasing: " + r1 + " // " + r2);
}
currentPage = nextPage;
countBlocks++;
currentIdx = 0;
}
slot = currentPage.getRecordBuffer().access(currentIdx, keySlot, mapper);
currentIdx++;
if (maxRec != null && Bytes.compare(keySlot, maxRec.getKey()) >= 0) {
close();
return false;
}
if (slot == null) {
close();
return false;
}
countRecords++;
return true;
}
use of org.apache.jena.dboe.base.record.Record in project jena by apache.
the class TestRecordBufferPage method record.
private static Record record(int i) {
byte[] b = new byte[] { (byte) ((i >> 8) & 0xFF), (byte) (i & 0xFF) };
Record r = factory.create(b);
return r;
}
use of org.apache.jena.dboe.base.record.Record in project jena by apache.
the class TestRecordBufferPage method get.
private static int get(RecordBuffer rb, int idx) {
Record r = rb.get(idx);
int v = (r.getKey()[0]) << 8 | ((r.getKey()[1]) & 0xFF);
return v;
}
Aggregations