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);
}
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));
}
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;
}
use of org.apache.jena.tdb.base.record.Record 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();
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class TestBPlusTreeRewriter method createData2.
static List<Record> createData2(int ORDER, int N, RecordFactory recordFactory) {
// Use a B+Tree - so original data can be unsorted.
BPlusTree bpt = SetupIndex.createBPTree(FileSet.mem(), ORDER, -1, -1, -1, recordFactory);
for (int i = 0; i < N; i++) {
Record record = recordFactory.create();
Bytes.setInt(i + 1, record.getKey());
bpt.add(record);
}
return Iter.toList(bpt.iterator());
}
Aggregations