You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "davidzollo (via GitHub)" <gi...@apache.org> on 2026/02/28 03:59:08 UTC

[I] [Docs][Core] Add Javadoc comments to key methods in the core runtime flow (Zeta engine, API SPI) [seatunnel]

davidzollo opened a new issue, #10533:
URL: https://github.com/apache/seatunnel/issues/10533

   ## Summary
   
   SeaTunnel's core runtime code is impressively engineered, but most key methods across the **Zeta engine**, **Connector V2 API SPI**, and the **multi-table sink framework** currently have no Javadoc comments. This makes the learning curve steep for new contributors who want to understand how the system works end-to-end.
   
   This issue proposes adding concise Javadoc to the most important lifecycle and coordination methods across these areas, as a contributor-friendly improvement task.
   
   ---
   
   ## Motivation
   
   When studying the source code (e.g., while implementing a new connector or debugging a Zeta job), contributors must infer the contract and intent of key methods purely from implementation. For example:
   
   - `CheckpointCoordinator.java` (1174 lines) has ~21 Javadoc comment lines (~1.8%)
   - `TaskExecutionService.java` (1018 lines) has ~24 Javadoc comment lines (~2.4%)
   - `CoordinatorService.java` (1177 lines) has ~50 Javadoc comment lines (~4.3%)
   - `MultiTableSinkWriter.java` (373 lines) has **zero** method-level Javadoc
   
   Methods like `initResourceManager`, `checkQueueRemain`, `snapshotState`, `prepareCommit`, `triggerCheckpoint`, `restoreComplete` carry important lifecycle semantics that are not obvious without reading through hundreds of lines of context.
   
   ---
   
   ## Suggested scope (good first issue — pick any area)
   
   Contributors can pick one file or one area. Suggested priority areas:
   
   ### 1. Connector V2 API SPI (`seatunnel-api`)
   
   | File | Key methods to document |
   |------|------------------------|
   | `SeaTunnelSource.java` | `createReader`, `getProducedType`, `getBoundedness` |
   | `SourceSplitEnumerator.java` | `open`, `run`, `addSplitsBack`, `handleSplitRequest`, `snapshotState` |
   | `SinkWriter.java` | `write`, `prepareCommit`, `snapshotState`, `abortPrepare`, `close` |
   | `SupportMultiTableSinkWriter.java` | `initMultiTableResourceManager`, `setMultiTableResourceManager`, `primaryKey` |
   | `MultiTableResourceManager.java` | `getSharedResource`, `close` |
   
   ### 2. Multi-table sink framework (`seatunnel-api`)
   
   | File | Key methods to document |
   |------|------------------------|
   | `MultiTableSinkWriter.java` | Constructor, `initResourceManager`, `write`, `prepareCommit`, `snapshotState`, `checkQueueRemain`, `close` |
   | `MultiTableWriterRunnable.java` | `run`, queue-draining logic |
   
   ### 3. Zeta Engine Server (`seatunnel-engine`)
   
   | File | Key methods to document |
   |------|------------------------|
   | `CoordinatorService.java` | `submitJob`, `cancelJob`, `getJobStatus`, master/worker registration |
   | `TaskExecutionService.java` | `submitTask`, `cancelTask`, task state transitions |
   | `CheckpointCoordinator.java` | `triggerCheckpoint`, `acknowledgeTask`, `restoreComplete`, barrier injection |
   
   ---
   
   ## Comment style guide
   
   Follow the existing project convention (also documented in `CLAUDE.md`):
   
   ```java
   /**
    * Enumerates source splits for parallel reading.
    * Called once during job initialization after {@link #open()}.
    *
    * <p>Implementations should avoid blocking here; long-running enumeration
    * should be done in {@link #run()}.
    *
    * @param context enumeration context providing access to assigned readers
    */
   void run() throws Exception;
   ```
   
   Guidelines:
   - Describe **what** the method does and **when** it is called in the lifecycle
   - Note thread-safety guarantees if relevant
   - Note side effects (state mutation, blocking calls)
   - Reference related methods where helpful
   - Keep comments concise — 2–5 lines per method is sufficient
   - No need to repeat parameter types (already in the signature)
   
   ---
   
   ## How to contribute
   
   1. Pick one file from the scope above (comment on this issue to claim it)
   2. Add Javadoc to the key public/package-private methods in that file
   3. Run `./mvnw spotless:apply` to ensure formatting
   4. Open a PR with title format: `[Docs][Core] Add Javadoc to <ClassName>`
   
   This is a **good first issue** — no logic changes required, just reading and writing clear comments. It is also a great way to deepen your understanding of how SeaTunnel works internally.
   
   ---
   
   ## References
   
   - SeaTunnel Connector V2 developer guide: https://seatunnel.apache.org/docs/contribution/contribute-transform-v2-guide
   - SeaTunnel architecture overview: https://seatunnel.apache.org/docs/concept/schema-feature


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Docs][Core] Add Javadoc to key lifecycle, checkpoint, and multi-table methods across seatunnel-api and seatunnel-engine [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on issue #10533:
URL: https://github.com/apache/seatunnel/issues/10533#issuecomment-3979979014

   If you are interested in this issue, please leave a message in the corresponding sub-task to claim it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Docs][Core] Add Javadoc to key lifecycle, checkpoint, and multi-table methods across seatunnel-api and seatunnel-engine [seatunnel]

Posted by "goutamadwant (via GitHub)" <gi...@apache.org>.
goutamadwant commented on issue #10533:
URL: https://github.com/apache/seatunnel/issues/10533#issuecomment-5352325230

   I checked the current status of the checklist and most of the listed Javadoc tasks have already been merged.
   
   I picked the remaining `SinkFlowLifeCycle` item and documented the current lifecycle behavior, including writer creation during restore and checkpoint barrier processing. This is documentation only and does not change runtime behavior.
   
   #11903 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Docs][Core] Add Javadoc to key lifecycle, checkpoint, and multi-table methods across seatunnel-api and seatunnel-engine [seatunnel]

Posted by "DanielCarter-stack (via GitHub)" <gi...@apache.org>.
DanielCarter-stack commented on issue #10533:
URL: https://github.com/apache/seatunnel/issues/10533#issuecomment-3976451313

   <!-- code-pr-reviewer -->
   Thanks for proposing this documentation improvement. The analysis confirms the stated coverage gaps are accurate:
   
   **Key findings:**
   - `CheckpointCoordinator.java` (1174 lines) has ~2% Javadoc coverage
   - `TaskExecutionService.java` (1018 lines) has ~2.6% Javadoc coverage
   - `SupportResourceShare.java` / `MultiTableResourceManager.java` SPI methods lack complete documentation
   - State fields (`readyToCloseStartingTask`, `schemaChanging`) lack semantic explanations
   
   Evidence files:
   - `seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/SupportResourceShare.java`
   - `seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/checkpoint/CheckpointCoordinator.java`
   - `seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/TaskExecutionService.java`
   
   This is a well-scoped documentation task. Sub-task 1 (SPI interfaces) is a good starting point as it directly helps connector implementers. Please follow the style examples in the issue description (what + when + thread-safety constraints).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org