use of de.invesdwin.context.persistence.ezdb.PersistentEzdbMapFactory in project invesdwin-context-persistence by subes.
the class PersistentEzdbPerformanceTest method testPersistentEzdbPerformance.
@Test
public void testPersistentEzdbPerformance() throws InterruptedException {
@SuppressWarnings("resource") final APersistentMap<FDate, FDate> table = new APersistentMap<FDate, FDate>("testPersistentEzdbPerformance") {
@Override
public File getBaseDirectory() {
return ContextProperties.TEMP_DIRECTORY;
}
@Override
public ISerde<FDate> newKeySerde() {
return FDateSerde.GET;
}
@Override
public ISerde<FDate> newValueSerde() {
return FDateSerde.GET;
}
@Override
protected IPersistentMapFactory<FDate, FDate> newFactory() {
return new PersistentEzdbMapFactory<>();
}
};
final LoopInterruptedCheck loopCheck = new LoopInterruptedCheck(Duration.ONE_SECOND);
final Instant writesStart = new Instant();
int i = 0;
for (final FDate date : newValues()) {
table.put(date, date);
i++;
if (i % FLUSH_INTERVAL == 0) {
if (loopCheck.check()) {
printProgress("Writes", writesStart, i, VALUES);
}
}
}
printProgress("WritesFinished", writesStart, VALUES, VALUES);
readIterator(table);
readGet(table);
table.deleteTable();
}
Aggregations