private void loadBuiltinCheckersAndActions() { logger.info("Loading built-in checker and action types"); ExecuteFlowAction.setExecutorManager(this.executorManagerAdapter); ExecuteFlowAction.setProjectManager(this.projectManager); ExecuteFlowAction.setTriggerManager(this.triggerManager); KillExecutionAction.setExecutorManager(this.executorManagerAdapter); CreateTriggerAction.setTriggerManager(this.triggerManager); ExecutionChecker.setExecutorManager(this.executorManagerAdapter); this.triggerManager.registerCheckerType(BasicTimeChecker.type, BasicTimeChecker.class); this.triggerManager.registerCheckerType(SlaChecker.type, SlaChecker.class); this.triggerManager.registerCheckerType(ExecutionChecker.type, ExecutionChecker.class); this.triggerManager.registerActionType(ExecuteFlowAction.type, ExecuteFlowAction.class); this.triggerManager.registerActionType(KillExecutionAction.type, KillExecutionAction.class); this.triggerManager.registerActionType(SlaAlertAction.type, SlaAlertAction.class); this.triggerManager.registerActionType(CreateTriggerAction.type, CreateTriggerAction.class); }
@Before public void setup() throws Exception { final Project project = new Project(1, "test-project"); project.setFlows(ImmutableMap.of("test-flow", new Flow("test-flow"))); when(projectManager.getProject(1)).thenReturn(project); when(executorManagerAdapter.submitExecutableFlow(any(), any())) .thenThrow(new ExecutorManagerException("Flow is already running. Skipping execution.", ExecutorManagerException.Reason.SkippedExecution)); ExecuteFlowAction.setExecutorManager(this.executorManagerAdapter); ExecuteFlowAction.setProjectManager(this.projectManager); ExecuteFlowAction.setTriggerManager(this.triggerManager); final Props props = new Props(); props.put("trigger.scan.interval", 300); this.triggerManager = new TriggerManager(props, triggerLoader, executorManagerAdapter); this.triggerManager.registerCheckerType(ThresholdChecker.type, ThresholdChecker.class); this.triggerManager.registerActionType(DummyTriggerAction.type, DummyTriggerAction.class); this.triggerManager.start(); }
private void loadBuiltinCheckersAndActions() { logger.info("Loading built-in checker and action types"); if(triggerManager instanceof TriggerManager) { SlaChecker.setExecutorManager(executorManager); ExecuteFlowAction.setExecutorManager(executorManager); ExecuteFlowAction.setProjectManager(projectManager); ExecuteFlowAction.setTriggerManager(triggerManager); KillExecutionAction.setExecutorManager(executorManager); SlaAlertAction.setExecutorManager(executorManager); //Map<String, azkaban.alert.Alerter> alerters = loadAlerters(props); SlaAlertAction.setAlerters(alerters); SlaAlertAction.setExecutorManager(executorManager); CreateTriggerAction.setTriggerManager(triggerManager); ExecutionChecker.setExecutorManager(executorManager); } triggerManager.registerCheckerType(BasicTimeChecker.type, BasicTimeChecker.class); triggerManager.registerCheckerType(SlaChecker.type, SlaChecker.class); triggerManager.registerCheckerType(ExecutionChecker.type, ExecutionChecker.class); triggerManager.registerActionType(ExecuteFlowAction.type, ExecuteFlowAction.class); triggerManager.registerActionType(KillExecutionAction.type, KillExecutionAction.class); triggerManager.registerActionType(SlaAlertAction.type, SlaAlertAction.class); triggerManager.registerActionType(CreateTriggerAction.type, CreateTriggerAction.class); }