@Test public void updatesWaitingSlotsToWaitTimeout() throws Exception { WorkflowID wfID1 = new WorkflowID("wf1"); Schedule sch1 = makeHourlySchedule(); SchedulingStrategy str1 = makeSerialSchedulingStrategy(); Trigger tr1 = new NeverTrigger(); ExternalService srv1 = new MockExternalService(new MockExternalService.MockExternalStatusRunning()); int maxRetryCount = 0; int waitTimeoutSeconds = 20; Workflow wf1 = new Workflow(wfID1, sch1, str1, tr1, srv1, maxRetryCount, Workflow.DEFAULT_START_TIME, waitTimeoutSeconds, emptyWorkflowInfo); WorkflowConfiguration cfg = new WorkflowConfiguration(); cfg.addWorkflow(wf1); SlotID id1 = new SlotID(wfID1, new ScheduledTime("2013-11-27T22:00:00Z")); SlotState slot1 = new SlotState(id1, SlotState.Status.WAITING); connection.putSlotState(slot1); int slidingWindowHours = 24; Scheduler sched = new Scheduler(cfg, slidingWindowHours); sched.step(new ScheduledTime("2013-11-27T22:00:19Z"), connection); Assert.assertEquals(SlotState.Status.WAITING, connection.getSlotState(id1).getStatus()); sched.step(new ScheduledTime("2013-11-27T22:00:20Z"), connection); Assert.assertEquals(SlotState.Status.WAITING, connection.getSlotState(id1).getStatus()); sched.step(new ScheduledTime("2013-11-27T22:00:21Z"), connection); Assert.assertEquals(SlotState.Status.WAIT_TIMEOUT, connection.getSlotState(id1).getStatus()); }
public void step(ScheduledTime current, StateDatabaseConnection connection) throws Exception { step(current, Collections.<WorkflowID>emptySet(), connection); }
Scheduler { public void step(ScheduledTime current, StateDatabaseConnection connection) throws Exception { step(current, Collections.<WorkflowID>emptySet(), connection); } }
Scheduler { public void step(ScheduledTime current, StateDatabaseConnection connection) throws Exception { step(current, Collections.<WorkflowID>emptySet(), connection); } Scheduler(WorkflowConfiguration configuration, int slidingWindowHours); }
Scheduler { public void step(ScheduledTime current, StateDatabaseConnection connection) throws Exception { step(current, Collections.<WorkflowID>emptySet(), connection); } Scheduler(WorkflowConfiguration configuration, int slidingWindowHours); void step(ScheduledTime current, StateDatabaseConnection connection); void step(ScheduledTime current, Set<WorkflowID> workflowIDs, StateDatabaseConnection connection); List<SlotState> getSlotStatesIncludingMarkedForRerun(Workflow wf, ScheduledTime current, ScheduledTime start, ScheduledTime end, StateDatabaseConnection connection); List<SlotState> getSlotStates(Workflow wf, ScheduledTime start, ScheduledTime end, StateDatabaseConnection connection); ScheduledTime getWorkflowStartTime(Workflow wf, ScheduledTime current); int getSlidingWindowHours(); WorkflowConfiguration getWorkflowConfiguration(); }
Scheduler { public void step(ScheduledTime current, StateDatabaseConnection connection) throws Exception { step(current, Collections.<WorkflowID>emptySet(), connection); } Scheduler(WorkflowConfiguration configuration, int slidingWindowHours); void step(ScheduledTime current, StateDatabaseConnection connection); void step(ScheduledTime current, Set<WorkflowID> workflowIDs, StateDatabaseConnection connection); List<SlotState> getSlotStatesIncludingMarkedForRerun(Workflow wf, ScheduledTime current, ScheduledTime start, ScheduledTime end, StateDatabaseConnection connection); List<SlotState> getSlotStates(Workflow wf, ScheduledTime start, ScheduledTime end, StateDatabaseConnection connection); ScheduledTime getWorkflowStartTime(Workflow wf, ScheduledTime current); int getSlidingWindowHours(); WorkflowConfiguration getWorkflowConfiguration();  }