Search in sources :

Example 11 with UserCompactionTaskQueryTuningConfig

use of org.apache.druid.server.coordinator.UserCompactionTaskQueryTuningConfig in project druid by druid-io.

the class NewestSegmentFirstIteratorTest method testFindPartitionsSpecFromConfigWithRangePartitionsSpec.

@Test
public void testFindPartitionsSpecFromConfigWithRangePartitionsSpec() {
    final DataSourceCompactionConfig config = new DataSourceCompactionConfig("datasource", null, null, null, null, new UserCompactionTaskQueryTuningConfig(null, null, null, null, new SingleDimensionPartitionsSpec(10000, null, "dim", false), null, null, null, null, null, null, null, null, null, null, null, null), null, null, null, null, null, null);
    Assert.assertEquals(new SingleDimensionPartitionsSpec(10000, null, "dim", false), NewestSegmentFirstIterator.findPartitionsSpecFromConfig(ClientCompactionTaskQueryTuningConfig.from(config.getTuningConfig(), config.getMaxRowsPerSegment())));
}
Also used : DataSourceCompactionConfig(org.apache.druid.server.coordinator.DataSourceCompactionConfig) UserCompactionTaskQueryTuningConfig(org.apache.druid.server.coordinator.UserCompactionTaskQueryTuningConfig) SingleDimensionPartitionsSpec(org.apache.druid.indexer.partitions.SingleDimensionPartitionsSpec) Test(org.junit.Test)

Example 12 with UserCompactionTaskQueryTuningConfig

use of org.apache.druid.server.coordinator.UserCompactionTaskQueryTuningConfig in project druid by druid-io.

the class NewestSegmentFirstIteratorTest method testFindPartitionsSpecFromConfigWithNonNullMaxTotalRowsReturnGivenValue.

@Test
public void testFindPartitionsSpecFromConfigWithNonNullMaxTotalRowsReturnGivenValue() {
    final DataSourceCompactionConfig config = new DataSourceCompactionConfig("datasource", null, null, null, null, new UserCompactionTaskQueryTuningConfig(null, null, null, null, new DynamicPartitionsSpec(null, 1000L), null, null, null, null, null, null, null, null, null, null, null, null), null, null, null, null, null, null);
    Assert.assertEquals(new DynamicPartitionsSpec(null, 1000L), NewestSegmentFirstIterator.findPartitionsSpecFromConfig(ClientCompactionTaskQueryTuningConfig.from(config.getTuningConfig(), config.getMaxRowsPerSegment())));
}
Also used : DynamicPartitionsSpec(org.apache.druid.indexer.partitions.DynamicPartitionsSpec) DataSourceCompactionConfig(org.apache.druid.server.coordinator.DataSourceCompactionConfig) UserCompactionTaskQueryTuningConfig(org.apache.druid.server.coordinator.UserCompactionTaskQueryTuningConfig) Test(org.junit.Test)

Example 13 with UserCompactionTaskQueryTuningConfig

use of org.apache.druid.server.coordinator.UserCompactionTaskQueryTuningConfig in project druid by druid-io.

the class NewestSegmentFirstIteratorTest method testFindPartitionsSpecFromConfigWithHashPartitionsSpec.

@Test
public void testFindPartitionsSpecFromConfigWithHashPartitionsSpec() {
    final DataSourceCompactionConfig config = new DataSourceCompactionConfig("datasource", null, null, null, null, new UserCompactionTaskQueryTuningConfig(null, null, null, null, new HashedPartitionsSpec(null, 10, ImmutableList.of("dim")), null, null, null, null, null, null, null, null, null, null, null, null), null, null, null, null, null, null);
    Assert.assertEquals(new HashedPartitionsSpec(null, 10, ImmutableList.of("dim")), NewestSegmentFirstIterator.findPartitionsSpecFromConfig(ClientCompactionTaskQueryTuningConfig.from(config.getTuningConfig(), config.getMaxRowsPerSegment())));
}
Also used : HashedPartitionsSpec(org.apache.druid.indexer.partitions.HashedPartitionsSpec) DataSourceCompactionConfig(org.apache.druid.server.coordinator.DataSourceCompactionConfig) UserCompactionTaskQueryTuningConfig(org.apache.druid.server.coordinator.UserCompactionTaskQueryTuningConfig) Test(org.junit.Test)

Example 14 with UserCompactionTaskQueryTuningConfig

use of org.apache.druid.server.coordinator.UserCompactionTaskQueryTuningConfig in project druid by druid-io.

the class NewestSegmentFirstIteratorTest method testFindPartitionsSpecFromConfigWithNonNullMaxRowsPerSegmentReturnGivenValue.

@Test
public void testFindPartitionsSpecFromConfigWithNonNullMaxRowsPerSegmentReturnGivenValue() {
    final DataSourceCompactionConfig config = new DataSourceCompactionConfig("datasource", null, null, null, null, new UserCompactionTaskQueryTuningConfig(null, null, null, null, new DynamicPartitionsSpec(100, 1000L), null, null, null, null, null, null, null, null, null, null, null, null), null, null, null, null, null, null);
    Assert.assertEquals(new DynamicPartitionsSpec(100, 1000L), NewestSegmentFirstIterator.findPartitionsSpecFromConfig(ClientCompactionTaskQueryTuningConfig.from(config.getTuningConfig(), config.getMaxRowsPerSegment())));
}
Also used : DynamicPartitionsSpec(org.apache.druid.indexer.partitions.DynamicPartitionsSpec) DataSourceCompactionConfig(org.apache.druid.server.coordinator.DataSourceCompactionConfig) UserCompactionTaskQueryTuningConfig(org.apache.druid.server.coordinator.UserCompactionTaskQueryTuningConfig) Test(org.junit.Test)

Example 15 with UserCompactionTaskQueryTuningConfig

use of org.apache.druid.server.coordinator.UserCompactionTaskQueryTuningConfig in project druid by druid-io.

the class NewestSegmentFirstIteratorTest method testFindPartitionsSpecFromConfigWithDeprecatedMaxRowsPerSegmentAndMaxTotalRowsReturnGivenValues.

@Test
public void testFindPartitionsSpecFromConfigWithDeprecatedMaxRowsPerSegmentAndMaxTotalRowsReturnGivenValues() {
    final DataSourceCompactionConfig config = new DataSourceCompactionConfig("datasource", null, null, 100, null, new UserCompactionTaskQueryTuningConfig(null, null, 1000L, null, null, null, null, null, null, null, null, null, null, null, null, null, null), null, null, null, null, null, null);
    Assert.assertEquals(new DynamicPartitionsSpec(100, 1000L), NewestSegmentFirstIterator.findPartitionsSpecFromConfig(ClientCompactionTaskQueryTuningConfig.from(config.getTuningConfig(), config.getMaxRowsPerSegment())));
}
Also used : DynamicPartitionsSpec(org.apache.druid.indexer.partitions.DynamicPartitionsSpec) DataSourceCompactionConfig(org.apache.druid.server.coordinator.DataSourceCompactionConfig) UserCompactionTaskQueryTuningConfig(org.apache.druid.server.coordinator.UserCompactionTaskQueryTuningConfig) Test(org.junit.Test)

Aggregations

DataSourceCompactionConfig (org.apache.druid.server.coordinator.DataSourceCompactionConfig)24 UserCompactionTaskQueryTuningConfig (org.apache.druid.server.coordinator.UserCompactionTaskQueryTuningConfig)24 Test (org.junit.Test)21 Period (org.joda.time.Period)15 ArrayList (java.util.ArrayList)14 HttpIndexingServiceClient (org.apache.druid.client.indexing.HttpIndexingServiceClient)13 DynamicPartitionsSpec (org.apache.druid.indexer.partitions.DynamicPartitionsSpec)7 ImmutableList (com.google.common.collect.ImmutableList)6 List (java.util.List)6 ClientCompactionTaskGranularitySpec (org.apache.druid.client.indexing.ClientCompactionTaskGranularitySpec)6 UserCompactionTaskGranularityConfig (org.apache.druid.server.coordinator.UserCompactionTaskGranularityConfig)5 UserCompactionTaskIOConfig (org.apache.druid.server.coordinator.UserCompactionTaskIOConfig)3 ClientCompactionTaskDimensionsSpec (org.apache.druid.client.indexing.ClientCompactionTaskDimensionsSpec)2 ClientCompactionTaskTransformSpec (org.apache.druid.client.indexing.ClientCompactionTaskTransformSpec)2 MaxSizeSplitHintSpec (org.apache.druid.data.input.MaxSizeSplitHintSpec)2 AggregatorFactory (org.apache.druid.query.aggregation.AggregatorFactory)2 CountAggregatorFactory (org.apache.druid.query.aggregation.CountAggregatorFactory)2 CoordinatorCompactionConfig (org.apache.druid.server.coordinator.CoordinatorCompactionConfig)2 DataSegment (org.apache.druid.timeline.DataSegment)2 ClientCompactionIOConfig (org.apache.druid.client.indexing.ClientCompactionIOConfig)1