use of com.linkedin.drelephant.schedulers.AzkabanScheduler in project dr-elephant by linkedin.
the class InfoExtractorTest method testGetSchedulerInstanceAzkaban.
@Test
public void testGetSchedulerInstanceAzkaban() {
Properties properties = new Properties();
properties.put(AzkabanScheduler.AZKABAN_WORKFLOW_URL, "azkaban_workflow_url");
properties.put(AzkabanScheduler.AZKABAN_JOB_URL, "azkaba_job_url");
properties.put(AzkabanScheduler.AZKABAN_EXECUTION_URL, "azkaban_execution_url");
properties.put(AzkabanScheduler.AZKABAN_ATTEMPT_URL, "azkaba_attempt_url");
properties.put(AzkabanScheduler.AZKABAN_JOB_NAME, "azkaba_job_name");
Scheduler scheduler = InfoExtractor.getSchedulerInstance("id", properties);
assertEquals(true, scheduler instanceof AzkabanScheduler);
assertEquals("azkaban_workflow_url", scheduler.getFlowDefId());
assertEquals("azkaba_job_url", scheduler.getJobDefId());
assertEquals("azkaban_execution_url", scheduler.getFlowExecId());
assertEquals("azkaba_attempt_url", scheduler.getJobExecId());
assertEquals("azkaba_job_name", scheduler.getJobName());
assertEquals("azkaban", scheduler.getSchedulerName());
}
use of com.linkedin.drelephant.schedulers.AzkabanScheduler in project dr-elephant by linkedin.
the class InfoExtractorTest method testLoadSchedulerInfo.
@Test
public void testLoadSchedulerInfo() {
Properties properties = new Properties();
properties.put(AzkabanScheduler.AZKABAN_JOB_URL, "https://grid.example.com:9000/manager?project=project-name&flow=flow-name&job=job-name");
properties.put(AzkabanScheduler.AZKABAN_ATTEMPT_URL, "https://grid.example.com:9000/executor?execid=123456&job=job-name&attempt=0");
properties.put(AzkabanScheduler.AZKABAN_WORKFLOW_URL, "https://grid.example.com:9000/manager?project=project-name&flow=flow-name");
properties.put(AzkabanScheduler.AZKABAN_EXECUTION_URL, "https://grid.example.com:9000/executor?execid=123456");
properties.put(AzkabanScheduler.AZKABAN_JOB_NAME, "job-name");
SchedulerConfigurationData schedulerConfigurationData = new SchedulerConfigurationData("azkaban", null, null);
Scheduler scheduler = new AzkabanScheduler("id", properties, schedulerConfigurationData);
AppResult result = new AppResult();
HadoopApplicationData data = new HadoopApplicationData() {
String appId = "application_5678";
Properties conf = new Properties();
ApplicationType applicationType = new ApplicationType("foo");
@Override
public String getAppId() {
return appId;
}
@Override
public Properties getConf() {
return conf;
}
@Override
public ApplicationType getApplicationType() {
return applicationType;
}
@Override
public boolean isEmpty() {
return false;
}
};
InfoExtractor.loadSchedulerInfo(result, data, scheduler);
assertEquals(result.scheduler, "azkaban");
assertFalse(StringUtils.isEmpty(result.getJobExecId()));
assertFalse(StringUtils.isEmpty(result.getJobDefId()));
assertFalse(StringUtils.isEmpty(result.getFlowExecId()));
assertFalse(StringUtils.isEmpty(result.getFlowDefId()));
assertFalse(StringUtils.isEmpty(result.getJobExecUrl()));
assertFalse(StringUtils.isEmpty(result.getJobDefUrl()));
assertFalse(StringUtils.isEmpty(result.getFlowExecUrl()));
assertFalse(StringUtils.isEmpty(result.getFlowDefUrl()));
}
Aggregations