Skip to content

[Docs][Core] Add Javadoc to MultiTableSink#10639

Open
zooo-code wants to merge 1 commit intoapache:devfrom
zooo-code:add-javadoc-multitablesink
Open

[Docs][Core] Add Javadoc to MultiTableSink#10639
zooo-code wants to merge 1 commit intoapache:devfrom
zooo-code:add-javadoc-multitablesink

Conversation

@zooo-code
Copy link
Contributor

Purpose of this pull request

Add method-level Javadoc to MultiTableSink.java as described in #10536 (sub-issue of #10533)

This class had 207 lines and zero method-level Javadoc. Added Javadoc to the class level and 8 key methods:

  • Constructor — sinks map population and replicaNum role
  • createWriter() — index formula and writer distribution
  • restoreWriter() — checkpoint state matching via SinkIdentifier
  • createCommitter() — per-table committer aggregation
  • createAggregatedCommitter() — per-table aggregated committer aggregation
  • getSinkTables() — fallback logic for table path resolution
  • getWriteCatalogTable() — always empty in multi-table context
  • supports() — schema evolution delegation to first sub-sink

Closes #10536

Does this PR introduce any user-facing change?

How was this patch tested?

  • ./mvnw spotless:apply — formatting verified
  • ./mvnw -q -DskipTests verify — build verified
  • No test needed as this is a documentation-only change (no code logic modified)

Check list

@github-actions github-actions bot added the api label Mar 24, 2026
Comment on lines 240 to 253
public List<TablePath> getSinkTables() {

List<TablePath> tablePaths = new ArrayList<>();
List<SeaTunnelSink> values = new ArrayList<>(sinks.values());
for (int i = 0; i < values.size(); i++) {
if (values.get(i).getWriteCatalogTable().isPresent()) {
tablePaths.add(
((CatalogTable) values.get(i).getWriteCatalogTable().get()).getTablePath());
} else {
tablePaths.add(sinks.keySet().toArray(new TablePath[0])[i]);
}
}
return tablePaths;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

As a small improvement, it might be better to iterate over entrySet() instead of relying on index alignment.
This could be addressed in a follow-up PR if you’re interested.

Copy link
Contributor Author

@zooo-code zooo-code Mar 26, 2026

Choose a reason for hiding this comment

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

Thanks for the suggestion! @dybyte
Since this PR is scoped to Javadoc-only changes, I'll keep the existing code as-is.
Would it be okay if I open a new issue and submit a follow-up PR for this improvement?

Copy link
Contributor

Choose a reason for hiding this comment

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

I've created issue #10658 .
If you'd like to work on it, please leave a comment and I can assign it to you.

Copy link
Contributor

@dybyte dybyte left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@chl-wxp chl-wxp left a comment

Choose a reason for hiding this comment

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

LGTM

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.

[Docs][Core] Add Javadoc to MultiTableSink

3 participants