use of io.druid.jackson.SegmentizerModule in project druid by druid-io.
the class SegmentizerFactoryTest method testFactory.
@Test
public void testFactory() throws IOException {
File factoryFile = Files.createTempFile("", "factory.json").toFile();
FileOutputStream fos = new FileOutputStream(factoryFile);
ObjectMapper mapper = new DefaultObjectMapper();
mapper.registerModule(new SegmentizerModule());
IndexIO indexIO = new IndexIO(mapper, new ColumnConfig() {
@Override
public int columnCacheSizeBytes() {
return 777;
}
});
mapper.setInjectableValues(new InjectableValues.Std().addValue(IndexIO.class, indexIO));
mapper.writeValue(fos, new MMappedQueryableSegmentizerFactory(indexIO));
fos.close();
SegmentizerFactory factory = mapper.readValue(factoryFile, SegmentizerFactory.class);
Assert.assertTrue(factory instanceof MMappedQueryableSegmentizerFactory);
}
Aggregations