Search in sources :

Example 1 with SavepointEnvironment

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

the class BootstrapStreamTaskRunner method open.

@Override
public void open() throws Exception {
    this.input = new ArrayBlockingQueue<>(16);
    SavepointEnvironment env = new SavepointEnvironment.Builder(getRuntimeContext(), maxParallelism).setConfiguration(streamConfig.getConfiguration()).build();
    this.task = new Thread(() -> {
        BootstrapStreamTask boundedStreamTask;
        try {
            boundedStreamTask = new BootstrapStreamTask(env, input, output);
        } catch (Exception e) {
            throw new RuntimeException("Failed to construct bootstrap stream task", e);
        }
        Throwable error = null;
        try {
            boundedStreamTask.invoke();
        } catch (Exception e) {
            error = e;
        }
        try {
            boundedStreamTask.cleanUp(error);
        } catch (Exception e) {
            throw new RuntimeException("Failed to cleanup task", e);
        }
    });
    this.task.setName(streamConfig.getOperatorName() + "-bootstrap-thread-" + getRuntimeContext().getIndexOfThisSubtask());
    this.task.start();
}
Also used : SavepointEnvironment(org.apache.flink.state.api.runtime.SavepointEnvironment)

Aggregations

SavepointEnvironment (org.apache.flink.state.api.runtime.SavepointEnvironment)1