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 04:10:25 UTC
[I] [Docs][Core] Add Javadoc to MultiTableSinkWriter [seatunnel]
davidzollo opened a new issue, #10537:
URL: https://github.com/apache/seatunnel/issues/10537
Sub-issue of #10533
## Scope
`MultiTableSinkWriter` is the most complex undocumented class in the multi-table framework: 373 lines, heavy concurrency, zero method-level Javadoc. It manages per-table async write queues and resource sharing.
## File
`seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/multitablesink/MultiTableSinkWriter.java`
## Methods to document
| Method | Line | What to explain |
|--------|------|-----------------|
| Constructor | 64 | `queueSize * 2` thread pool reason (write threads + prepareCommit tasks); BlockingQueue-to-writer assignment; modulo distribution formula `entry.getKey().getIndex() % queueSize` |
| `initResourceManager(int)` | 112 | One-shot init from first writer; broadcasts shared resource to all writers via `setMultiTableResourceManager`; primary key map population |
| `subSinkErrorCheck()` | 134 | Propagates exceptions from async writer threads back to the caller thread; called before every state-mutating operation |
| `write(SeaTunnelRow)` | 179 | Role of `submitted` flag (lazy executor start); primary-key hashing for ordered delivery (`hashCode % queueSize`); random queue for no-primary-key tables |
| `prepareCommit(long)` | 246 | Parallel per-table `prepareCommit` inside executor service; `Future` aggregation into `MultiTableCommitInfo` |
| `snapshotState(long)` | 222 | Synchronizes with runnable (`synchronized(runnable.get(i))`) to prevent concurrent mutation during snapshot |
| `abortPrepare()` | 294 | First-exception-wins error aggregation across sub-writers |
| `close()` | 322 | `executorService.shutdownNow()` then per-writer `close()` under runnable lock; resource manager teardown |
| `checkQueueRemain()` | 361 | Busy-waits until all BlockingQueues drain before snapshot/commit; polls every 100 ms; must complete before lock-protected state operations |
## How to contribute
1. Fork the repo and create a branch
2. Add Javadoc to the methods above
3. Run `./mvnw spotless:apply` and `./mvnw -q -DskipTests verify`
4. Open a PR with title: `[Docs][Core] Add Javadoc to MultiTableSinkWriter`
--
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 MultiTableSinkWriter [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo closed issue #10537: [Docs][Core] Add Javadoc to MultiTableSinkWriter
URL: https://github.com/apache/seatunnel/issues/10537
--
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 MultiTableSinkWriter [seatunnel]
Posted by "DanielCarter-stack (via GitHub)" <gi...@apache.org>.
DanielCarter-stack commented on issue #10537:
URL: https://github.com/apache/seatunnel/issues/10537#issuecomment-3976459477
<!-- code-pr-reviewer -->
Verified this as a valid documentation request. The `MultiTableSinkWriter` class (seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/multitablesink/MultiTableSinkWriter.java, lines 48-373) currently has no method-level Javadoc, which creates a significant barrier for connector developers implementing `SupportMultiTableSinkWriter`.
The Issue accurately lists 9 methods needing documentation, and all line numbers match the source code:
- Constructor (line 64): needs explanation for `queueSize * 2` thread pool sizing
- `initResourceManager(int)` (line 112): resource initialization across writers
- `subSinkErrorCheck()` (line 134): async error propagation mechanism
- `write(SeaTunnelRow)` (line 179): hash-based routing logic
- `snapshotState(long)` (line 222): checkpoint coordination
- `prepareCommit(long)` (line 246): queue draining before commit
- `abortPrepare()` (line 294): rollback semantics
- `close()` (line 322): resource cleanup
- `checkQueueRemain()` (line 361): busy-wait mechanism
The existing architecture documentation (docs/en/architecture/features/multi-table.md, section 4.2) provides high-level pseudocode but doesn't explain critical implementation details like thread safety, error propagation, or the modulo-based distribution strategy.
**Recommendation**: This is a good first issue for contributors familiar with SeaTunnel's sink API. The Issue author has already provided a solid template of what needs to be documented.
--
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 MultiTableSinkWriter [seatunnel]
Posted by "zooo-code (via GitHub)" <gi...@apache.org>.
zooo-code commented on issue #10537:
URL: https://github.com/apache/seatunnel/issues/10537#issuecomment-4014748370
Hi @davidzollo,
If no one is currently working on this, I would like to take this issue.
I will work on adding Javadoc to `MultiTableSinkWriter` following the description.
Please assign this to me!
--
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