SEPURI-SAI-KRISHNA commented on PR #11721: URL: https://github.com/apache/seatunnel/pull/11721#issuecomment-5578889800
Thanks @DanielLeens for the independent re-check, and @SEZ9 for stating exactly what you need confirmed. Both answers below with pointers. **PR11721-F1: the snippet mirrors the implementation now, not just the callout being removed.** Two places in `docs/en/architecture/features/multi-table.md` carry the routing code, and both changed: - Section 4.2, the `MultiTableSinkWriter.write(SeaTunnelRow)` reproduction, now reads `element.getField(primaryKey.get())`, `int index = 0`, `(object.hashCode() & Integer.MAX_VALUE) % blockingQueues.size()` and `offerRowElement(index, element)`. Those are the same identifiers as the real method, which is at `MultiTableSinkWriter.java:584-626` on this head. - Section 5.3, the one-line summary, now reads `int index = (object.hashCode() & Integer.MAX_VALUE) % blockingQueues.size();`, where it previously read `Math.abs(object.hashCode()) % blockingQueues.size()`. On the two names you raised specifically. `replicaNum` does still appear on the page, but never in a routing snippet: it is in section 4.1's `MultiTableSink` field listing, where it matches the real `MultiTableSink.java:72`, and in the capacity-planning prose in 5.1 and 7, where it is the config-level concept rather than code. `extractPrimaryKeyIfPresent` appears nowhere on the page and nowhere in `MultiTableSinkWriter.java`, so there is no mismatch under that name to fix; the routing branch resolves the key through `sinkPrimaryKeys.get(tableId)` and `element.getField(...)`, which is what the snippet shows. The `:::caution Known issue` block is now a `:::note` that explains why the mask is used instead of `Math.abs`, and `docs/zh` received the parallel change. **PR11721-F2: the helper extraction is deferred, and this PR keeps the inline idiom.** Stated explicitly for the record: this PR keeps `(hash & Integer.MAX_VALUE) % n` inline at `MultiTableSinkWriter.java:622`. The extraction is not in this diff. The reason is ordering rather than preference. The shared helper is `HashUtils.bucketIndex`, and it did not exist when this branch was cut. A contents lookup for `seatunnel-common/src/main/java/org/apache/seatunnel/common/utils/HashUtils.java` at this head `aea9854a1` returns 404. It landed on `dev` through #11987, merged 2026-09-01, which is a week after this branch's last `dev` merge on 08-24. Adopting it here would mean a fresh `dev` merge and a re-review of an already-approved diff, for a change that is one line. #11976 tracks migrating this call site to `HashUtils.bucketIndex`, and I have deliberately kept it open until this PR merges so the extraction lands as its own small change. The two are the same function for every input: the helper body is exactly `(hash & Integer.MAX_VALUE) % bucketCount`, so nothing about the behavior pinned by the `Integer.MIN_VALUE` test changes when the migration happens. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
