Created
January 29, 2017 08:56
-
-
Save isaacmg/c1942b1d43ccabe6a8259b9786dff076 to your computer and use it in GitHub Desktop.
A simple example of using a DAG to run a jar file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from airflow import DAG | |
from airflow.operators import BashOperator | |
from datetime import datetime | |
import os | |
import sys | |
args = { | |
'owner': 'airflow' | |
, 'start_date': datetime(2017, 1, 27) | |
, 'provide_context': True | |
} | |
d = datetime(2017, 1, 17, 3, 15,00) | |
dag = DAG('usgs', start_date = d, schedule_interval = '16 * * * *', default_args = args) | |
t_main = BashOperator( | |
task_id = 'usgs_fetch' | |
, dag = dag | |
, bash_command = 'java -cp /mnt/c/Users/img/Documents/GitHub/backbone/target/kafkaUSGS-1.0-SNAPSHOT.jar KafkaUSGS' | |
#params = {'class': 'FetchJSON', 'path': 'jars/kafkaUSGS.jar'} | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
what is KafkaUSGS in line 20, java_class name?