Search in sources :

Example 21 with SavepointRestoreSettings

use of org.apache.flink.runtime.jobgraph.SavepointRestoreSettings in project flink by apache.

the class StreamGraphGeneratorTest method testSettingSavepointRestoreSettingsSetterOverrides.

@Test
public void testSettingSavepointRestoreSettingsSetterOverrides() {
    Configuration config = new Configuration();
    config.set(SavepointConfigOptions.SAVEPOINT_PATH, "/tmp/savepoint");
    StreamGraphGenerator generator = new StreamGraphGenerator(Collections.emptyList(), new ExecutionConfig(), new CheckpointConfig(), config);
    generator.setSavepointRestoreSettings(SavepointRestoreSettings.forPath("/tmp/savepoint1"));
    final StreamGraph streamGraph = generator.generate();
    SavepointRestoreSettings savepointRestoreSettings = streamGraph.getSavepointRestoreSettings();
    assertThat(savepointRestoreSettings, equalTo(SavepointRestoreSettings.forPath("/tmp/savepoint1")));
}
Also used : Configuration(org.apache.flink.configuration.Configuration) CheckpointConfig(org.apache.flink.streaming.api.environment.CheckpointConfig) ExecutionConfig(org.apache.flink.api.common.ExecutionConfig) SavepointRestoreSettings(org.apache.flink.runtime.jobgraph.SavepointRestoreSettings) Test(org.junit.Test)

Example 22 with SavepointRestoreSettings

use of org.apache.flink.runtime.jobgraph.SavepointRestoreSettings in project flink by apache.

the class StreamGraphGeneratorTest method testSettingSavepointRestoreSettings.

@Test
public void testSettingSavepointRestoreSettings() {
    Configuration config = new Configuration();
    config.set(SavepointConfigOptions.SAVEPOINT_PATH, "/tmp/savepoint");
    final StreamGraph streamGraph = new StreamGraphGenerator(Collections.emptyList(), new ExecutionConfig(), new CheckpointConfig(), config).generate();
    SavepointRestoreSettings savepointRestoreSettings = streamGraph.getSavepointRestoreSettings();
    assertThat(savepointRestoreSettings, equalTo(SavepointRestoreSettings.forPath("/tmp/savepoint")));
}
Also used : Configuration(org.apache.flink.configuration.Configuration) CheckpointConfig(org.apache.flink.streaming.api.environment.CheckpointConfig) ExecutionConfig(org.apache.flink.api.common.ExecutionConfig) SavepointRestoreSettings(org.apache.flink.runtime.jobgraph.SavepointRestoreSettings) Test(org.junit.Test)

Aggregations

SavepointRestoreSettings (org.apache.flink.runtime.jobgraph.SavepointRestoreSettings)22 Test (org.junit.Test)12 JobGraph (org.apache.flink.runtime.jobgraph.JobGraph)9 Configuration (org.apache.flink.configuration.Configuration)7 JobID (org.apache.flink.api.common.JobID)5 File (java.io.File)4 ExecutionConfig (org.apache.flink.api.common.ExecutionConfig)3 CheckpointConfig (org.apache.flink.streaming.api.environment.CheckpointConfig)3 Matchers.containsString (org.hamcrest.Matchers.containsString)3 GlobalConfiguration (org.apache.flink.configuration.GlobalConfiguration)2 CheckpointRecoveryFactory (org.apache.flink.runtime.checkpoint.CheckpointRecoveryFactory)2 CompletedCheckpoint (org.apache.flink.runtime.checkpoint.CompletedCheckpoint)2 PerJobCheckpointRecoveryFactory (org.apache.flink.runtime.checkpoint.PerJobCheckpointRecoveryFactory)2 StandaloneCheckpointRecoveryFactory (org.apache.flink.runtime.checkpoint.StandaloneCheckpointRecoveryFactory)2 StandaloneCompletedCheckpointStore (org.apache.flink.runtime.checkpoint.StandaloneCompletedCheckpointStore)2 JobVertex (org.apache.flink.runtime.jobgraph.JobVertex)2 JobMasterBuilder (org.apache.flink.runtime.jobmaster.utils.JobMasterBuilder)2 RemoteStreamEnvironment (org.apache.flink.streaming.api.environment.RemoteStreamEnvironment)2 ActorRef (akka.actor.ActorRef)1 ActorSystem (akka.actor.ActorSystem)1