use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method deployingTaskFailureNotifiesCoordinator.
@Test
public void deployingTaskFailureNotifiesCoordinator() throws Exception {
final DefaultScheduler scheduler = createAndStartScheduler();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
failTask(scheduler, 1);
assertEquals(1, coordinator.getFailedTasks().size());
assertThat(coordinator.getFailedTasks(), contains(1));
assertThat(coordinator.getFailedTasks(), not(contains(0)));
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method testGlobalFailureResetsToCheckpoint.
@Test
public void testGlobalFailureResetsToCheckpoint() throws Exception {
final DefaultScheduler scheduler = createSchedulerAndDeployTasks();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
final byte[] coordinatorState = new byte[] { 7, 11, 3, 5 };
takeCompleteCheckpoint(scheduler, coordinator, coordinatorState);
failGlobalAndRestart(scheduler, new TestException());
assertArrayEquals("coordinator should have a restored checkpoint", coordinatorState, coordinator.getLastRestoredCheckpointState());
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method createSchedulerAndDeployTasks.
private DefaultScheduler createSchedulerAndDeployTasks(TaskExecutorOperatorEventGateway gateway) throws Exception {
final DefaultScheduler scheduler = setupTestJobAndScheduler(new TestingOperatorCoordinator.Provider(testOperatorId), gateway, null, false);
scheduleAllTasksToRunning(scheduler);
return scheduler;
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method testSnapshotAsyncFailureFailsCheckpoint.
@Test
public void testSnapshotAsyncFailureFailsCheckpoint() throws Exception {
final DefaultScheduler scheduler = createSchedulerAndDeployTasks();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
final CompletableFuture<?> checkpointFuture = triggerCheckpoint(scheduler);
final CompletableFuture<?> coordinatorStateFuture = coordinator.getLastTriggeredCheckpoint();
coordinatorStateFuture.completeExceptionally(new TestException());
waitForCompletionToPropagate(checkpointFuture);
assertThat(checkpointFuture, futureWillCompleteWithTestException());
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method taskGatewayAvailableWhenTasksRunning.
@Test
public void taskGatewayAvailableWhenTasksRunning() throws Exception {
final DefaultScheduler scheduler = createSchedulerAndDeployTasks();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
final OperatorCoordinator.SubtaskGateway gateway = coordinator.getSubtaskGateway(0);
assertNotNull(gateway);
}
Aggregations