use of io.druid.collections.StupidPool in project druid by druid-io.
the class IncrementalIndexTest method constructorFeeder.
@Parameterized.Parameters
public static Collection<?> constructorFeeder() throws IOException {
DimensionsSpec dimensions = new DimensionsSpec(Arrays.<DimensionSchema>asList(new StringDimensionSchema("string"), new StringDimensionSchema("float"), new StringDimensionSchema("long")), null, null);
AggregatorFactory[] metrics = { new FilteredAggregatorFactory(new CountAggregatorFactory("cnt"), new SelectorDimFilter("billy", "A", null)) };
final IncrementalIndexSchema schema = new IncrementalIndexSchema.Builder().withMinTimestamp(0).withQueryGranularity(Granularities.MINUTE).withDimensionsSpec(dimensions).withMetrics(metrics).withRollup(true).build();
final List<Object[]> constructors = Lists.newArrayList();
for (final Boolean sortFacts : ImmutableList.of(false, true)) {
constructors.add(new Object[] { new IndexCreator() {
@Override
public IncrementalIndex createIndex() {
return new OnheapIncrementalIndex(schema, false, true, sortFacts, 1000);
}
} });
constructors.add(new Object[] { new IndexCreator() {
@Override
public IncrementalIndex createIndex() {
return new OffheapIncrementalIndex(schema, true, true, sortFacts, 1000000, new StupidPool<ByteBuffer>("OffheapIncrementalIndex-bufferPool", new Supplier<ByteBuffer>() {
@Override
public ByteBuffer get() {
return ByteBuffer.allocate(256 * 1024);
}
}));
}
} });
}
return constructors;
}
use of io.druid.collections.StupidPool in project druid by druid-io.
the class GroupByQueryRunnerFailureTest method makeQueryRunnerFactory.
private static GroupByQueryRunnerFactory makeQueryRunnerFactory(final ObjectMapper mapper, final GroupByQueryConfig config) {
final Supplier<GroupByQueryConfig> configSupplier = Suppliers.ofInstance(config);
final StupidPool<ByteBuffer> bufferPool = new StupidPool<>("GroupByQueryEngine-bufferPool", new Supplier<ByteBuffer>() {
@Override
public ByteBuffer get() {
return ByteBuffer.allocateDirect(DEFAULT_PROCESSING_CONFIG.intermediateComputeSizeBytes());
}
});
final GroupByStrategySelector strategySelector = new GroupByStrategySelector(configSupplier, new GroupByStrategyV1(configSupplier, new GroupByQueryEngine(configSupplier, bufferPool), QueryRunnerTestHelper.NOOP_QUERYWATCHER, bufferPool), new GroupByStrategyV2(DEFAULT_PROCESSING_CONFIG, configSupplier, bufferPool, mergeBufferPool, mapper, QueryRunnerTestHelper.NOOP_QUERYWATCHER));
final GroupByQueryQueryToolChest toolChest = new GroupByQueryQueryToolChest(strategySelector, QueryRunnerTestHelper.NoopIntervalChunkingQueryRunnerDecorator());
return new GroupByQueryRunnerFactory(strategySelector, toolChest);
}
use of io.druid.collections.StupidPool in project druid by druid-io.
the class GroupByQueryMergeBufferTest method makeQueryRunnerFactory.
private static GroupByQueryRunnerFactory makeQueryRunnerFactory(final ObjectMapper mapper, final GroupByQueryConfig config) {
final Supplier<GroupByQueryConfig> configSupplier = Suppliers.ofInstance(config);
final StupidPool<ByteBuffer> bufferPool = new StupidPool<>("GroupByQueryEngine-bufferPool", new Supplier<ByteBuffer>() {
@Override
public ByteBuffer get() {
return ByteBuffer.allocateDirect(PROCESSING_CONFIG.intermediateComputeSizeBytes());
}
});
final GroupByStrategySelector strategySelector = new GroupByStrategySelector(configSupplier, new GroupByStrategyV1(configSupplier, new GroupByQueryEngine(configSupplier, bufferPool), QueryRunnerTestHelper.NOOP_QUERYWATCHER, bufferPool), new GroupByStrategyV2(PROCESSING_CONFIG, configSupplier, bufferPool, mergeBufferPool, mapper, QueryRunnerTestHelper.NOOP_QUERYWATCHER));
final GroupByQueryQueryToolChest toolChest = new GroupByQueryQueryToolChest(strategySelector, QueryRunnerTestHelper.NoopIntervalChunkingQueryRunnerDecorator());
return new GroupByQueryRunnerFactory(strategySelector, toolChest);
}
Aggregations