Search in sources :

Example 1 with JsonKafkaSourcePostProcessor

use of org.apache.hudi.utilities.sources.processor.JsonKafkaSourcePostProcessor in project hudi by apache.

the class JsonKafkaSource method postProcess.

private JavaRDD<String> postProcess(JavaRDD<String> jsonStringRDD) {
    String postProcessorClassName = this.props.getString(KafkaOffsetGen.Config.JSON_KAFKA_PROCESSOR_CLASS_OPT.key(), null);
    // no processor, do nothing
    if (StringUtils.isNullOrEmpty(postProcessorClassName)) {
        return jsonStringRDD;
    }
    JsonKafkaSourcePostProcessor processor;
    try {
        processor = UtilHelpers.createJsonKafkaSourcePostProcessor(postProcessorClassName, this.props);
    } catch (IOException e) {
        throw new HoodieSourcePostProcessException("Could not init " + postProcessorClassName, e);
    }
    return processor.process(jsonStringRDD);
}
Also used : JsonKafkaSourcePostProcessor(org.apache.hudi.utilities.sources.processor.JsonKafkaSourcePostProcessor) HoodieSourcePostProcessException(org.apache.hudi.utilities.exception.HoodieSourcePostProcessException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 HoodieSourcePostProcessException (org.apache.hudi.utilities.exception.HoodieSourcePostProcessException)1 JsonKafkaSourcePostProcessor (org.apache.hudi.utilities.sources.processor.JsonKafkaSourcePostProcessor)1