TaskHandler

@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class TaskHandler(val dag: String, val task: String = "")

Marks a method as the Java body of a task the Python Dag file declares with @task.stub.

This is not Task under another name. Python declares the task and Java supplies only its body, so the handler names the pair it binds to rather than an id it owns:

@Airflow.TaskHandler(dag = "etl", task = "score")
public long score(Client client, long rows) { ... }

Register every handler a class holds with Bundle.register; there is no Dag annotation on this surface, because the Dag is the Python file's.

Parameters

dag

Dag ID as declared in the Python Dag file.

task

Task ID as declared by the @task.stub function. Empty derives it from the annotated method's name.

Properties

Link copied to clipboard
val dag: String
Link copied to clipboard