Airflow
Container for the annotation-based Dag-authoring API.
Annotating a class with Dag generates a <Class>Builder whose static build() returns the DagDef to add to a Bundle, and a <Class>Deps wiring view for the class's Deps class to implement.
Example:
@Airflow.Dag(id = "my_pipeline", schedule = "@daily")
public class MyPipeline {
@Airflow.Task(id = "extract", retries = 2)
public long extract(Client client) { ... }
@Airflow.Task(id = "transform")
public long transform(Client client, long extracted) { ... }
@Airflow.Deps
static class Wiring implements MyPipelineDeps {
void depends() { transform(extract()); }
}
}A task method's data parameters, meaning every parameter other than the injected Client and Context, receive by position the inputs the Deps class wired. For a task the Python Dag file declares with @task.stub, the arguments bound at that call site take their place. Keyword arguments bind by name instead through a single TaskInput parameter.
Types
Annotation to automate a Dag-builder pattern.
Marks the nested class that declares this Dag's task graph.
Marks a task method whose boolean picks one of two tasks; the other is skipped.
Marks a task method that chooses one of several tasks to run; every other one is skipped.
Annotation to automate task definition in a Dag-builder pattern.
Marks a nested class that groups the tasks declared inside it, as Python's TaskGroup does.
Marks a method as the Java body of a task the Python Dag file declares with @task.stub.