Search in sources :

Example 26 with Record

use of org.apache.jena.tdb.base.record.Record in project jena by apache.

the class TestRecordBuffer method recBufferIterate02.

@Test
public void recBufferIterate02() {
    RecordBuffer rb = make(3, 5);
    Iterator<Record> iter = rb.iterator();
    same(iter, 2, 4, 6);
}
Also used : Record(org.apache.jena.tdb.base.record.Record) RecordLib.intToRecord(org.apache.jena.tdb.base.record.RecordLib.intToRecord) RecordBuffer(org.apache.jena.tdb.base.buffer.RecordBuffer) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 27 with Record

use of org.apache.jena.tdb.base.record.Record in project jena by apache.

the class TestRecordBuffer method recBufferIterate04.

@Test
public void recBufferIterate04() {
    RecordBuffer rb = make(3, 5);
    Iterator<Record> iter = rb.iterator(intToRecord(3), null);
    same(iter, 4, 6);
}
Also used : Record(org.apache.jena.tdb.base.record.Record) RecordLib.intToRecord(org.apache.jena.tdb.base.record.RecordLib.intToRecord) RecordBuffer(org.apache.jena.tdb.base.buffer.RecordBuffer) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 28 with Record

use of org.apache.jena.tdb.base.record.Record in project jena by apache.

the class TestRecordBuffer method recBufferIterate10.

@Test
public void recBufferIterate10() {
    RecordBuffer rb = make(5, 5);
    Iterator<Record> iter = rb.iterator(intToRecord(4), intToRecord(8));
    same(iter, 4, 6);
}
Also used : Record(org.apache.jena.tdb.base.record.Record) RecordLib.intToRecord(org.apache.jena.tdb.base.record.RecordLib.intToRecord) RecordBuffer(org.apache.jena.tdb.base.buffer.RecordBuffer) Test(org.junit.Test) BaseTest(org.apache.jena.atlas.junit.BaseTest)

Example 29 with Record

use of org.apache.jena.tdb.base.record.Record in project jena by apache.

the class TestRecord method record3.

@Test
public void record3() {
    Record r1 = intToRecord(1000, RecLen);
    Record r2 = intToRecord(0, RecLen);
    assertFalse(Record.keyEQ(r1, r2));
    assertTrue(Record.keyGE(r1, r2));
    assertFalse(Record.keyLE(r1, r2));
    assertFalse(Record.keyLT(r1, r2));
    assertTrue(Record.keyGT(r1, r2));
}
Also used : Record(org.apache.jena.tdb.base.record.Record) RecordLib.intToRecord(org.apache.jena.tdb.base.record.RecordLib.intToRecord) BaseTest(org.apache.jena.atlas.junit.BaseTest) Test(org.junit.Test)

Example 30 with Record

use of org.apache.jena.tdb.base.record.Record in project jena by apache.

the class TestBPlusTreeRewriter method createData.

static List<Record> createData(int N, RecordFactory recordFactory) {
    List<Record> originaldata = new ArrayList<>(N);
    for (int i = 0; i < N; i++) {
        Record record = recordFactory.create();
        Bytes.setInt(i + 1, record.getKey());
        if (recordFactory.hasValue())
            Bytes.setInt(10 * i + 1, record.getValue());
        originaldata.add(record);
    }
    return originaldata;
}
Also used : ArrayList(java.util.ArrayList) Record(org.apache.jena.tdb.base.record.Record)

Aggregations

Record (org.apache.jena.tdb.base.record.Record)96 BaseTest (org.apache.jena.atlas.junit.BaseTest)25 Test (org.junit.Test)25 RecordLib.intToRecord (org.apache.jena.tdb.base.record.RecordLib.intToRecord)20 RecordBuffer (org.apache.jena.tdb.base.buffer.RecordBuffer)15 RangeIndex (org.apache.jena.tdb.index.RangeIndex)8 BPTreeRecords (org.apache.jena.tdb.index.bplustree.BPTreeRecords)5 NodeId (org.apache.jena.tdb.store.NodeId)5 NoSuchElementException (java.util.NoSuchElementException)4 Pair (org.apache.jena.atlas.lib.Pair)4 BlockMgr (org.apache.jena.tdb.base.block.BlockMgr)4 RecordFactory (org.apache.jena.tdb.base.record.RecordFactory)4 Tuple (org.apache.jena.atlas.lib.tuple.Tuple)3 StorageException (org.apache.jena.tdb.base.StorageException)3 FileSet (org.apache.jena.tdb.base.file.FileSet)3 Location (org.apache.jena.tdb.base.file.Location)3 RecordBufferPage (org.apache.jena.tdb.base.recordbuffer.RecordBufferPage)3 Index (org.apache.jena.tdb.index.Index)3 BPlusTree (org.apache.jena.tdb.index.bplustree.BPlusTree)3 TupleIndexRecord (org.apache.jena.tdb.store.tupletable.TupleIndexRecord)3