use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_ins_0_0.
@Test
public void tree_ins_0_0() {
// Empty tree
int[] keys = {};
RangeIndex rIndex = makeRangeIndex(2);
testInsert(rIndex, keys);
assertTrue(rIndex.isEmpty());
assertNull(rIndex.minKey());
assertNull(rIndex.maxKey());
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_ins_2_01.
@Test
public void tree_ins_2_01() {
int[] keys = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
RangeIndex rIndex = makeRangeIndex(2);
testInsert(rIndex, keys);
assertEquals(0, r(rIndex.minKey()));
assertEquals(9, r(rIndex.maxKey()));
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class LoaderOps method idxBTree.
/**
* Get the BPlusTree index for a {@Link TupleIndex}
*/
public static BPlusTree idxBTree(TupleIndex idx) {
TupleIndexRecord idxr = (TupleIndexRecord) idx;
RangeIndex rIndex = idxr.getRangeIndex();
BPlusTree bpt = (BPlusTree) rIndex;
return bpt;
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class TestTupleIndexRecord method create.
@Override
protected TupleIndexRecord create(String description) {
IndexParams indexParams = StoreParams.getDftStoreParams();
RangeIndex rIdx = BuildTestLib.buildRangeIndex(FileSet.mem(), factory, indexParams);
TupleMap tmap = TupleMap.create("SPO", description);
TupleIndexRecord index = new TupleIndexRecord(3, tmap, description, factory, rIdx);
return index;
}
use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.
the class AbstractTestRangeIndex method tree_iter_0_01.
// Root
@Test
public void tree_iter_0_01() {
int[] keys = { 1, 2, 3, 4, 5 };
RangeIndex rIndex = makeRangeIndex(5);
add(rIndex, keys);
Iterator<Record> iter = rIndex.iterator(r(2), r(4));
while (iter.hasNext()) iter.next();
List<Integer> x = toIntList(rIndex.iterator(r(2), r(4)));
List<Integer> expected = toIntList(2, 3);
assertEquals(expected, x);
}
Aggregations