Search in sources :

Example 16 with RoaringBitmapSerdeFactory

use of org.apache.druid.segment.data.RoaringBitmapSerdeFactory in project druid by druid-io.

the class ParallelIndexTuningConfigTest method testConstructorWithDynamicPartitionsSpecAndForceGuaranteedRollupFailToCreate.

@Test
public void testConstructorWithDynamicPartitionsSpecAndForceGuaranteedRollupFailToCreate() {
    expectedException.expect(IllegalArgumentException.class);
    expectedException.expectMessage("cannot be used for perfect rollup");
    final boolean forceGuaranteedRollup = true;
    new ParallelIndexTuningConfig(null, null, null, 10, 1000L, null, null, null, null, new DynamicPartitionsSpec(100, null), new IndexSpec(new RoaringBitmapSerdeFactory(true), CompressionStrategy.UNCOMPRESSED, CompressionStrategy.LZF, LongEncodingStrategy.LONGS), new IndexSpec(), 1, forceGuaranteedRollup, true, 10000L, OffHeapMemorySegmentWriteOutMediumFactory.instance(), null, 10, 100, 20L, new Duration(3600), 128, null, null, false, null, null, null, null, null);
}
Also used : IndexSpec(org.apache.druid.segment.IndexSpec) DynamicPartitionsSpec(org.apache.druid.indexer.partitions.DynamicPartitionsSpec) RoaringBitmapSerdeFactory(org.apache.druid.segment.data.RoaringBitmapSerdeFactory) Duration(org.joda.time.Duration) Test(org.junit.Test)

Example 17 with RoaringBitmapSerdeFactory

use of org.apache.druid.segment.data.RoaringBitmapSerdeFactory in project druid by druid-io.

the class ParallelIndexTuningConfigTest method testSerdeWithMaxRowsPerSegment.

@Test
public void testSerdeWithMaxRowsPerSegment() throws IOException {
    final ParallelIndexTuningConfig tuningConfig = new ParallelIndexTuningConfig(null, null, null, 10, 1000L, null, null, null, null, new DynamicPartitionsSpec(100, 100L), new IndexSpec(new RoaringBitmapSerdeFactory(true), CompressionStrategy.UNCOMPRESSED, CompressionStrategy.LZF, LongEncodingStrategy.LONGS), new IndexSpec(), 1, false, true, 10000L, OffHeapMemorySegmentWriteOutMediumFactory.instance(), null, 250, 100, 20L, new Duration(3600), 128, null, null, false, null, null, null, null, null);
    final byte[] json = mapper.writeValueAsBytes(tuningConfig);
    final ParallelIndexTuningConfig fromJson = (ParallelIndexTuningConfig) mapper.readValue(json, TuningConfig.class);
    Assert.assertEquals(fromJson, tuningConfig);
}
Also used : TuningConfig(org.apache.druid.segment.indexing.TuningConfig) IndexSpec(org.apache.druid.segment.IndexSpec) DynamicPartitionsSpec(org.apache.druid.indexer.partitions.DynamicPartitionsSpec) RoaringBitmapSerdeFactory(org.apache.druid.segment.data.RoaringBitmapSerdeFactory) Duration(org.joda.time.Duration) Test(org.junit.Test)

Example 18 with RoaringBitmapSerdeFactory

use of org.apache.druid.segment.data.RoaringBitmapSerdeFactory in project druid by druid-io.

the class ParallelIndexTuningConfigTest method testSerdeWithMaxNumConcurrentSubTasks.

@Test
public void testSerdeWithMaxNumConcurrentSubTasks() throws IOException {
    final int maxNumConcurrentSubTasks = 250;
    final ParallelIndexTuningConfig tuningConfig = new ParallelIndexTuningConfig(null, null, null, 10, 1000L, null, null, null, null, new DynamicPartitionsSpec(100, 100L), new IndexSpec(new RoaringBitmapSerdeFactory(true), CompressionStrategy.UNCOMPRESSED, CompressionStrategy.LZF, LongEncodingStrategy.LONGS), new IndexSpec(), 1, false, true, 10000L, OffHeapMemorySegmentWriteOutMediumFactory.instance(), null, maxNumConcurrentSubTasks, 100, 20L, new Duration(3600), 128, null, null, false, null, null, null, null, null);
    final byte[] json = mapper.writeValueAsBytes(tuningConfig);
    final ParallelIndexTuningConfig fromJson = (ParallelIndexTuningConfig) mapper.readValue(json, TuningConfig.class);
    Assert.assertEquals(fromJson, tuningConfig);
}
Also used : TuningConfig(org.apache.druid.segment.indexing.TuningConfig) IndexSpec(org.apache.druid.segment.IndexSpec) DynamicPartitionsSpec(org.apache.druid.indexer.partitions.DynamicPartitionsSpec) RoaringBitmapSerdeFactory(org.apache.druid.segment.data.RoaringBitmapSerdeFactory) Duration(org.joda.time.Duration) Test(org.junit.Test)

Example 19 with RoaringBitmapSerdeFactory

use of org.apache.druid.segment.data.RoaringBitmapSerdeFactory in project druid by druid-io.

the class ParallelIndexTuningConfigTest method testConstructorWithHashedPartitionsSpecAndNonForceGuaranteedRollupFailToCreate.

@Test
public void testConstructorWithHashedPartitionsSpecAndNonForceGuaranteedRollupFailToCreate() {
    expectedException.expect(IllegalArgumentException.class);
    expectedException.expectMessage("DynamicPartitionsSpec must be used for best-effort rollup");
    final boolean forceGuaranteedRollup = false;
    new ParallelIndexTuningConfig(null, null, null, 10, 1000L, null, null, null, null, new HashedPartitionsSpec(null, 10, null), new IndexSpec(new RoaringBitmapSerdeFactory(true), CompressionStrategy.UNCOMPRESSED, CompressionStrategy.LZF, LongEncodingStrategy.LONGS), new IndexSpec(), 1, forceGuaranteedRollup, true, 10000L, OffHeapMemorySegmentWriteOutMediumFactory.instance(), null, 10, 100, 20L, new Duration(3600), 128, null, null, false, null, null, null, null, null);
}
Also used : HashedPartitionsSpec(org.apache.druid.indexer.partitions.HashedPartitionsSpec) IndexSpec(org.apache.druid.segment.IndexSpec) RoaringBitmapSerdeFactory(org.apache.druid.segment.data.RoaringBitmapSerdeFactory) Duration(org.joda.time.Duration) Test(org.junit.Test)

Example 20 with RoaringBitmapSerdeFactory

use of org.apache.druid.segment.data.RoaringBitmapSerdeFactory in project druid by druid-io.

the class ParallelIndexTuningConfigTest method testConstructorWithSingleDimensionPartitionsSpecAndNonForceGuaranteedRollupFailToCreate.

@Test
public void testConstructorWithSingleDimensionPartitionsSpecAndNonForceGuaranteedRollupFailToCreate() {
    expectedException.expect(IllegalArgumentException.class);
    expectedException.expectMessage("DynamicPartitionsSpec must be used for best-effort rollup");
    final boolean forceGuaranteedRollup = false;
    new ParallelIndexTuningConfig(null, null, null, 10, 1000L, null, null, null, null, new SingleDimensionPartitionsSpec(100, null, "dim", false), new IndexSpec(new RoaringBitmapSerdeFactory(true), CompressionStrategy.UNCOMPRESSED, CompressionStrategy.LZF, LongEncodingStrategy.LONGS), new IndexSpec(), 1, forceGuaranteedRollup, true, 10000L, OffHeapMemorySegmentWriteOutMediumFactory.instance(), null, 10, 100, 20L, new Duration(3600), 128, null, null, false, null, null, null, null, null);
}
Also used : IndexSpec(org.apache.druid.segment.IndexSpec) RoaringBitmapSerdeFactory(org.apache.druid.segment.data.RoaringBitmapSerdeFactory) SingleDimensionPartitionsSpec(org.apache.druid.indexer.partitions.SingleDimensionPartitionsSpec) Duration(org.joda.time.Duration) Test(org.junit.Test)

Aggregations

RoaringBitmapSerdeFactory (org.apache.druid.segment.data.RoaringBitmapSerdeFactory)31 IndexSpec (org.apache.druid.segment.IndexSpec)25 Test (org.junit.Test)25 DynamicPartitionsSpec (org.apache.druid.indexer.partitions.DynamicPartitionsSpec)10 Duration (org.joda.time.Duration)9 IndexTuningConfig (org.apache.druid.indexing.common.task.IndexTask.IndexTuningConfig)8 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 DimensionsSpec (org.apache.druid.data.input.impl.DimensionsSpec)5 AggregatorFactory (org.apache.druid.query.aggregation.AggregatorFactory)5 BitmapSerdeFactory (org.apache.druid.segment.data.BitmapSerdeFactory)5 Function (com.google.common.base.Function)4 BitmapFactory (org.apache.druid.collections.bitmap.BitmapFactory)4 RoaringBitmapFactory (org.apache.druid.collections.bitmap.RoaringBitmapFactory)4 HashedPartitionsSpec (org.apache.druid.indexer.partitions.HashedPartitionsSpec)4 LongSumAggregatorFactory (org.apache.druid.query.aggregation.LongSumAggregatorFactory)4 BitmapIndex (org.apache.druid.segment.column.BitmapIndex)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 MutableBitmap (org.apache.druid.collections.bitmap.MutableBitmap)3 InputRow (org.apache.druid.data.input.InputRow)3