use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method testLocalFailoverResetsTask.
@Test
public void testLocalFailoverResetsTask() throws Exception {
final DefaultScheduler scheduler = createSchedulerAndDeployTasks();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
final long checkpointId = takeCompleteCheckpoint(scheduler, coordinator, new byte[0]);
failAndRestartTask(scheduler, 1);
assertEquals(1, coordinator.getRestoredTasks().size());
final TestingOperatorCoordinator.SubtaskAndCheckpoint restoredTask = coordinator.getRestoredTasks().get(0);
assertEquals(1, restoredTask.subtaskIndex);
assertEquals(checkpointId, restoredTask.checkpointId);
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method cancellationAsPartOfFailoverNotifiesCoordinator.
@Test
public void cancellationAsPartOfFailoverNotifiesCoordinator() throws Exception {
final DefaultScheduler scheduler = createSchedulerWithAllRestartOnFailureAndDeployTasks();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
failTask(scheduler, 1);
assertEquals(2, coordinator.getFailedTasks().size());
assertThat(coordinator.getFailedTasks(), containsInAnyOrder(0, 1));
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method testDeliveringClientRequestToRequestHandler.
// ------------------------------------------------------------------------
// tests for REST request delivery
// ------------------------------------------------------------------------
@Test
@SuppressWarnings("unchecked")
public void testDeliveringClientRequestToRequestHandler() throws Exception {
final OperatorCoordinator.Provider provider = new TestingCoordinationRequestHandler.Provider(testOperatorId);
final DefaultScheduler scheduler = createScheduler(provider);
final String payload = "testing payload";
final TestingCoordinationRequestHandler.Request<String> request = new TestingCoordinationRequestHandler.Request<>(payload);
final TestingCoordinationRequestHandler.Response<String> response = (TestingCoordinationRequestHandler.Response<String>) scheduler.deliverCoordinationRequestToCoordinator(testOperatorId, request).get();
assertEquals(payload, response.getPayload());
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method testBatchGlobalFailoverDoesNotNotifyLocalRestore.
@Test
public void testBatchGlobalFailoverDoesNotNotifyLocalRestore() throws Exception {
final DefaultScheduler scheduler = createSchedulerWithoutCheckpointingAndDeployTasks();
final TestingOperatorCoordinator coordinator = getCoordinator(scheduler);
failGlobalAndRestart(scheduler, new TestException());
assertThat(coordinator.getRestoredTasks(), empty());
}
use of org.apache.flink.runtime.scheduler.DefaultScheduler in project flink by apache.
the class OperatorCoordinatorSchedulerTest method testLocalFailoverBeforeCheckpointResetsTask.
@Test
public void testLocalFailoverBeforeCheckpointResetsTask() throws Exception {
final DefaultScheduler scheduler = createSchedulerAndDeployTasks();
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);
}
Aggregations