Search in sources :

Example 1 with AirflowScheduler

use of com.linkedin.drelephant.schedulers.AirflowScheduler in project dr-elephant by linkedin.

the class InfoExtractorTest method testGetSchedulerInstanceAirflow.

@Test
public void testGetSchedulerInstanceAirflow() {
    Properties properties = new Properties();
    properties.put(AirflowScheduler.AIRFLOW_DAG_ID, "airflow_dag_id");
    properties.put(AirflowScheduler.AIRFLOW_DAG_RUN_EXECUTION_DATE, "airflow_dag_run_execution_date");
    properties.put(AirflowScheduler.AIRFLOW_TASK_ID, "airflow_task_id");
    properties.put(AirflowScheduler.AIRFLOW_TASK_INSTANCE_EXECUTION_DATE, "airflow_task_instance_execution_date");
    Scheduler scheduler = InfoExtractor.getSchedulerInstance("id", properties);
    assertEquals(true, scheduler instanceof AirflowScheduler);
    assertEquals("airflow_dag_id", scheduler.getFlowDefId());
    assertEquals("airflow_dag_id/airflow_dag_run_execution_date", scheduler.getFlowExecId());
    assertEquals("airflow_dag_id/airflow_task_id", scheduler.getJobDefId());
    assertEquals("airflow_dag_id/airflow_dag_run_execution_date/airflow_task_id/airflow_task_instance_execution_date", scheduler.getJobExecId());
    assertEquals("airflow_task_id", scheduler.getJobName());
    assertEquals("airflow", scheduler.getSchedulerName());
}
Also used : Scheduler(com.linkedin.drelephant.schedulers.Scheduler) AzkabanScheduler(com.linkedin.drelephant.schedulers.AzkabanScheduler) AirflowScheduler(com.linkedin.drelephant.schedulers.AirflowScheduler) OozieScheduler(com.linkedin.drelephant.schedulers.OozieScheduler) Properties(java.util.Properties) AirflowScheduler(com.linkedin.drelephant.schedulers.AirflowScheduler) Test(org.junit.Test)

Aggregations

AirflowScheduler (com.linkedin.drelephant.schedulers.AirflowScheduler)1 AzkabanScheduler (com.linkedin.drelephant.schedulers.AzkabanScheduler)1 OozieScheduler (com.linkedin.drelephant.schedulers.OozieScheduler)1 Scheduler (com.linkedin.drelephant.schedulers.Scheduler)1 Properties (java.util.Properties)1 Test (org.junit.Test)1