use of org.apache.druid.segment.column.ColumnConfig 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);
}
use of org.apache.druid.segment.column.ColumnConfig in project druid by druid-io.
the class AggregationTestHelper method createTopNQueryAggregationTestHelper.
public static AggregationTestHelper createTopNQueryAggregationTestHelper(List<? extends Module> jsonModulesToRegister, TemporaryFolder tempFolder) {
ObjectMapper mapper = TestHelper.makeJsonMapper();
TopNQueryQueryToolChest toolchest = new TopNQueryQueryToolChest(new TopNQueryConfig());
final CloseableStupidPool<ByteBuffer> pool = new CloseableStupidPool<>("TopNQueryRunnerFactory-bufferPool", new Supplier<ByteBuffer>() {
@Override
public ByteBuffer get() {
return ByteBuffer.allocate(10 * 1024 * 1024);
}
});
final Closer resourceCloser = Closer.create();
TopNQueryRunnerFactory factory = new TopNQueryRunnerFactory(pool, toolchest, QueryRunnerTestHelper.NOOP_QUERYWATCHER);
IndexIO indexIO = new IndexIO(mapper, new ColumnConfig() {
@Override
public int columnCacheSizeBytes() {
return 0;
}
});
return new AggregationTestHelper(mapper, new IndexMergerV9(mapper, indexIO, OffHeapMemorySegmentWriteOutMediumFactory.instance()), indexIO, toolchest, factory, tempFolder, jsonModulesToRegister, resourceCloser, Collections.emptyMap());
}
use of org.apache.druid.segment.column.ColumnConfig in project druid by druid-io.
the class AggregationTestHelper method createScanQueryAggregationTestHelper.
public static AggregationTestHelper createScanQueryAggregationTestHelper(List<? extends Module> jsonModulesToRegister, TemporaryFolder tempFolder) {
ObjectMapper mapper = TestHelper.makeJsonMapper();
ScanQueryQueryToolChest toolchest = new ScanQueryQueryToolChest(new ScanQueryConfig(), DefaultGenericQueryMetricsFactory.instance());
final Closer resourceCloser = Closer.create();
ScanQueryRunnerFactory factory = new ScanQueryRunnerFactory(toolchest, new ScanQueryEngine(), new ScanQueryConfig());
IndexIO indexIO = new IndexIO(mapper, new ColumnConfig() {
@Override
public int columnCacheSizeBytes() {
return 0;
}
});
return new AggregationTestHelper(mapper, new IndexMergerV9(mapper, indexIO, OffHeapMemorySegmentWriteOutMediumFactory.instance()), indexIO, toolchest, factory, tempFolder, jsonModulesToRegister, resourceCloser, Collections.emptyMap());
}
Aggregations