Search in sources :

Example 1 with BatchExecutionStateBackend

use of org.apache.flink.streaming.api.operators.sorted.state.BatchExecutionStateBackend in project flink by apache.

the class StreamGraphGenerator method setBatchStateBackendAndTimerService.

private void setBatchStateBackendAndTimerService(StreamGraph graph) {
    boolean useStateBackend = configuration.get(ExecutionOptions.USE_BATCH_STATE_BACKEND);
    boolean sortInputs = configuration.get(ExecutionOptions.SORT_INPUTS);
    checkState(!useStateBackend || sortInputs, "Batch state backend requires the sorted inputs to be enabled!");
    if (useStateBackend) {
        LOG.debug("Using BATCH execution state backend and timer service.");
        graph.setStateBackend(new BatchExecutionStateBackend());
        graph.setChangelogStateBackendEnabled(TernaryBoolean.FALSE);
        graph.setCheckpointStorage(new BatchExecutionCheckpointStorage());
        graph.setTimerServiceProvider(BatchExecutionInternalTimeServiceManager::create);
    } else {
        graph.setStateBackend(stateBackend);
        graph.setChangelogStateBackendEnabled(changelogStateBackendEnabled);
    }
}
Also used : BatchExecutionCheckpointStorage(org.apache.flink.streaming.api.operators.sorted.state.BatchExecutionCheckpointStorage) BatchExecutionStateBackend(org.apache.flink.streaming.api.operators.sorted.state.BatchExecutionStateBackend) BatchExecutionInternalTimeServiceManager(org.apache.flink.streaming.api.operators.sorted.state.BatchExecutionInternalTimeServiceManager)

Aggregations

BatchExecutionCheckpointStorage (org.apache.flink.streaming.api.operators.sorted.state.BatchExecutionCheckpointStorage)1 BatchExecutionInternalTimeServiceManager (org.apache.flink.streaming.api.operators.sorted.state.BatchExecutionInternalTimeServiceManager)1 BatchExecutionStateBackend (org.apache.flink.streaming.api.operators.sorted.state.BatchExecutionStateBackend)1