Search in sources :

Example 1 with TimedShutoffInputSourceReader

use of org.apache.druid.data.input.impl.TimedShutoffInputSourceReader in project druid by druid-io.

the class InputSourceSampler method buildReader.

private InputSourceReader buildReader(SamplerConfig samplerConfig, DataSchema dataSchema, InputSource inputSource, @Nullable InputFormat inputFormat, File tempDir) {
    final InputRowSchema inputRowSchema = InputRowSchemas.fromDataSchema(dataSchema);
    InputSourceReader reader = inputSource.reader(inputRowSchema, inputFormat, tempDir);
    if (samplerConfig.getTimeoutMs() > 0) {
        reader = new TimedShutoffInputSourceReader(reader, DateTimes.nowUtc().plusMillis(samplerConfig.getTimeoutMs()));
    }
    return dataSchema.getTransformSpec().decorate(reader);
}
Also used : InputSourceReader(org.apache.druid.data.input.InputSourceReader) TimedShutoffInputSourceReader(org.apache.druid.data.input.impl.TimedShutoffInputSourceReader) InputRowSchema(org.apache.druid.data.input.InputRowSchema) TimedShutoffInputSourceReader(org.apache.druid.data.input.impl.TimedShutoffInputSourceReader)

Aggregations

InputRowSchema (org.apache.druid.data.input.InputRowSchema)1 InputSourceReader (org.apache.druid.data.input.InputSourceReader)1 TimedShutoffInputSourceReader (org.apache.druid.data.input.impl.TimedShutoffInputSourceReader)1