Search in sources :

Example 1 with OperatorEventDispatcherImpl

use of org.apache.flink.streaming.runtime.tasks.OperatorEventDispatcherImpl in project flink by apache.

the class AbstractStreamOperatorTestHarness method setup.

/**
 * Calls {@link SetupableStreamOperator#setup(StreamTask, StreamConfig, Output)} ()}.
 */
public void setup(TypeSerializer<OUT> outputSerializer) {
    if (!setupCalled) {
        streamTaskStateInitializer = createStreamTaskStateManager(environment, stateBackend, ttlTimeProvider, timeServiceManagerProvider);
        mockTask.setStreamTaskStateInitializer(streamTaskStateInitializer);
        if (operator == null) {
            this.operator = StreamOperatorFactoryUtil.createOperator(factory, mockTask, config, new MockOutput(outputSerializer), new OperatorEventDispatcherImpl(this.getClass().getClassLoader(), new NoOpTaskOperatorEventGateway())).f0;
        } else {
            if (operator instanceof AbstractStreamOperator) {
                ((AbstractStreamOperator) operator).setProcessingTimeService(processingTimeService);
            }
            if (operator instanceof SetupableStreamOperator) {
                ((SetupableStreamOperator) operator).setup(mockTask, config, new MockOutput(outputSerializer));
            }
        }
        setupCalled = true;
        this.mockTask.init();
    }
}
Also used : NoOpTaskOperatorEventGateway(org.apache.flink.runtime.taskmanager.NoOpTaskOperatorEventGateway) SetupableStreamOperator(org.apache.flink.streaming.api.operators.SetupableStreamOperator) OperatorEventDispatcherImpl(org.apache.flink.streaming.runtime.tasks.OperatorEventDispatcherImpl) AbstractStreamOperator(org.apache.flink.streaming.api.operators.AbstractStreamOperator)

Aggregations

NoOpTaskOperatorEventGateway (org.apache.flink.runtime.taskmanager.NoOpTaskOperatorEventGateway)1 AbstractStreamOperator (org.apache.flink.streaming.api.operators.AbstractStreamOperator)1 SetupableStreamOperator (org.apache.flink.streaming.api.operators.SetupableStreamOperator)1 OperatorEventDispatcherImpl (org.apache.flink.streaming.runtime.tasks.OperatorEventDispatcherImpl)1