Search in sources :

Example 6 with StupidPool

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;
}
Also used : FilteredAggregatorFactory(io.druid.query.aggregation.FilteredAggregatorFactory) AggregatorFactory(io.druid.query.aggregation.AggregatorFactory) CountAggregatorFactory(io.druid.query.aggregation.CountAggregatorFactory) FilteredAggregatorFactory(io.druid.query.aggregation.FilteredAggregatorFactory) ByteBuffer(java.nio.ByteBuffer) StringDimensionSchema(io.druid.data.input.impl.StringDimensionSchema) CountAggregatorFactory(io.druid.query.aggregation.CountAggregatorFactory) SelectorDimFilter(io.druid.query.filter.SelectorDimFilter) DimensionsSpec(io.druid.data.input.impl.DimensionsSpec) StupidPool(io.druid.collections.StupidPool)

Example 7 with StupidPool

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);
}
Also used : GroupByStrategySelector(io.druid.query.groupby.strategy.GroupByStrategySelector) ByteBuffer(java.nio.ByteBuffer) GroupByStrategyV1(io.druid.query.groupby.strategy.GroupByStrategyV1) GroupByStrategyV2(io.druid.query.groupby.strategy.GroupByStrategyV2) StupidPool(io.druid.collections.StupidPool)

Example 8 with StupidPool

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);
}
Also used : GroupByStrategySelector(io.druid.query.groupby.strategy.GroupByStrategySelector) ByteBuffer(java.nio.ByteBuffer) GroupByStrategyV1(io.druid.query.groupby.strategy.GroupByStrategyV1) GroupByStrategyV2(io.druid.query.groupby.strategy.GroupByStrategyV2) StupidPool(io.druid.collections.StupidPool)

Aggregations

StupidPool (io.druid.collections.StupidPool)8 ByteBuffer (java.nio.ByteBuffer)6 GroupByStrategySelector (io.druid.query.groupby.strategy.GroupByStrategySelector)5 GroupByStrategyV1 (io.druid.query.groupby.strategy.GroupByStrategyV1)5 GroupByStrategyV2 (io.druid.query.groupby.strategy.GroupByStrategyV2)5 BenchmarkDataGenerator (io.druid.benchmark.datagen.BenchmarkDataGenerator)4 InputRow (io.druid.data.input.InputRow)4 OffheapBufferGenerator (io.druid.offheap.OffheapBufferGenerator)4 HyperUniquesSerde (io.druid.query.aggregation.hyperloglog.HyperUniquesSerde)4 IndexSpec (io.druid.segment.IndexSpec)4 IncrementalIndex (io.druid.segment.incremental.IncrementalIndex)4 OnheapIncrementalIndex (io.druid.segment.incremental.OnheapIncrementalIndex)4 File (java.io.File)4 Setup (org.openjdk.jmh.annotations.Setup)4 BlockingPool (io.druid.collections.BlockingPool)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 SmileFactory (com.fasterxml.jackson.dataformat.smile.SmileFactory)2 DefaultObjectMapper (io.druid.jackson.DefaultObjectMapper)2 DruidProcessingConfig (io.druid.query.DruidProcessingConfig)2 GroupByQueryConfig (io.druid.query.groupby.GroupByQueryConfig)2