Search in sources :

Example 1 with RangePartitionAnalysis

use of org.apache.druid.indexing.common.task.batch.partition.RangePartitionAnalysis in project druid by druid-io.

the class RangePartitionCachingLocalSegmentAllocatorTest method setup.

@Before
public void setup() throws IOException {
    TaskToolbox toolbox = createToolbox(INTERVAL_TO_VERSION.keySet().stream().map(RangePartitionCachingLocalSegmentAllocatorTest::createTaskLock).collect(Collectors.toList()));
    final RangePartitionAnalysis partitionAnalysis = new RangePartitionAnalysis(new DimensionRangePartitionsSpec(null, 1, PARTITION_DIMENSIONS, false));
    INTERVAL_TO_PARTITIONS.forEach(partitionAnalysis::updateBucket);
    target = SegmentAllocators.forNonLinearPartitioning(toolbox, DATASOURCE, TASKID, new UniformGranularitySpec(Granularities.HOUR, Granularities.NONE, ImmutableList.of()), new SupervisorTaskAccessWithNullClient(SUPERVISOR_TASKID), partitionAnalysis);
    sequenceNameFunction = ((CachingLocalSegmentAllocator) target).getSequenceNameFunction();
}
Also used : TaskToolbox(org.apache.druid.indexing.common.TaskToolbox) UniformGranularitySpec(org.apache.druid.segment.indexing.granularity.UniformGranularitySpec) RangePartitionAnalysis(org.apache.druid.indexing.common.task.batch.partition.RangePartitionAnalysis) DimensionRangePartitionsSpec(org.apache.druid.indexer.partitions.DimensionRangePartitionsSpec) Before(org.junit.Before)

Example 2 with RangePartitionAnalysis

use of org.apache.druid.indexing.common.task.batch.partition.RangePartitionAnalysis in project druid by druid-io.

the class PartialRangeSegmentGenerateTask method createSegmentAllocator.

@Override
SegmentAllocatorForBatch createSegmentAllocator(TaskToolbox toolbox, ParallelIndexSupervisorTaskClient taskClient) throws IOException {
    final RangePartitionAnalysis partitionAnalysis = new RangePartitionAnalysis((DimensionRangePartitionsSpec) ingestionSchema.getTuningConfig().getPartitionsSpec());
    intervalToPartitions.forEach(partitionAnalysis::updateBucket);
    return SegmentAllocators.forNonLinearPartitioning(toolbox, getDataSource(), getSubtaskSpecId(), ingestionSchema.getDataSchema().getGranularitySpec(), new SupervisorTaskAccess(supervisorTaskId, taskClient), partitionAnalysis);
}
Also used : RangePartitionAnalysis(org.apache.druid.indexing.common.task.batch.partition.RangePartitionAnalysis)

Aggregations

RangePartitionAnalysis (org.apache.druid.indexing.common.task.batch.partition.RangePartitionAnalysis)2 DimensionRangePartitionsSpec (org.apache.druid.indexer.partitions.DimensionRangePartitionsSpec)1 TaskToolbox (org.apache.druid.indexing.common.TaskToolbox)1 UniformGranularitySpec (org.apache.druid.segment.indexing.granularity.UniformGranularitySpec)1 Before (org.junit.Before)1