use of com.linkedin.drelephant.configurations.scheduler.SchedulerConfigurationData in project dr-elephant by linkedin.
the class OozieSchedulerTest method testOozieScheduledJob.
/*
Job Reference ID: C_ID-ActionName-Depth
Job Execution ID: Oozie Job ID
Flow Reference ID: Coordinator ID = C_ID
Flow Execution ID: Coordinator Action ID = C_ID@1
*/
@Test
public void testOozieScheduledJob() throws Exception {
SchedulerConfigurationData schedulerConfig = makeConfig("oozie", new HashMap<String, String>());
OozieScheduler scheduler = new OozieScheduler("id", getOozieProperties(), schedulerConfig, scheduledJobClient);
assertEquals(coordinatorJobInfo + "-" + actionName + "-0", scheduler.getJobDefId());
assertEquals(jobInfo, scheduler.getJobExecId());
assertEquals(coordinatorJobInfo, scheduler.getFlowDefId());
assertEquals(coordinatorActionInfo, scheduler.getFlowExecId());
assertEquals(oozieUrl + jobInfo, scheduler.getJobDefUrl());
assertEquals(oozieUrl + jobInfo, scheduler.getJobExecUrl());
assertEquals(coordinatorJobInfo, scheduler.getFlowDefUrl());
assertEquals(coordinatorActionInfo, scheduler.getFlowExecUrl());
assertEquals(0, scheduler.getWorkflowDepth());
assertEquals(coordinatorJobInfo + "-" + actionName + "-0", scheduler.getJobName());
assertEquals("oozie", scheduler.getSchedulerName());
}
use of com.linkedin.drelephant.configurations.scheduler.SchedulerConfigurationData in project dr-elephant by linkedin.
the class OozieSchedulerTest method testOozieLoadInfoWithMissingProperty.
@Test
public void testOozieLoadInfoWithMissingProperty() {
SchedulerConfigurationData schedulerConfig = makeConfig("oozie", getDefaultSchedulerParams());
OozieScheduler scheduler = new OozieScheduler("id", getNonOozieProperties(), schedulerConfig);
assertEquals(null, scheduler.getFlowDefUrl());
assertEquals(null, scheduler.getFlowDefId());
assertEquals(null, scheduler.getFlowExecUrl());
assertEquals(null, scheduler.getFlowExecId());
assertEquals(null, scheduler.getJobDefUrl());
assertEquals(null, scheduler.getJobDefId());
assertEquals(null, scheduler.getJobExecUrl());
assertEquals(null, scheduler.getJobExecId());
assertEquals(null, scheduler.getJobName());
assertEquals(0, scheduler.getWorkflowDepth());
assertEquals("oozie", scheduler.getSchedulerName());
}
use of com.linkedin.drelephant.configurations.scheduler.SchedulerConfigurationData in project dr-elephant by linkedin.
the class OozieSchedulerTest method testOozieLoadInfoWithNullProperty.
@Test
public void testOozieLoadInfoWithNullProperty() {
SchedulerConfigurationData schedulerConfig = makeConfig("oozie", getDefaultSchedulerParams());
OozieScheduler scheduler = new OozieScheduler("id", null, schedulerConfig);
assertEquals(null, scheduler.getFlowDefUrl());
assertEquals(null, scheduler.getFlowDefId());
assertEquals(null, scheduler.getFlowExecId());
assertEquals(null, scheduler.getFlowExecUrl());
assertEquals(null, scheduler.getJobDefId());
assertEquals(null, scheduler.getJobDefUrl());
assertEquals(null, scheduler.getJobExecId());
assertEquals(null, scheduler.getJobExecUrl());
assertEquals(null, scheduler.getJobName());
assertEquals(0, scheduler.getWorkflowDepth());
assertEquals("oozie", scheduler.getSchedulerName());
}
use of com.linkedin.drelephant.configurations.scheduler.SchedulerConfigurationData in project dr-elephant by linkedin.
the class OozieSchedulerTest method tesOozieScheduledJobAppNameUnique.
/*
Job Reference ID: Job AppName-ActionName
Job Execution ID: Oozie Job ID
Flow Reference ID: Coordinator Job name
Flow Execution ID: Coordinator Action ID = C_ID@1
*/
@Test
public void tesOozieScheduledJobAppNameUnique() throws Exception {
HashMap<String, String> params = new HashMap<String, String>();
params.put("oozie_app_name_uniqueness", "true");
SchedulerConfigurationData schedulerConfig = makeConfig("oozie", params);
OozieScheduler scheduler = new OozieScheduler("id", getOozieProperties(), schedulerConfig, scheduledJobClient);
assertEquals(jobAppName + "-" + actionName, scheduler.getJobDefId());
assertEquals(jobInfo, scheduler.getJobExecId());
assertEquals(coordinatorName, scheduler.getFlowDefId());
assertEquals(coordinatorActionInfo, scheduler.getFlowExecId());
assertEquals(oozieUrl + jobInfo, scheduler.getJobDefUrl());
assertEquals(oozieUrl + jobInfo, scheduler.getJobExecUrl());
assertEquals(coordinatorJobInfo, scheduler.getFlowDefUrl());
assertEquals(coordinatorActionInfo, scheduler.getFlowExecUrl());
assertEquals(0, scheduler.getWorkflowDepth());
assertEquals(jobAppName + "-" + actionName, scheduler.getJobName());
assertEquals("oozie", scheduler.getSchedulerName());
}
use of com.linkedin.drelephant.configurations.scheduler.SchedulerConfigurationData in project dr-elephant by linkedin.
the class OozieSchedulerTest method testManualCommittedJob.
/*
Job Reference ID: Oozie Job ID
Job Execution ID: Oozie Job ID
Flow Reference ID: Super Parent Oozie job ID
Flow Execution ID: Super Parent Oozie job ID
*/
@Test
public void testManualCommittedJob() throws Exception {
SchedulerConfigurationData schedulerConfig = makeConfig("oozie", new HashMap<String, String>());
OozieScheduler scheduler = new OozieScheduler("id", getOozieProperties(), schedulerConfig, manualCommittedJobClient);
assertEquals(jobInfo, scheduler.getJobDefId());
assertEquals(jobInfo, scheduler.getJobExecId());
assertEquals(parentJobInfo, scheduler.getFlowDefId());
assertEquals(parentJobInfo, scheduler.getFlowExecId());
assertEquals(oozieUrl + jobInfo, scheduler.getJobDefUrl());
assertEquals(oozieUrl + jobInfo, scheduler.getJobExecUrl());
assertEquals(oozieUrl + parentJobInfo, scheduler.getFlowDefUrl());
assertEquals(oozieUrl + parentJobInfo, scheduler.getFlowExecUrl());
assertEquals(1, scheduler.getWorkflowDepth());
assertEquals(jobInfo, scheduler.getJobName());
assertEquals("oozie", scheduler.getSchedulerName());
}
Aggregations