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();
}
}
Aggregations