Builder

class Builder

Container for the annotation-based Dag-authoring API.

This class is not instantiated directly. Its nested annotations drive the BuilderProcessor annotation processor, which generates a *Builder class for each class annotated with Dag.

Example:

@Builder.Dag(id = "my_pipeline")
public class MyPipeline {

@Builder.Task(id = "extract")
public long extract(Client client) { ... }

@Builder.Task(id = "transform")
public long transform(Client client, @Builder.XCom(task = "extract") long extracted) { ... }
}

The processor generates MyPipelineBuilder.build(), which returns a fully wired-up Dag ready to add to a Bundle.

Types

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class Dag(val id: String = "", val to: String = "")

Annotation to automate a Dag-builder pattern.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Task(val id: String = "")

Annotation to automate task definition in a Dag-builder pattern.

Link copied to clipboard
annotation class XCom(val task: String = "", val key: String = Client.XCOM_RETURN_KEY)

Annotation to mark a task definition's method parameter as an XCom input.