use of com.indeed.lsmtree.core.Store in project invesdwin-context-persistence by subes.
the class LsmTreePerformanceTest method readGetLatest.
private void readGetLatest(final Store<FDate, FDate> table) throws InterruptedException, IOException {
final LoopInterruptedCheck loopCheck = new LoopInterruptedCheck(Duration.ONE_SECOND);
final List<FDate> values = Lists.toList(newValues());
final Instant readsStart = new Instant();
for (int reads = 1; reads <= READS; reads++) {
FDate prevValue = null;
for (int i = 0; i < values.size(); i++) {
try {
final Store.Entry<FDate, FDate> entry = table.floor(values.get(i));
final FDate value = entry.getValue();
if (prevValue != null) {
Assertions.checkTrue(prevValue.isBefore(value));
}
prevValue = value;
} catch (final NoSuchElementException e) {
break;
}
}
if (loopCheck.check()) {
printProgress("GetLatests", readsStart, VALUES * reads, VALUES * READS);
}
}
printProgress("GetLatestsFinished", readsStart, VALUES * READS, VALUES * READS);
}
Aggregations