Skip to content

Java SDK: Rewrite the user docs around Dag definition - #74701

Open
jason810496 wants to merge 2 commits into
apache:mainfrom
jason810496:docs/java-sdk/align-user-docs
Open

jason810496 wants to merge 2 commits into
apache:mainfrom
jason810496:docs/java-sdk/align-user-docs

Conversation

@jason810496

Copy link
Copy Markdown
Member

Why

The Java SDK guide started from stub tasks of a Python Dag and did not cover conditions, switches or TriggerDagRun, and the README mixed user docs with the contributor and release guide.

What

  • java.rst: rewrite it in the same order as the TypeScript guide.
    • Quick start with a Dag defined in Java, then every Dag-definition feature, annotation style first and interface style second.
    • New sections for @Airflow.If / dag.If, @Airflow.Switch / dag.Switch and TriggerDagRun.
    • Then stub TaskHandlers, with a table of how arguments bind by position and by name.
    • Tables for the Client methods and the logging integrations.
  • java-sdk/README.md: keep installation, a quick start, links to the guide and the compatibility matrix.
  • java-sdk/DEVELOPMENT.md: new, holding the build, release and contributing content moved from the README. References to it are updated.
  • java-sdk/example/README.md: new, listing the example Dags under "Dag definition" and "Python Dag with stub TaskHandler".
  • java-sdk/sdk/module.md (API reference landing page): add a quick start.

Was generative AI tooling used to co-author this PR?

jason810496 and others added 2 commits October 20, 2026 02:05
Reorder the Java SDK guide to start from a Dag defined in Java, document
conditions, switches and TriggerDagRun, and add a table of how stub task
arguments bind. Split the README into a user landing page and
DEVELOPMENT.md, and add an example README.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@jason810496
jason810496 force-pushed the docs/java-sdk/align-user-docs branch from 6cf0e4f to bd256f1 Compare October 20, 2026 02:07
@jason810496
jason810496 marked this pull request as ready for review October 20, 2026 03:55
@jason810496 jason810496 added the backport-to-v3-4-test Backport to v3-4-test label Oct 20, 2026
@jason810496 jason810496 added this to the Airflow 3.4.0 milestone Oct 20, 2026

@FrankYang0529 FrankYang0529 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Leave some comments.

Comment on lines +478 to +479
@Airflow.Task
public TriggerDagRun triggerDownstream() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add queue here like other tasks?

Comment on lines +68 to +70
| `java_native_annotation_example` | `AnnotationExample.java` | The annotation style: task inputs, a task group, `@Airflow.If`, `@Airflow.Switch`, and `TriggerDagRun` |
| `java_native_interface_example` | `InterfaceExample.java` | A similar Dag in the interface style, with `DagDef` |
| `java_native_target_example` | `TargetExample.java` | The Dag the other two trigger |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No task in nativedag/*.java sets a queue. We need to add it, so users can follow the example to run the dag.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants