Search in sources :

Example 6 with RecordBuffer

use of org.apache.jena.dboe.base.buffer.RecordBuffer in project jena by apache.

the class BPlusTreeRewriter method copyBPTreeNode.

private static void copyBPTreeNode(BPTreeNode nodeSrc, BPTreeNode nodeDst, BPlusTree bpt2) {
    PtrBuffer pBuff = nodeSrc.getPtrBuffer();
    pBuff.copy(0, nodeDst.getPtrBuffer(), 0, pBuff.getSize());
    RecordBuffer rBuff = nodeSrc.getRecordBuffer();
    rBuff.copy(0, nodeDst.getRecordBuffer(), 0, rBuff.getSize());
    nodeDst.setCount(nodeSrc.getCount());
    nodeDst.setIsLeaf(nodeSrc.isLeaf());
    bpt2.getNodeManager().put(nodeDst);
}
Also used : RecordBuffer(org.apache.jena.dboe.base.buffer.RecordBuffer) PtrBuffer(org.apache.jena.dboe.base.buffer.PtrBuffer)

Example 7 with RecordBuffer

use of org.apache.jena.dboe.base.buffer.RecordBuffer in project jena by apache.

the class RecordBufferPagePacker method hasNext.

@Override
public boolean hasNext() {
    if (recordBufferPage == null) {
        if (records == null)
            return false;
        if (!records.hasNext()) {
            records = null;
            return false;
        }
        // At least one record to be processed.
        // No pending RecordBufferPage
        // ==> There will be a RecordBufferPage to yield.
        // int id = rbMgr.allocateId();
        // //System.out.println("Allocate : "+id);
        recordBufferPage = rbMgr.create();
        RecordBuffer rb = recordBufferPage.getRecordBuffer();
        while (!rb.isFull() && records.hasNext()) {
            Record r = records.next();
            rb.add(r);
        }
        if (!records.hasNext())
            records = null;
        return true;
    }
    return true;
}
Also used : Record(org.apache.jena.dboe.base.record.Record) RecordBuffer(org.apache.jena.dboe.base.buffer.RecordBuffer)

Aggregations

RecordBuffer (org.apache.jena.dboe.base.buffer.RecordBuffer)7 PtrBuffer (org.apache.jena.dboe.base.buffer.PtrBuffer)3 ByteBuffer (java.nio.ByteBuffer)2 Record (org.apache.jena.dboe.base.record.Record)2 IOException (java.io.IOException)1 RecordBufferPage (org.apache.jena.dboe.base.recordbuffer.RecordBufferPage)1 BPTreeNode (org.apache.jena.dboe.trans.bplustree.BPTreeNode)1