use of org.apache.jena.tdb.index.bplustree.BPlusTreeParams in project jena by apache.
the class DatasetBuilderStd method createBPTree.
/**
* Knowing all the parameters, create a B+Tree
*/
private RangeIndex createBPTree(FileSet fileset, int order, BlockMgrBuilder blockMgrBuilderNodes, BlockMgrBuilder blockMgrBuilderRecords, RecordFactory factory, IndexParams indexParams) {
// ---- Checking
{
int blockSize = indexParams.getBlockSize();
if (blockSize < 0)
throw new IllegalArgumentException("Negative blocksize: " + blockSize);
if (blockSize < 0 && order < 0)
throw new IllegalArgumentException("Neither blocksize nor order specified");
if (blockSize >= 0 && order < 0)
order = BPlusTreeParams.calcOrder(blockSize, factory.recordLength());
if (blockSize >= 0 && order >= 0) {
int order2 = BPlusTreeParams.calcOrder(blockSize, factory.recordLength());
if (order != order2)
throw new IllegalArgumentException("Wrong order (" + order + "), calculated = " + order2);
}
}
BPlusTreeParams params = new BPlusTreeParams(order, factory);
BlockMgr blkMgrNodes = blockMgrBuilderNodes.buildBlockMgr(fileset, Names.bptExtTree, indexParams);
BlockMgr blkMgrRecords = blockMgrBuilderRecords.buildBlockMgr(fileset, Names.bptExtRecords, indexParams);
return BPlusTree.create(params, blkMgrNodes, blkMgrRecords);
}
Aggregations