Source:
public TaskStatus runTask(TaskToolbox toolbox) throws Exception { DataSchema dataSchema = ingestionSchema.getDataSchema(); GranularitySpec granularitySpec = dataSchema.getGranularitySpec(); ParallelIndexTuningConfig tuningConfig = ingestionSchema.getTuningConfig(); SingleDimensionPartitionsSpec partitionsSpec = (SingleDimensionPartitionsSpec) tuningConfig.getPartitionsSpec(); Preconditions.checkNotNull(partitionsSpec); String partitionDimension = partitionsSpec.getPartitionDimension(); Preconditions.checkNotNull(partitionDimension, "partitionDimension required"); boolean isAssumeGrouped = partitionsSpec.isAssumeGrouped(); InputSource inputSource = ingestionSchema.getIOConfig().getNonNullInputSource( ingestionSchema.getDataSchema().getParser() ); List<String> metricsNames = Arrays.stream(dataSchema.getAggregators()) .map(AggregatorFactory::getName) .collect(Collectors.toList()); InputFormat inputFormat = ParallelIndexSupervisorTask.getInputFormat(ingestionSchema); InputSourceReader inputSourceReader = dataSchema.getTransformSpec().decorate( inputSource.reader( new InputRowSchema( dataSchema.getTimestampSpec(), dataSchema.getDimensionsSpec(), metricsNames ), inputFormat, null ) ); try ( CloseableIterator<InputRow> inputRowIterator = inputSourceReader.read(); HandlingInputRowIterator iterator = new RangePartitionIndexTaskInputRowIteratorBuilder(partitionDimension) .delegate(inputRowIterator) .granularitySpec(granularitySpec) .nullRowRunnable(IndexTaskInputRowIteratorBuilder.NOOP_RUNNABLE) .absentBucketIntervalConsumer(IndexTaskInputRowIteratorBuilder.NOOP_CONSUMER) .build() ) { Map<Interval, StringDistribution> distribution = determineDistribution( iterator, granularitySpec, partitionDimension, isAssumeGrouped, tuningConfig.isLogParseExceptions(), tuningConfig.getMaxParseExceptions() ); sendReport(new DimensionDistributionReport(getId(), distribution)); } return TaskStatus.success(getId()); }

Target:
public TaskStatus runTask(TaskToolbox toolbox) throws Exception { DataSchema dataSchema = ingestionSchema.getDataSchema(); GranularitySpec granularitySpec = dataSchema.getGranularitySpec(); ParallelIndexTuningConfig tuningConfig = ingestionSchema.getTuningConfig(); SingleDimensionPartitionsSpec partitionsSpec = (SingleDimensionPartitionsSpec) tuningConfig.getPartitionsSpec(); Preconditions.checkNotNull(partitionsSpec, "partitionsSpec required in tuningConfig"); String partitionDimension = partitionsSpec.getPartitionDimension(); Preconditions.checkNotNull(partitionDimension, "partitionDimension required in partitionsSpec"); boolean isAssumeGrouped = partitionsSpec.isAssumeGrouped(); InputSource inputSource = ingestionSchema.getIOConfig().getNonNullInputSource( ingestionSchema.getDataSchema().getParser() ); List<String> metricsNames = Arrays.stream(dataSchema.getAggregators()) .map(AggregatorFactory::getName) .collect(Collectors.toList()); InputFormat inputFormat = inputSource.needsFormat() ? ParallelIndexSupervisorTask.getInputFormat(ingestionSchema) : null; InputSourceReader inputSourceReader = dataSchema.getTransformSpec().decorate( inputSource.reader( new InputRowSchema( dataSchema.getTimestampSpec(), dataSchema.getDimensionsSpec(), metricsNames ), inputFormat, toolbox.getIndexingTmpDir() ) ); try ( CloseableIterator<InputRow> inputRowIterator = inputSourceReader.read(); HandlingInputRowIterator iterator = new RangePartitionIndexTaskInputRowIteratorBuilder(partitionDimension, SKIP_NULL) .delegate(inputRowIterator) .granularitySpec(granularitySpec) .nullRowRunnable(IndexTaskInputRowIteratorBuilder.NOOP_RUNNABLE) .absentBucketIntervalConsumer(IndexTaskInputRowIteratorBuilder.NOOP_CONSUMER) .build() ) { Map<Interval, StringDistribution> distribution = determineDistribution( iterator, granularitySpec, partitionDimension, isAssumeGrouped, tuningConfig.isLogParseExceptions(), tuningConfig.getMaxParseExceptions() ); sendReport(new DimensionDistributionReport(getId(), distribution)); } return TaskStatus.success(getId()); }