use of com.indeed.mph.serializers.SmartLongSerializer in project invesdwin-context-persistence by subes.
the class MphTablePerformanceTest method testMphTablePerformance.
@Test
public void testMphTablePerformance() throws IOException {
final File directory = new File(ContextProperties.getCacheDirectory(), MphTablePerformanceTest.class.getSimpleName());
Files.deleteNative(directory);
Files.forceMkdir(directory);
final File file = new File(directory, "testMphTablePerformance");
final Instant writesStart = new Instant();
final TableConfig<Long, Long> config = new TableConfig<Long, Long>().withKeySerializer(new SmartLongSerializer()).withValueSerializer(new SmartVLongSerializer());
final ATransformingIterable<FDate, com.indeed.util.core.Pair<Long, Long>> entries = new ATransformingIterable<FDate, com.indeed.util.core.Pair<Long, Long>>(newValues()) {
@Override
protected com.indeed.util.core.Pair<Long, Long> transform(final FDate value) {
return com.indeed.util.core.Pair.of(value.millisValue(), value.millisValue());
}
};
// can not append to an existing table
TableWriter.write(file, config, entries);
printProgress("WritesFinished", writesStart, VALUES, VALUES);
readIterator(file);
readGet(file);
}
Aggregations