use of org.apache.flink.runtime.state.CheckpointStorage in project flink by apache.
the class ChangelogStateBackendLoadingTest method testApplicationEnableChangelogStateBackend.
@Test
public void testApplicationEnableChangelogStateBackend() throws Exception {
final StateBackend backend = StateBackendLoader.fromApplicationOrConfigOrDefault(null, TernaryBoolean.TRUE, config(false), cl, null);
final CheckpointStorage storage = CheckpointStorageLoader.load(null, null, backend, config(), cl, null);
assertDelegateStateBackend(backend, HashMapStateBackend.class, storage, JobManagerCheckpointStorage.class);
}
use of org.apache.flink.runtime.state.CheckpointStorage in project flink by apache.
the class ChangelogStateBackendLoadingTest method testLoadingStateBackend.
private void testLoadingStateBackend(String backendName, Class<?> delegatedStateBackendClass, Class<?> storageClass, boolean configOnly) throws Exception {
final Configuration config = config(backendName, true);
StateBackend backend;
StateBackend appBackend = StateBackendLoader.loadStateBackendFromConfig(config, cl, null);
if (configOnly) {
backend = StateBackendLoader.fromApplicationOrConfigOrDefault(null, TernaryBoolean.UNDEFINED, config, cl, null);
} else {
backend = StateBackendLoader.fromApplicationOrConfigOrDefault(appBackend, TernaryBoolean.TRUE, config, cl, null);
}
final CheckpointStorage storage = CheckpointStorageLoader.load(null, null, backend, config, cl, null);
assertDelegateStateBackend(backend, delegatedStateBackendClass, storage, storageClass);
}
use of org.apache.flink.runtime.state.CheckpointStorage in project flink by apache.
the class ChangelogStateBackendLoadingTest method testApplicationDefinedChangelogStateBackend.
@Test
public void testApplicationDefinedChangelogStateBackend() throws Exception {
final StateBackend appBackend = new MockStateBackend();
// "rocksdb" should not take effect
final StateBackend backend = StateBackendLoader.fromApplicationOrConfigOrDefault(appBackend, TernaryBoolean.TRUE, config("rocksdb", false), cl, null);
final CheckpointStorage storage = CheckpointStorageLoader.load(null, null, backend, config(), cl, null);
assertDelegateStateBackend(backend, MockStateBackend.class, storage, MockStateBackend.class);
assertTrue(((MockStateBackend) (((ChangelogStateBackend) backend).getDelegatedStateBackend())).isConfigUpdated());
}
Aggregations