Search in sources :

Example 1 with BPTreeRecords

use of org.apache.jena.tdb.index.bplustree.BPTreeRecords in project jena by apache.

the class TestBPTreeRecords method bpt_shift_2.

@Test
public void bpt_shift_2() {
    BPTreeRecords bpr1 = make();
    BPTreeRecords bpr2 = make();
    insert(bpr1, 10);
    Record r = bpr2.shiftLeft(bpr1, null);
    assertTrue(Record.keyEQ(r, RecordLib.intToRecord(10)));
    contains(bpr1);
    contains(bpr2, 10);
    bpr1.release();
    bpr2.release();
}
Also used : BPTreeRecords(org.apache.jena.tdb.index.bplustree.BPTreeRecords) Record(org.apache.jena.tdb.base.record.Record) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 2 with BPTreeRecords

use of org.apache.jena.tdb.index.bplustree.BPTreeRecords in project jena by apache.

the class TestBPTreeRecords method bpt_records_4.

@Test
public void bpt_records_4() {
    BPTreeRecords bpr = make();
    for (int i = bpr.getMaxSize() - 1; i >= 0; i--) insert(bpr, i + 0x20);
    check(bpr);
    bpr.release();
}
Also used : BPTreeRecords(org.apache.jena.tdb.index.bplustree.BPTreeRecords) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 3 with BPTreeRecords

use of org.apache.jena.tdb.index.bplustree.BPTreeRecords in project jena by apache.

the class TestBPTreeRecords method bpt_merge_2.

@Test
public void bpt_merge_2() {
    BPTreeRecords bpr1 = make();
    BPTreeRecords bpr2 = make();
    insert(bpr1, 10, 20);
    insert(bpr2, 5);
    BPTreeRecords bpr3 = (BPTreeRecords) bpr2.merge(bpr1, null);
    contains(bpr1);
    contains(bpr2, 5, 10, 20);
    assertSame(bpr2, bpr3);
    bpr1.release();
    bpr2.release();
}
Also used : BPTreeRecords(org.apache.jena.tdb.index.bplustree.BPTreeRecords) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 4 with BPTreeRecords

use of org.apache.jena.tdb.index.bplustree.BPTreeRecords in project jena by apache.

the class TestBPTreeRecords method bpt_records_1.

@Test
public void bpt_records_1() {
    BPTreeRecords bpr = make();
    fill(bpr);
    check(bpr);
    bpr.release();
}
Also used : BPTreeRecords(org.apache.jena.tdb.index.bplustree.BPTreeRecords) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 5 with BPTreeRecords

use of org.apache.jena.tdb.index.bplustree.BPTreeRecords in project jena by apache.

the class TestBPTreeRecords method bpt_shift_1.

@Test
public void bpt_shift_1() {
    BPTreeRecords bpr1 = make();
    BPTreeRecords bpr2 = make();
    insert(bpr1, 10);
    Record r = bpr1.shiftRight(bpr2, null);
    assertNull(r);
    //assertTrue(Record.keyEQ(r, RecordTestLib.intToRecord(10))) ;
    contains(bpr1);
    contains(bpr2, 10);
    bpr1.release();
    bpr2.release();
}
Also used : BPTreeRecords(org.apache.jena.tdb.index.bplustree.BPTreeRecords) Record(org.apache.jena.tdb.base.record.Record) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Aggregations

BaseTest (org.apache.jena.atlas.junit.BaseTest)12 BPTreeRecords (org.apache.jena.tdb.index.bplustree.BPTreeRecords)12 Test (org.junit.Test)12 Record (org.apache.jena.tdb.base.record.Record)5 BPTreePage (org.apache.jena.tdb.index.bplustree.BPTreePage)1