Search in sources :

Example 1 with OperatorEventGateway

use of org.apache.flink.runtime.operators.coordination.OperatorEventGateway in project flink by apache.

the class SourceOperatorFactory method createStreamOperator.

@Override
public <T extends StreamOperator<OUT>> T createStreamOperator(StreamOperatorParameters<OUT> parameters) {
    final OperatorID operatorId = parameters.getStreamConfig().getOperatorID();
    final OperatorEventGateway gateway = parameters.getOperatorEventDispatcher().getOperatorEventGateway(operatorId);
    final SourceOperator<OUT, ?> sourceOperator = instantiateSourceOperator(source::createReader, gateway, source.getSplitSerializer(), watermarkStrategy, parameters.getProcessingTimeService(), parameters.getContainingTask().getEnvironment().getTaskManagerInfo().getConfiguration(), parameters.getContainingTask().getEnvironment().getTaskManagerInfo().getTaskManagerExternalAddress(), emitProgressiveWatermarks);
    sourceOperator.setup(parameters.getContainingTask(), parameters.getStreamConfig(), parameters.getOutput());
    parameters.getOperatorEventDispatcher().registerEventHandler(operatorId, sourceOperator);
    // today's lunch is generics spaghetti
    @SuppressWarnings("unchecked") final T castedOperator = (T) sourceOperator;
    return castedOperator;
}
Also used : OperatorEventGateway(org.apache.flink.runtime.operators.coordination.OperatorEventGateway) OperatorID(org.apache.flink.runtime.jobgraph.OperatorID)

Aggregations

OperatorID (org.apache.flink.runtime.jobgraph.OperatorID)1 OperatorEventGateway (org.apache.flink.runtime.operators.coordination.OperatorEventGateway)1