Search in sources :

Example 41 with RangeIndex

use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.

the class AbstractTestRangeIndex method tree_iter_2_08.

@Test
public void tree_iter_2_08() {
    int[] keys = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
    RangeIndex rIndex = makeRangeIndex(2);
    add(rIndex, keys);
    List<Integer> x = toIntList(rIndex.iterator(r(0), r(99)));
    List<Integer> expected = toIntList(keys);
    assertEquals(expected, x);
}
Also used : RangeIndex(org.apache.jena.dboe.index.RangeIndex) Test(org.junit.Test) IndexTestLib.randTest(org.apache.jena.dboe.index.test.IndexTestLib.randTest)

Example 42 with RangeIndex

use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.

the class AbstractTestRangeIndex method tree_iter_2_02.

@Test
public void tree_iter_2_02() {
    int[] keys = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
    RangeIndex rIndex = makeRangeIndex(2);
    add(rIndex, keys);
    List<Integer> x = toIntList(rIndex.iterator(r(4), r(7)));
    List<Integer> expected = toIntList(4, 5, 6);
    assertEquals(expected, x);
}
Also used : RangeIndex(org.apache.jena.dboe.index.RangeIndex) Test(org.junit.Test) IndexTestLib.randTest(org.apache.jena.dboe.index.test.IndexTestLib.randTest)

Example 43 with RangeIndex

use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.

the class AbstractTestRangeIndex method tree_iter_0_03.

@Test
public void tree_iter_0_03() {
    int[] keys = { 1, 2, 3, 4, 5 };
    RangeIndex rIndex = makeRangeIndex(5);
    add(rIndex, keys);
    List<Integer> x = toIntList(rIndex.iterator(r(5), null));
    List<Integer> expected = toIntList(5);
    assertEquals(expected, x);
}
Also used : RangeIndex(org.apache.jena.dboe.index.RangeIndex) Test(org.junit.Test) IndexTestLib.randTest(org.apache.jena.dboe.index.test.IndexTestLib.randTest)

Example 44 with RangeIndex

use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.

the class TestTupleIndexRecordDirect method create.

static 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;
}
Also used : IndexParams(org.apache.jena.dboe.index.IndexParams) RangeIndex(org.apache.jena.dboe.index.RangeIndex) TupleMap(org.apache.jena.atlas.lib.tuple.TupleMap)

Example 45 with RangeIndex

use of org.apache.jena.dboe.index.RangeIndex in project jena by apache.

the class BPlusTreeFactory method makeBPlusTree.

public static RangeIndex makeBPlusTree(ComponentId cid, FileSet fs, int blkSize, int readCacheSize, int writeCacheSize, int dftKeyLength, int dftValueLength) {
    RecordFactory recordFactory = makeRecordFactory(dftKeyLength, dftValueLength);
    int order = BPlusTreeParams.calcOrder(blkSize, recordFactory.recordLength());
    RangeIndex rIndex = createBPTree(cid, fs, order, blkSize, readCacheSize, writeCacheSize, recordFactory);
    return rIndex;
}
Also used : RecordFactory(org.apache.jena.dboe.base.record.RecordFactory) RangeIndex(org.apache.jena.dboe.index.RangeIndex)

Aggregations

RangeIndex (org.apache.jena.dboe.index.RangeIndex)45 IndexTestLib.randTest (org.apache.jena.dboe.index.test.IndexTestLib.randTest)37 Test (org.junit.Test)37 TupleMap (org.apache.jena.atlas.lib.tuple.TupleMap)3 Record (org.apache.jena.dboe.base.record.Record)2 RecordFactory (org.apache.jena.dboe.base.record.RecordFactory)2 IndexParams (org.apache.jena.dboe.index.IndexParams)2 RecordLib.intToRecord (org.apache.jena.dboe.test.RecordLib.intToRecord)2 TupleIndexRecord (org.apache.jena.tdb2.store.tupletable.TupleIndexRecord)2 Index (org.apache.jena.dboe.index.Index)1 BPlusTree (org.apache.jena.dboe.trans.bplustree.BPlusTree)1 TupleIndex (org.apache.jena.tdb2.store.tupletable.TupleIndex)1