Search in sources :

Example 36 with RangeIndex

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

the class AbstractTestRangeIndex method tree_ret_2.

@Test
public void tree_ret_2() {
    int[] keys = { 1, 2, 3, 4, 5 };
    RangeIndex rIndex = makeRangeIndex(2);
    add(rIndex, keys);
    boolean b = rIndex.delete(intToRecord(9));
    assertFalse(b);
    b = rIndex.insert(intToRecord(1));
    assertFalse(b);
}
Also used : RangeIndex(org.apache.jena.dboe.index.RangeIndex) Test(org.junit.Test) IndexTestLib.randTest(org.apache.jena.dboe.index.test.IndexTestLib.randTest)

Example 37 with RangeIndex

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

the class AbstractTestRangeIndex method tree_iter_2_04.

@Test
public void tree_iter_2_04() {
    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(null, null));
    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 38 with RangeIndex

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

the class AbstractTestRangeIndex method tree_del_2_08.

@Test
public void tree_del_2_08() {
    int[] keys1 = { 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
    int[] keys2 = { 0, 9, 2, 7, 4, 5, 6, 3, 8, 1 };
    RangeIndex rIndex = makeRangeIndex(2);
    testInsertDelete(rIndex, keys1, keys2);
}
Also used : RangeIndex(org.apache.jena.dboe.index.RangeIndex) Test(org.junit.Test) IndexTestLib.randTest(org.apache.jena.dboe.index.test.IndexTestLib.randTest)

Example 39 with RangeIndex

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

the class AbstractTestRangeIndex method tree_iter_2_09.

@Test
public void tree_iter_2_09() {
    int[] keys = { 1, 2, 3, 4, /* 5, 6, */
    7, 8, 9, 10, 11 };
    RangeIndex rIndex = makeRangeIndex(2);
    add(rIndex, keys);
    List<Integer> x = toIntList(rIndex.iterator(r(5), r(7)));
    List<Integer> expected = toIntList();
    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 40 with RangeIndex

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

the class AbstractTestRangeIndex method tree_del_2_10.

@Test
public void tree_del_2_10() {
    int[] keys1 = { 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 };
    int[] keys2 = { 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };
    RangeIndex rIndex = makeRangeIndex(2);
    testInsertDelete(rIndex, keys1, keys2);
}
Also used : RangeIndex(org.apache.jena.dboe.index.RangeIndex) Test(org.junit.Test) IndexTestLib.randTest(org.apache.jena.dboe.index.test.IndexTestLib.randTest)

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