Search in sources :

Example 1 with WatermarkAssignerOperatorFactory

use of org.apache.flink.table.runtime.operators.wmassigners.WatermarkAssignerOperatorFactory in project flink by apache.

the class StreamExecWatermarkAssigner method translateToPlanInternal.

@SuppressWarnings("unchecked")
@Override
protected Transformation<RowData> translateToPlanInternal(PlannerBase planner, ExecNodeConfig config) {
    final ExecEdge inputEdge = getInputEdges().get(0);
    final Transformation<RowData> inputTransform = (Transformation<RowData>) inputEdge.translateToPlan(planner);
    final GeneratedWatermarkGenerator watermarkGenerator = WatermarkGeneratorCodeGenerator.generateWatermarkGenerator(config.getTableConfig(), (RowType) inputEdge.getOutputType(), watermarkExpr, JavaScalaConversionUtil.toScala(Optional.empty()));
    final long idleTimeout = config.get(ExecutionConfigOptions.TABLE_EXEC_SOURCE_IDLE_TIMEOUT).toMillis();
    final WatermarkAssignerOperatorFactory operatorFactory = new WatermarkAssignerOperatorFactory(rowtimeFieldIndex, idleTimeout, watermarkGenerator);
    return ExecNodeUtil.createOneInputTransformation(inputTransform, createTransformationMeta(WATERMARK_ASSIGNER_TRANSFORMATION, config), operatorFactory, InternalTypeInfo.of(getOutputType()), inputTransform.getParallelism());
}
Also used : GeneratedWatermarkGenerator(org.apache.flink.table.runtime.generated.GeneratedWatermarkGenerator) RowData(org.apache.flink.table.data.RowData) Transformation(org.apache.flink.api.dag.Transformation) ExecEdge(org.apache.flink.table.planner.plan.nodes.exec.ExecEdge) WatermarkAssignerOperatorFactory(org.apache.flink.table.runtime.operators.wmassigners.WatermarkAssignerOperatorFactory)

Aggregations

Transformation (org.apache.flink.api.dag.Transformation)1 RowData (org.apache.flink.table.data.RowData)1 ExecEdge (org.apache.flink.table.planner.plan.nodes.exec.ExecEdge)1 GeneratedWatermarkGenerator (org.apache.flink.table.runtime.generated.GeneratedWatermarkGenerator)1 WatermarkAssignerOperatorFactory (org.apache.flink.table.runtime.operators.wmassigners.WatermarkAssignerOperatorFactory)1