@Test public void testJobRescheduledWhenItFinishesDuringDecommission() { initScheduledRequest(); initFirstDeploy(); resourceOffers(); SingularityTask task = launchTask(request, firstDeploy, 1, TaskState.TASK_RUNNING); slaveManager.changeState("slave1", MachineState.STARTING_DECOMMISSION, Optional.<String> absent(), Optional.of("user1")); cleaner.drainCleanupQueue(); resourceOffers(); cleaner.drainCleanupQueue(); statusUpdate(task, TaskState.TASK_FINISHED); Assert.assertTrue(!taskManager.getPendingTaskIds().isEmpty()); }
private <T extends SingularityMachineAbstraction<T>> void changeState(Map<T, MachineState> map, AbstractMachineManager<T> manager) { for (Entry<T, MachineState> entry : map.entrySet()) { manager.changeState(entry.getKey().getId(), entry.getValue(), entry.getKey().getCurrentState().getMessage(), entry.getKey().getCurrentState().getUser()); } }
SingularityScheduler { private <T extends SingularityMachineAbstraction<T>> void changeState(Map<T, MachineState> map, AbstractMachineManager<T> manager) { for (Entry<T, MachineState> entry : map.entrySet()) { manager.changeState(entry.getKey().getId(), entry.getValue(), entry.getKey().getCurrentState().getMessage(), entry.getKey().getCurrentState().getUser()); } } }
SingularityScheduler { private <T extends SingularityMachineAbstraction<T>> void changeState(Map<T, MachineState> map, AbstractMachineManager<T> manager) { for (Entry<T, MachineState> entry : map.entrySet()) { manager.changeState(entry.getKey().getId(), entry.getValue(), entry.getKey().getCurrentState().getMessage(), entry.getKey().getCurrentState().getUser()); } } @Inject  SingularityScheduler(TaskRequestManager taskRequestManager, SingularityConfiguration configuration, SingularityCooldown cooldown, DeployManager deployManager,
    TaskManager taskManager, RequestManager requestManager, SlaveManager slaveManager, RackManager rackManager, SingularityMailer mailer); }
SingularityScheduler { private <T extends SingularityMachineAbstraction<T>> void changeState(Map<T, MachineState> map, AbstractMachineManager<T> manager) { for (Entry<T, MachineState> entry : map.entrySet()) { manager.changeState(entry.getKey().getId(), entry.getValue(), entry.getKey().getCurrentState().getMessage(), entry.getKey().getCurrentState().getUser()); } } @Inject  SingularityScheduler(TaskRequestManager taskRequestManager, SingularityConfiguration configuration, SingularityCooldown cooldown, DeployManager deployManager,
    TaskManager taskManager, RequestManager requestManager, SlaveManager slaveManager, RackManager rackManager, SingularityMailer mailer); @Timed void checkForDecomissions(SingularitySchedulerStateCache stateCache); @Timed void drainPendingQueue(final SingularitySchedulerStateCache stateCache); @Timed List<SingularityTaskRequest> getDueTasks(); @Timed void handleCompletedTask(Optional<SingularityTask> task, SingularityTaskId taskId, boolean wasActive, long timestamp, ExtendedTaskState state,
    SingularityCreateResult taskHistoryUpdateCreateResult, SingularitySchedulerStateCache stateCache); }
SingularityScheduler { private <T extends SingularityMachineAbstraction<T>> void changeState(Map<T, MachineState> map, AbstractMachineManager<T> manager) { for (Entry<T, MachineState> entry : map.entrySet()) { manager.changeState(entry.getKey().getId(), entry.getValue(), entry.getKey().getCurrentState().getMessage(), entry.getKey().getCurrentState().getUser()); } } @Inject  SingularityScheduler(TaskRequestManager taskRequestManager, SingularityConfiguration configuration, SingularityCooldown cooldown, DeployManager deployManager,
    TaskManager taskManager, RequestManager requestManager, SlaveManager slaveManager, RackManager rackManager, SingularityMailer mailer); @Timed void checkForDecomissions(SingularitySchedulerStateCache stateCache); @Timed void drainPendingQueue(final SingularitySchedulerStateCache stateCache); @Timed List<SingularityTaskRequest> getDueTasks(); @Timed void handleCompletedTask(Optional<SingularityTask> task, SingularityTaskId taskId, boolean wasActive, long timestamp, ExtendedTaskState state,
    SingularityCreateResult taskHistoryUpdateCreateResult, SingularitySchedulerStateCache stateCache);  }