Search in sources :

Example 76 with Record

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

the class RecordRangeIterator method next.

@Override
public Record next() {
    if (!hasNext())
        throw new NoSuchElementException();
    Record x = slot;
    slot = null;
    return x;
}
Also used : Record(org.apache.jena.tdb.base.record.Record) NoSuchElementException(java.util.NoSuchElementException)

Example 77 with Record

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

the class IndexMap method add.

@Override
public boolean add(Record record) {
    Record r = find(record);
    if (r != null && r.equals(record))
        return false;
    index.put(wrap(record.getKey()), wrap(record.getValue()));
    return true;
}
Also used : Record(org.apache.jena.tdb.base.record.Record)

Example 78 with Record

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

the class TestTransIterator method transIter_01.

@Test
public void transIter_01() {
    int[] vals = {};
    RangeIndex rIndex = build(2, vals);
    Iterator<Record> iter1 = rIndex.iterator();
    Iterator<Record> iter2 = rIndex.iterator();
    count(iter1, vals.length);
    count(iter2, vals.length);
}
Also used : Record(org.apache.jena.tdb.base.record.Record) RangeIndex(org.apache.jena.tdb.index.RangeIndex) Test(org.junit.Test)

Example 79 with Record

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

the class TestTransIterator method transIter_02.

@Test
public void transIter_02() {
    int[] vals = { 1, 2, 3, 4, 5, 6, 7 };
    RangeIndex rIndex = build(2, vals);
    Iterator<Record> iter1 = rIndex.iterator();
    Iterator<Record> iter2 = rIndex.iterator();
    count(iter1, vals.length);
    count(iter2, vals.length);
}
Also used : Record(org.apache.jena.tdb.base.record.Record) RangeIndex(org.apache.jena.tdb.index.RangeIndex) Test(org.junit.Test)

Example 80 with Record

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

the class TestRecordBufferPage method record.

private static Record record(int i) {
    byte[] b = new byte[] { (byte) ((i >> 8) & 0xFF), (byte) (i & 0xFF) };
    Record r = factory.create(b);
    return r;
}
Also used : Record(org.apache.jena.tdb.base.record.Record)

Aggregations

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