use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class ExtHashTestBase method delete.
public static ExtHash delete(ExtHash extHash, int... recs) {
for (int i : recs) {
Record r = intToRecord(i);
extHash.delete(r);
}
return extHash;
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class ExtHashTestBase method check.
public static void check(ExtHash extHash, int... recs) {
extHash.check();
for (int i : recs) {
Record r = intToRecordKey(i);
assertNotNull(extHash.find(r));
}
List<Integer> y = unique(asList(recs));
int x = (int) extHash.size();
assertEquals(y.size(), x);
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class AbstractTestIndex method index_find_1.
@Test
public void index_find_1() {
int[] keys = { 1 };
Index index = test(keys);
Record r = intToRecord(1, RecordLib.TestRecordLength);
r = index.find(r);
assertNotNull(r);
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class AbstractTestIndex method index_find_2.
@Test
public void index_find_2() {
int[] keys = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
Index index = test(keys);
Record r = intToRecord(20, RecordLib.TestRecordLength);
r = index.find(r);
assertNull(r);
}
use of org.apache.jena.tdb.base.record.Record in project jena by apache.
the class RecordsFromInput method hasNext.
@Override
public boolean hasNext() {
if (finished)
return false;
if (slot != null)
return true;
if (idx == -1 || idx == buffer.length) {
len = fill();
if (len == -1) {
finished = true;
return false;
}
idx = 0;
}
// Fill one slot.
Record record = recordFactory.create();
// System.out.print("In: ") ;
for (int i = 0; i < itemsPerRow; i++) {
long x = Hex.getLong(buffer, idx);
idx += 16;
// Separator or end-of-line.
idx++;
int j = (colMap == null) ? i : colMap.mapSlotIdx(i);
int recordOffset = j * SystemTDB.SizeOfLong;
Bytes.setLong(x, record.getKey(), recordOffset);
// System.out.printf("%016X ", x) ;
}
// Buffer all processed.
if (idx >= len)
idx = -1;
slot = record;
return true;
}
Aggregations