use of org.apache.jena.tdb.base.recordbuffer.RecordBufferPage in project jena by apache.
the class BPlusTreeRewriterUtils method summarizeDataBlocks.
static Iterator<Pair<Integer, Record>> summarizeDataBlocks(Iterator<Pair<Integer, Record>> iter, RecordBufferPageMgr recordPageMgr) {
divider();
List<Pair<Integer, Record>> x = Iter.toList(iter);
for (Pair<Integer, Record> pair : x) {
RecordBufferPage rbp = recordPageMgr.getRead(pair.car());
System.out.printf("%s -- RecordBufferPage[id=%d,link=%d] (%d) -> [%s]\n", pair, rbp.getId(), rbp.getLink(), rbp.getCount(), rbp.getRecordBuffer().getHigh());
recordPageMgr.release(rbp);
}
return x.iterator();
}
use of org.apache.jena.tdb.base.recordbuffer.RecordBufferPage in project jena by apache.
the class BPlusTreeRewriterUtils method printDataBlocks.
private static Iterator<Pair<Integer, Record>> printDataBlocks(Iterator<Pair<Integer, Record>> iter, RecordBufferPageMgr recordPageMgr) {
divider();
List<Pair<Integer, Record>> x = Iter.toList(iter);
System.out.printf(">>Packed data blocks\n");
for (Pair<Integer, Record> pair : x) {
System.out.printf(" %s\n", pair);
RecordBufferPage rbp = recordPageMgr.getRead(pair.car());
// System.out.printf("RecordBufferPage[id=%d,link=%d] %d\n", rbp.getId(), rbp.getLink(), rbp.getCount() ) ;
System.out.println(rbp);
recordPageMgr.release(rbp);
}
System.out.printf("<<Packed data blocks\n");
System.out.printf("Blocks: %d\n", x.size());
return x.iterator();
}
use of org.apache.jena.tdb.base.recordbuffer.RecordBufferPage in project jena by apache.
the class RecordBufferPageLinker method hasNext.
@Override
public boolean hasNext() {
if (slot != null)
return true;
if (peekIter == null)
return false;
if (!peekIter.hasNext()) {
peekIter = null;
return false;
}
slot = peekIter.next();
RecordBufferPage nextSlot = peekIter.peek();
// If null, no slot ahead so no linkage field to set.
if (nextSlot != null)
// Set the slot to the id of the next one
slot.setLink(nextSlot.getId());
return true;
}
use of org.apache.jena.tdb.base.recordbuffer.RecordBufferPage in project jena by apache.
the class RecordBufferPageLinker method next.
@Override
public RecordBufferPage next() {
if (!hasNext())
throw new NoSuchElementException();
RecordBufferPage rbp = slot;
slot = null;
return rbp;
}
use of org.apache.jena.tdb.base.recordbuffer.RecordBufferPage in project jena by apache.
the class RecordBufferPageMgr method getReadIterator.
public RecordBufferPage getReadIterator(int id) {
Block block = blockMgr.getReadIterator(id);
RecordBufferPage page = pageFactory.fromBlock(block);
return page;
}
Aggregations