Search in sources :

Example 1 with Checkpoints

use of org.apache.flink.runtime.checkpoint.Checkpoints in project flink by apache.

the class OperatorCoordinatorSchedulerTest method createSchedulerWithoutCheckpointingAndDeployTasks.

private DefaultScheduler createSchedulerWithoutCheckpointingAndDeployTasks() throws Exception {
    final Consumer<JobGraph> noCheckpoints = (jobGraph) -> jobGraph.setSnapshotSettings(null);
    final DefaultScheduler scheduler = setupTestJobAndScheduler(new TestingOperatorCoordinator.Provider(testOperatorId), null, noCheckpoints, false);
    // guard test assumptions: this must set up a scheduler without checkpoints
    assertNull(scheduler.getExecutionGraph().getCheckpointCoordinator());
    scheduleAllTasksToRunning(scheduler);
    return scheduler;
}
Also used : ComponentMainThreadExecutorServiceAdapter(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutorServiceAdapter) CheckpointCoordinator(org.apache.flink.runtime.checkpoint.CheckpointCoordinator) OperatorState(org.apache.flink.runtime.checkpoint.OperatorState) JobGraph(org.apache.flink.runtime.jobgraph.JobGraph) Matchers.not(org.hamcrest.Matchers.not) ExceptionUtils(org.apache.flink.util.ExceptionUtils) Random(java.util.Random) DefaultScheduler(org.apache.flink.runtime.scheduler.DefaultScheduler) Assert.assertThat(org.junit.Assert.assertThat) StateBackend(org.apache.flink.runtime.state.StateBackend) CloseableRegistry(org.apache.flink.core.fs.CloseableRegistry) TestingCheckpointStorageAccessCoordinatorView(org.apache.flink.runtime.state.TestingCheckpointStorageAccessCoordinatorView) After(org.junit.After) Duration(java.time.Duration) TestLogger(org.apache.flink.util.TestLogger) OperatorStateBackend(org.apache.flink.runtime.state.OperatorStateBackend) Checkpoints(org.apache.flink.runtime.checkpoint.Checkpoints) Assert.fail(org.junit.Assert.fail) CompletedCheckpoint(org.apache.flink.runtime.checkpoint.CompletedCheckpoint) FlinkMatchers.futureFailedWith(org.apache.flink.core.testutils.FlinkMatchers.futureFailedWith) KeyGroupRange(org.apache.flink.runtime.state.KeyGroupRange) TypeSerializer(org.apache.flink.api.common.typeutils.TypeSerializer) KeyedStateHandle(org.apache.flink.runtime.state.KeyedStateHandle) Collection(java.util.Collection) ExecutionVertexID(org.apache.flink.runtime.scheduler.strategy.ExecutionVertexID) CommonTestUtils(org.apache.flink.core.testutils.CommonTestUtils) Acknowledge(org.apache.flink.runtime.messages.Acknowledge) CheckpointMetadata(org.apache.flink.runtime.checkpoint.metadata.CheckpointMetadata) Matchers.instanceOf(org.hamcrest.Matchers.instanceOf) MetricGroup(org.apache.flink.metrics.MetricGroup) TtlTimeProvider(org.apache.flink.runtime.state.ttl.TtlTimeProvider) SerializedValue(org.apache.flink.util.SerializedValue) Matchers.contains(org.hamcrest.Matchers.contains) Matchers.containsInAnyOrder(org.hamcrest.Matchers.containsInAnyOrder) OperatorID(org.apache.flink.runtime.jobgraph.OperatorID) Optional(java.util.Optional) RestartAllFailoverStrategy(org.apache.flink.runtime.executiongraph.failover.flip1.RestartAllFailoverStrategy) SchedulerTestingUtils(org.apache.flink.runtime.scheduler.SchedulerTestingUtils) Environment(org.apache.flink.runtime.execution.Environment) FlinkException(org.apache.flink.util.FlinkException) ComponentMainThreadExecutor(org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor) JobVertex(org.apache.flink.runtime.jobgraph.JobVertex) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ManuallyTriggeredScheduledExecutorService(org.apache.flink.runtime.concurrent.ManuallyTriggeredScheduledExecutorService) CompletableFuture(java.util.concurrent.CompletableFuture) JobVertexID(org.apache.flink.runtime.jobgraph.JobVertexID) Assert.assertSame(org.junit.Assert.assertSame) FutureUtils(org.apache.flink.util.concurrent.FutureUtils) Assert.assertArrayEquals(org.junit.Assert.assertArrayEquals) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) FlinkMatchers.futureWillCompleteExceptionally(org.apache.flink.core.testutils.FlinkMatchers.futureWillCompleteExceptionally) OperatorStateHandle(org.apache.flink.runtime.state.OperatorStateHandle) TaskExecutorOperatorEventGateway(org.apache.flink.runtime.taskexecutor.TaskExecutorOperatorEventGateway) Nonnull(javax.annotation.Nonnull) CheckpointableKeyedStateBackend(org.apache.flink.runtime.state.CheckpointableKeyedStateBackend) Nullable(javax.annotation.Nullable) SchedulerTestingUtils.setExecutionToState(org.apache.flink.runtime.scheduler.SchedulerTestingUtils.setExecutionToState) ExecutionJobVertex(org.apache.flink.runtime.executiongraph.ExecutionJobVertex) TaskKvStateRegistry(org.apache.flink.runtime.query.TaskKvStateRegistry) Matchers.empty(org.hamcrest.Matchers.empty) JobGraphBuilder(org.apache.flink.runtime.jobgraph.JobGraphBuilder) Assert.assertNotNull(org.junit.Assert.assertNotNull) ExecutionState(org.apache.flink.runtime.execution.ExecutionState) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) IOException(java.io.IOException) OperatorIDPair(org.apache.flink.runtime.OperatorIDPair) StreamStateHandle(org.apache.flink.runtime.state.StreamStateHandle) Consumer(java.util.function.Consumer) ExecutionAttemptID(org.apache.flink.runtime.executiongraph.ExecutionAttemptID) JobID(org.apache.flink.api.common.JobID) Assert.assertNull(org.junit.Assert.assertNull) Ignore(org.junit.Ignore) Matcher(org.hamcrest.Matcher) ByteStreamStateHandle(org.apache.flink.runtime.state.memory.ByteStreamStateHandle) SavepointRestoreSettings(org.apache.flink.runtime.jobgraph.SavepointRestoreSettings) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) NoOpInvokable(org.apache.flink.runtime.testtasks.NoOpInvokable) JobGraph(org.apache.flink.runtime.jobgraph.JobGraph) DefaultScheduler(org.apache.flink.runtime.scheduler.DefaultScheduler)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1 Duration (java.time.Duration)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 Optional (java.util.Optional)1 Random (java.util.Random)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1 Consumer (java.util.function.Consumer)1 Nonnull (javax.annotation.Nonnull)1 Nullable (javax.annotation.Nullable)1 JobID (org.apache.flink.api.common.JobID)1 TypeSerializer (org.apache.flink.api.common.typeutils.TypeSerializer)1 CloseableRegistry (org.apache.flink.core.fs.CloseableRegistry)1 CommonTestUtils (org.apache.flink.core.testutils.CommonTestUtils)1 FlinkMatchers.futureFailedWith (org.apache.flink.core.testutils.FlinkMatchers.futureFailedWith)1 FlinkMatchers.futureWillCompleteExceptionally (org.apache.flink.core.testutils.FlinkMatchers.futureWillCompleteExceptionally)1 MetricGroup (org.apache.flink.metrics.MetricGroup)1 OperatorIDPair (org.apache.flink.runtime.OperatorIDPair)1