Search in sources :

Example 1 with NeverFireProcessingTimeService

use of org.apache.flink.state.api.runtime.NeverFireProcessingTimeService in project flink by apache.

the class StreamOperatorContextBuilder method build.

StreamOperatorStateContext build(Logger logger) throws IOException {
    final Environment environment = new SavepointEnvironment.Builder(ctx, maxParallelism).setConfiguration(configuration).setSubtaskIndex(split.getSplitNumber()).setPrioritizedOperatorSubtaskState(split.getPrioritizedOperatorSubtaskState()).build();
    StateBackend stateBackend;
    try {
        stateBackend = StateBackendLoader.fromApplicationOrConfigOrDefault(applicationStateBackend, TernaryBoolean.FALSE, configuration, ctx.getUserCodeClassLoader(), logger);
    } catch (DynamicCodeLoadingException e) {
        throw new IOException("Failed to load state backend", e);
    }
    StreamTaskStateInitializer initializer = new StreamTaskStateInitializerImpl(environment, stateBackend);
    try {
        return initializer.streamOperatorStateContext(operatorState.getOperatorID(), operatorState.getOperatorID().toString(), new NeverFireProcessingTimeService(), keyContext, keySerializer, registry, ctx.getMetricGroup(), 1.0, false);
    } catch (Exception e) {
        throw new IOException("Failed to restore state backend", e);
    }
}
Also used : StreamTaskStateInitializer(org.apache.flink.streaming.api.operators.StreamTaskStateInitializer) NeverFireProcessingTimeService(org.apache.flink.state.api.runtime.NeverFireProcessingTimeService) DynamicCodeLoadingException(org.apache.flink.util.DynamicCodeLoadingException) StreamTaskStateInitializerImpl(org.apache.flink.streaming.api.operators.StreamTaskStateInitializerImpl) SavepointEnvironment(org.apache.flink.state.api.runtime.SavepointEnvironment) Environment(org.apache.flink.runtime.execution.Environment) IOException(java.io.IOException) StateBackend(org.apache.flink.runtime.state.StateBackend) IOException(java.io.IOException) DynamicCodeLoadingException(org.apache.flink.util.DynamicCodeLoadingException)

Example 2 with NeverFireProcessingTimeService

use of org.apache.flink.state.api.runtime.NeverFireProcessingTimeService in project flink by apache.

the class StateBootstrapWrapperOperator method setup.

@Override
public void setup(StreamTask<?, ?> containingTask, StreamConfig config, Output<StreamRecord<TaggedOperatorSubtaskState>> output) {
    ((SetupableStreamOperator) operator).setup(containingTask, config, new VoidOutput<>());
    operator.setProcessingTimeService(new NeverFireProcessingTimeService());
    this.output = output;
}
Also used : NeverFireProcessingTimeService(org.apache.flink.state.api.runtime.NeverFireProcessingTimeService) SetupableStreamOperator(org.apache.flink.streaming.api.operators.SetupableStreamOperator)

Aggregations

NeverFireProcessingTimeService (org.apache.flink.state.api.runtime.NeverFireProcessingTimeService)2 IOException (java.io.IOException)1 Environment (org.apache.flink.runtime.execution.Environment)1 StateBackend (org.apache.flink.runtime.state.StateBackend)1 SavepointEnvironment (org.apache.flink.state.api.runtime.SavepointEnvironment)1 SetupableStreamOperator (org.apache.flink.streaming.api.operators.SetupableStreamOperator)1 StreamTaskStateInitializer (org.apache.flink.streaming.api.operators.StreamTaskStateInitializer)1 StreamTaskStateInitializerImpl (org.apache.flink.streaming.api.operators.StreamTaskStateInitializerImpl)1 DynamicCodeLoadingException (org.apache.flink.util.DynamicCodeLoadingException)1