Search in sources :

Example 1 with SinkOperator

use of org.apache.flink.table.runtime.operators.sink.SinkOperator in project flink by apache.

the class CommonExecSink method createSinkFunctionTransformation.

private Transformation<?> createSinkFunctionTransformation(SinkFunction<RowData> sinkFunction, StreamExecutionEnvironment env, Transformation<RowData> inputTransformation, int rowtimeFieldIndex, TransformationMetadata transformationMetadata, int sinkParallelism) {
    final SinkOperator operator = new SinkOperator(env.clean(sinkFunction), rowtimeFieldIndex);
    if (sinkFunction instanceof InputTypeConfigurable) {
        ((InputTypeConfigurable) sinkFunction).setInputType(getInputTypeInfo(), env.getConfig());
    }
    final Transformation<?> transformation = new LegacySinkTransformation<>(inputTransformation, transformationMetadata.getName(), SimpleOperatorFactory.of(operator), sinkParallelism);
    transformationMetadata.fill(transformation);
    return transformation;
}
Also used : SinkOperator(org.apache.flink.table.runtime.operators.sink.SinkOperator) LegacySinkTransformation(org.apache.flink.streaming.api.transformations.LegacySinkTransformation) InputTypeConfigurable(org.apache.flink.api.java.typeutils.InputTypeConfigurable)

Aggregations

InputTypeConfigurable (org.apache.flink.api.java.typeutils.InputTypeConfigurable)1 LegacySinkTransformation (org.apache.flink.streaming.api.transformations.LegacySinkTransformation)1 SinkOperator (org.apache.flink.table.runtime.operators.sink.SinkOperator)1