Search in sources :

Example 1 with ProcTimeMiniBatchAssignerOperator

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

the class StreamExecMiniBatchAssigner method translateToPlanInternal.

@SuppressWarnings("unchecked")
@Override
protected Transformation<RowData> translateToPlanInternal(PlannerBase planner, ExecNodeConfig config) {
    final Transformation<RowData> inputTransform = (Transformation<RowData>) getInputEdges().get(0).translateToPlan(planner);
    final OneInputStreamOperator<RowData, RowData> operator;
    if (miniBatchInterval.getMode() == MiniBatchMode.ProcTime) {
        operator = new ProcTimeMiniBatchAssignerOperator(miniBatchInterval.getInterval());
    } else if (miniBatchInterval.getMode() == MiniBatchMode.RowTime) {
        operator = new RowTimeMiniBatchAssginerOperator(miniBatchInterval.getInterval());
    } else {
        throw new TableException(String.format("MiniBatchAssigner shouldn't be in %s mode this is a bug, please file an issue.", miniBatchInterval.getMode()));
    }
    return ExecNodeUtil.createOneInputTransformation(inputTransform, createTransformationMeta(MINI_BATCH_ASSIGNER_TRANSFORMATION, config), operator, InternalTypeInfo.of(getOutputType()), inputTransform.getParallelism());
}
Also used : RowData(org.apache.flink.table.data.RowData) Transformation(org.apache.flink.api.dag.Transformation) TableException(org.apache.flink.table.api.TableException) ProcTimeMiniBatchAssignerOperator(org.apache.flink.table.runtime.operators.wmassigners.ProcTimeMiniBatchAssignerOperator) RowTimeMiniBatchAssginerOperator(org.apache.flink.table.runtime.operators.wmassigners.RowTimeMiniBatchAssginerOperator)

Aggregations

Transformation (org.apache.flink.api.dag.Transformation)1 TableException (org.apache.flink.table.api.TableException)1 RowData (org.apache.flink.table.data.RowData)1 ProcTimeMiniBatchAssignerOperator (org.apache.flink.table.runtime.operators.wmassigners.ProcTimeMiniBatchAssignerOperator)1 RowTimeMiniBatchAssginerOperator (org.apache.flink.table.runtime.operators.wmassigners.RowTimeMiniBatchAssginerOperator)1