use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method runningTaskCancellationNotifiesCoordinator.
@Ignore
@Test
public void runningTaskCancellationNotifiesCoordinator() throws Exception {
final DefaultScheduler scheduler = createSchedulerAndDeployTasks();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
cancelTask(scheduler, 0);
assertEquals(1, coordinator.getFailedTasks().size());
assertThat(coordinator.getFailedTasks(), contains(0));
assertThat(coordinator.getFailedTasks(), not(contains(1)));
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method testCoordinatorDisposedWhenSchedulerStops.
@Test
public void testCoordinatorDisposedWhenSchedulerStops() throws Exception {
final DefaultScheduler scheduler = createAndStartScheduler();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
closeScheduler(scheduler);
assertTrue(coordinator.isClosed());
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method testBatchLocalFailoverResetsTask.
@Test
public void testBatchLocalFailoverResetsTask() throws Exception {
final DefaultScheduler scheduler = createSchedulerWithoutCheckpointingAndDeployTasks();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
failAndRestartTask(scheduler, 1);
assertEquals(1, coordinator.getRestoredTasks().size());
final TestingOperatorCoordinator.SubtaskAndCheckpoint restoredTask = coordinator.getRestoredTasks().get(0);
assertEquals(1, restoredTask.subtaskIndex);
assertEquals(OperatorCoordinator.NO_CHECKPOINT, restoredTask.checkpointId);
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method testCoordinatorStartedWhenSchedulerStarts.
// ------------------------------------------------------------------------
// tests for scheduling
// ------------------------------------------------------------------------
@Test
public void testCoordinatorStartedWhenSchedulerStarts() throws Exception {
final DefaultScheduler scheduler = createAndStartScheduler();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
assertTrue(coordinator.isStarted());
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler 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;
}
Aggregations