use of com.indeed.lsmtree.recordlog.BasicRecordFile in project invesdwin-context-persistence by subes.
the class BasicRecordFilePerformanceTest method readIterator.
private void readIterator(final File file) throws IOException, InterruptedException {
final LoopInterruptedCheck loopCheck = new LoopInterruptedCheck();
final Instant readsStart = new Instant();
for (int reads = 1; reads <= READS; reads++) {
FDate prevValue = null;
int count = 0;
try (BasicRecordFile<TimedDecimal> reader = new BasicRecordFile<>(file, IndeedSerializer.valueOf(TimedDecimalSerde.GET))) {
final RecordFile.Reader<TimedDecimal> iterator = reader.reader();
while (iterator.next()) {
final FDate value = iterator.get().getTime();
if (prevValue != null) {
Assertions.checkTrue(prevValue.isBefore(value));
}
prevValue = value;
count++;
}
Assertions.checkEquals(count, VALUES);
if (loopCheck.check()) {
printProgress("Reads", readsStart, VALUES * reads, VALUES * READS);
}
}
}
printProgress("ReadsFinished", readsStart, VALUES * READS, VALUES * READS);
}
Aggregations